Skip to content

Commit c5bbff5

Browse files
Merge pull request #263 from IFRCGo/fix/dref-submit-button-label
Rename DREF submit button label to save
2 parents e39085b + 97d0f2e commit c5bbff5

File tree

4 files changed

+67
-56
lines changed

4 files changed

+67
-56
lines changed

src/components/Navbar/LanguageDropdown/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import styles from './styles.module.css';
1313
const languageNameMap: Record<Language, string> = {
1414
en: 'English',
1515
fr: 'Français',
16-
es: 'Española',
16+
es: 'Español',
1717
ar: 'عربي',
1818
};
1919

src/views/DrefApplicationForm/index.tsx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -509,20 +509,31 @@ export function Component() {
509509
className={styles.drefApplicationForm}
510510
title={strings.formPageTitle}
511511
heading={strings.formPageHeading}
512-
actions={isDefined(drefId) && (
512+
actions={(
513513
<>
514+
{isDefined(drefId) && (
515+
<>
516+
<Button
517+
name={undefined}
518+
onClick={handleShareClick}
519+
>
520+
{strings.formShareButtonLabel}
521+
</Button>
522+
<Button
523+
name={undefined}
524+
onClick={handleExportClick}
525+
icons={<DownloadTwoLineIcon />}
526+
>
527+
{strings.formExportLabel}
528+
</Button>
529+
</>
530+
)}
514531
<Button
515532
name={undefined}
516-
onClick={handleShareClick}
517-
>
518-
{strings.formShareButtonLabel}
519-
</Button>
520-
<Button
521-
name={undefined}
522-
onClick={handleExportClick}
523-
icons={<DownloadTwoLineIcon />}
533+
onClick={handleFormSubmit}
534+
disabled={disabled}
524535
>
525-
{strings.formExportLabel}
536+
{strings.formSaveButtonLabel}
526537
</Button>
527538
</>
528539
)}
@@ -673,13 +684,6 @@ export function Component() {
673684
{strings.formContinueButtonLabel}
674685
</Button>
675686
</div>
676-
<Button
677-
name={undefined}
678-
onClick={handleFormSubmit}
679-
disabled={activeTab !== 'submission' || disabled}
680-
>
681-
{strings.formSubmitButtonLabel}
682-
</Button>
683687
</div>
684688
</>
685689
)}

src/views/DrefFinalReportForm/index.tsx

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -399,22 +399,33 @@ export function Component() {
399399
className={styles.drefFinalReportForm}
400400
title={strings.formPageTitle}
401401
heading={strings.formPageHeading}
402-
actions={isTruthyString(finalReportId) && (
402+
actions={(
403403
<>
404+
{isTruthyString(finalReportId) && (
405+
<>
406+
<Button
407+
name={undefined}
408+
onClick={setShowShareModalTrue}
409+
disabled={isNotDefined(drefId)}
410+
>
411+
{strings.formShareButtonLabel}
412+
</Button>
413+
<Button
414+
name={undefined}
415+
onClick={setShowExportModalTrue}
416+
icons={<DownloadTwoLineIcon />}
417+
disabled={isNotDefined(drefId)}
418+
>
419+
{strings.formExportLabel}
420+
</Button>
421+
</>
422+
)}
404423
<Button
405424
name={undefined}
406-
onClick={setShowShareModalTrue}
407-
disabled={isNotDefined(drefId)}
408-
>
409-
{strings.formShareButtonLabel}
410-
</Button>
411-
<Button
412-
name={undefined}
413-
onClick={setShowExportModalTrue}
414-
icons={<DownloadTwoLineIcon />}
415-
disabled={isNotDefined(drefId)}
425+
onClick={handleFormSubmit}
426+
disabled={disabled}
416427
>
417-
{strings.formExportLabel}
428+
{strings.formSaveButtonLabel}
418429
</Button>
419430
</>
420431
)}
@@ -554,13 +565,6 @@ export function Component() {
554565
{strings.formContinueButtonLabel}
555566
</Button>
556567
</div>
557-
<Button
558-
name={undefined}
559-
onClick={handleFormSubmit}
560-
disabled={activeTab !== 'submission' || disabled}
561-
>
562-
{strings.formSubmitButtonLabel}
563-
</Button>
564568
</div>
565569
</>
566570
)}

src/views/DrefOperationalUpdateForm/index.tsx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ export function Component() {
259259
// is_assessment_report,
260260
...otherValues
261261
} = removeNull(response);
262-
263262
setValue({
264263
...otherValues,
265264
planned_interventions: planned_interventions?.map(
@@ -621,21 +620,32 @@ export function Component() {
621620
className={styles.drefOperationalUpdateForm}
622621
title={strings.formPageTitle}
623622
heading={strings.formPageHeading}
624-
actions={isTruthyString(opsUpdateId) && (
623+
actions={(
625624
<>
625+
{isTruthyString(opsUpdateId) && (
626+
<>
627+
<Button
628+
name={undefined}
629+
onClick={handleShareClick}
630+
disabled={isNotDefined(drefId)}
631+
>
632+
{strings.formShareButtonLabel}
633+
</Button>
634+
<Button
635+
name={undefined}
636+
onClick={handleExportClick}
637+
icons={<DownloadTwoLineIcon />}
638+
>
639+
{strings.formExportLabel}
640+
</Button>
641+
</>
642+
)}
626643
<Button
627644
name={undefined}
628-
onClick={handleShareClick}
629-
disabled={isNotDefined(drefId)}
630-
>
631-
{strings.formShareButtonLabel}
632-
</Button>
633-
<Button
634-
name={undefined}
635-
onClick={handleExportClick}
636-
icons={<DownloadTwoLineIcon />}
645+
onClick={handleFormSubmit}
646+
disabled={disabled}
637647
>
638-
{strings.formExportLabel}
648+
{strings.formSaveButtonLabel}
639649
</Button>
640650
</>
641651
)}
@@ -809,13 +819,6 @@ export function Component() {
809819
{strings.formContinueButtonLabel}
810820
</Button>
811821
</div>
812-
<Button
813-
name={undefined}
814-
onClick={handleFormSubmit}
815-
disabled={activeTab !== 'submission' || disabled}
816-
>
817-
{strings.formSubmitButtonLabel}
818-
</Button>
819822
</div>
820823
</>
821824
)}

0 commit comments

Comments
 (0)