diff --git a/epictrack-api/src/api/schemas/response/project_response.py b/epictrack-api/src/api/schemas/response/project_response.py index 346c5c214..947b9539a 100644 --- a/epictrack-api/src/api/schemas/response/project_response.py +++ b/epictrack-api/src/api/schemas/response/project_response.py @@ -19,6 +19,7 @@ class Meta(AutoSchemaBase.Meta): model = Project include_fk = True unknown = EXCLUDE + exclude = ("created_by", "updated_at", "updated_by", "is_deleted") sub_type = fields.Nested(SubTypeSchema, dump_only=True, exclude=("type", "type_id")) type = fields.Nested(TypeSchema, dump_only=True) diff --git a/epictrack-api/src/api/schemas/response/work_response.py b/epictrack-api/src/api/schemas/response/work_response.py index 9818bf3c4..50356fd9c 100644 --- a/epictrack-api/src/api/schemas/response/work_response.py +++ b/epictrack-api/src/api/schemas/response/work_response.py @@ -49,11 +49,10 @@ class Meta(AutoSchemaBase.Meta): model = Work include_fk = True unknown = EXCLUDE + exclude = ("created_by", "updated_at", "updated_by", "is_deleted") project = fields.Nested( - ProjectResponseSchema(exclude=("region_env", "region_flnro", "sub_type")), - dump_only=True, - ) + ProjectResponseSchema(exclude=("created_by", "updated_at", "updated_by", "is_deleted")), dump_only=True) ministry = fields.Nested(MinistrySchema, dump_only=True) eao_team = fields.Nested(EAOTeamSchema, dump_only=True) ea_act = fields.Nested(EAActSchema, dump_only=True) diff --git a/epictrack-web/src/components/workPlan/WorkPlanContainer.tsx b/epictrack-web/src/components/workPlan/WorkPlanContainer.tsx index f7d349f0e..2791154ae 100644 --- a/epictrack-web/src/components/workPlan/WorkPlanContainer.tsx +++ b/epictrack-web/src/components/workPlan/WorkPlanContainer.tsx @@ -17,6 +17,7 @@ import Issues from "./issues"; import WorkState from "./WorkState"; import ComingSoon from "../../routes/ComingSoon"; import { isStatusOutOfDate } from "./status/shared"; +import About from "./about"; const IndicatorIcon: React.FC = Icons["IndicatorIcon"]; @@ -123,7 +124,8 @@ const WorkPlanContainer = () => { ...tabPanel, }} > - + {/* */} + = Icons["LinkIcon"]; + +const AboutContainer = () => { + const { work } = useContext(WorkplanContext); + const [selectedTabIndex, setSelectedTabIndex] = React.useState(0); + + const handleTabSelected = (event: React.SyntheticEvent, index: number) => { + setSelectedTabIndex(index); + }; + + return ( + + + + + + + + + + Resources + + + + + + + + + + + + + + + + + Link to EPIC.Public + + + + {ABOUT_RESOURCES.map((resource) => { + return ( + <> + + + + + {resource.title} + + + + + ); + })} + + + + ); +}; + +export default AboutContainer; diff --git a/epictrack-web/src/components/workPlan/about/AboutContext.tsx b/epictrack-web/src/components/workPlan/about/AboutContext.tsx new file mode 100644 index 000000000..9d26d8d02 --- /dev/null +++ b/epictrack-web/src/components/workPlan/about/AboutContext.tsx @@ -0,0 +1,23 @@ +import { createContext } from "react"; +import React from "react"; +import { useSearchParams } from "../../../hooks/SearchParams"; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface AboutContextProps {} + +interface StatusContainerRouteParams extends URLSearchParams { + work_id: string; +} + +export const AboutContext = createContext({}); + +export const AboutProvider = ({ + children, +}: { + children: JSX.Element | JSX.Element[]; +}) => { + const query = useSearchParams(); + const workId = React.useMemo(() => query.get("work_id"), [query]); + + return {children}; +}; diff --git a/epictrack-web/src/components/workPlan/about/aboutDetails/ProjectDetails.tsx b/epictrack-web/src/components/workPlan/about/aboutDetails/ProjectDetails.tsx new file mode 100644 index 000000000..84697575a --- /dev/null +++ b/epictrack-web/src/components/workPlan/about/aboutDetails/ProjectDetails.tsx @@ -0,0 +1,123 @@ +import { Box, Divider, Grid } from "@mui/material"; +import { useContext } from "react"; +import { WorkplanContext } from "../../WorkPlanContext"; +import { ETCaption1, ETCaption2, GrayBox } from "../../../shared"; +import { Palette } from "../../../../styles/theme"; +import { MONTH_DAY_YEAR } from "../../../../constants/application-constant"; +import dayjs from "dayjs"; + +const ProjectDetails = () => { + const { work } = useContext(WorkplanContext); + return ( + + + + + PROJECT CREATION DATE + + + + + {dayjs(work?.project?.created_at).format(MONTH_DAY_YEAR)} + + + + + + + + PROPONENT + + + + + {work?.project?.proponent?.name} + + + + + PROJECT DESCRIPTION + + + + + {work?.project?.description} + + + + + TYPE + + + + + SUBTYPE + + + + + {work?.project?.type?.name} + + + + + {work?.project?.sub_type?.name} + + + + + LOCATION DESCRIPTION + + + + + {work?.project?.address} + + + + + ENV REGION + + + + + NRS REGION + + + + + {work?.project?.region_env?.name} + + + + + {work?.project?.region_flnro?.name} + + + + + ABBREVIATION + + + + + {work?.project?.abbreviation} + + + + + ); +}; + +export default ProjectDetails; diff --git a/epictrack-web/src/components/workPlan/about/aboutDetails/WorkDetails.tsx b/epictrack-web/src/components/workPlan/about/aboutDetails/WorkDetails.tsx new file mode 100644 index 000000000..f90714d82 --- /dev/null +++ b/epictrack-web/src/components/workPlan/about/aboutDetails/WorkDetails.tsx @@ -0,0 +1,133 @@ +import { Box, Divider, Grid } from "@mui/material"; +import { useContext, useEffect, useState } from "react"; +import { WorkplanContext } from "../../WorkPlanContext"; +import { ETCaption1, ETCaption2, GrayBox } from "../../../shared"; +import { Palette } from "../../../../styles/theme"; +import dayjs from "dayjs"; +import { MONTH_DAY_YEAR } from "../../../../constants/application-constant"; + +const WorkDetails = () => { + const [phaseInfo, setPhaseInfo] = useState({}); + const { work, workPhases } = useContext(WorkplanContext); + + const getNextPhaseInfo = () => { + workPhases.map((phase) => { + if (phase?.work_phase?.id === work?.current_work_phase_id) { + setPhaseInfo(phase); + } + }); + }; + + useEffect(() => { + getNextPhaseInfo(); + }, []); + + return ( + + + + WORK START DATE + + + + {dayjs(work?.created_at).format(MONTH_DAY_YEAR)} + + + + + + + + ANTICIPATED REFERRAL DATE + + + + + {work?.anticipated_decision_date || "-"} + + + + + CURRENT MILESTONE + + + + + NEXT MILESTONE + + + + - + + + + {phaseInfo?.next_milestone} + + + + + EA ACT + + + + + FEDERAL INVOLVEMENT + + + + + FEDERAL ACT + + + + + {work?.ea_act?.name} + + + + + {work?.federal_involvement?.name} + + + + + {work?.substitution_act?.name} + + + + + RESPONSIBLE MINISTRY + + + + + {work?.ministry?.name} + + + + + DECISION MAKER + + + + + {work?.decision_by?.full_name} + + + + + ); +}; + +export default WorkDetails; diff --git a/epictrack-web/src/components/workPlan/about/aboutDetails/index.tsx b/epictrack-web/src/components/workPlan/about/aboutDetails/index.tsx new file mode 100644 index 000000000..2ba442c22 --- /dev/null +++ b/epictrack-web/src/components/workPlan/about/aboutDetails/index.tsx @@ -0,0 +1,18 @@ +import { Grid } from "@mui/material"; +import ProjectDetails from "./ProjectDetails"; +import WorkDetials from "./WorkDetails"; + +const AboutDetials = () => { + return ( + + + + + + + + + ); +}; + +export default AboutDetials; diff --git a/epictrack-web/src/components/workPlan/about/index.tsx b/epictrack-web/src/components/workPlan/about/index.tsx new file mode 100644 index 000000000..69da85365 --- /dev/null +++ b/epictrack-web/src/components/workPlan/about/index.tsx @@ -0,0 +1,13 @@ +import React from "react"; +import AboutContainer from "./AboutContainer"; +import { AboutProvider } from "./AboutContext"; + +const Status = () => { + return ( + + + + ); +}; + +export default Status; diff --git a/epictrack-web/src/constants/application-constant.ts b/epictrack-web/src/constants/application-constant.ts index cd8185608..026a68243 100644 --- a/epictrack-web/src/constants/application-constant.ts +++ b/epictrack-web/src/constants/application-constant.ts @@ -76,6 +76,17 @@ export const FN_RESOURCES = [ }, ]; +export const ABOUT_RESOURCES = [ + { + title: "Link to eGuide", + url: "https://intranet.gov.bc.ca/eao/our-work/eguide-2018", + }, + { + title: "Link to EA Act (2018)", + url: "https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/18051", + }, +]; + export const GROUPS = { SUPER_USER: "Super User", DEVELOPER: "Developer", diff --git a/epictrack-web/src/models/work.ts b/epictrack-web/src/models/work.ts index ade89743e..90d54ed14 100644 --- a/epictrack-web/src/models/work.ts +++ b/epictrack-web/src/models/work.ts @@ -35,8 +35,18 @@ export interface Work extends MasterBase { decision_by_id: number; decision_maker_position_id: number; start_date_locked: boolean; - - project: ListType & { description: string }; + created_at: string; + project: ListType & { + created_at: string; + description: string; + address: string; + abbreviation: string; + type: ListType & { name: string }; + sub_type: ListType & { name: string }; + proponent: ListType & { name: string }; + region_env: ListType & { name: string }; + region_flnro: ListType & { name: string }; + }; ministry: Ministry; ea_act: ListType; eao_team: ListType;