Skip to content

Commit d62c05c

Browse files
authored
Merge pull request #1956 from IFRCGo/fix/dref-final-report-export-placement
fix(dref-final-report): fix placement of logo in proposed action in export
2 parents 61fca55 + 84b4802 commit d62c05c

File tree

6 files changed

+42
-9
lines changed

6 files changed

+42
-9
lines changed

.changeset/whole-lions-guess.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"go-web-app": patch
3+
---
4+
5+
- Fix calculation of Operation End date in Final report form
6+
- Fix icon position issue in the implementation table of DREF PDF export
7+
- Update the label for last update date in the crisis categorization pop-up

app/src/views/DrefFinalReportExport/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,8 @@ export function Component() {
669669
headingLevel={3}
670670
childrenContainerClassName={styles.proposedActions}
671671
>
672+
{/* NOTE: Leaving this empty for empty header */}
673+
<div className={styles.logoHeader} />
672674
<div className={styles.actionTitleLabel}>
673675
{strings.proposedActionsSector}
674676
</div>

app/src/views/DrefFinalReportExport/styles.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@
234234
grid-template-columns: 4fr 5fr 5fr 4fr 4fr;
235235
page-break-inside: avoid;
236236

237+
.logo-header,
237238
.action-title-label {
238239
background-color: var(--go-ui-color-element-background);
239240
padding: var(--go-ui-spacing-sm);
@@ -289,4 +290,4 @@
289290
break-inside: avoid;
290291
}
291292
}
292-
}
293+
}

app/src/views/DrefFinalReportForm/Submission/index.tsx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ import {
88
} from '@ifrc-go/ui';
99
import { useTranslation } from '@ifrc-go/ui/hooks';
1010
import {
11+
addNumDaysToDate,
1112
addNumMonthsToDate,
1213
encodeDate,
1314
} from '@ifrc-go/ui/utils';
14-
import { isDefined } from '@togglecorp/fujs';
15+
import {
16+
isDefined,
17+
isNotDefined,
18+
} from '@togglecorp/fujs';
1519
import {
1620
type EntriesAsList,
1721
type Error,
@@ -64,15 +68,23 @@ function Submission(props: Props) {
6468
const handleOperationStartDateChange = useCallback(
6569
(val: string | undefined, name: 'operation_start_date') => {
6670
setFieldValue(val, name);
67-
const endDate = addNumMonthsToDate(
68-
val,
69-
value.total_operation_timeframe,
70-
);
71-
if (isDefined(endDate)) {
71+
let endDate;
72+
if (value.type_of_dref === TYPE_IMMINENT) {
73+
endDate = addNumDaysToDate(
74+
val,
75+
value.total_operation_timeframe,
76+
);
77+
} else {
78+
endDate = addNumMonthsToDate(
79+
val,
80+
value.total_operation_timeframe,
81+
);
82+
}
83+
if (isNotDefined(endDate)) {
7284
setFieldValue(encodeDate(endDate), 'operation_end_date');
7385
}
7486
},
75-
[setFieldValue, value.total_operation_timeframe],
87+
[setFieldValue, value.total_operation_timeframe, value.type_of_dref],
7688
);
7789

7890
return (

app/src/views/EmergencyDetails/i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"situationalOverviewTitle": "Situational Overview",
1515
"linksTitle": "Links",
1616
"emergencyMapTitle": "Affected Provinces",
17-
"severityLevelUpdateDateLabel": "Updated date",
17+
"severityLevelUpdateDateLabel": "Last update",
1818
"exportMap": "Export",
1919
"contactsTitle": "Contacts",
2020
"sourceLabel": "Source {source}"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"parent": "000043-1754048543774.json",
3+
"actions": [
4+
{
5+
"action": "update",
6+
"key": "severityLevelUpdateDateLabel",
7+
"namespace": "emergencyDetails",
8+
"newValue": "Last update"
9+
}
10+
]
11+
}

0 commit comments

Comments
 (0)