Skip to content

Commit

Permalink
make changes from test findings
Browse files Browse the repository at this point in the history
  • Loading branch information
13bfrancis committed Jul 25, 2024
1 parent 423f958 commit f818b74
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
defaultWithdrawPackageFields,
defaultWithdrawRaiFields,
medSpaRaiFields,
waiverWithdraw1915cPackageFields,
} from "@/features/package-actions/lib/modules";

type FieldsGroup = Record<AuthorityUnion, ReactElement[] | undefined>;
Expand Down Expand Up @@ -56,7 +57,7 @@ const withdrawPackageFor: FieldsGroup = {
"CHIP SPA": chipWithdrawPackageFields,
"Medicaid SPA": defaultWithdrawPackageFields,
"1915(b)": defaultWithdrawPackageFields,
"1915(c)": defaultWithdrawPackageFields,
"1915(c)": waiverWithdraw1915cPackageFields,
};

const tempExtensionFor: FieldsGroup = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,19 @@ export const defaultWithdrawPackageContent: FormContentHydrator = (
},
});

export const waiverWithdrawPackageFields: ReactElement[] = [
...defaultWithdrawPackageFields,
].toSpliced(
0,
1,
<ActionFormDescription key="content-description" boldReminder>
Complete this form to withdraw this 1915(c) Appendix K package. Once
complete, you will not be able to resubmit this package. CMS will be
notified and will use this content to review your request. If CMS needs any
additional information, they will follow up by email.
</ActionFormDescription>,
);
console.log(waiverWithdrawPackageFields);

export const packageWithdrawn: CheckDocumentFunction = (checks) =>
checks.hasStatus(SEATOOL_STATUS.WITHDRAWN);
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import {
ActionFormDescription,
AdditionalInfoSection,
AttachmentsSection,
} from "@/components";
import { FormContentHydrator } from "@/features/package-actions/lib/contentSwitch";
import { defaultWithdrawPackageContent } from "@/features/package-actions/lib/modules";
import { ReactElement } from "react";
import { opensearch } from "shared-types";

const mapActionType: Record<string, string> = {
Expand All @@ -19,6 +25,30 @@ const confirmationModalBody = (document: opensearch.main.Document) => {
return `${beginning} ${middle} ${end}`;
};

export const waiverWithdraw1915cPackageFields: ReactElement[] = [
<ActionFormDescription key="content-description" boldReminder>
Complete this form to withdraw this 1915(c) Appendix K package. Once
complete, you will not be able to resubmit this package. CMS will be
notified and will use this content to review your request. If CMS needs any
additional information, they will follow up by email.
</ActionFormDescription>,
<AttachmentsSection
faqAttLink="/faq"
key={"field-attachments"}
attachments={[
{
name: "supportingDocumentation",
required: false,
},
]}
/>,
<AdditionalInfoSection
required
key={"field-addlinfo"}
instruction={"Explain your need for withdrawal."}
/>,
];

export const waiverWithdrawPackageContent: FormContentHydrator = (
document,
) => ({
Expand Down
16 changes: 15 additions & 1 deletion src/services/ui/src/features/package/package-details/appk.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { ConfirmationModal, LoadingSpinner } from "@/components";
import {
ConfirmationModal,
LoadingSpinner,
Route,
useAlertContext,
useModalContext,
} from "@/components";
import { Authority, SEATOOL_STATUS } from "shared-types";
import { useState } from "react";
import * as T from "@/components/Table";
Expand All @@ -12,6 +18,7 @@ import { usePackageDetailsCache } from "..";

export const AppK = () => {
const [removeChild, setRemoveChild] = useState("");
const alert = useAlertContext();
const [loading, setLoading] = useState(false);
const { data: user } = useGetUser();
const cache = usePackageDetailsCache();
Expand All @@ -34,6 +41,13 @@ export const AppK = () => {
setRemoveChild("");
cache.refetch();
setLoading(false);
alert.setContent({
header: "Package withdrawn",
body: `The package ${id} has been withdrawn.`,
});
alert.setBannerStyle("success");
alert.setBannerShow(true);
alert.setBannerDisplayOn(window.location.pathname as Route);
}, 5000);
},
onError: (err) => {
Expand Down

0 comments on commit f818b74

Please sign in to comment.