Skip to content

Commit 0b51670

Browse files
committed
Use surge deployment cost constant
1 parent 16caedf commit 0b51670

File tree

2 files changed

+165
-160
lines changed

2 files changed

+165
-160
lines changed

app/src/views/DrefApplicationExport/index.tsx

Lines changed: 157 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,167 +1050,165 @@ export function Component() {
10501050
</>
10511051
)}
10521052
{proposedActionsDefined && (
1053-
<>
1054-
<Container
1055-
heading={strings.proposedActions}
1056-
headingLevel={3}
1057-
childrenContainerClassName={styles.actionsSection}
1053+
<Container
1054+
heading={strings.proposedActions}
1055+
headingLevel={3}
1056+
childrenContainerClassName={styles.actionsSection}
1057+
>
1058+
<div className={styles.actionsItem} />
1059+
<DescriptionText
1060+
className={styles.actionsTitle}
10581061
>
1059-
<div className={styles.actionsItem} />
1060-
<DescriptionText
1061-
className={styles.actionsTitle}
1062-
>
1063-
{strings.proposedActionsActivities}
1064-
</DescriptionText>
1065-
<DescriptionText
1066-
className={styles.actionsTitle}
1067-
>
1068-
{strings.priorityActionsBudget}
1069-
</DescriptionText>
1070-
<TextOutput
1071-
className={styles.actionsItem}
1072-
label=""
1073-
value={strings.proposedActionsEarlyActions}
1074-
withoutLabelColon
1075-
strongValue
1076-
/>
1077-
<TextOutput
1078-
className={styles.actionsItem}
1079-
label=""
1080-
value={proposedActionsByType[EARLY_ACTIONS]?.map((action) => (
1081-
<ul key={action.id}>
1082-
<li>
1083-
<SelectOutput
1084-
className={styles.actionsItem}
1085-
options={activityOptionResponse}
1086-
label={undefined}
1087-
labelSelector={activityLabelSelector}
1088-
keySelector={activityKeySelector}
1089-
value={action?.activity}
1090-
/>
1091-
</li>
1092-
</ul>
1093-
))}
1094-
withoutLabelColon
1095-
invalidText
1096-
/>
1097-
<TextOutput
1098-
className={styles.actionsItem}
1099-
label=""
1100-
value={proposedActionsByType[EARLY_ACTIONS]?.map((action) => (
1101-
<TextOutput
1102-
key={action.id}
1103-
className={styles.actionsItem}
1104-
label=""
1105-
value={action.budget}
1106-
invalidText
1107-
withoutLabelColon
1108-
/>
1109-
))}
1110-
withoutLabelColon
1111-
invalidText
1112-
/>
1062+
{strings.proposedActionsActivities}
1063+
</DescriptionText>
1064+
<DescriptionText
1065+
className={styles.actionsTitle}
1066+
>
1067+
{strings.priorityActionsBudget}
1068+
</DescriptionText>
1069+
<TextOutput
1070+
className={styles.actionsItem}
1071+
label=""
1072+
value={strings.proposedActionsEarlyActions}
1073+
withoutLabelColon
1074+
strongValue
1075+
/>
1076+
<TextOutput
1077+
className={styles.actionsItem}
1078+
label=""
1079+
value={proposedActionsByType[EARLY_ACTIONS]?.map((action) => (
1080+
<ul key={action.id}>
1081+
<li>
1082+
<SelectOutput
1083+
className={styles.actionsItem}
1084+
options={activityOptionResponse}
1085+
label={undefined}
1086+
labelSelector={activityLabelSelector}
1087+
keySelector={activityKeySelector}
1088+
value={action?.activity}
1089+
/>
1090+
</li>
1091+
</ul>
1092+
))}
1093+
withoutLabelColon
1094+
invalidText
1095+
/>
1096+
<TextOutput
1097+
className={styles.actionsItem}
1098+
label=""
1099+
value={proposedActionsByType[EARLY_ACTIONS]?.map((action) => (
1100+
<TextOutput
1101+
key={action.id}
1102+
className={styles.actionsItem}
1103+
label=""
1104+
value={action.budget}
1105+
invalidText
1106+
withoutLabelColon
1107+
/>
1108+
))}
1109+
withoutLabelColon
1110+
invalidText
1111+
/>
11131112

1114-
<TextOutput
1115-
className={styles.actionsItem}
1116-
label=""
1117-
value={strings.priorityActionsEarlyResponse}
1118-
withoutLabelColon
1119-
strongValue
1120-
/>
1121-
<TextOutput
1122-
className={styles.actionsItem}
1123-
label=""
1124-
value={proposedActionsByType[EARLY_RESPONSE]?.map((response) => (
1125-
<ul key={response.id}>
1126-
<li>
1127-
<SelectOutput
1128-
className={styles.actionsItem}
1129-
options={activityOptionResponse}
1130-
label={undefined}
1131-
labelSelector={activityLabelSelector}
1132-
keySelector={activityKeySelector}
1133-
value={response?.activity}
1134-
/>
1135-
</li>
1136-
</ul>
1137-
))}
1138-
withoutLabelColon
1139-
invalidText
1140-
/>
1141-
<TextOutput
1142-
className={styles.actionsItem}
1143-
label=""
1144-
value={proposedActionsByType[EARLY_RESPONSE]?.map((response) => (
1145-
<TextOutput
1146-
className={styles.actionsItem}
1147-
label=""
1148-
value={response.budget}
1149-
invalidText
1150-
withoutLabelColon
1151-
/>
1152-
))}
1153-
withoutLabelColon
1154-
invalidText
1155-
/>
1156-
<div className={styles.actionsItem} />
1157-
<TextOutput
1158-
className={styles.costItem}
1159-
label=""
1160-
value={strings.priorityActionsSubTotal}
1161-
withoutLabelColon
1162-
strongValue
1163-
/>
1164-
<TextOutput
1165-
className={styles.actionsItem}
1166-
label=""
1167-
value={drefResponse?.sub_total}
1168-
withoutLabelColon
1169-
/>
1170-
<div className={styles.actionsItem} />
1171-
<TextOutput
1172-
className={styles.costItem}
1173-
label=""
1174-
value={strings.priorityActionsSurgeDeployment}
1175-
withoutLabelColon
1176-
strongValue
1177-
/>
1178-
<TextOutput
1179-
className={styles.actionsItem}
1180-
label=""
1181-
value={drefResponse?.surge_deployment_cost}
1182-
withoutLabelColon
1183-
/>
1184-
<div className={styles.actionsItem} />
1185-
<TextOutput
1186-
className={styles.costItem}
1187-
label=""
1188-
value={strings.priorityActionsIndirectCost}
1189-
withoutLabelColon
1190-
strongValue
1191-
/>
1192-
<TextOutput
1193-
className={styles.actionsItem}
1194-
label=""
1195-
value={drefResponse?.indirect_cost}
1196-
withoutLabelColon
1197-
/>
1198-
<div className={styles.actionsItem} />
1199-
<TextOutput
1200-
className={styles.costItem}
1201-
label=""
1202-
value={strings.priorityActionsTotal}
1203-
withoutLabelColon
1204-
strongValue
1205-
/>
1206-
<TextOutput
1207-
className={styles.actionsItem}
1208-
label=""
1209-
value={drefResponse?.total}
1210-
withoutLabelColon
1211-
/>
1212-
</Container>
1213-
</>
1113+
<TextOutput
1114+
className={styles.actionsItem}
1115+
label=""
1116+
value={strings.priorityActionsEarlyResponse}
1117+
withoutLabelColon
1118+
strongValue
1119+
/>
1120+
<TextOutput
1121+
className={styles.actionsItem}
1122+
label=""
1123+
value={proposedActionsByType[EARLY_RESPONSE]?.map((response) => (
1124+
<ul key={response.id}>
1125+
<li>
1126+
<SelectOutput
1127+
className={styles.actionsItem}
1128+
options={activityOptionResponse}
1129+
label={undefined}
1130+
labelSelector={activityLabelSelector}
1131+
keySelector={activityKeySelector}
1132+
value={response?.activity}
1133+
/>
1134+
</li>
1135+
</ul>
1136+
))}
1137+
withoutLabelColon
1138+
invalidText
1139+
/>
1140+
<TextOutput
1141+
className={styles.actionsItem}
1142+
label=""
1143+
value={proposedActionsByType[EARLY_RESPONSE]?.map((response) => (
1144+
<TextOutput
1145+
className={styles.actionsItem}
1146+
label=""
1147+
value={response.budget}
1148+
invalidText
1149+
withoutLabelColon
1150+
/>
1151+
))}
1152+
withoutLabelColon
1153+
invalidText
1154+
/>
1155+
<div className={styles.actionsItem} />
1156+
<TextOutput
1157+
className={styles.costItem}
1158+
label=""
1159+
value={strings.priorityActionsSubTotal}
1160+
withoutLabelColon
1161+
strongValue
1162+
/>
1163+
<TextOutput
1164+
className={styles.actionsItem}
1165+
label=""
1166+
value={drefResponse?.sub_total}
1167+
withoutLabelColon
1168+
/>
1169+
<div className={styles.actionsItem} />
1170+
<TextOutput
1171+
className={styles.costItem}
1172+
label=""
1173+
value={strings.priorityActionsSurgeDeployment}
1174+
withoutLabelColon
1175+
strongValue
1176+
/>
1177+
<TextOutput
1178+
className={styles.actionsItem}
1179+
label=""
1180+
value={drefResponse?.surge_deployment_cost}
1181+
withoutLabelColon
1182+
/>
1183+
<div className={styles.actionsItem} />
1184+
<TextOutput
1185+
className={styles.costItem}
1186+
label=""
1187+
value={strings.priorityActionsIndirectCost}
1188+
withoutLabelColon
1189+
strongValue
1190+
/>
1191+
<TextOutput
1192+
className={styles.actionsItem}
1193+
label=""
1194+
value={drefResponse?.indirect_cost}
1195+
withoutLabelColon
1196+
/>
1197+
<div className={styles.actionsItem} />
1198+
<TextOutput
1199+
className={styles.costItem}
1200+
label=""
1201+
value={strings.priorityActionsTotal}
1202+
withoutLabelColon
1203+
strongValue
1204+
/>
1205+
<TextOutput
1206+
className={styles.actionsItem}
1207+
label=""
1208+
value={drefResponse?.total}
1209+
withoutLabelColon
1210+
/>
1211+
</Container>
12141212
)}
12151213
<Container
12161214
heading={strings.targetPopulationSectionHeading}

app/src/views/DrefApplicationForm/schema.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
DISASTER_FLOOD,
3030
INDIRECT_COST,
3131
SUB_TOTAL,
32+
SURGE_DEPLOYMENT_COST,
3233
SURGE_INDIRECT_COST,
3334
TYPE_ASSESSMENT,
3435
TYPE_IMMINENT,
@@ -811,7 +812,13 @@ const schema: DrefFormSchema = {
811812
(value) => {
812813
if (value?.is_surge_personnel_deployed) {
813814
return {
814-
surge_deployment_cost: { required: true },
815+
surge_deployment_cost: {
816+
required: true,
817+
validations: [
818+
positiveIntegerCondition,
819+
lessThanOrEqualToCondition(SURGE_DEPLOYMENT_COST),
820+
],
821+
},
815822
indirect_cost: {
816823
required: true,
817824
validations: [

0 commit comments

Comments
 (0)