Skip to content

Commit

Permalink
feat(OY2-27248): Submission FAQ Link (#464)
Browse files Browse the repository at this point in the history
* feat(OY2-27248): Submission FAQ Link
  • Loading branch information
pkim-gswell authored Apr 2, 2024
1 parent e9763f0 commit df2784a
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 29 deletions.
17 changes: 17 additions & 0 deletions src/services/ui/src/components/Footer/FAQFooter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Alert, Button, Link } from "@/components";

export const FAQFooter = () => {
return (
<Alert
variant={"infoBlock"}
className="my-8 items-center flex py-8 px-14 flex-row text-sm justify-center gap-24"
>
<p className="text-lg">Do you have questions or need support?</p>
<Link path="/faq" target="_blank">
<Button className="mx-4" size="lg">
View FAQ
</Button>
</Link>
</Alert>
);
};
24 changes: 22 additions & 2 deletions src/services/ui/src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import MedicaidLogo from "@/assets/MedicaidLogo.svg";
import DepartmentOfHealthLogo from "@/assets/DepartmentOfHealthLogo.svg";
import { Alert, Button, Link } from "@/components";

type Props = {
email: string;
Expand Down Expand Up @@ -36,8 +37,11 @@ export const Footer = ({ email, address }: Props) => {
<div className="w-full bg-primary">
<div className="px-10 py-4 text-white text-[.8rem] flex flex-col items-center sm:flex-row max-w-screen-xl mx-auto">
<div>
Email <a href={`mailto:${email}`} className="font-bold underline">{email}</a> for help or
feedback
Email{" "}
<a href={`mailto:${email}`} className="font-bold underline">
{email}
</a>{" "}
for help or feedback
</div>
<div className="flex-1"></div>
<div>
Expand All @@ -51,3 +55,19 @@ export const Footer = ({ email, address }: Props) => {
</footer>
);
};

export const FAQFooter = () => {
return (
<Alert
variant={"infoBlock"}
className="my-8 items-center flex py-8 px-14 flex-row text-sm justify-center gap-24"
>
<p className="text-lg">Do you have questions or need support?</p>
<Link path="/faq" target="_blank">
<Button className="mx-4" size="lg">
View FAQ
</Button>
</Link>
</Alert>
);
};
5 changes: 4 additions & 1 deletion src/services/ui/src/features/actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
SimplePageContainer,
Navigate,
useParams,
FAQFooter,
} from "@/components";
import {
ToggleRaiResponseWithdraw,
Expand Down Expand Up @@ -98,7 +99,7 @@ const ActionFormSwitch = () => {
} else {
const setup = getFormSetup(
item!._source.authority as string as SetupOptions,
type
type,
);
if (!setup) return <Navigate path="/" />;
// Form renders
Expand All @@ -119,12 +120,14 @@ const ActionFormSwitch = () => {

export const ActionFormIndex = () => {
const { id, type } = useParams("/action/:id/:type");

return (
<SimplePageContainer>
<BreadCrumbs
options={detailsAndActionsCrumbs({ id: id, action: type })}
/>
<ActionFormSwitch />
<FAQFooter />
</SimplePageContainer>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FormProvider, useForm } from "react-hook-form";
import { Outlet, useLocation } from "react-router-dom";
import { zodResolver } from "@hookform/resolvers/zod";
import { ZodSchema } from "zod";
import { BreadCrumbs, SimplePageContainer } from "@/components";
import { BreadCrumbs, FAQFooter, SimplePageContainer } from "@/components";
import { detailsAndActionsCrumbs } from "@/features";
import { Action } from "shared-types";
import { issueRaiSchema } from "./IssueRai";
Expand Down Expand Up @@ -55,6 +55,7 @@ export const ActionWrapper = () => {
<FormProvider {...methods}>
<Outlet />
</FormProvider>
<FAQFooter />
</SimplePageContainer>
);
};
35 changes: 14 additions & 21 deletions src/services/ui/src/features/submission/app-k/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
/* eslint-disable react/prop-types */

import {
BreadCrumbs,
LoadingSpinner,
SectionCard,
SimplePageContainer,
useLocationCrumbs,
FAQ_TAB,
} from "@/components";
import { SlotAttachments } from "@/features/actions";
import * as I from "@/components/Inputs";
import * as C from "@/components";
Expand All @@ -27,7 +19,7 @@ import { Link } from "react-router-dom";

export const AppKSubmissionForm = () => {
const nav = useNavigate();
const crumbs = useLocationCrumbs();
const crumbs = C.useLocationCrumbs();
const { data: user } = useGetUser();
const [isNavigating, setIsNavigating] = useState(false);

Expand Down Expand Up @@ -58,7 +50,7 @@ export const AppKSubmissionForm = () => {
}, 5000); // delay for opensearch record to be ready
},
onError: (err) => console.error(err),
}
},
);
});

Expand All @@ -76,12 +68,12 @@ export const AppKSubmissionForm = () => {
}, [state]);

return (
<SimplePageContainer>
{(submission.isLoading || isNavigating) && <LoadingSpinner />}
<BreadCrumbs options={crumbs} />
<C.SimplePageContainer>
{(submission.isLoading || isNavigating) && <C.LoadingSpinner />}
<C.BreadCrumbs options={crumbs} />
<I.Form {...form}>
<form onSubmit={onSubmit} className="my-6 space-y-8 flex flex-col">
<SectionCard title="1915(c) APPENDIX K Amendment Request Details">
<C.SectionCard title="1915(c) APPENDIX K Amendment Request Details">
<Content.FormIntroText />
<I.FormField
control={form.control}
Expand Down Expand Up @@ -115,7 +107,7 @@ export const AppKSubmissionForm = () => {
</I.FormLabel>
<Link
to="/faq/waiver-c-id"
target={FAQ_TAB}
target={C.FAQ_TAB}
rel="noopener noreferrer"
className="text-blue-700 hover:underline"
>
Expand Down Expand Up @@ -152,8 +144,8 @@ export const AppKSubmissionForm = () => {
</I.FormItem>
)}
/>
</SectionCard>
<SectionCard title="Attachments">
</C.SectionCard>
<C.SectionCard title="Attachments">
<C.AttachmentsSizeTypesDesc faqLink="/faq/#chip-spa-attachments" />

<I.FormField
Expand Down Expand Up @@ -182,9 +174,9 @@ export const AppKSubmissionForm = () => {
className: "my-4",
})}
/>
</SectionCard>
</C.SectionCard>

<SectionCard title="Additional Information">
<C.SectionCard title="Additional Information">
<I.FormField
control={form.control}
name="additionalInformation"
Expand All @@ -201,7 +193,7 @@ export const AppKSubmissionForm = () => {
</I.FormItem>
)}
/>
</SectionCard>
</C.SectionCard>
<C.PreSubmissionMessage />
<div className="flex gap-2 p-4 ml-auto">
<I.Button type="submit">Submit</I.Button>
Expand All @@ -211,6 +203,7 @@ export const AppKSubmissionForm = () => {
</div>
</form>
</I.Form>
</SimplePageContainer>
<C.FAQFooter />
</C.SimplePageContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export const ChipSpaFormPage = () => {
</div>
</form>
</Inputs.Form>
<Content.FAQFooter />
</SimplePageContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export const MedicaidSpaFormPage = () => {
</div>
</form>
</Inputs.Form>
<Content.FAQFooter />
</SimplePageContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
SectionCard,
formCrumbsFromPath,
FAQ_TAB,
FAQFooter,
useAlertContext,
useNavigate,
} from "@/components";
Expand Down Expand Up @@ -268,6 +269,7 @@ export const Capitated1915BWaiverAmendmentPage = () => {
<SubmitAndCancelBtnSection />
</form>
</Inputs.Form>
<FAQFooter />
</SimplePageContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
BreadCrumbs,
SimplePageContainer,
SectionCard,
FAQFooter,
formCrumbsFromPath,
useNavigate,
} from "@/components";
Expand Down Expand Up @@ -238,6 +239,7 @@ export const Capitated1915BWaiverInitialPage = () => {
<SubmitAndCancelBtnSection />
</form>
</Inputs.Form>
<FAQFooter />
</SimplePageContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
SectionCard,
formCrumbsFromPath,
FAQ_TAB,
FAQFooter,
useAlertContext,
useNavigate,
} from "@/components";
Expand Down Expand Up @@ -298,6 +299,7 @@ export const Capitated1915BWaiverRenewalPage = () => {
<SubmitAndCancelBtnSection />
</form>
</Inputs.Form>
<FAQFooter />
</SimplePageContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
SimplePageContainer,
SectionCard,
FAQ_TAB,
FAQFooter,
useNavigate,
useAlertContext,
formCrumbsFromPath,
Expand Down Expand Up @@ -265,6 +266,7 @@ export const Contracting1915BWaiverAmendmentPage = () => {
<SubmitAndCancelBtnSection />
</form>
</Inputs.Form>
<FAQFooter />
</SimplePageContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
SimplePageContainer,
SectionCard,
FAQ_TAB,
FAQFooter,
useAlertContext,
formCrumbsFromPath,
useNavigate,
Expand Down Expand Up @@ -84,7 +85,7 @@ export const Contracting1915BWaiverInitialPage = () => {
const urlQuery = useQueryString();
const alert = useAlertContext();
const originPath = useOriginPath();

const handleSubmit: SubmitHandler<Waiver1915BContractingInitial> = async (
formData,
) => {
Expand Down Expand Up @@ -229,9 +230,10 @@ export const Contracting1915BWaiverInitialPage = () => {
name="additionalInformation"
/>
<Content.PreSubmissionMessage />
<SubmitAndCancelBtnSection/>
<SubmitAndCancelBtnSection />
</form>
</Inputs.Form>
<FAQFooter />
</SimplePageContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
SimplePageContainer,
SectionCard,
FAQ_TAB,
FAQFooter,
formCrumbsFromPath,
useAlertContext,
useNavigate,
Expand Down Expand Up @@ -291,6 +292,7 @@ export const Contracting1915BWaiverRenewalPage = () => {
<SubmitAndCancelBtnSection />
</form>
</Inputs.Form>
<FAQFooter />
</SimplePageContainer>
);
};
3 changes: 1 addition & 2 deletions src/services/ui/src/features/welcome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,13 @@ export const Welcome = () => {
</div>
</div>
<section>
<div className="flex justify-around items-center text-xl px-10 py-4 max-w-screen-xl mx-auto">
<div className="flex justify-around items-center text-xl px-10 py-2 max-w-screen-xl mx-auto">
<h4>Do you have questions or need support?</h4>
<Link path={"/faq"} target={FAQ_TAB}>
<Button>View FAQ</Button>
</Link>
</div>
</section>
;
</>
);
};

0 comments on commit df2784a

Please sign in to comment.