Skip to content

Commit

Permalink
merge from main + ajaita add initiative wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaitasaini committed Aug 30, 2023
2 parents c6fc847 + 413b54f commit 062b95c
Show file tree
Hide file tree
Showing 18 changed files with 1,551 additions and 14 deletions.
144 changes: 136 additions & 8 deletions services/app-api/forms/wp.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@
"section": "",
"subsection": "",
"hint": "",
"exportSection": ""
"exportSection": "",
"info": [
{
"type": "text",
"content": ""
}
]
}
}
},
Expand Down Expand Up @@ -515,18 +521,140 @@
}
},
{
"name": "State & Territory Specific Initiatives",
"name": "state-and-territory-specific-initiatives",
"path": "/wp/state-and-territory-specific-initiatives/initiatives",
"pageType": "standard",
"pageType": "modalOverlay",
"entityType": "initiatives",
"verbiage": {
"intro": {
"section": "",
"subsection": ""
}
"intro": {
"section": "",
"subsection": "State and Territory-Specific Initiatives",
"info": [
{
"type": "html",
"content": "See "
},
{
"type": "internalLink",
"content": "previous page",
"props": {
"to": "/wp/state-and-territory-specific-initiatives/instructions"
}
},
{
"type": "html",
"content": " for detailed instructions."
}
],
"exportSectionHeader": "exportSectionHeader"
},
"addEntityButtonText": "Add Initiative",
"editEntityButtonText": "Edit name",
"addEditModalAddTitle": "Add initiative",
"enterReportText": "Edit",
"dashboardTitle": "Initative Total Count",
"countEntitiesInTitle": true,
"tableHeader": "tableHeader",
"addEditModalHint": "Provide the name of one initiative. You will be then be asked to complete details for this initiative including description, evaluation plan and funding sources.",
"emptyDashboardText": "Empty"
},
"modalForm": {
"id": "add_initiative",
"fields": [
{
"id": "initiative_name",
"type": "textarea",
"validation": "text",
"props": {
"label": "Initiative name"
}
},
{
"id": "initiative_wpTopic",
"type": "radio",
"props": {
"label": "Work Plan topic:",
"hint": "Note: Initiative topics with * are required and must be selected at least once across all initiatives.",
"choices": [
{
"id": "VjQ0OFqior9Dxu5RRNiZ5u",
"label": "Transitions and transition coordination services*"
},
{
"id": "wbUsMMqVP7q1n10szK5h5S",
"label": "Housing-related supports*"
},
{
"id": "SdaFlF3DJyzKcHCCu3Zylm",
"label": "Quality measurement and improvement*"
},
{
"id": "8CpFrev6sMfRijIhafMj7V",
"label": "Self-direction(*if applicable)"
},
{
"id": "tVURShWTPfVKGU94QmIwDn",
"label": "Tribal Initiative (*if applicable)"
},
{
"id": "1k3EnM5WrizX3hsa6Zn85G",
"label": "Recruitment and enrollment"
},
{
"id": "dtybJ8ZucoIn7a4LnMpWg2",
"label": "Person-centered planning and services"
},
{
"id": "rSTGMVEOaJ4OZ6amTQetaa",
"label": "No Wrong Door systems"
},
{
"id": "8In9QpCC7O3XBkDOyB36vy",
"label": "Community transition support"
},
{
"id": "GCBzQ9GDWMwILW0sBQ2dhN",
"label": "Direct service workforce and caregivers"
},
{
"id": "K8WifjAU3SymG751jAvv6j",
"label": "Data-based decision-making"
},
{
"id": "39oSwSqVoDpLGbD9HnfUhg",
"label": "Financing approaches"
},
{
"id": "I9A6C2SY0Dk3ezfvywqqwB",
"label": "Stakeholder engagement"
},
{
"id": "2qjBuLtpA5pDvUM1HSHMVq",
"label": "Equity and SDOH"
},
{
"id": "18Wb9b2zMIF13pZwWstdJF",
"label": "Other, specify",
"children": [
{
"id": "initiative_wp_otherTopic",
"type": "textarea",
"validation": {
"type": "text",
"nested": true,
"parentFieldName": "initiative_wpTopic"
}
}
]
}
]
}
}
]
}
}
]
},
},
{
"name": "Review & Submit",
"path": "/wp/review-and-submit",
Expand Down
7 changes: 7 additions & 0 deletions services/ui-src/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,18 @@ export { StandardReportPage } from "./reports/StandardReportPage";
export { ReportPageFooter } from "./reports/ReportPageFooter";
export { ReportPageWrapper } from "./reports/ReportPageWrapper";
export { ReportContext } from "./reports/ReportProvider";
export { EntityProvider } from "./reports/EntityProvider";
export { DrawerReportPage } from "./reports/DrawerReportPage";
export { ModalDrawerReportPage } from "./reports/ModalDrawerReportPage";
export { ModalOverlayReportPage } from "./reports/ModalOverlayReportPage";

// statusing
export { StatusTable } from "./statusing/StatusTable";
// tables
export { Table } from "./tables/Table";
export { EntityRow } from "./tables/EntityRow";
export { MobileEntityRow } from "./tables/MobileEntityRow";
export { EntityStatusIcon } from "./tables/EntityStatusIcon";
// widgets
export { SpreadsheetWidget } from "./widgets/SpreadsheetWidget";
// Redirects
Expand All @@ -85,3 +90,5 @@ export { PostLogoutRedirect } from "./PostLogoutRedirect/index";
export { DashboardPage } from "./pages/Dashboard/DashboardPage";
export { DashboardTable } from "./pages/Dashboard/DashboardTable";
export { MobileDashboardTable } from "./pages/Dashboard/MobileDashboardTable";
//overlay
export { EntityDetailsOverlay } from "./overlays/EntityDetailsOverlay";
24 changes: 24 additions & 0 deletions services/ui-src/src/components/menus/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,30 @@ export const Sidebar = ({ isHidden }: SidebarProps) => {
section={{ name: "placeholder", path: "/standard" }}
level={1}
/>
<NavSection
key={"general"}
section={{
name: "General Information",
path: "/wp/general-information",
}}
level={1}
/>
<NavSection
key={"transition"}
section={{
name: "Transition Benchmark Strategy",
path: "/wp/transition-benchmark-strategy",
}}
level={1}
/>
<NavSection
key={"state & territory"}
section={{
name: "State & Territory Specific Initiatives",
path: "/wp/state-and-territory-specific-initiatives/initiatives",
}}
level={2}
/>
</Box>
</Box>
</>
Expand Down
174 changes: 174 additions & 0 deletions services/ui-src/src/components/overlays/EntityDetailsOverlay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
import React, { MouseEventHandler, useContext, useEffect } from "react";
// components
import { Box, Button, Flex, Image, Spinner, Text } from "@chakra-ui/react";
import { Form, ReportPageIntro } from "components";
// types
import { EntityShape, EntityType, FormJson } from "types";
// utils

// assets
import arrowLeftBlue from "assets/icons/icon_arrow_left_blue.png";
// verbiage
import accordionVerbiage from "../../verbiage/pages/accordion";
import overlayVerbiage from "../../verbiage/pages/overlays";
import { EntityContext } from "components/reports/EntityProvider";

export const EntityDetailsOverlay = ({
closeEntityDetailsOverlay,
entityType,
entities,
form,
onSubmit,
selectedEntity,
disabled,
submitting,
validateOnRender,
}: Props) => {
// Entity Provider Setup
const { setEntities, setSelectedEntity, setEntityType } =
useContext(EntityContext);

useEffect(() => {
setSelectedEntity(selectedEntity);
setEntityType(entityType);
setEntities(entities);
return () => {
setEntities([]);
setSelectedEntity(undefined);
};
}, [entityType, selectedEntity]);

// Display Variables
const {
report_programName: reportProgramName,
report_planName: reportPlanName,
} = selectedEntity;
const eligibilityGroup = `${
selectedEntity["report_eligibilityGroup-otherText"] ||
selectedEntity.report_eligibilityGroup[0].value
}`;
const reportingPeriod = `${selectedEntity.report_reportingPeriodStartDate} to ${selectedEntity.report_reportingPeriodEndDate}`;

const programInfo = [
reportPlanName,
reportProgramName,
eligibilityGroup,
reportingPeriod,
];

return (
<Box>
<Button
sx={sx.backButton}
variant="none"
onClick={closeEntityDetailsOverlay as MouseEventHandler}
aria-label="Return to MLR reporting"
>
<Image src={arrowLeftBlue} alt="Arrow left" sx={sx.backIcon} />
Return to MLR Reporting
</Button>
<ReportPageIntro
text={overlayVerbiage.WP.intro}
accordion={accordionVerbiage.WP.detailIntro}
/>
<Box sx={sx.programInfo}>
<Text sx={sx.textHeading}>MLR report for:</Text>
<ul>
{programInfo.map((field, index) => (
<li key={index}>{field}</li>
))}
</ul>
</Box>
<Form
id={form.id}
formJson={form}
onSubmit={onSubmit}
formData={selectedEntity}
autosave={true}
disabled={disabled}
validateOnRender={validateOnRender || false}
dontReset={true}
/>
<Box sx={sx.footerBox}>
<Flex sx={sx.buttonFlex}>
{disabled ? (
<Button
variant="outline"
onClick={closeEntityDetailsOverlay as MouseEventHandler}
>
Return
</Button>
) : (
<Button type="submit" form={form.id} sx={sx.saveButton}>
{submitting ? <Spinner size="md" /> : "Save & return"}
</Button>
)}
</Flex>
</Box>
</Box>
);
};

interface Props {
closeEntityDetailsOverlay: Function;
entityType: EntityType;
entities: any;
form: FormJson;
onSubmit: Function;
selectedEntity: EntityShape;
disabled: boolean;
submitting?: boolean;
validateOnRender?: boolean;
}

const sx = {
overlayContainer: {
backgroundColor: "palette.white",
width: "100%",
},
backButton: {
padding: 0,
fontWeight: "normal",
color: "palette.primary",
display: "flex",
position: "relative",
right: "3rem",
marginBottom: "2rem",
marginTop: "-2rem",
},
backIcon: {
color: "palette.primary",
height: "1rem",
marginRight: "0.5rem",
},
footerBox: {
marginTop: "2rem",
borderTop: "1.5px solid var(--chakra-colors-palette-gray_light)",
},
buttonFlex: {
justifyContent: "end",
marginY: "1.5rem",
},
saveButton: {
width: "8.25rem",
},
textHeading: {
fontWeight: "bold",
lineHeight: "1.25rem",
},
programInfo: {
ul: {
margin: "0.5rem auto 0 auto",
listStyleType: "none",
li: {
wordWrap: "break-word",
whiteSpace: "break-spaces",
fontSize: "xl",
lineHeight: "1.75rem",
"&:first-child": {
fontWeight: "bold",
},
},
},
},
};
Loading

0 comments on commit 062b95c

Please sign in to comment.