Skip to content

Commit 1d06eec

Browse files
committed
Fix export for old DREF final report
1 parent 5517fe5 commit 1d06eec

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

app/src/components/domain/DrefExportModal/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ interface Props {
4343
onCancel: () => void;
4444
applicationType: 'DREF' | 'OPS_UPDATE' | 'FINAL_REPORT';
4545
drefType?: TypeOfDrefEnum | null;
46+
isDrefImminentV2?: boolean;
4647
}
4748

4849
function DrefExportModal(props: Props) {
@@ -51,6 +52,7 @@ function DrefExportModal(props: Props) {
5152
onCancel,
5253
applicationType,
5354
drefType,
55+
isDrefImminentV2,
5456
} = props;
5557

5658
const strings = useTranslation(i18n);
@@ -65,8 +67,15 @@ function DrefExportModal(props: Props) {
6567
if (applicationType === 'OPS_UPDATE') {
6668
type = 'dref-operational-updates';
6769
} else if (applicationType === 'FINAL_REPORT') {
68-
type = 'dref-final-reports';
70+
if (isDrefImminentV2) {
71+
type = 'dref-final-reports';
72+
} else {
73+
type = 'old-dref-final-reports';
74+
}
75+
} else if (applicationType === 'DREF') {
76+
type = 'dref-applications';
6977
} else {
78+
applicationType satisfies never;
7079
type = 'dref-applications';
7180
}
7281

@@ -82,6 +91,7 @@ function DrefExportModal(props: Props) {
8291
id,
8392
includePga,
8493
applicationType,
94+
isDrefImminentV2,
8595
],
8696
);
8797

app/src/views/AccountMyFormsDref/DrefTableActions/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ function DrefTableActions(props: Props) {
356356
publishOpsUpdate(null);
357357
} else if (applicationType === 'FINAL_REPORT') {
358358
publishFinalReport(null);
359+
} else {
360+
applicationType satisfies never;
359361
}
360362
},
361363
[
@@ -528,6 +530,7 @@ function DrefTableActions(props: Props) {
528530
id={id}
529531
applicationType={applicationType}
530532
drefType={drefType}
533+
isDrefImminentV2={isDrefImminentV2}
531534
/>
532535
)}
533536
{showShareModal && (

app/src/views/DrefFinalReportForm/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ export function Component() {
626626
onCancel={setShowExportModalFalse}
627627
id={Number(finalReportId)}
628628
applicationType="FINAL_REPORT"
629+
isDrefImminentV2
629630
/>
630631
)}
631632
</Page>

app/src/views/OldDrefFinalReportForm/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ export function Component() {
565565
onCancel={setShowExportModalFalse}
566566
id={Number(finalReportId)}
567567
applicationType="FINAL_REPORT"
568+
isDrefImminentV2={false}
568569
/>
569570
)}
570571
</Page>

0 commit comments

Comments
 (0)