Skip to content

Commit

Permalink
Merge branch 'master' into appk-with
Browse files Browse the repository at this point in the history
  • Loading branch information
13bfrancis committed Jul 25, 2024
2 parents f818b74 + 33a0310 commit d6f1fd1
Show file tree
Hide file tree
Showing 35 changed files with 265 additions and 327 deletions.
1 change: 0 additions & 1 deletion src/packages/shared-types/authority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export enum Authority {
"1915c" = "1915(c)",
}

/* Authority values as a union string type. Replaces old Authority enum. */
export type AuthorityUnion =
| "Medicaid SPA"
| "CHIP SPA"
Expand Down
86 changes: 46 additions & 40 deletions src/services/api/webforms/ABP4/v202401.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,49 +42,55 @@ export const v202401: FormSchema = {
},
},
{
rhf: "Checkbox",
name: "see-approved-attachment",
rules: { required: "* Required" },
formItemClassName:
"ml-[0.6rem] px-4 my-2 border-l-4 border-l-primary",
dependency: {
conditions: [
{
name: "abp4_cost-sharing_abp-for-individuals-income-over-100-poverty",
type: "expectedValue",
expectedValue: "yes",
rhf: "WrappedGroup",
name: "wrapped",
fields: [
{
rhf: "Checkbox",
name: "see-approved-attachment",
rules: { required: "* Required" },
formItemClassName:
"ml-[0.6rem] px-4 border-l-4 border-l-primary pb-6",
dependency: {
conditions: [
{
name: "abp4_cost-sharing_abp-for-individuals-income-over-100-poverty",
type: "expectedValue",
expectedValue: "yes",
},
],
effect: { type: "show" },
},
],
effect: { type: "show" },
},
props: {
options: [
{
label:
"See approved Attachment 4.18-F or G for description.",
value: "true",
props: {
options: [
{
label:
"See approved Attachment 4.18-F or G for description.",
value: "true",
},
],
},
],
},
},
{
rhf: "Upload",
name: "attachment_upload",
label: "Attachment 4.18-F or G",
labelClassName: "font-bold",
rules: { required: "* Required" },
formItemClassName:
"ml-[0.6rem] px-4 my-2 border-l-4 border-l-primary",
dependency: {
conditions: [
{
name: "abp4_cost-sharing_abp-for-individuals-income-over-100-poverty",
type: "expectedValue",
expectedValue: "yes",
},
{
rhf: "Upload",
name: "attachment_upload",
label: "Attachment 4.18-F or G",
labelClassName: "font-bold",
rules: { required: "* Required" },
formItemClassName:
"ml-[0.6rem] px-4 border-l-4 border-l-primary",
dependency: {
conditions: [
{
name: "abp4_cost-sharing_abp-for-individuals-income-over-100-poverty",
type: "expectedValue",
expectedValue: "yes",
},
],
effect: { type: "show" },
},
],
effect: { type: "show" },
},
},
],
},
{
rhf: "Textarea",
Expand Down
9 changes: 9 additions & 0 deletions src/services/api/webforms/ABP6/v202401.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export const v202401: FormSchema = {
label:
"Aggregate actuarial value of the benchmark plan (e.g., FEHBP, state/territory employee coverage, commercial plan, state plan) that is equivalent to the state/territory's benefit package",
labelClassName: "font-bold",
props: {
icon: "$",
},
rules: {
required: "* Required",
pattern: {
Expand All @@ -35,6 +38,9 @@ export const v202401: FormSchema = {
label:
"Aggregate actuarial value of the state/territory's benchmark-equivalent plan (must be greater than or equal to the amount entered above)",
labelClassName: "font-bold",
props: {
icon: "$",
},
rules: {
required: "* Required",
pattern: {
Expand Down Expand Up @@ -283,6 +289,9 @@ export const v202401: FormSchema = {
{
name: "description",
rhf: "Textarea",
props: {
className: "h-[114px]",
},
},
],
},
Expand Down
9 changes: 9 additions & 0 deletions src/services/api/webforms/ABP9/v202401.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export const v202401: FormSchema = {
label:
"Describe the employer-sponsored insurance, including the population covered, amount of premium assistance by population, and employer-sponsored insurance activities, including required contribution, cost-effectiveness test requirements, and benefit information.",
labelClassName: "font-bold",
props: {
className: "h-[114px]",
},
dependency: {
conditions: [
{
Expand Down Expand Up @@ -82,6 +85,9 @@ export const v202401: FormSchema = {
label:
"Describe, including the population covered, amount of premium assistance by population, required contributions, cost-effectiveness test requirements, and benefit information.",
labelClassName: "font-bold",
props: {
className: "h-[114px]",
},
dependency: {
conditions: [
{
Expand All @@ -100,6 +106,9 @@ export const v202401: FormSchema = {
label:
"Other information about employer-sponsored insurance or payment of premiums (optional)",
labelClassName: "font-bold",
props: {
className: "h-[114px]",
},
rules: {
pattern: {
value: /^\S(.*\S)?$/,
Expand Down
14 changes: 7 additions & 7 deletions src/services/email/ses-email-templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,11 @@ for {{id}} was withdrawn by {{submitterName}} {{submitterEmail}}.</p>
Summary:
<br>{{additionalInformation}}
<br>
<p>This mailbox is for the submittal of State Plan Amendments and non-web
based responses to Requests for Additional Information (RAI) on submitted
SPAs only. Any other correspondence will be disregarded.</p>
<p>This mailbox is for the submittal of Section 1915(b) and 1915(c) Waivers,
responses to Requests for Additional Information (RAI), and extension requests on Waivers only.
Any other correspondence will be disregarded.</p>
<p>If you have questions, please contact
<a href='mailto:[email protected]'>[email protected]</a>.</p>
<a href='mailto:[email protected]'>[email protected]</a> or your state lead.</p>
<p>Thank you!</p>`,
text: `
The OneMAC Submission Portal received a request to withdraw the Formal
Expand All @@ -560,9 +560,9 @@ Medicaid SPA Package ID: {{id}}
Summary:
{{additionalInformation}}
This mailbox is for the submittal of State Plan Amendments and non-web
based responses to Requests for Additional Information (RAI) on submitted
SPAs only. Any other correspondence will be disregarded.
This mailbox is for the submittal of Section 1915(b) and 1915(c) Waivers,
responses to Requests for Additional Information (RAI), and extension requests on Waivers only.
Any other correspondence will be disregarded.
If you have any questions, please contact [email protected] or your state lead.
Expand Down
1 change: 0 additions & 1 deletion src/services/ui/e2e/tests/a11y/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import AxeBuilder from "@axe-core/playwright";
const staticRoutes = [
"/",
"/dashboard",
"/details",
"/faq",
"/profile",
"/new-submission",
Expand Down
2 changes: 1 addition & 1 deletion src/services/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"serverless-s3-sync": "^3.1.0",
"tailwindcss": "^3.3.1",
"typescript": "^5.2.0",
"vite": "^4.2.0",
"vite": "^5.3.5",
"vite-plugin-radar": "^0.9.2"
}
}
9 changes: 5 additions & 4 deletions src/services/ui/src/api/submissionService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
import * as unit from "./submissionService";
import { OneMacUser } from "@/api/useGetUser";
import { SubmissionServiceEndpoint } from "@/utils";
import { Authority } from "shared-types";

const mockFormData = {
test: "data",
Expand Down Expand Up @@ -99,10 +100,10 @@ describe("helpers", () => {
{ test: "data" },
mockGeorge,
"/default" as SubmissionServiceEndpoint,
"MEDICAID",
Authority.MED_SPA,
mockUploadRecipes(3),
);
expect(payload.authority).toEqual("MEDICAID");
expect(payload.authority).toEqual("medicaid spa");
expect(payload.origin).toEqual("micro");
expect(payload.attachments).toHaveLength(3);
expect(payload.test).toEqual("data");
Expand All @@ -115,10 +116,10 @@ describe("helpers", () => {
mockFormData,
mockGeorge,
"/submit",
"MEDICAID",
Authority.MED_SPA,
mockUploadRecipes(3),
);
expect(payload.authority).toEqual("MEDICAID");
expect(payload.authority).toEqual("medicaid spa");
expect(payload.origin).toEqual("micro");
expect(payload.attachments).toHaveLength(3);
expect(payload.test).toEqual("data");
Expand Down
6 changes: 3 additions & 3 deletions src/services/ui/src/api/submissionService.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { API } from "aws-amplify";
import {
Attachment,
Authority,
ReactQueryApiError,
Action,
AttachmentKey,
Authority,
} from "shared-types";
import { buildActionUrl, SubmissionServiceEndpoint } from "@/utils";
import { OneMacUser } from "@/api";
Expand All @@ -15,7 +15,7 @@ export type SubmissionServiceParameters<T> = {
data: T;
endpoint: SubmissionServiceEndpoint;
user: OneMacUser | undefined;
authority?: Authority;
authority: Authority;
};
type SubmissionServiceResponse = {
body: {
Expand Down Expand Up @@ -58,7 +58,7 @@ export const buildSubmissionPayload = <T extends Record<string, unknown>>(
data: T,
user: OneMacUser | undefined,
endpoint: SubmissionServiceEndpoint,
authority?: string,
authority: Authority,
attachments?: UploadRecipe[],
) => {
const userDetails = {
Expand Down
2 changes: 1 addition & 1 deletion src/services/ui/src/api/useGetItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const useGetItem = (
);
};

export const useGetItemCache = (id: string) => {
export const useGetItemCache = (id: string | undefined) => {
const queryClient = useQueryClient();
const data = (() => {
const data = queryClient.getQueryCache().find(["record", id])?.state
Expand Down
2 changes: 2 additions & 0 deletions src/services/ui/src/components/Context/modalContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ConfirmationModal } from "@/components";
export type SubmissionAlert = {
header: string;
body: string;
areButtonsReversed?: boolean;
cancelButtonText?: string;
acceptButtonText?: string;
};
Expand Down Expand Up @@ -46,6 +47,7 @@ export const ModalProvider = ({ children }: PropsWithChildren) => {
acceptButtonVisible={context.content.acceptButtonText !== undefined}
cancelButtonText={context.content.cancelButtonText}
acceptButtonText={context.content.acceptButtonText}
areButtonsReversed={context.content.areButtonsReversed}
title={context.content.header}
body={context.content.body}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/services/ui/src/components/Dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const DialogFooter = ({
}) => (
<div
className={cn(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
"flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",
className,
)}
{...props}
Expand Down
6 changes: 3 additions & 3 deletions src/services/ui/src/components/Inputs/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<div className="relative w-fit">
{icon && (
<span
className={`absolute inset-y-0 flex items-center text-gray-500 ${iconRight ? "right-0 pr-2" : "left-0 pl-2"}`}
className={`absolute inset-y-0 border-[#212121] border flex items-center px-3 bg-[#f0f0f0] ${iconRight ? "right-0 border-s-black rounded-e-sm" : "left-0 border-e-black rounded-s-sm"}`}
>
{icon}
</span>
)}
<input
className={cn(
"flex h-9 w-full rounded-sm border border-black bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
icon && (iconRight ? "pr-6" : "pl-6"),
"flex h-9 w-full rounded-sm border border-[#212121] bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
icon && (iconRight ? "pr-10" : "pl-10"),
className,
)}
ref={ref}
Expand Down
19 changes: 13 additions & 6 deletions src/services/ui/src/components/Modal/ConfirmationModal.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { cn } from "@/utils";
import {
Dialog,
DialogContent,
Expand All @@ -12,6 +13,7 @@ export type ConfirmationModalProps = {
open: boolean;
description?: React.ReactNode;
body?: React.ReactNode;
areButtonsReversed?: boolean;
title: React.ReactNode;
onCancel: () => void;
onAccept: () => void;
Expand All @@ -26,6 +28,7 @@ export function ConfirmationModal({
open,
description,
title,
areButtonsReversed = false,
body,
onAccept,
onCancel,
Expand All @@ -42,17 +45,21 @@ export function ConfirmationModal({
{description && <DialogDescription>{description}</DialogDescription>}
</DialogHeader>
{body && <div className="grid gap-4 py-4">{body}</div>}
<DialogFooter>
{cancelButtonVisible && (
<Button type="button" variant={"outline"} onClick={onCancel}>
{cancelButtonText}
</Button>
)}
<DialogFooter
className={cn({
"flex-col sm:flex-row-reverse sm:justify-start": areButtonsReversed,
})}
>
{acceptButtonVisible && (
<Button type="submit" onClick={onAccept}>
{acceptButtonText}
</Button>
)}
{cancelButtonVisible && (
<Button type="button" variant={"outline"} onClick={onCancel}>
{cancelButtonText}
</Button>
)}
</DialogFooter>
</DialogContent>
</Dialog>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ export const useFilterDrawer = () => {
(STATE, [KEY, AGG]) => {
return {
...STATE,
[KEY]: AGG.buckets.map((BUCK) => ({
label: `${labelMap[BUCK.key] || BUCK.key}`,
value: BUCK.key,
})),
[KEY]: AGG.buckets
.map((BUCK) => ({
label: `${labelMap[BUCK.key] || BUCK.key}`,
value: BUCK.key,
}))
.sort((a, b) => Intl.Collator("en").compare(a.value, b.value)),
};
},
{} as Record<opensearch.main.Field, { label: string; value: string }[]>,
Expand Down
1 change: 0 additions & 1 deletion src/services/ui/src/consts/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./blank-value";
export * from "./spa-id-regex";
1 change: 0 additions & 1 deletion src/services/ui/src/consts/spa-id-regex.ts

This file was deleted.

Loading

0 comments on commit d6f1fd1

Please sign in to comment.