Skip to content

Commit

Permalink
update imports and interface
Browse files Browse the repository at this point in the history
  • Loading branch information
matbusby-fw committed Sep 23, 2024
1 parent 2217401 commit 61fe55c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
1 change: 1 addition & 0 deletions services/common/src/constants/strings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const CONTACT_ADMIN = [
];
export const MMO_EMAIL = "[email protected]";
export const EMPTY_FIELD = "N/A";
export const UNKNOWN = "Unknown";
export const EMPTY = "";
export const ZERO = "0.00";
export const UNASSIGNED = "Unassigned";
Expand Down
1 change: 1 addition & 0 deletions services/common/src/interfaces/projects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ export * from "./linkedProject.interface";
export * from "./requirement.interface";
export * from "./authorizationSummary.interface";
export * from "./projectSummaryMinistryComment.interface";
export * from "./projectStage.interface";
11 changes: 11 additions & 0 deletions services/common/src/interfaces/projects/projectStage.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IProjectSummary } from "@mds/common/interfaces";

export interface IProjectStage {
title: string;
key: string;
status: string;
payload: IProjectSummary;
statusHash: any;
required: boolean;
navigateForward: (source: string, status: string) => void;
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from "react";
import React, { FC } from "react";
import { useSelector } from "react-redux";
import { Link } from "react-router-dom";
import PropTypes from "prop-types";
import { Button, Table } from "antd";
import * as routes from "@/constants/routes";
import { ColumnsType } from "antd/es/table";
import { getProjectSummary } from "@mds/common/redux/reducers/projectReducer";
import { IProjectStage } from "@mds/common";

const propTypes = {
projectStages: PropTypes.arrayOf(PropTypes.any).isRequired,
};
interface ProjectStagesTableProps {
projectStages: IProjectStage[];
}

export const ProjectStagesTable = ({ projectStages }) => {
export const ProjectStagesTable: FC<ProjectStagesTableProps> = ({ projectStages }) => {
const projectSummary = useSelector(getProjectSummary);
const transformRowData = (projectStages) =>
projectStages &&
Expand Down Expand Up @@ -91,7 +91,7 @@ export const ProjectStagesTable = ({ projectStages }) => {
}
}
if (record.project_stage === "IRT") {
let buttonLabel;
let buttonLabel: string;
if (!record.stage_status) {
buttonLabel = "Start";
} else if (record.stage_status === "APV") {
Expand Down Expand Up @@ -141,6 +141,4 @@ export const ProjectStagesTable = ({ projectStages }) => {
);
};

ProjectStagesTable.propTypes = propTypes;

export default ProjectStagesTable;
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {
getProject,
getProjectSummary,
} from "@mds/common/redux/selectors/projectSelectors";
import * as Strings from "@/constants/strings";
import { formatDate } from "@/utils/helpers";
import MinistryContactItem from "@/components/dashboard/mine/overview/MinistryContactItem";
import ProjectStagesTable from "../../dashboard/mine/projects/ProjectStagesTable";
import { EMPTY_FIELD, UNKNOWN } from "@mds/common";
import { formatDate } from "@common/utils/helpers";
import ProjectStagesTable from "@/components/dashboard/mine/projects/ProjectStagesTable";

interface ProjectOverviewTabProps {
navigateForward: (source: string, status?: string) => void;
Expand All @@ -41,7 +41,7 @@ export const ProjectOverviewTab: FC<ProjectOverviewTabProps> = ({ navigateForwar
const isPrimary = c.is_primary;
const hasJobTitle = c.job_title;
const name = [c?.first_name, c?.last_name].join(" ").trim();
let title;
let title: string;
if (isPrimary) {
title = "Primary Contact";
} else if (hasJobTitle) {
Expand All @@ -55,7 +55,7 @@ export const ProjectOverviewTab: FC<ProjectOverviewTabProps> = ({ navigateForwar
</Typography.Text>
)}
<br />
<Typography.Text>{name || Strings.EMPTY_FIELD}</Typography.Text>
<Typography.Text>{name || EMPTY_FIELD}</Typography.Text>
<br />
<Typography.Text>{c.phone_number}</Typography.Text>
<br />
Expand Down Expand Up @@ -125,14 +125,14 @@ export const ProjectOverviewTab: FC<ProjectOverviewTabProps> = ({ navigateForwar
label="Estimated IRT Submission"
className="vertical-description"
>
{formatDate(expected_draft_irt_submission_date) || Strings.UNKNOWN}
{formatDate(expected_draft_irt_submission_date) || UNKNOWN}
</Descriptions.Item>
<Descriptions.Item
span={12}
label="Desired date to receive permit/amendment(s)"
className="vertical-description"
>
{formatDate(expected_permit_receipt_date) || Strings.UNKNOWN}
{formatDate(expected_permit_receipt_date) || UNKNOWN}
</Descriptions.Item>
</Descriptions>
</Col>
Expand All @@ -143,14 +143,14 @@ export const ProjectOverviewTab: FC<ProjectOverviewTabProps> = ({ navigateForwar
label="Estimated Permit Application Submission"
className="vertical-description"
>
{formatDate(expected_permit_application_date) || Strings.UNKNOWN}
{formatDate(expected_permit_application_date) || UNKNOWN}
</Descriptions.Item>
<Descriptions.Item
span={12}
label="Anticipated work start"
className="vertical-description"
>
{formatDate(expected_project_start_date) || Strings.UNKNOWN}
{formatDate(expected_project_start_date) || UNKNOWN}
</Descriptions.Item>
</Descriptions>
</Col>
Expand Down

0 comments on commit 61fe55c

Please sign in to comment.