Skip to content

Commit b0b08ba

Browse files
barshathakuriAdityaKhatri
authored andcommitted
fix(final-report): add missing translation
1 parent c6baeed commit b0b08ba

File tree

9 files changed

+30
-45
lines changed

9 files changed

+30
-45
lines changed

app/src/views/DrefFinalReportExport/i18n.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@
116116
"priorityActionsTotal": "Total",
117117
"proposedActionsSector": "Sector",
118118
"mitigationEffortsAndAchievements": "Mitigation efforts and achievements.",
119-
"lessonsLearntAndChallenges": "Lessons learnt and challenges"
119+
"lessonsLearntAndChallenges": "Lessons learnt and challenges",
120+
"expenditure": "Expenditure",
121+
"imageIcon": "Icon"
120122
}
121123
}

app/src/views/DrefFinalReportExport/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export function Component() {
9393
const primarySectorOptions = usePrimarySector();
9494

9595
const {
96-
// pending: fetchingDref,
9796
response: drefResponse,
9897
} = useRequest({
9998
skip: isFalsyString(finalReportId),
@@ -670,7 +669,6 @@ export function Component() {
670669
headingLevel={3}
671670
childrenContainerClassName={styles.proposedActions}
672671
>
673-
<div className={styles.actionTitleLabel} />
674672
<div className={styles.actionTitleLabel}>
675673
{strings.proposedActionsSector}
676674
</div>
@@ -681,7 +679,7 @@ export function Component() {
681679
{strings.priorityActionsBudget}
682680
</div>
683681
<div className={styles.actionTitleLabel}>
684-
Expenditure
682+
{strings.expenditure}
685683
</div>
686684
{groupedProposedActions.map((proposedAction) => (
687685
<Fragment key={proposedAction.key}>
@@ -694,15 +692,15 @@ export function Component() {
694692
<img
695693
className={styles.icon}
696694
src={proposedAction.icon}
697-
alt=""
695+
alt={strings.imageIcon}
698696
/>
699697
<div className={styles.title}>
700698
{proposedAction.title}
701699
</div>
702700
</div>
703701
{proposedAction.actions.map((action) => (
704702
<Fragment key={action.id}>
705-
{action.activities.map((activity, i) => (
703+
{action.activities.map((activity, index) => (
706704
<Fragment key={activity.id}>
707705
<SelectOutput
708706
className={styles.sector}
@@ -715,7 +713,7 @@ export function Component() {
715713
<div className={styles.activity}>
716714
{activity.activity}
717715
</div>
718-
{i === 0 && (
716+
{index === 0 && (
719717
<div
720718
className={styles.budget}
721719
style={{ gridRow: `span ${action.activities.length}` }}
@@ -726,7 +724,7 @@ export function Component() {
726724
/>
727725
</div>
728726
)}
729-
{i === 0 && (
727+
{index === 0 && (
730728
<div
731729
className={styles.budget}
732730
style={{ gridRow: `span ${action.activities.length}` }}

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -313,21 +313,6 @@ function Overview(props: Props) {
313313
value?.type_of_dref === TYPE_IMMINENT
314314
}
315315
/>
316-
{/* (value?.disaster_type === DISASTER_FIRE
317-
|| value?.disaster_type === DISASTER_FLASH_FLOOD
318-
|| value?.disaster_type === DISASTER_FLOOD)
319-
? (
320-
<BooleanInput
321-
name="is_man_made_event"
322-
label={strings.drefFormManMadeEvent}
323-
value={value?.is_man_made_event}
324-
onChange={setFieldValue}
325-
error={error?.is_man_made_event}
326-
disabled={disabled}
327-
/>
328-
) : (
329-
<div />
330-
) */}
331316
{value?.type_of_dref !== TYPE_IMMINENT && (
332317
<SelectInput
333318
name="disaster_category"

app/src/views/DrefFinalReportForm/common.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,12 @@ type TypeOfDrefEnum = components<'read'>['schemas']['DrefDrefDrefTypeEnumKey'];
1616
type TypeOfOnsetEnum = components<'read'>['schemas']['DrefDrefOnsetTypeEnumKey'];
1717
type ProposedActionOption = NonNullable<GlobalEnumsResponse['dref_proposed_action']>[number];
1818

19-
// export const ONSET_SLOW = 1 satisfies TypeOfOnsetEnum;
2019
export const ONSET_SUDDEN = 2 satisfies TypeOfOnsetEnum;
2120

2221
export const TYPE_IMMINENT = 0 satisfies TypeOfDrefEnum;
2322
export const TYPE_ASSESSMENT = 1 satisfies TypeOfDrefEnum;
24-
// export const TYPE_RESPONSE = 2 satisfies TypeOfDrefEnum;
2523
export const TYPE_LOAN = 3 satisfies TypeOfDrefEnum;
2624

27-
// FIXME: identify a way to store disaster
28-
// const DISASTER_FIRE = 15;
29-
// const DISASTER_FLASH_FLOOD = 27;
30-
// const DISASTER_FLOOD = 12;
31-
3225
export const SUB_TOTAL = 75000;
3326
export const SURGE_DEPLOYMENT_COST = 10000;
3427

app/src/views/DrefFinalReportForm/schema.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,6 @@ const schema: FinalReportFormSchema = {
631631
required: true,
632632
validations: [
633633
(value: Maybe<number>) => (
634-
// FIXME: use translations
635634
isDefined(value) && value !== SUB_TOTAL
636635
? 'The sub-total of the budgets should be exactly CHF 75000'
637636
: undefined

app/src/views/OldDrefFinalReportExport/i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"nationalSocietyHotlineHeading": "National Society Hotline",
101101
"sourceInformationSectionHeading": "Source Information",
102102
"sourceInformationSourceNameTitle": "Source Name",
103-
"sourceInformationSourceLinkTitle": "Source Link"
103+
"sourceInformationSourceLinkTitle": "Source Link",
104+
"imageIcon": "Icon"
104105
}
105106
}

app/src/views/OldDrefFinalReportExport/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,13 @@ export function Component() {
134134

135135
const sortedPlannedInterventions = useMemo(
136136
() => filteredPlannedIntervention?.sort(
137-
138137
(a, b) => plannedInterventionOrder[a.title] - plannedInterventionOrder[b.title],
139138
),
140139
[filteredPlannedIntervention],
141140
);
142141

143142
const sortedIdentifiedNeedsAndGaps = useMemo(
144143
() => filteredIdentifiedNeedsAndGaps?.sort(
145-
146144
(a, b) => identifiedNeedsAndGapsOrder[a.title] - identifiedNeedsAndGapsOrder[b.title],
147145
),
148146
[filteredIdentifiedNeedsAndGaps],
@@ -648,7 +646,7 @@ export function Component() {
648646
<img
649647
className={styles.icon}
650648
src={identifiedNeed.image_url}
651-
alt=""
649+
alt={strings.imageIcon}
652650
/>
653651
{identifiedNeed.title_display}
654652
</Heading>
@@ -888,7 +886,7 @@ export function Component() {
888886
<img
889887
className={styles.icon}
890888
src={plannedIntervention.image_url}
891-
alt=""
889+
alt={strings.imageIcon}
892890
/>
893891
{plannedIntervention.title_display}
894892
</Heading>

app/src/views/OldDrefFinalReportForm/index.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,6 @@ export function Component() {
174174
// eslint-disable-next-line max-len
175175
newMap[response.financial_report_details.id] = response.financial_report_details.file;
176176
}
177-
/*
178-
if ((response.photos_file?.length ?? 0) > 0) {
179-
response.photos_file?.forEach((img) => {
180-
if (isDefined(img.file)) {
181-
newMap[img.id] = img.file;
182-
}
183-
});
184-
}
185-
*/
186177
if ((response.images_file?.length ?? 0) > 0) {
187178
response.images_file?.forEach((img) => {
188179
if (isDefined(img.file) && isDefined(img.id)) {

translationMigrations/000042-1753424586649.json renamed to translationMigrations/000042-1754038716022.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,24 @@
6161
"namespace": "drefFinalReportExport",
6262
"value": "Events impact"
6363
},
64+
{
65+
"action": "add",
66+
"key": "expenditure",
67+
"namespace": "drefFinalReportExport",
68+
"value": "Expenditure"
69+
},
6470
{
6571
"action": "add",
6672
"key": "financialReportVariancesModificationHeading",
6773
"namespace": "drefFinalReportExport",
6874
"value": "Explain any variances or modifications to the implemented activities"
6975
},
76+
{
77+
"action": "add",
78+
"key": "imageIcon",
79+
"namespace": "drefFinalReportExport",
80+
"value": "Icon"
81+
},
7082
{
7183
"action": "add",
7284
"key": "imminentExportTitle",
@@ -629,6 +641,12 @@
629641
"namespace": "oldDrefFinalReportExport",
630642
"value": "ICRC Actions Related To The Current Event"
631643
},
644+
{
645+
"action": "add",
646+
"key": "imageIcon",
647+
"namespace": "oldDrefFinalReportExport",
648+
"value": "Icon"
649+
},
632650
{
633651
"action": "add",
634652
"key": "imageLogoIFRCAlt",

0 commit comments

Comments
 (0)