}
- {verbiage.list && (
-
- {verbiage.list.map((listItem: string, index: number) => (
- {listItem}
- ))}
-
- )}
-
-
-);
-
-interface Props {
- verbiage: AnyObject;
- [key: string]: any;
-}
diff --git a/services/ui-src/src/components/cards/CiIntroductionCard.test.tsx b/services/ui-src/src/components/cards/CiIntroductionCard.test.tsx
new file mode 100644
index 00000000..8176e264
--- /dev/null
+++ b/services/ui-src/src/components/cards/CiIntroductionCard.test.tsx
@@ -0,0 +1,19 @@
+import { CiIntroductionCard } from "./CiIntroductionCard";
+import { render, screen } from "@testing-library/react";
+import { testA11y } from "utils/testing/commonTests";
+import { RouterWrappedComponent } from "utils/testing/mockRouter";
+
+const component = (
+
+
+
+);
+
+describe("CiIntroductionCard", () => {
+ it("should render", () => {
+ render(component);
+ expect(screen.getByText("The HCBS is", { exact: false })).toBeVisible();
+ });
+
+ testA11y(component);
+});
diff --git a/services/ui-src/src/components/cards/CiIntroductionCard.tsx b/services/ui-src/src/components/cards/CiIntroductionCard.tsx
new file mode 100644
index 00000000..f8e57636
--- /dev/null
+++ b/services/ui-src/src/components/cards/CiIntroductionCard.tsx
@@ -0,0 +1,31 @@
+import { Accordion, Link } from "@chakra-ui/react";
+import { AccordionItem, ReportIntroCard } from "components";
+import { ReportType } from "types";
+import { ReportIntroCardActions } from "./ReportIntroCardActions";
+
+/**
+ * This card appears on the state user home page.
+ * It contains text specific to the CI report.
+ */
+export const CiIntroductionCard = () => {
+ return (
+
+ The HCBS is ...
+
+ 6071(a)(1) of the Deficit Reduction Act (DRA)
+
+ as "increasing the use of home and community-based, rather than
+ institutional, long-term care services."
+
+
+
+
The HCBS Critical Incident will be created and submitted ...
+
The HCBS Critical Incident deadlines are TBD ...
+
+
+
+ );
+};
diff --git a/services/ui-src/src/components/cards/DownloadTemplate.test.tsx b/services/ui-src/src/components/cards/DownloadTemplate.test.tsx
deleted file mode 100644
index 1300b50e..00000000
--- a/services/ui-src/src/components/cards/DownloadTemplate.test.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { downloadTemplate } from "./TemplateCard";
-
-jest.mock("utils", () => ({
- getSignedTemplateUrl: jest.fn(),
-}));
-
-const mockCreateElement = jest.spyOn(document, "createElement");
-const mockClick = jest.fn();
-const mockSetAttribute = jest.fn();
-const mockRemove = jest.fn();
-
-describe("downloadTemplate", () => {
- beforeEach(() => {
- mockCreateElement.mockReturnValue({
- setAttribute: mockSetAttribute,
- click: mockClick,
- remove: mockRemove,
- } as unknown as HTMLAnchorElement);
- });
-
- afterEach(() => {
- jest.clearAllMocks();
- });
-
- test("should download the template when called", async () => {
- const templateName = "test-template";
- const signedUrl = "https://example.com/signed-url";
- const { getSignedTemplateUrl } = require("utils");
- (getSignedTemplateUrl as jest.Mock).mockResolvedValue(signedUrl);
-
- await downloadTemplate(templateName);
-
- expect(getSignedTemplateUrl).toHaveBeenCalledWith(templateName);
- expect(mockSetAttribute).toHaveBeenCalledWith("target", "_blank");
- expect(mockSetAttribute).toHaveBeenCalledWith("href", signedUrl);
- expect(mockClick).toHaveBeenCalled();
- expect(mockRemove).toHaveBeenCalled();
- });
-});
diff --git a/services/ui-src/src/components/cards/HelpCard.test.tsx b/services/ui-src/src/components/cards/HelpCard.test.tsx
index 576c8d0c..fc0b4471 100644
--- a/services/ui-src/src/components/cards/HelpCard.test.tsx
+++ b/services/ui-src/src/components/cards/HelpCard.test.tsx
@@ -1,18 +1,18 @@
import { render, screen } from "@testing-library/react";
import { testA11y } from "utils/testing/commonTests";
-import { EmailCard } from "components";
+import { HelpCard } from "components";
import { Link } from "@chakra-ui/react";
describe("Test EmailCard", () => {
test("Email for EmailCard is visible", () => {
render(
-
+
mdct_help@cms.hhs.gov
-
+
);
const link = screen.getByRole("link", { name: "mdct_help@cms.hhs.gov" });
expect(link).toBeVisible();
});
- testA11y();
+ testA11y();
});
diff --git a/services/ui-src/src/components/cards/QMSIntroductionCard.test.tsx b/services/ui-src/src/components/cards/QMSIntroductionCard.test.tsx
new file mode 100644
index 00000000..fafda4d9
--- /dev/null
+++ b/services/ui-src/src/components/cards/QMSIntroductionCard.test.tsx
@@ -0,0 +1,19 @@
+import { QmsIntroductionCard } from "./QmsIntroductionCard";
+import { render, screen } from "@testing-library/react";
+import { testA11y } from "utils/testing/commonTests";
+import { RouterWrappedComponent } from "utils/testing/mockRouter";
+
+const component = (
+
+
+
+);
+
+describe("QmsIntroductionCard", () => {
+ it("should render", () => {
+ render(component);
+ expect(screen.getByText("The HCBS is", { exact: false })).toBeVisible();
+ });
+
+ testA11y(component);
+});
diff --git a/services/ui-src/src/components/cards/QmsIntroductionCard.tsx b/services/ui-src/src/components/cards/QmsIntroductionCard.tsx
new file mode 100644
index 00000000..5d884a38
--- /dev/null
+++ b/services/ui-src/src/components/cards/QmsIntroductionCard.tsx
@@ -0,0 +1,32 @@
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+import { Accordion, Link } from "@chakra-ui/react";
+import { AccordionItem, ReportIntroCard } from "components";
+import { ReportType } from "types";
+import { ReportIntroCardActions } from "./ReportIntroCardActions";
+
+/**
+ * This card appears on the state user home page.
+ * It contains text specific to the QMS report.
+ */
+export const QmsIntroductionCard = () => {
+ return (
+
+ The HCBS is ...
+
+ 6071(a)(1) of the Deficit Reduction Act (DRA)
+
+ as "increasing the use of home and community-based, rather than
+ institutional, long-term care services."
+
+
+
+
The HCBS Quality Measure Set will be created and submitted ...
+
The HCBS Quality Measure Set deadlines are TBD ...
+
+
+
+ );
+};
diff --git a/services/ui-src/src/components/cards/ReportIntroCard.test.tsx b/services/ui-src/src/components/cards/ReportIntroCard.test.tsx
new file mode 100644
index 00000000..f5d79fa4
--- /dev/null
+++ b/services/ui-src/src/components/cards/ReportIntroCard.test.tsx
@@ -0,0 +1,50 @@
+import { render, screen } from "@testing-library/react";
+import { ReportIntroCard } from "components";
+import { mockUseStore, RouterWrappedComponent } from "utils/testing/setupJest";
+import { useStore } from "utils";
+import { testA11y } from "utils/testing/commonTests";
+
+jest.mock("utils/other/useBreakpoint", () => ({
+ useBreakpoint: jest.fn(() => ({
+ isDesktop: true,
+ })),
+}));
+
+jest.mock("utils/state/useStore");
+const mockedUseStore = useStore as jest.MockedFunction;
+mockedUseStore.mockReturnValue(mockUseStore);
+
+const mockUseNavigate = jest.fn();
+
+jest.mock("react-router-dom", () => ({
+ useNavigate: () => mockUseNavigate,
+}));
+
+const qmsReportTypeCardComponent = (
+
+
+ This is the body of the report intro card. Normally it would contain a
+ description of the report, as well as an instance of
+ <IntroCardActions>
+
+
+);
+
+describe("", () => {
+ describe("Renders", () => {
+ beforeEach(() => {
+ render(qmsReportTypeCardComponent);
+ });
+
+ test("QMS ReportTypeCard is visible", () => {
+ expect(screen.getByText("HCBS Quality Measure Set")).toBeVisible();
+ });
+
+ test("QMS ReportTypeCard image is visible on desktop", () => {
+ const imageAltText = "Spreadsheet icon";
+ expect(screen.getByAltText(imageAltText)).toBeVisible();
+ });
+ });
+
+ testA11y(qmsReportTypeCardComponent);
+});
diff --git a/services/ui-src/src/components/cards/ReportIntroCard.tsx b/services/ui-src/src/components/cards/ReportIntroCard.tsx
new file mode 100644
index 00000000..8cfd3ba9
--- /dev/null
+++ b/services/ui-src/src/components/cards/ReportIntroCard.tsx
@@ -0,0 +1,59 @@
+import { Flex, Heading, Image } from "@chakra-ui/react";
+import { Card } from "components";
+import { useBreakpoint } from "utils";
+import spreadsheetIcon from "assets/icons/spreadsheet/icon_spreadsheet_gray.svg";
+import { ReactNode } from "react";
+
+/**
+ * This card used on the state user home page.
+ * Each report type has its own card,
+ * describing the report and answering common questions (such as due date).
+ * Each card will also contain a button to download the User Guide,
+ * and a link to that report type's dashboard.
+ */
+export const ReportIntroCard = ({ title, children }: Props) => {
+ const { isDesktop } = useBreakpoint();
+
+ return (
+
+
+ {isDesktop && (
+
+ )}
+
+ {title}
+ {children}
+
+
+
+ );
+};
+
+interface Props {
+ title: string;
+ children: ReactNode;
+}
+
+const sx = {
+ root: {
+ flexDirection: "row",
+ },
+ spreadsheetIcon: {
+ marginRight: "2rem",
+ boxSize: "5.5rem",
+ },
+ cardContentFlex: {
+ width: "100%",
+ flexDirection: "column",
+ },
+ cardTitleText: {
+ marginBottom: "0.5rem",
+ fontSize: "lg",
+ fontWeight: "bold",
+ lineHeight: "1.5",
+ },
+};
diff --git a/services/ui-src/src/components/cards/ReportIntroCardActions.test.tsx b/services/ui-src/src/components/cards/ReportIntroCardActions.test.tsx
new file mode 100644
index 00000000..a0c4cb4e
--- /dev/null
+++ b/services/ui-src/src/components/cards/ReportIntroCardActions.test.tsx
@@ -0,0 +1,98 @@
+import { render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import {
+ downloadUserGuide,
+ ReportIntroCardActions,
+} from "./ReportIntroCardActions";
+import { mockUseStore, RouterWrappedComponent } from "utils/testing/setupJest";
+import { useStore, getSignedTemplateUrl } from "utils";
+import { testA11y } from "utils/testing/commonTests";
+import { ReportType } from "types";
+
+jest.mock("../../utils/api/requestMethods/getTemplateUrl", () => ({
+ getSignedTemplateUrl: jest
+ .fn()
+ .mockResolvedValue("https://mdcthcbs.cms.gov/qms/userGuide.pdf"),
+}));
+
+const mockCreateElement = jest.spyOn(document, "createElement");
+const mockClick = jest.fn();
+const mockSetAttribute = jest.fn();
+const mockRemove = jest.fn();
+
+jest.mock("utils/other/useBreakpoint", () => ({
+ useBreakpoint: jest.fn(() => ({
+ isDesktop: true,
+ })),
+}));
+
+jest.mock("utils/state/useStore");
+const mockedUseStore = useStore as jest.MockedFunction;
+mockedUseStore.mockReturnValue(mockUseStore);
+
+const mockUseNavigate = jest.fn();
+
+jest.mock("react-router-dom", () => ({
+ useNavigate: () => mockUseNavigate,
+}));
+
+const reportActionsComponent = (
+
+
+
+);
+
+describe("", () => {
+ describe("Renders", () => {
+ beforeEach(() => {
+ render(reportActionsComponent);
+ });
+
+ test("QMS ReportTypeCard link is visible on desktop", () => {
+ const downloadButton = screen.getByRole("button", {
+ name: "User Guide and Help File",
+ });
+ expect(downloadButton).toBeVisible();
+ });
+
+ test("QMS ReportTypeCard navigates to next route on link click", async () => {
+ const dashboardLink = screen.getByRole("button", {
+ name: "Enter HCBS QMS online",
+ });
+ await userEvent.click(dashboardLink);
+ const expectedRoute = "/report/QMS/MN";
+ expect(mockUseNavigate).toHaveBeenCalledWith(expectedRoute);
+ });
+ });
+
+ describe("downloadTemplate", () => {
+ beforeEach(() => {
+ mockCreateElement.mockReturnValueOnce({
+ setAttribute: mockSetAttribute,
+ click: mockClick,
+ remove: mockRemove,
+ } as unknown as HTMLAnchorElement);
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+
+ test("should download the template when called", async () => {
+ const reportType = ReportType.QMS;
+
+ await downloadUserGuide(reportType);
+
+ expect(getSignedTemplateUrl).toHaveBeenCalledWith(reportType);
+ expect(mockSetAttribute).toHaveBeenCalledWith("target", "_blank");
+ expect(mockSetAttribute).toHaveBeenCalledWith(
+ "href",
+ "https://mdcthcbs.cms.gov/qms/userGuide.pdf"
+ );
+ expect(mockClick).toHaveBeenCalled();
+ expect(mockRemove).toHaveBeenCalled();
+ });
+ });
+
+ testA11y(reportActionsComponent);
+});
diff --git a/services/ui-src/src/components/cards/ReportIntroCardActions.tsx b/services/ui-src/src/components/cards/ReportIntroCardActions.tsx
new file mode 100644
index 00000000..0ab2e9ca
--- /dev/null
+++ b/services/ui-src/src/components/cards/ReportIntroCardActions.tsx
@@ -0,0 +1,78 @@
+import { Button, Flex, Image } from "@chakra-ui/react";
+import downloadIcon from "assets/icons/download/icon_download_primary.svg";
+import nextIcon from "assets/icons/arrows/icon_arrow_next_white.svg";
+import { useNavigate } from "react-router-dom";
+import { ReportType } from "types";
+import { getSignedTemplateUrl, useStore } from "utils";
+
+/**
+ * This component is contained within each card on the stat user home page.
+ * It has a button to download the user guide for that report type,
+ * and a link to that report type's dashboard.
+ */
+export const ReportIntroCardActions = ({ reportType }: Props) => {
+ const navigate = useNavigate();
+ const state = useStore().user?.state;
+ const dashboardRoute = `/report/${reportType}/${state}`;
+
+ return (
+
+
+ }
+ onClick={async () => {
+ await downloadUserGuide(reportType);
+ }}
+ >
+ User Guide and Help File
+
+ {/* TODO: this Button is for navigation, so it maybe should be a Link instead. */}
+
+
+ );
+};
+
+export const downloadUserGuide = async (reportType: ReportType) => {
+ const signedUrl = await getSignedTemplateUrl(reportType);
+ const link = document.createElement("a");
+ link.setAttribute("target", "_blank");
+ link.setAttribute("href", signedUrl);
+ link.click();
+ link.remove();
+};
+
+interface Props {
+ reportType: ReportType;
+}
+
+const sx = {
+ actionsFlex: {
+ flexFlow: "wrap",
+ gridGap: "1rem",
+ justifyContent: "space-between",
+ margin: "1rem 0 0 1rem",
+ ".mobile &": {
+ flexDirection: "column",
+ },
+ },
+ userGuideDownloadButton: {
+ justifyContent: "start",
+ marginRight: "1rem",
+ padding: "0",
+ span: {
+ marginLeft: "0rem",
+ marginRight: "0.5rem",
+ },
+ ".mobile &": {
+ marginRight: "0",
+ },
+ },
+};
diff --git a/services/ui-src/src/components/cards/TaIntroductionCard.test.tsx b/services/ui-src/src/components/cards/TaIntroductionCard.test.tsx
new file mode 100644
index 00000000..52d0f04b
--- /dev/null
+++ b/services/ui-src/src/components/cards/TaIntroductionCard.test.tsx
@@ -0,0 +1,19 @@
+import { TaIntroductionCard } from "./TaIntroductionCard";
+import { render, screen } from "@testing-library/react";
+import { testA11y } from "utils/testing/commonTests";
+import { RouterWrappedComponent } from "utils/testing/mockRouter";
+
+const component = (
+
+
+
+);
+
+describe("TaIntroductionCard", () => {
+ it("should render", () => {
+ render(component);
+ expect(screen.getByText("The HCBS is", { exact: false })).toBeVisible();
+ });
+
+ testA11y(component);
+});
diff --git a/services/ui-src/src/components/cards/TaIntroductionCard.tsx b/services/ui-src/src/components/cards/TaIntroductionCard.tsx
new file mode 100644
index 00000000..a56b5bf6
--- /dev/null
+++ b/services/ui-src/src/components/cards/TaIntroductionCard.tsx
@@ -0,0 +1,31 @@
+import { Accordion, Link } from "@chakra-ui/react";
+import { AccordionItem, ReportIntroCard } from "components";
+import { ReportType } from "types";
+import { ReportIntroCardActions } from "./ReportIntroCardActions";
+
+/**
+ * This card appears on the state user home page.
+ * It contains text specific to the TA report.
+ */
+export const TaIntroductionCard = () => {
+ return (
+
+ The HCBS is ...
+
+ 6071(a)(1) of the Deficit Reduction Act (DRA)
+
+ as "increasing the use of home and community-based, rather than
+ institutional, long-term care services."
+
+
+
+
The HCBS Timely Access will be created and submitted ...
+
The HCBS Timely Access deadlines are TBD ...
+
+
+
+ );
+};
diff --git a/services/ui-src/src/components/cards/TemplateCard.test.tsx b/services/ui-src/src/components/cards/TemplateCard.test.tsx
deleted file mode 100644
index b599f0e1..00000000
--- a/services/ui-src/src/components/cards/TemplateCard.test.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import { render, screen } from "@testing-library/react";
-import userEvent from "@testing-library/user-event";
-import { TemplateCard } from "components";
-import { mockUseStore, RouterWrappedComponent } from "utils/testing/setupJest";
-import { useStore } from "utils";
-import verbiage from "verbiage/pages/home";
-import { testA11y } from "utils/testing/commonTests";
-
-jest.mock("utils/other/useBreakpoint", () => ({
- useBreakpoint: jest.fn(() => ({
- isDesktop: true,
- })),
-}));
-
-jest.mock("utils/state/useStore");
-const mockedUseStore = useStore as jest.MockedFunction;
-mockedUseStore.mockReturnValue(mockUseStore);
-
-const mockUseNavigate = jest.fn();
-
-jest.mock("react-router-dom", () => ({
- useNavigate: () => mockUseNavigate,
-}));
-
-const qmsTemplateVerbiage = verbiage.cards.QMS;
-
-const qmsTemplateCardComponent = (
-
-
-
-);
-
-describe("", () => {
- describe("Renders", () => {
- beforeEach(() => {
- render(qmsTemplateCardComponent);
- });
-
- test("QMS TemplateCard is visible", () => {
- expect(screen.getByText(qmsTemplateVerbiage.title)).toBeVisible();
- });
-
- test("QMS TemplateCard image is visible on desktop", () => {
- const imageAltText = "Spreadsheet icon";
- expect(screen.getByAltText(imageAltText)).toBeVisible();
- });
-
- test("QMS TemplateCard link is visible on desktop", () => {
- const templateCardLink = qmsTemplateVerbiage.link.text;
- expect(screen.getByText(templateCardLink)).toBeVisible();
- });
-
- test("QMS TemplateCard navigates to next route on link click", async () => {
- const templateCardLink = screen.getByText(qmsTemplateVerbiage.link.text)!;
- await userEvent.click(templateCardLink);
- const expectedRoute = "/report/QMS/MN";
- expect(mockUseNavigate).toHaveBeenCalledWith(expectedRoute);
- });
- });
-
- testA11y(qmsTemplateCardComponent);
-});
diff --git a/services/ui-src/src/components/cards/TemplateCard.tsx b/services/ui-src/src/components/cards/TemplateCard.tsx
deleted file mode 100644
index 8b345edc..00000000
--- a/services/ui-src/src/components/cards/TemplateCard.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import { Button, Flex, Heading, Image, Text, Link } from "@chakra-ui/react";
-import { Card, TemplateCardAccordion } from "components";
-import { useNavigate } from "react-router-dom";
-import { useBreakpoint, getSignedTemplateUrl, useStore } from "utils";
-import { AnyObject } from "types";
-import downloadIcon from "assets/icons/download/icon_download_primary.svg";
-import nextIcon from "assets/icons/arrows/icon_arrow_next_white.svg";
-import spreadsheetIcon from "assets/icons/spreadsheet/icon_spreadsheet_gray.svg";
-
-export const downloadTemplate = async (templateName: string) => {
- const signedUrl = await getSignedTemplateUrl(templateName);
- const link = document.createElement("a");
- link.setAttribute("target", "_blank");
- link.setAttribute("href", signedUrl);
- link.click();
- link.remove();
-};
-
-export const TemplateCard = ({
- templateName,
- verbiage,
- cardprops,
- isHidden,
- ...props
-}: Props) => {
- const { isDesktop } = useBreakpoint();
- const navigate = useNavigate();
- const store = useStore();
- const user = store.user;
- const state = user?.state;
- const dashboardPath = verbiage.link.route.replace("{state}", state);
-
- return (
-
-
- {isDesktop && (
-
- )}
-
- {verbiage.title}
-
- {verbiage.body.available}
- {/*
- {verbiage.linkText}
- */}
- {verbiage.midText}
-
- {verbiage.linkText2}
-
- {/* {verbiage.postLinkText} */}
-
-
- {verbiage.downloadText && (
-
- }
- onClick={async () => {
- await downloadTemplate(templateName);
- }}
- >
- {verbiage.downloadText}
-
- )}
- {!isHidden && (
-
- )}
-
-
- Notes on when it's due
-
-
-
- );
-};
-
-interface Props {
- verbiage: AnyObject;
- isHidden?: boolean;
- [key: string]: any;
-}
-
-const sx = {
- root: {
- flexDirection: "row",
- },
- spreadsheetIcon: {
- marginRight: "2rem",
- boxSize: "5.5rem",
- },
- cardContentFlex: {
- width: "100%",
- flexDirection: "column",
- },
- cardTitleText: {
- marginBottom: "0.5rem",
- fontSize: "lg",
- fontWeight: "bold",
- lineHeight: "1.5",
- },
- actionsFlex: {
- flexFlow: "wrap",
- gridGap: "1rem",
- justifyContent: "space-between",
- margin: "1rem 0 0 1rem",
- ".mobile &": {
- flexDirection: "column",
- },
- },
- templateDownloadButton: {
- justifyContent: "start",
- marginRight: "1rem",
- padding: "0",
- span: {
- marginLeft: "0rem",
- marginRight: "0.5rem",
- },
- ".mobile &": {
- marginRight: "0",
- },
- },
- formLink: {
- justifyContent: "start",
- span: {
- marginLeft: "0.5rem",
- marginRight: "-0.25rem",
- },
- },
- textMargin: {
- paddingTop: "1rem",
- },
-};
diff --git a/services/ui-src/src/components/forms/AdminDashSelector.test.tsx b/services/ui-src/src/components/forms/AdminDashSelector.test.tsx
index 9eb44688..e150e9b2 100644
--- a/services/ui-src/src/components/forms/AdminDashSelector.test.tsx
+++ b/services/ui-src/src/components/forms/AdminDashSelector.test.tsx
@@ -44,22 +44,19 @@ describe("AdminDashSelector Component", () => {
(useNavigate as jest.Mock).mockReturnValue(mockNavigate);
});
- const mockVerbiage = {
- header: "Select a State and Report",
- buttonLabel: "Submit",
- };
-
test("renders correctly with header and button label", () => {
- render();
+ render();
- expect(screen.getByText(mockVerbiage.header)).toBeInTheDocument();
expect(
- screen.getByRole("button", { name: mockVerbiage.buttonLabel })
+ screen.getByText("View State/Territory Reports")
+ ).toBeInTheDocument();
+ expect(
+ screen.getByRole("button", { name: "Go to Report Dashboard" })
).toBeInTheDocument();
});
test("allows user to select a state and report", async () => {
- render();
+ render();
// Select a state
const dropdown = screen.getByLabelText(
@@ -77,7 +74,7 @@ describe("AdminDashSelector Component", () => {
});
test("navigates to the correct report URL on form submission", async () => {
- render();
+ render();
// Select a state and report
const dropdown = screen.getByLabelText("Select state or territory:");
@@ -87,7 +84,7 @@ describe("AdminDashSelector Component", () => {
// Submit the form
const submitButton = screen.getByRole("button", {
- name: mockVerbiage.buttonLabel,
+ name: "Go to Report Dashboard",
});
await userEvent.click(submitButton);
@@ -95,10 +92,10 @@ describe("AdminDashSelector Component", () => {
expect(mockNavigate).toHaveBeenCalledWith("report/QMS/CA");
});
test("submit button is disabled when no state or report is selected", async () => {
- render();
+ render();
const submitButton = screen.getByRole("button", {
- name: mockVerbiage.buttonLabel,
+ name: "Go to Report Dashboard",
});
expect(submitButton).toBeDisabled();
diff --git a/services/ui-src/src/components/forms/AdminDashSelector.tsx b/services/ui-src/src/components/forms/AdminDashSelector.tsx
index af7f5087..523c39c6 100644
--- a/services/ui-src/src/components/forms/AdminDashSelector.tsx
+++ b/services/ui-src/src/components/forms/AdminDashSelector.tsx
@@ -2,14 +2,10 @@ import React, { useState } from "react";
import { useNavigate } from "react-router-dom";
import { Box, Button, Flex, Heading } from "@chakra-ui/react";
import { Dropdown, ChoiceList } from "@cmsgov/design-system";
-import { AnyObject, DropdownOptions } from "types";
+import { DropdownOptions } from "types";
import { StateNames } from "../../constants";
-interface FormProps {
- verbiage: AnyObject;
-}
-
-export const AdminDashSelector = ({ verbiage }: FormProps) => {
+export const AdminDashSelector = () => {
const [selectedState, setSelectedState] = useState("");
const [selectedReport, setSelectedReport] = useState("");
const navigate = useNavigate();
@@ -58,7 +54,7 @@ export const AdminDashSelector = ({ verbiage }: FormProps) => {
return (
- {verbiage.header}
+ View State/Territory Reports
diff --git a/services/ui-src/src/components/index.ts b/services/ui-src/src/components/index.ts
index 79252dd7..ff78a98a 100644
--- a/services/ui-src/src/components/index.ts
+++ b/services/ui-src/src/components/index.ts
@@ -1,6 +1,5 @@
// accordions
export { AccordionItem } from "./accordions/AccordionItem";
-export { TemplateCardAccordion } from "./accordions/TemplateCardAccordion";
export { InstructionsAccordion } from "./accordions/InstructionsAccordion";
// alerts
export { Alert } from "./alerts/Alert";
@@ -24,8 +23,12 @@ export { AppRoutes } from "./app/AppRoutes";
export { Timeout } from "./layout/Timeout";
// cards
export { Card } from "./cards/Card";
-export { HelpCard as EmailCard } from "./cards/HelpCard";
-export { TemplateCard } from "./cards/TemplateCard";
+export { HelpCard } from "./cards/HelpCard";
+export { ReportIntroCard } from "./cards/ReportIntroCard";
+export { QmsIntroductionCard } from "./cards/QmsIntroductionCard";
+export { TaIntroductionCard } from "./cards/TaIntroductionCard";
+export { CiIntroductionCard } from "./cards/CiIntroductionCard";
+export { ReportIntroCardActions } from "./cards/ReportIntroCardActions";
// export
export { ExportedReportBanner } from "./export/ExportedReportBanner";
export { ExportedReportWrapper } from "./export/ExportedReportWrapper";
diff --git a/services/ui-src/src/components/layout/HomePage.tsx b/services/ui-src/src/components/layout/HomePage.tsx
index cfe2f429..e2a5e38d 100644
--- a/services/ui-src/src/components/layout/HomePage.tsx
+++ b/services/ui-src/src/components/layout/HomePage.tsx
@@ -2,17 +2,17 @@ import { Box, Collapse, Heading, Link, Text } from "@chakra-ui/react";
import {
AdminDashSelector,
Banner,
+ CiIntroductionCard,
PageTemplate,
- TemplateCard,
+ QmsIntroductionCard,
+ TaIntroductionCard,
} from "components";
import { useEffect } from "react";
import { checkDateRangeStatus, useStore } from "utils";
-import verbiage from "verbiage/pages/home";
import { useFlags } from "launchdarkly-react-client-sdk";
export const HomePage = () => {
const { bannerData, bannerActive, setBannerActive } = useStore();
- const { intro, cards } = verbiage;
const { userIsEndUser } = useStore().user ?? {};
const isTAReportActive = useFlags()?.isTaReportActive;
@@ -44,28 +44,27 @@ export const HomePage = () => {
<>
- {intro.header}
+ Home and Community Based Services (HCBS) Portal
- {intro.body.preLinkText}
-
- {intro.body.linkText}
+ Get started by completing the Home and Community-Based Services
+ (HCBS) for your state or territory. Learn more about this
+
+ new data collection tool
- {intro.body.postLinkText}
+ from CMS.
-
-
- {isTAReportActive && (
-
- )}
- {isCIReportActive && (
-
- )}
+
+ {isTAReportActive && }
+ {isCIReportActive && }
>
) : (
// show read-only view to non-state users
-
+
)}
>
diff --git a/services/ui-src/src/components/pages/HelpPage/HelpPage.tsx b/services/ui-src/src/components/pages/HelpPage/HelpPage.tsx
index 393af69d..99575589 100644
--- a/services/ui-src/src/components/pages/HelpPage/HelpPage.tsx
+++ b/services/ui-src/src/components/pages/HelpPage/HelpPage.tsx
@@ -1,5 +1,5 @@
import { Accordion, Box, Flex, Heading, Link, Text } from "@chakra-ui/react";
-import { AccordionItem, EmailCard, PageTemplate } from "components";
+import { AccordionItem, HelpCard, PageTemplate } from "components";
import { useBreakpoint } from "utils";
const helpDeskEmailAddress = "mdct_help@cms.hhs.gov";
@@ -19,7 +19,7 @@ export const HelpPage = () => {
-
+ For technical support and login issues:
Email {!isDesktop && }
@@ -27,8 +27,8 @@ export const HelpPage = () => {
{helpDeskEmailAddress}
-
-
+
+ For questions about the online form:
Email {!isDesktop && }
@@ -36,7 +36,7 @@ export const HelpPage = () => {
{mfpDemoEmailAddress}
-
+
diff --git a/services/ui-src/src/components/report/Elements.tsx b/services/ui-src/src/components/report/Elements.tsx
index 8e30aa37..389d4a90 100644
--- a/services/ui-src/src/components/report/Elements.tsx
+++ b/services/ui-src/src/components/report/Elements.tsx
@@ -1,5 +1,12 @@
import { useNavigate, useParams } from "react-router-dom";
-import { Button, Heading, Stack, Image, Text } from "@chakra-ui/react";
+import {
+ Button,
+ Heading,
+ Stack,
+ Image,
+ Text,
+ Accordion,
+} from "@chakra-ui/react";
import {
HeaderTemplate,
SubHeaderTemplate,
@@ -8,8 +15,9 @@ import {
ButtonLinkTemplate,
PageElement,
} from "types";
-import { TemplateCardAccordion } from "components";
+import { AccordionItem } from "components";
import arrowLeftIcon from "assets/icons/arrows/icon_arrow_left_blue.png";
+import { parseCustomHtml } from "utils";
export interface PageElementProps {
element: PageElement;
@@ -52,9 +60,11 @@ export const paragraphElement = (props: PageElementProps) => {
export const accordionElement = (props: PageElementProps) => {
const accordion = props.element as AccordionTemplate;
return (
-
+
+
+ {parseCustomHtml(accordion.value)}
+
+
);
};
diff --git a/services/ui-src/src/types/other.ts b/services/ui-src/src/types/other.ts
index c7490bc3..e171558f 100644
--- a/services/ui-src/src/types/other.ts
+++ b/services/ui-src/src/types/other.ts
@@ -1,7 +1,6 @@
// ALERTS
-import { Box } from "@chakra-ui/react";
-import { ComponentProps } from "react";
+import { ReactNode } from "react";
import { StateNames } from "../constants";
export enum AlertTypes {
@@ -45,9 +44,9 @@ export interface CustomHtmlElement {
children?: CustomHtmlElement[];
}
-export interface ErrorVerbiage
- extends Pick, "children"> {
+export interface ErrorVerbiage {
title: string;
+ children: ReactNode;
}
export type StateAbbr = keyof typeof StateNames;
diff --git a/services/ui-src/src/types/report.ts b/services/ui-src/src/types/report.ts
index f23e2588..9760f1e2 100644
--- a/services/ui-src/src/types/report.ts
+++ b/services/ui-src/src/types/report.ts
@@ -2,7 +2,10 @@ import { StateAbbr } from "./other";
export enum ReportType {
QMS = "QMS",
+ TA = "TA",
+ CI = "CI",
}
+
export const isReportType = (
reportType: string | undefined
): reportType is ReportType => {
diff --git a/services/ui-src/src/verbiage/pages/home.ts b/services/ui-src/src/verbiage/pages/home.ts
deleted file mode 100644
index 60689def..00000000
--- a/services/ui-src/src/verbiage/pages/home.ts
+++ /dev/null
@@ -1,103 +0,0 @@
-export default {
- intro: {
- header: "Home and Community Based Services (HCBS) Portal",
- body: {
- preLinkText:
- "Get started by completing the Home and Community-Based Services (HCBS) for your state or territory. Learn more about this ",
- linkText: "new data collection tool",
- linkLocation:
- "https://www.medicaid.gov/medicaid/home-community-based-services/index.html",
- postLinkText: " from CMS.",
- },
- },
- cards: {
- QMS: {
- title: "HCBS Quality Measure Set",
- body: {
- available: "The HCBS is ... ",
- },
- linkText: "6071(a)(1) of the Deficit Reduction Act (DRA)",
- linkLocation:
- "https://www.govinfo.gov/content/pkg/PLAW-109publ171/pdf/PLAW-109publ171.pdf",
- postLinkText:
- ' as "increasing the use of home and community-based, rather than institutional, long-term care services."',
- downloadText: "User Guide and Help File",
- link: {
- text: "Enter HCBS QMS online",
- route: "/report/QMS/{state}",
- },
- accordion: {
- buttonLabel: "When is the HCBS Quality Measure Set due?",
- text: [
- {
- content:
- "The HCBS Quality Measure Set will be created and submitted ...",
- },
- {
- content: "The HCBS Quality Measure Set deadlines are TBD ...",
- },
- ],
- },
- },
- TA: {
- title: "HCBS Timely Access Report",
- body: {
- available: "The HCBS is ... ",
- },
- linkText: "6071(a)(1) of the Deficit Reduction Act (DRA)",
- linkLocation:
- "https://www.govinfo.gov/content/pkg/PLAW-109publ171/pdf/PLAW-109publ171.pdf",
- postLinkText:
- ' as "increasing the use of home and community-based, rather than institutional, long-term care services."',
- downloadText: "User Guide and Help File",
- link: {
- text: "Enter HCBS TA online",
- route: "/report/TA/",
- },
- accordion: {
- buttonLabel: "When is the HCBS Timely Access Report due?",
- text: [
- {
- content:
- "The HCBS Timely Access Report will be created and submitted ...",
- },
- {
- content: "The HCBS Timely Access Report deadlines are TBD ...",
- },
- ],
- },
- },
- CI: {
- title: "HCBS Critical Incident Report",
- body: {
- available: "The HCBS is ... ",
- },
- linkText: "6071(a)(1) of the Deficit Reduction Act (DRA)",
- linkLocation:
- "https://www.govinfo.gov/content/pkg/PLAW-109publ171/pdf/PLAW-109publ171.pdf",
- postLinkText:
- ' as "increasing the use of home and community-based, rather than institutional, long-term care services."',
- downloadText: "User Guide and Help File",
- link: {
- text: "Enter HCBS CI online",
- route: "/report/CI/",
- },
- accordion: {
- buttonLabel: "When is the HCBS Critical Incident Report due?",
- text: [
- {
- content:
- "The HCBS Critical Incident will be created and submitted ...",
- },
- {
- content: "The HCBS Critical Incident Report deadlines are TBD ...",
- },
- ],
- },
- },
- },
- readOnly: {
- header: "View State/Territory Reports",
- buttonLabel: "Go to Report Dashboard",
- },
-};
From 7ed5de7327184105637935a194fe15df949afb6e Mon Sep 17 00:00:00 2001
From: benmartin-coforma
Date: Mon, 27 Jan 2025 16:24:18 -0700
Subject: [PATCH 05/17] Inline verbiage for pages: Error, Help, Profile,
NotFound
---
services/ui-src/src/components/app/Error.tsx | 18 +++++--------
.../components/pages/HelpPage/HelpPage.tsx | 6 ++---
.../pages/NotFound/NotFoundPage.tsx | 27 +++++++++----------
.../components/pages/Profile/ProfilePage.tsx | 15 +++++------
services/ui-src/src/constants.ts | 2 ++
services/ui-src/src/verbiage/errors.tsx | 7 +++--
services/ui-src/src/verbiage/not-found.ts | 11 --------
services/ui-src/src/verbiage/pages/error.ts | 9 -------
services/ui-src/src/verbiage/pages/profile.ts | 9 -------
9 files changed, 35 insertions(+), 69 deletions(-)
delete mode 100644 services/ui-src/src/verbiage/not-found.ts
delete mode 100644 services/ui-src/src/verbiage/pages/error.ts
delete mode 100644 services/ui-src/src/verbiage/pages/profile.ts
diff --git a/services/ui-src/src/components/app/Error.tsx b/services/ui-src/src/components/app/Error.tsx
index 0349e893..0a67281c 100644
--- a/services/ui-src/src/components/app/Error.tsx
+++ b/services/ui-src/src/components/app/Error.tsx
@@ -1,30 +1,26 @@
import { Flex, Heading, Image, Link, Text } from "@chakra-ui/react";
import { PageTemplate } from "components";
-import { createEmailLink } from "utils/other/email";
import warningIcon from "assets/icons/alert/icon_warning.svg";
-import verbiage from "verbiage/pages/error";
+import { HELP_DESK_EMAIL_ADDRESS } from "../../constants";
export const Error = () => {
- const { header, subHeading, emailText } = verbiage;
- const { preLinkText, helpDeskEmail, postLinkText } = emailText;
-
return (
- {header}
+ Error
- {subHeading}
+ Sorry! An error has occurred.
- {preLinkText}
-
- {helpDeskEmail}
+ Please refresh and try again, or email
+
+ {HELP_DESK_EMAIL_ADDRESS}
- {postLinkText}
+ for help.
);
diff --git a/services/ui-src/src/components/pages/HelpPage/HelpPage.tsx b/services/ui-src/src/components/pages/HelpPage/HelpPage.tsx
index 99575589..278957d3 100644
--- a/services/ui-src/src/components/pages/HelpPage/HelpPage.tsx
+++ b/services/ui-src/src/components/pages/HelpPage/HelpPage.tsx
@@ -1,8 +1,8 @@
import { Accordion, Box, Flex, Heading, Link, Text } from "@chakra-ui/react";
import { AccordionItem, HelpCard, PageTemplate } from "components";
+import { HELP_DESK_EMAIL_ADDRESS } from "../../../constants";
import { useBreakpoint } from "utils";
-const helpDeskEmailAddress = "mdct_help@cms.hhs.gov";
const mfpDemoEmailAddress = "MFPDemo@cms.hhs.gov";
export const HelpPage = () => {
@@ -23,8 +23,8 @@ export const HelpPage = () => {
For technical support and login issues:
Email {!isDesktop && }
-
- {helpDeskEmailAddress}
+
+ {HELP_DESK_EMAIL_ADDRESS}
diff --git a/services/ui-src/src/components/pages/NotFound/NotFoundPage.tsx b/services/ui-src/src/components/pages/NotFound/NotFoundPage.tsx
index 974b46b3..d056f122 100644
--- a/services/ui-src/src/components/pages/NotFound/NotFoundPage.tsx
+++ b/services/ui-src/src/components/pages/NotFound/NotFoundPage.tsx
@@ -1,34 +1,33 @@
-// components
import { Flex, Heading, Image, Link, Text, Box } from "@chakra-ui/react";
import { PageTemplate } from "components";
-// utils
-import { createEmailLink } from "utils/other/email";
-// assets
import warningIcon from "assets/icons/alert/icon_warning.svg";
-import verbiage from "./../../../verbiage/not-found";
+import { HELP_DESK_EMAIL_ADDRESS } from "../../../constants";
export const NotFoundPage = () => {
- const { header, subHeading, emailText, body } = verbiage;
- const { preLinkText, cmsEmail, postLinkText } = emailText;
-
return (
- {header}
+ Page not found
- {subHeading}
+ Sorry, the page you're looking for couldn't be found. It's possible that
+ this page has moved, or the address may have been typed incorrectly.
- {preLinkText}
- {cmsEmail}
- {postLinkText}
+ Please email
+
+ {HELP_DESK_EMAIL_ADDRESS}
+
+ for help or feedback.
+
+
+ Note: If you were using a bookmark, please reset it once you find the
+ correct page.
- {body}
);
diff --git a/services/ui-src/src/components/pages/Profile/ProfilePage.tsx b/services/ui-src/src/components/pages/Profile/ProfilePage.tsx
index 5b7d06e0..c6deae96 100644
--- a/services/ui-src/src/components/pages/Profile/ProfilePage.tsx
+++ b/services/ui-src/src/components/pages/Profile/ProfilePage.tsx
@@ -1,8 +1,8 @@
import { useNavigate } from "react-router-dom";
import { Button, Heading, Link, Text } from "@chakra-ui/react";
import { PageTemplate, Table } from "components";
-import { createEmailLink, useStore } from "utils";
-import verbiage from "verbiage/pages/profile";
+import { useStore } from "utils";
+import { HELP_DESK_EMAIL_ADDRESS } from "../../../constants";
export const ProfilePage = () => {
const navigate = useNavigate();
@@ -10,8 +10,6 @@ export const ProfilePage = () => {
const { email, given_name, family_name, userRole, state, userIsAdmin } =
useStore().user ?? {};
- const { intro } = verbiage;
-
const tableContent = {
caption: "Profile Account Information",
bodyRows: [
@@ -26,12 +24,13 @@ export const ProfilePage = () => {
return (
- {intro.header}
+ My Account
- {intro.body}{" "}
-
- {intro.email.address}
+ If any information is incorrect, please contact the Managed Care
+ Reporting (MCR) Help Desk at
+
+ {HELP_DESK_EMAIL_ADDRESS}
.
diff --git a/services/ui-src/src/constants.ts b/services/ui-src/src/constants.ts
index 8aba192d..0e24ef6c 100644
--- a/services/ui-src/src/constants.ts
+++ b/services/ui-src/src/constants.ts
@@ -6,6 +6,8 @@ export const PRODUCTION_HOST_DOMAIN = "mdcthcbs.cms.gov";
export const notAnsweredText = "Not answered";
+export const HELP_DESK_EMAIL_ADDRESS = "mdct_help@cms.hhs.gov" as const;
+
// STATES
export const StateNames = {
AL: "Alabama",
diff --git a/services/ui-src/src/verbiage/errors.tsx b/services/ui-src/src/verbiage/errors.tsx
index 35f4767b..d2e3c300 100644
--- a/services/ui-src/src/verbiage/errors.tsx
+++ b/services/ui-src/src/verbiage/errors.tsx
@@ -1,8 +1,7 @@
import { Link } from "@chakra-ui/react";
+import { HELP_DESK_EMAIL_ADDRESS } from "../constants";
import { ErrorVerbiage } from "types";
-const helpDeskEmailAddress = "mdct_help@cms.hhs.gov";
-
export const genericErrorContent = (
<>
Something went wrong on our end. Refresh your screen and try again.
@@ -10,12 +9,12 @@ export const genericErrorContent = (
If this persists, contact the MDCT Help Desk with questions or to request
technical assistance by emailing
- {helpDeskEmailAddress}
+ {HELP_DESK_EMAIL_ADDRESS}
.