Skip to content

Commit 5676827

Browse files
committed
eap(simplified-overview-form): Add Simplified overview Form
1 parent 8792615 commit 5676827

File tree

14 files changed

+1257
-21
lines changed

14 files changed

+1257
-21
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"namespace": "simplifiedEapForm",
3+
"strings": {
4+
"simplifiedEapDeliverHeading": "Risk Analysis",
5+
"simplifiedEapDeliverEarlyActions": "Experience and/or capacity to implement the early actions",
6+
"simplifiedEapDeliverEarlyActionsDescription": "Assumptions or minimum conditions needed to deliver on the early actions (including issues to be resolved.) Explain how the National Society will be able to delive on the early actions, what experiences and/or capacities they have related to be intervention. Are there issues to be addressed in order for the Naional Society to deliver on these actions? How will these issues be resolved?",
7+
"simplifiedEapDeliverDescription": "Description",
8+
"simplifiedEapDeliverInvolved": "RCRC Movement partners, Governmental/other agencies consulted/involved",
9+
"simplifiedEapDeliverInvolvedDescription": "Explain who was part of the development of this plan, how were they involved and if they have any role on the implementation of the actions. Add any relevant information of the National Society's role on the National Disaster Response System.",
10+
"simplifiedEapDeliverBudget": "Budget",
11+
"simplifiedEapDeliverTotalBudget": "Total budget",
12+
"simplifiedEapDeliverTotalBudgetDescription": "Add the expected budget amount",
13+
"simplifiedEapDeliverBudgetLabel": "Budget",
14+
"simplifiedEapDeliverReadinessLabel": "Readiness",
15+
"simplifiedEapDeliverPrepositioning": "Prepositioning",
16+
"simplifiedEapDeliverBudgetDetails": "Budget details",
17+
"simplifiedEapDeliverBudgetDetailsDescription": "Add here the page from the budget template called EAP for publication.",
18+
"simplifiedEapEarlyAction": "Early Action"
19+
}
20+
}

app/src/views/SimplifiedEapForm/DeliverBudget/index.tsx

Lines changed: 130 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,134 @@
1-
function Deliver() {
1+
import {
2+
Container,
3+
Heading,
4+
InputSection,
5+
NumberInput,
6+
TextArea,
7+
} from '@ifrc-go/ui';
8+
import { useTranslation } from '@ifrc-go/ui/hooks';
9+
import {
10+
type EntriesAsList,
11+
type Error,
12+
getErrorObject,
13+
} from '@togglecorp/toggle-form';
14+
15+
import ImageWithCaptionInput from '#components/domain/ImageWithCaptionInput';
16+
17+
import { type FormType } from '../schema';
18+
19+
import i18n from './i18n.json';
20+
21+
interface Props {
22+
value: FormType;
23+
setFieldValue: (...entries: EntriesAsList<FormType>) => void;
24+
error: Error<FormType> | undefined;
25+
disabled?: boolean;
26+
}
27+
28+
function Deliver(props: Props) {
29+
const {
30+
value,
31+
setFieldValue,
32+
error: formError,
33+
disabled,
34+
} = props;
35+
36+
const strings = useTranslation(i18n);
37+
const error = getErrorObject(formError);
38+
239
return (
3-
<>
4-
This is Deliver Page.
5-
</>
40+
<Container
41+
heading={strings.simplifiedEapDeliverHeading}
42+
>
43+
<InputSection
44+
title={strings.simplifiedEapDeliverEarlyActions}
45+
description={strings.simplifiedEapDeliverEarlyActionsDescription}
46+
withAsteriskOnTitle
47+
>
48+
<TextArea
49+
label={strings.simplifiedEapDeliverDescription}
50+
name="capacity_early_action"
51+
value={value?.capacity_early_action}
52+
onChange={setFieldValue}
53+
error={error?.capacity_early_action}
54+
disabled={disabled}
55+
/>
56+
</InputSection>
57+
<InputSection
58+
title={strings.simplifiedEapDeliverInvolved}
59+
description={strings.simplifiedEapDeliverInvolvedDescription}
60+
withAsteriskOnTitle
61+
>
62+
<TextArea
63+
label={strings.simplifiedEapDeliverDescription}
64+
name="rcrc_partners"
65+
value={value?.rcrc_partners}
66+
onChange={setFieldValue}
67+
error={error?.rcrc_partners}
68+
disabled={disabled}
69+
/>
70+
</InputSection>
71+
<Heading level={4}>
72+
{strings.simplifiedEapDeliverBudget}
73+
</Heading>
74+
<InputSection
75+
title={strings.simplifiedEapDeliverTotalBudget}
76+
description={strings.simplifiedEapDeliverTotalBudgetDescription}
77+
withAsteriskOnTitle
78+
numPreferredColumns={4}
79+
>
80+
<NumberInput
81+
name="budget"
82+
value={value?.budget}
83+
onChange={setFieldValue}
84+
error={error?.budget}
85+
disabled={disabled}
86+
label={strings.simplifiedEapDeliverBudgetLabel}
87+
/>
88+
<NumberInput
89+
label={strings.simplifiedEapDeliverReadinessLabel}
90+
name="readiness"
91+
value={value?.readiness}
92+
onChange={setFieldValue}
93+
error={error?.readiness}
94+
disabled={disabled}
95+
/>
96+
<NumberInput
97+
label={strings.simplifiedEapDeliverPrepositioning}
98+
name="prepositioning"
99+
value={value?.prepositioning}
100+
onChange={setFieldValue}
101+
error={error?.prepositioning}
102+
disabled={disabled}
103+
/>
104+
<NumberInput
105+
label={strings.simplifiedEapEarlyAction}
106+
name="early_action"
107+
value={value?.early_action}
108+
onChange={setFieldValue}
109+
error={error?.early_action}
110+
disabled={disabled}
111+
/>
112+
</InputSection>
113+
<InputSection
114+
title={strings.simplifiedEapDeliverBudgetDetails}
115+
description={strings.simplifiedEapDeliverBudgetDetailsDescription}
116+
withAsteriskOnTitle
117+
>
118+
<ImageWithCaptionInput
119+
name="cover_image_file"
120+
// FIXME: Add eap url
121+
url="/api/v2/dref-files/"
122+
value={undefined}
123+
onChange={() => {}}
124+
error={undefined}
125+
fileIdToUrlMap={[]}
126+
setFileIdToUrlMap={undefined}
127+
label="Upload"
128+
disabled={disabled}
129+
/>
130+
</InputSection>
131+
</Container>
6132
);
7133
}
8134

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"namespace": "simplifiedEapForm",
3+
"strings": {
4+
"simplifiedEapActionHeading": "Early Action Intervention",
5+
"simplifiedEapIntervention": "Overall objective of the intervention",
6+
"simplifiedEapInterventionDescription": "Provide an objective statement that describes the main goal of the intervention.",
7+
"simplifiedEapActionDescription": "Description",
8+
"simplifiedEapActionPeopleTargeted": "People targeted",
9+
"simplifiedEapActionPeopleTargetedDescription": "Add the number of people targeted for the event.",
10+
"simplifiedEapActionOperation": "Assisted through the operation",
11+
"simplifiedEapActionOperationDescription": "List who will be targeted by the early actions in this simplified EAP (these should be groups of people who are most exposed combined with those moose vulnerable to the impacts of the hazard)",
12+
"simplifiedEapActionCriteria": "Explain your selection criteria for who will be targeted.",
13+
"simplifiedEapActionsStatement": "Trigger(s) statement",
14+
"simplifiedEapActionsStatementDescription": "State clear and precise criteria that will have to be met for the simplified EAP to be activated. If multiple triggers are used, indicate which trigger is linked to which early action.",
15+
"simplifiedEapActionsLeadTime": "sEAP Lead Time",
16+
"simplifiedEapActionsLeadTimeDescription": "This is the time between the trigger being met and the impact of the hazard, when the early actions are undertaken.",
17+
"simplifiedEapActionsOperational": "Operational Timeframe",
18+
"simplifiedEapActionsOperationalDescription": "The operational timeframe starts from the trigger date and includes the time it takes to implement the early action activities plus the time it takes to finalize the operation, including time to settle the finances, facilities the lessons learned workshop and prepare the final report.",
19+
"simplifiedEapJustification": "Trigger threshold justification",
20+
"simplifiedEapJustificationDescription": "Explain how the triggers(s) were set and provide information showing that the level chosen has caused humanitarian impact in the past.",
21+
"simplifiedEapFullEap": "Next step towards full EAP",
22+
"simplifiedEapFullEapDescription": "For National Societies that intend to develop a full EAP, outline the next steps you will be taking to continue developing this simplified EAP into a full EAP."
23+
}
24+
}

app/src/views/SimplifiedEapForm/EarlyAction/index.tsx

Lines changed: 168 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,172 @@
1-
function EarlyAction() {
1+
import {
2+
Container,
3+
InputSection,
4+
TextArea,
5+
TextInput,
6+
} from '@ifrc-go/ui';
7+
import { useTranslation } from '@ifrc-go/ui/hooks';
8+
import {
9+
type EntriesAsList,
10+
type Error,
11+
getErrorObject,
12+
} from '@togglecorp/toggle-form';
13+
14+
import { type FormType } from '../schema';
15+
16+
import i18n from './i18n.json';
17+
18+
interface Props {
19+
value: FormType;
20+
setFieldValue: (...entries: EntriesAsList<FormType>) => void;
21+
error: Error<FormType> | undefined;
22+
disabled?: boolean;
23+
}
24+
25+
function EarlyAction(props: Props) {
26+
const {
27+
value,
28+
setFieldValue,
29+
error: formError,
30+
disabled,
31+
} = props;
32+
33+
const strings = useTranslation(i18n);
34+
const error = getErrorObject(formError);
35+
236
return (
3-
<>
4-
This is Early Action Page.
5-
</>
37+
<Container
38+
heading={strings.simplifiedEapActionHeading}
39+
>
40+
<InputSection
41+
title={strings.simplifiedEapIntervention}
42+
description={strings.simplifiedEapInterventionDescription}
43+
withAsteriskOnTitle
44+
>
45+
<TextArea
46+
label={strings.simplifiedEapActionDescription}
47+
name="interventation"
48+
value={value?.interventation}
49+
onChange={setFieldValue}
50+
error={undefined}
51+
disabled={disabled}
52+
/>
53+
</InputSection>
54+
{/* TODO: Add new component */}
55+
<InputSection
56+
title={strings.simplifiedEapActionPeopleTargeted}
57+
description={strings.simplifiedEapActionPeopleTargetedDescription}
58+
withAsteriskOnTitle
59+
numPreferredColumns={2}
60+
>
61+
<TextInput
62+
label={strings.simplifiedEapActionDescription}
63+
name="people_targeted"
64+
value={value?.people_targeted}
65+
onChange={setFieldValue}
66+
error={error?.people_targeted}
67+
disabled={disabled}
68+
/>
69+
</InputSection>
70+
<InputSection
71+
title={strings.simplifiedEapActionOperation}
72+
description={strings.simplifiedEapActionOperationDescription}
73+
withAsteriskOnTitle
74+
>
75+
<TextArea
76+
label={strings.simplifiedEapActionDescription}
77+
name="assisted_operation"
78+
value={value?.assisted_operation}
79+
onChange={setFieldValue}
80+
error={error?.assisted_operation}
81+
disabled={disabled}
82+
/>
83+
</InputSection>
84+
<InputSection
85+
description={strings.simplifiedEapActionCriteria}
86+
withAsteriskOnTitle
87+
>
88+
<TextArea
89+
label={strings.simplifiedEapActionDescription}
90+
name="targeted_criteria"
91+
value={value?.targeted_criteria}
92+
onChange={setFieldValue}
93+
error={error?.targeted_criteria}
94+
disabled={disabled}
95+
/>
96+
</InputSection>
97+
<InputSection
98+
title={strings.simplifiedEapActionsStatement}
99+
description={strings.simplifiedEapActionsStatementDescription}
100+
withAsteriskOnTitle
101+
>
102+
<TextArea
103+
label={strings.simplifiedEapActionDescription}
104+
name="trigger_statement"
105+
value={value?.trigger_statement}
106+
onChange={setFieldValue}
107+
error={error?.trigger_statement}
108+
disabled={disabled}
109+
/>
110+
</InputSection>
111+
<InputSection
112+
title={strings.simplifiedEapActionsLeadTime}
113+
description={strings.simplifiedEapActionsLeadTimeDescription}
114+
withAsteriskOnTitle
115+
numPreferredColumns={2}
116+
>
117+
<TextInput
118+
label={strings.simplifiedEapActionDescription}
119+
name="simplified_eap_lead_time"
120+
value={value?.simplified_eap_lead_time}
121+
onChange={setFieldValue}
122+
error={error?.simplified_eap_lead_time}
123+
disabled={disabled}
124+
/>
125+
</InputSection>
126+
<InputSection
127+
title={strings.simplifiedEapActionsOperational}
128+
description={strings.simplifiedEapActionsOperationalDescription}
129+
withAsteriskOnTitle
130+
numPreferredColumns={2}
131+
>
132+
<TextInput
133+
label={strings.simplifiedEapActionDescription}
134+
name="operation_timeframe"
135+
value={value?.operation_timeframe}
136+
onChange={setFieldValue}
137+
error={error?.operation_timeframe}
138+
disabled={disabled}
139+
/>
140+
</InputSection>
141+
<InputSection
142+
title={strings.simplifiedEapJustification}
143+
description={strings.simplifiedEapJustificationDescription}
144+
withAsteriskOnTitle
145+
>
146+
<TextArea
147+
label={strings.simplifiedEapActionDescription}
148+
name="trigger_threshold"
149+
value={value?.trigger_threshold}
150+
onChange={setFieldValue}
151+
error={error?.trigger_threshold}
152+
disabled={disabled}
153+
/>
154+
</InputSection>
155+
<InputSection
156+
title={strings.simplifiedEapFullEap}
157+
description={strings.simplifiedEapFullEapDescription}
158+
withAsteriskOnTitle
159+
>
160+
<TextArea
161+
label={strings.simplifiedEapActionDescription}
162+
name="full_eap"
163+
value={value?.full_eap}
164+
onChange={setFieldValue}
165+
error={error?.full_eap}
166+
disabled={disabled}
167+
/>
168+
</InputSection>
169+
</Container>
6170
);
7171
}
8172

0 commit comments

Comments
 (0)