Skip to content

Commit 66e8193

Browse files
frozenheliumAdityaKhatri
authored andcommitted
chore(translation): generate strings for imminent final report changes
* refactor(dref-export-modal): update pga state management logic
1 parent f8db4de commit 66e8193

File tree

4 files changed

+2455
-3
lines changed

4 files changed

+2455
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ function DrefExportModal(props: Props) {
112112
return;
113113
}
114114

115-
// Don't automatically trigger the export for imminent DREFs (except for Final Reports)
115+
// Don't automatically trigger the export for imminent DREF Applications
116116
// We need to allow users to configure PGA before the export
117-
if (drefType === DREF_TYPE_IMMINENT && applicationType !== 'FINAL_REPORT') {
117+
if (drefType === DREF_TYPE_IMMINENT && applicationType === 'DREF') {
118118
return;
119119
}
120120

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,12 @@ function ActiveDrefTable(props: Props) {
219219
return {
220220
id,
221221
drefId: id,
222+
drefType,
222223
status: item.status,
223224
applicationType,
224225
canAddOpsUpdate: false,
225226
canCreateFinalReport: false,
227+
hasPermissionToApprove: false,
226228
};
227229
}
228230

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
} from '@togglecorp/fujs';
2727

2828
import useFilterState from '#hooks/useFilterState';
29+
import { type TypeOfDrefEnum } from '#utils/constants';
2930
import { useRequest } from '#utils/restRequest';
3031

3132
import DrefTableActions, { type Props as DrefTableActionsProps } from '../DrefTableActions';
@@ -76,7 +77,7 @@ function CompletedDrefTable(props: Props) {
7677
},
7778
});
7879

79-
type DrefResultItem = NonNullable<NonNullable<typeof completedDrefResponse>['results']>[number];
80+
type DrefResultItem = NonNullable<NonNullable<typeof completedDrefResponse>['results']>[number] & { drefType?: TypeOfDrefEnum | null | undefined };
8081
type Key = DrefResultItem['id'];
8182

8283
const [expandedRow, setExpandedRow] = useState<DrefResultItem | undefined>();
@@ -135,6 +136,7 @@ function CompletedDrefTable(props: Props) {
135136
id,
136137
drefId: item.dref.id,
137138
status: item.status,
139+
drefType: item.drefType,
138140
// FIXME: fix typing in server (medium priority)
139141
// the application_type should be an enum
140142
applicationType: item.application_type as 'DREF' | 'OPS_UPDATE' | 'FINAL_REPORT',
@@ -204,6 +206,7 @@ function CompletedDrefTable(props: Props) {
204206
{
205207
...datum.dref,
206208
dref: datum.dref,
209+
drefType: datum.dref.type_of_dref,
207210
glide_code: datum.glide_code,
208211
date_of_publication: datum.date_of_publication,
209212
},

0 commit comments

Comments
 (0)