-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(actions): Updating action template and forms content #322
Changes from 17 commits
5525543
a63beb3
5c17f1a
9883a8f
fb1a353
fde0b4d
83b0ab3
589b898
dd2f957
32f7acb
be478b8
a723cc1
2ec364a
4407d7b
508208e
14ee15d
2a6160b
c0c67ef
0c71d39
47880b9
e29562e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { ZodObject } from "zod"; | ||
import { ZodEffects, ZodObject } from "zod"; | ||
import { AttachmentRecipe } from "@/lib"; | ||
|
||
export type FormSetup = { | ||
schema: ZodObject<any>; | ||
schema: ZodObject<any> | ZodEffects<any>; | ||
attachments: AttachmentRecipe<any>[]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good. I was just curious what ZodEffects are. Is this for the super refine business There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, ZodEffects is the return type of |
||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { z } from "zod"; | ||
import { | ||
zAdditionalInfo, | ||
zAttachmentOptional, | ||
zAttachmentRequired, | ||
} from "@/pages/form/zod"; | ||
|
||
export const defaultIssueRaiSetup = { | ||
schema: z.object({ | ||
additionalInformation: z.string().max(4000), | ||
additionalInformation: zAdditionalInfo, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good reuse opportunity there with additional information. It will also lead to better consistency across the board I bet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep! Merging submission forms into the same pattern will also help consolidate things. |
||
attachments: z.object({ | ||
formalRaiLetter: z | ||
.array(z.instanceof(File)) | ||
.refine((value) => value.length > 0, { | ||
message: "Required", | ||
}), | ||
other: z.array(z.instanceof(File)).optional(), | ||
formalRaiLetter: zAttachmentRequired({ min: 1 }), | ||
other: zAttachmentOptional, | ||
}), | ||
}), | ||
attachments: [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,7 +200,10 @@ export const DetailsContent = ({ | |
<PackageActionsCard id={data._id} /> | ||
</section> | ||
<div className="flex flex-col gap-3"> | ||
<DetailsSection id="package-details" title="Medicaid Package Details"> | ||
<DetailsSection | ||
id="package-details" | ||
title={`${data._source.planType} Package Details`} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dynamic titling on Details page: "CHIP SPA Package Details", "Medicaid SPA Package Details", ... |
||
> | ||
<DetailItemsGrid displayItems={spaDetails(data._source)} /> | ||
<DetailItemsGrid displayItems={submissionDetails(data._source)} /> | ||
</DetailsSection> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,5 +36,4 @@ export const zAttachmentRequired = ({ | |
|
||
export const zAdditionalInfo = z | ||
.string() | ||
.max(4000, "This field may only be up to 4000 characters.") | ||
.optional(); | ||
.max(4000, "This field may only be up to 4000 characters."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leaving |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced by
ZodObject.superRefine
, see below