Skip to content

Commit a65e61d

Browse files
committed
fix(eap-export): update full and summary eap export
1 parent 2f64187 commit a65e61d

2 files changed

Lines changed: 59 additions & 191 deletions

File tree

app/src/views/EapFullExport/index.tsx

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,13 @@ export function Component() {
563563
/>
564564
<PrintableContainer
565565
heading={strings.partnerNationalSocietyContactLabel}
566-
headingLevel={5}
566+
headingLevel={6}
567567
>
568568
{partner_contacts?.map((partner) => {
569569
const prevPartner = prevPartnerContactsMapping[partner.id!];
570570
return (
571-
<PrintableDataDisplay
572-
valueType="text"
571+
<PrintableDescription
572+
key={partner.id}
573573
withDiff={withDiff}
574574
value={[
575575
partner.name,
@@ -587,8 +587,6 @@ export function Component() {
587587
]
588588
.filter(isTruthyString)
589589
.join(', ')}
590-
variant="inline"
591-
strongLabel
592590
/>
593591
);
594592
})}
@@ -820,13 +818,9 @@ export function Component() {
820818
heading={strings.descriptionLabel}
821819
headingLevel={6}
822820
>
823-
<PrintableDataDisplay
821+
<PrintableDescription
824822
value={prioritized_impact}
825823
prevValue={prev_prioritized_impact}
826-
valueType="text"
827-
withoutLabelColon
828-
variant="block"
829-
strongLabel
830824
withDiff={withDiff}
831825
/>
832826
</PrintableContainer>
@@ -896,28 +890,26 @@ export function Component() {
896890
heading={strings.triggerStatementLabel}
897891
headingLevel={3}
898892
>
899-
<PrintableDataDisplay
893+
<PrintableDescription
900894
value={trigger_statement}
901895
prevValue={prev_trigger_statement}
902-
valueType="text"
903-
withoutLabelColon
904-
variant="block"
905-
strongLabel
906896
withDiff={withDiff}
907897
/>
908898
</PrintableContainer>
909-
<PrintableContainer
910-
heading={strings.leadTimeLabel}
911-
headingLevel={3}
912-
>
913-
<PrintableDataDisplay
914-
value={lead_time}
915-
prevValue={prev_lead_time}
916-
valueType="number"
917-
variant="inline"
918-
strongLabel
919-
withDiff={withDiff}
920-
/>
899+
<PrintableContainer headingLevel={3}>
900+
<ListView layout="grid">
901+
<PrintableDataDisplay
902+
label={strings.leadTimeLabel}
903+
value={lead_time}
904+
prevValue={prev_lead_time}
905+
valueType="number"
906+
variant="block"
907+
withBackground
908+
withPadding
909+
strongLabel
910+
withDiff={withDiff}
911+
/>
912+
</ListView>
921913
</PrintableContainer>
922914
<PrintableContainer
923915
heading={strings.sourceForecastLabel}
@@ -962,13 +954,9 @@ export function Component() {
962954
heading={strings.forecastSelectionLabel}
963955
headingLevel={3}
964956
>
965-
<PrintableDataDisplay
957+
<PrintableDescription
966958
value={forecast_selection}
967959
prevValue={prev_forecast_selection}
968-
valueType="text"
969-
withoutLabelColon
970-
variant="block"
971-
strongLabel
972960
withDiff={withDiff}
973961
/>
974962
</PrintableContainer>
@@ -992,13 +980,9 @@ export function Component() {
992980
heading={strings.definitionJustificationLabel}
993981
headingLevel={3}
994982
>
995-
<PrintableDataDisplay
983+
<PrintableDescription
996984
value={definition_and_justification_impact_level}
997985
prevValue={prev_definition_and_justification_impact_level}
998-
valueType="text"
999-
withoutLabelColon
1000-
variant="block"
1001-
strongLabel
1002986
withDiff={withDiff}
1003987
/>
1004988
</PrintableContainer>
@@ -1019,14 +1003,9 @@ export function Component() {
10191003
heading={strings.identificationInterventionLabel}
10201004
headingLevel={3}
10211005
>
1022-
<PrintableDataDisplay
1023-
label={strings.identificationInterventionLabel}
1006+
<PrintableDescription
10241007
value={identification_of_the_intervention_area}
10251008
prevValue={prev_identification_of_the_intervention_area}
1026-
valueType="text"
1027-
withoutLabelColon
1028-
variant="block"
1029-
strongLabel
10301009
withDiff={withDiff}
10311010
/>
10321011
</PrintableContainer>

app/src/views/EapSummaryExport/index.tsx

Lines changed: 37 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ import {
1717
listToMap,
1818
} from '@togglecorp/fujs';
1919

20-
import Link from '#components/Link';
20+
import Link from '#components/printable/Link';
2121
import PrintableContainer from '#components/printable/PrintableContainer';
2222
import PrintableDataDisplay from '#components/printable/PrintableDataDisplay';
2323
import PrintableDescription from '#components/printable/PrintableDescription';
2424
import PrintablePage from '#components/printable/PrintablePage';
2525
import useGlobalEnums from '#hooks/domain/useGlobalEnums';
2626
import { useRequest } from '#utils/restRequest';
27+
import PrintableContactOutput from '#views/EapFullExport/PrintableContactOutput';
2728

2829
import i18n from './i18n.json';
2930
import styles from './styles.module.css';
@@ -73,48 +74,8 @@ export function Component() {
7374
const {
7475
cover_image_file,
7576

76-
national_society_contact_name,
77-
national_society_contact_email,
78-
national_society_contact_title,
79-
national_society_contact_phone_number,
80-
8177
partner_contacts,
8278

83-
ifrc_delegation_focal_point_name,
84-
ifrc_delegation_focal_point_email,
85-
ifrc_delegation_focal_point_title,
86-
ifrc_delegation_focal_point_phone_number,
87-
88-
ifrc_head_of_delegation_name,
89-
ifrc_head_of_delegation_email,
90-
ifrc_head_of_delegation_title,
91-
ifrc_head_of_delegation_phone_number,
92-
93-
dref_focal_point_name,
94-
dref_focal_point_email,
95-
dref_focal_point_title,
96-
dref_focal_point_phone_number,
97-
98-
ifrc_regional_focal_point_name,
99-
ifrc_regional_focal_point_email,
100-
ifrc_regional_focal_point_title,
101-
ifrc_regional_focal_point_phone_number,
102-
103-
ifrc_regional_ops_manager_name,
104-
ifrc_regional_ops_manager_email,
105-
ifrc_regional_ops_manager_title,
106-
ifrc_regional_ops_manager_phone_number,
107-
108-
ifrc_regional_head_dcc_name,
109-
ifrc_regional_head_dcc_email,
110-
ifrc_regional_head_dcc_title,
111-
ifrc_regional_head_dcc_phone_number,
112-
113-
ifrc_global_ops_coordinator_name,
114-
ifrc_global_ops_coordinator_email,
115-
ifrc_global_ops_coordinator_title,
116-
ifrc_global_ops_coordinator_phone_number,
117-
11879
admin2_details,
11980
lead_time,
12081
planned_operations,
@@ -482,16 +443,8 @@ export function Component() {
482443
</PrintableContainer>
483444
))}
484445
</PrintableContainer>
485-
<PrintableContainer
486-
heading={strings.operationBudgetLabel}
487-
headingLevel={3}
488-
>
489-
<Link
490-
href={budget_file_details?.file}
491-
withLinkIcon
492-
external
493-
withUnderline
494-
>
446+
<PrintableContainer headingLevel={3}>
447+
<Link href={budget_file_details?.file}>
495448
{strings.downloadBudgetLabel}
496449
</Link>
497450
</PrintableContainer>
@@ -503,24 +456,16 @@ export function Component() {
503456
<PrintableDescription value={strings.contactInformationDescription} />
504457
</PrintableContainer>
505458
<PrintableContainer heading={strings.nationalLabel} headingLevel={4}>
506-
<PrintableDataDisplay
459+
<PrintableContactOutput
507460
label={strings.nationalSocietyContactLabel}
508-
valueType="text"
509-
value={[
510-
national_society_contact_name,
511-
national_society_contact_title,
512-
national_society_contact_email,
513-
national_society_contact_phone_number,
514-
]
515-
.filter(isTruthyString)
516-
.join(', ')}
517-
variant="inline"
518-
strongLabel
461+
namePrefix="national_society_contact"
462+
data={fullEapResponse}
463+
prevData={undefined}
519464
withDiff={false}
520465
/>
521466
<PrintableContainer
522467
heading={strings.partnerNationalSocietyContactLabel}
523-
headingLevel={5}
468+
headingLevel={6}
524469
>
525470
{partner_contacts?.map((partner) => (
526471
<PrintableDataDisplay
@@ -541,115 +486,59 @@ export function Component() {
541486
</PrintableContainer>
542487
</PrintableContainer>
543488
<PrintableContainer heading={strings.delegationLabel} headingLevel={4}>
544-
<PrintableDataDisplay
489+
<PrintableContactOutput
545490
label={strings.delegationFocalLabel}
546-
valueType="text"
491+
namePrefix="ifrc_delegation_focal_point"
492+
data={fullEapResponse}
493+
prevData={undefined}
547494
withDiff={false}
548-
value={[
549-
ifrc_delegation_focal_point_name,
550-
ifrc_delegation_focal_point_email,
551-
ifrc_delegation_focal_point_title,
552-
ifrc_delegation_focal_point_phone_number,
553-
]
554-
.filter(isTruthyString)
555-
.join(', ')}
556-
variant="inline"
557-
strongLabel
558495
/>
559-
<PrintableDataDisplay
496+
<PrintableContactOutput
560497
label={strings.delegationHeadLabel}
561-
valueType="text"
498+
namePrefix="ifrc_head_of_delegation"
499+
data={fullEapResponse}
500+
prevData={undefined}
562501
withDiff={false}
563-
value={[
564-
ifrc_head_of_delegation_name,
565-
ifrc_head_of_delegation_title,
566-
ifrc_head_of_delegation_email,
567-
ifrc_head_of_delegation_phone_number,
568-
]
569-
.filter(isTruthyString)
570-
.join(', ')}
571-
variant="inline"
572-
strongLabel
573502
/>
574503
</PrintableContainer>
575504
<PrintableContainer
576505
heading={strings.regionalGlobalLabel}
577506
headingLevel={4}
578507
>
579-
<PrintableDataDisplay
508+
<PrintableContactOutput
580509
label={strings.drefFocalLabel}
581-
valueType="text"
510+
namePrefix="dref_focal_point"
511+
data={fullEapResponse}
512+
prevData={undefined}
582513
withDiff={false}
583-
value={[
584-
dref_focal_point_name,
585-
dref_focal_point_email,
586-
dref_focal_point_title,
587-
dref_focal_point_phone_number,
588-
]
589-
.filter(isTruthyString)
590-
.join(', ')}
591-
variant="inline"
592-
strongLabel
593514
/>
594-
<PrintableDataDisplay
515+
<PrintableContactOutput
595516
label={strings.regionalFocalLabel}
596-
valueType="text"
517+
namePrefix="ifrc_regional_focal_point"
518+
data={fullEapResponse}
519+
prevData={undefined}
597520
withDiff={false}
598-
value={[
599-
ifrc_regional_focal_point_name,
600-
ifrc_regional_focal_point_email,
601-
ifrc_regional_focal_point_title,
602-
ifrc_regional_focal_point_phone_number,
603-
]
604-
.filter(isTruthyString)
605-
.join(', ')}
606-
variant="inline"
607-
strongLabel
608521
/>
609-
<PrintableDataDisplay
522+
<PrintableContactOutput
610523
label={strings.regionalOpsLabel}
611-
valueType="text"
524+
namePrefix="ifrc_regional_ops_manager"
525+
data={fullEapResponse}
526+
prevData={undefined}
612527
withDiff={false}
613-
value={[
614-
ifrc_regional_ops_manager_name,
615-
ifrc_regional_ops_manager_email,
616-
ifrc_regional_ops_manager_title,
617-
ifrc_regional_ops_manager_phone_number,
618-
]
619-
.filter(isTruthyString)
620-
.join(', ')}
621-
variant="inline"
622-
strongLabel
623528
/>
624-
<PrintableDataDisplay
529+
<PrintableContactOutput
625530
label={strings.regionalHeadLabel}
626-
valueType="text"
531+
namePrefix="ifrc_regional_head_dcc"
532+
data={fullEapResponse}
533+
prevData={undefined}
627534
withDiff={false}
628-
value={[
629-
ifrc_regional_head_dcc_name,
630-
ifrc_regional_head_dcc_email,
631-
ifrc_regional_head_dcc_title,
632-
ifrc_regional_head_dcc_phone_number,
633-
]
634-
.filter(isTruthyString)
635-
.join(', ')}
636-
variant="inline"
637-
strongLabel
638535
/>
639-
<PrintableDataDisplay
536+
<PrintableContactOutput
640537
label={strings.globalOpsLabel}
641-
valueType="text"
538+
namePrefix="ifrc_global_ops_coordinator"
539+
data={fullEapResponse}
540+
prevData={undefined}
642541
withDiff={false}
643-
value={[
644-
ifrc_global_ops_coordinator_name,
645-
ifrc_global_ops_coordinator_email,
646-
ifrc_global_ops_coordinator_title,
647-
ifrc_global_ops_coordinator_phone_number,
648-
]
649-
.filter(isTruthyString)
650-
.join(', ')}
651-
variant="inline"
652-
strongLabel
653542
/>
654543
</PrintableContainer>
655544
</PrintableContainer>

0 commit comments

Comments
 (0)