From 441fd085eb7728e31153b234535b53a87c28f689 Mon Sep 17 00:00:00 2001 From: karla-vm Date: Wed, 13 Nov 2024 10:30:47 -0500 Subject: [PATCH] hydrate other text --- services/app-api/utils/types/reportContext.ts | 2 +- services/app-api/utils/types/reports.ts | 2 +- services/app-api/utils/validation/schemas.ts | 2 +- services/ui-src/src/components/modals/AddEditReportModal.tsx | 4 ++-- .../ui-src/src/components/pages/Dashboard/DashboardPage.tsx | 3 ++- services/ui-src/src/types/reportContext.ts | 2 +- services/ui-src/src/types/reports.ts | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/services/app-api/utils/types/reportContext.ts b/services/app-api/utils/types/reportContext.ts index 7d599df86..e8e4af24e 100644 --- a/services/app-api/utils/types/reportContext.ts +++ b/services/app-api/utils/types/reportContext.ts @@ -31,7 +31,7 @@ export interface ReportMetadataShape extends ReportKeys { programIsPCCM?: Choice[]; previousRevisions: string[]; planTypeIncludedInProgram?: Choice[]; - otherPlanType?: string; + "planTypeIncludedInProgram-otherText"?: string; novMcparRelease?: boolean; } diff --git a/services/app-api/utils/types/reports.ts b/services/app-api/utils/types/reports.ts index b6b828e3f..d41e813f6 100644 --- a/services/app-api/utils/types/reports.ts +++ b/services/app-api/utils/types/reports.ts @@ -191,7 +191,7 @@ export interface NAAARReportMetadata extends ReportMetadata { reportingPeriodEndDate: number; dueDate: number; planTypeIncludedInProgram: Choice[]; - otherPlanType?: string; + "planTypeIncludedInProgram-otherText"?: string; } // HELPER FUNCTIONS diff --git a/services/app-api/utils/validation/schemas.ts b/services/app-api/utils/validation/schemas.ts index 23e58c6e1..bbb01f6bb 100644 --- a/services/app-api/utils/validation/schemas.ts +++ b/services/app-api/utils/validation/schemas.ts @@ -20,5 +20,5 @@ export const metadataValidationSchema = yup.object().shape({ completionStatus: yup.mixed(), copyFieldDataSourceId: yup.string(), planTypeIncludedInProgram: radio(), - otherPlanType: textOptional(), + "planTypeIncludedInProgram-otherText": textOptional(), }); diff --git a/services/ui-src/src/components/modals/AddEditReportModal.tsx b/services/ui-src/src/components/modals/AddEditReportModal.tsx index 7c6b65aaf..60ab96fc0 100644 --- a/services/ui-src/src/components/modals/AddEditReportModal.tsx +++ b/services/ui-src/src/components/modals/AddEditReportModal.tsx @@ -148,7 +148,6 @@ export const AddEditReportModal = ({ formData["reportingPeriodEndDate"] ); const planTypeIncludedInProgram = formData["planTypeIncludedInProgram"]; - const otherPlanType = formData["planTypeIncludedInProgram-otherText"]; return { metadata: { @@ -159,7 +158,8 @@ export const AddEditReportModal = ({ lastAlteredBy: full_name, copyFieldDataSourceId: copyFieldDataSourceId?.value, planTypeIncludedInProgram, - otherPlanType, + "planTypeIncludedInProgram-otherText": + formData["planTypeIncludedInProgram-otherText"], locked: false, submissionCount: 0, previousRevisions: [], diff --git a/services/ui-src/src/components/pages/Dashboard/DashboardPage.tsx b/services/ui-src/src/components/pages/Dashboard/DashboardPage.tsx index 9d1793739..246f3c39f 100644 --- a/services/ui-src/src/components/pages/Dashboard/DashboardPage.tsx +++ b/services/ui-src/src/components/pages/Dashboard/DashboardPage.tsx @@ -156,7 +156,8 @@ export const DashboardPage = ({ reportType }: Props) => { copyFieldDataSourceId, programIsPCCM: report?.programIsPCCM, planTypeIncludedInProgram: report?.planTypeIncludedInProgram, - otherPlanType: report?.otherPlanType, + "planTypeIncludedInProgram-otherText": + report?.["planTypeIncludedInProgram-otherText"], }, state: report.state, id: report.id, diff --git a/services/ui-src/src/types/reportContext.ts b/services/ui-src/src/types/reportContext.ts index d5a0ee6a4..13bc122fe 100644 --- a/services/ui-src/src/types/reportContext.ts +++ b/services/ui-src/src/types/reportContext.ts @@ -31,7 +31,7 @@ export interface ReportMetadataShape extends ReportKeys { programIsPCCM?: Choice[]; previousRevisions: string[]; planTypeIncludedInProgram?: Choice[]; - otherPlanType?: string; + "planTypeIncludedInProgram-otherText"?: string; novMcparRelease?: boolean; } diff --git a/services/ui-src/src/types/reports.ts b/services/ui-src/src/types/reports.ts index 4c2236541..466b06f0a 100644 --- a/services/ui-src/src/types/reports.ts +++ b/services/ui-src/src/types/reports.ts @@ -192,7 +192,7 @@ export interface NAAARReportMetadata extends ReportMetadata { reportingPeriodEndDate: number; dueDate: number; planTypeIncludedInProgram: Choice[]; - otherPlanType?: string; + "planTypeIncludedInProgram-otherText"?: string; } // HELPER FUNCTIONS