Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/src/views/SimplifiedEapForm/Approaches/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Approaches() {
return (
<>
This is Approaches Page.
</>
);
}

export default Approaches;
20 changes: 20 additions & 0 deletions app/src/views/SimplifiedEapForm/DeliverBudget/i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"namespace": "simplifiedEapForm",
"strings": {
"simplifiedEapDeliverHeading": "Risk Analysis",
"simplifiedEapDeliverEarlyActions": "Experience and/or capacity to implement the early actions",
"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?",
"simplifiedEapDeliverDescription": "Description",
"simplifiedEapDeliverInvolved": "RCRC Movement partners, Governmental/other agencies consulted/involved",
"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.",
"simplifiedEapDeliverBudget": "Budget",
"simplifiedEapDeliverTotalBudget": "Total budget",
"simplifiedEapDeliverTotalBudgetDescription": "Add the expected budget amount",
"simplifiedEapDeliverBudgetLabel": "Budget",
"simplifiedEapDeliverReadinessLabel": "Readiness",
"simplifiedEapDeliverPrepositioning": "Prepositioning",
"simplifiedEapDeliverBudgetDetails": "Budget details",
"simplifiedEapDeliverBudgetDetailsDescription": "Add here the page from the budget template called EAP for publication.",
"simplifiedEapEarlyAction": "Early Action"
}
}
135 changes: 135 additions & 0 deletions app/src/views/SimplifiedEapForm/DeliverBudget/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
import {
Container,
Heading,
InputSection,
NumberInput,
TextArea,
} from '@ifrc-go/ui';
import { useTranslation } from '@ifrc-go/ui/hooks';
import {
type EntriesAsList,
type Error,
getErrorObject,
} from '@togglecorp/toggle-form';

import ImageWithCaptionInput from '#components/domain/ImageWithCaptionInput';

import { type FormType } from '../schema';

import i18n from './i18n.json';

interface Props {
value: FormType;
setFieldValue: (...entries: EntriesAsList<FormType>) => void;
error: Error<FormType> | undefined;
disabled?: boolean;
}

function Deliver(props: Props) {
const {
value,
setFieldValue,
error: formError,
disabled,
} = props;

const strings = useTranslation(i18n);
const error = getErrorObject(formError);

return (
<Container
heading={strings.simplifiedEapDeliverHeading}
>
<InputSection
title={strings.simplifiedEapDeliverEarlyActions}
description={strings.simplifiedEapDeliverEarlyActionsDescription}
withAsteriskOnTitle
>
<TextArea
label={strings.simplifiedEapDeliverDescription}
name="capacity_early_action"
value={value?.capacity_early_action}
onChange={setFieldValue}
error={error?.capacity_early_action}
disabled={disabled}
/>
</InputSection>
<InputSection
title={strings.simplifiedEapDeliverInvolved}
description={strings.simplifiedEapDeliverInvolvedDescription}
withAsteriskOnTitle
>
<TextArea
label={strings.simplifiedEapDeliverDescription}
name="rcrc_partners"
value={value?.rcrc_partners}
onChange={setFieldValue}
error={error?.rcrc_partners}
disabled={disabled}
/>
</InputSection>
<Heading level={4}>
{strings.simplifiedEapDeliverBudget}
</Heading>
<InputSection
title={strings.simplifiedEapDeliverTotalBudget}
description={strings.simplifiedEapDeliverTotalBudgetDescription}
withAsteriskOnTitle
numPreferredColumns={4}
>
<NumberInput
name="budget"
value={value?.budget}
onChange={setFieldValue}
error={error?.budget}
disabled={disabled}
label={strings.simplifiedEapDeliverBudgetLabel}
/>
<NumberInput
label={strings.simplifiedEapDeliverReadinessLabel}
name="readiness"
value={value?.readiness}
onChange={setFieldValue}
error={error?.readiness}
disabled={disabled}
/>
<NumberInput
label={strings.simplifiedEapDeliverPrepositioning}
name="prepositioning"
value={value?.prepositioning}
onChange={setFieldValue}
error={error?.prepositioning}
disabled={disabled}
/>
<NumberInput
label={strings.simplifiedEapEarlyAction}
name="early_action"
value={value?.early_action}
onChange={setFieldValue}
error={error?.early_action}
disabled={disabled}
/>
</InputSection>
<InputSection
title={strings.simplifiedEapDeliverBudgetDetails}
description={strings.simplifiedEapDeliverBudgetDetailsDescription}
withAsteriskOnTitle
>
<ImageWithCaptionInput
name="cover_image_file"
// FIXME: Add eap url
url="/api/v2/dref-files/"
value={undefined}
onChange={() => {}}
error={undefined}
fileIdToUrlMap={[]}
setFileIdToUrlMap={undefined}
label="Upload"
disabled={disabled}
/>
</InputSection>
</Container>
);
}

export default Deliver;
24 changes: 24 additions & 0 deletions app/src/views/SimplifiedEapForm/EarlyAction/i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"namespace": "simplifiedEapForm",
"strings": {
"simplifiedEapActionHeading": "Early Action Intervention",
"simplifiedEapIntervention": "Overall objective of the intervention",
"simplifiedEapInterventionDescription": "Provide an objective statement that describes the main goal of the intervention.",
"simplifiedEapActionDescription": "Description",
"simplifiedEapActionPeopleTargeted": "People targeted",
"simplifiedEapActionPeopleTargetedDescription": "Add the number of people targeted for the event.",
"simplifiedEapActionOperation": "Assisted through the operation",
"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)",
"simplifiedEapActionCriteria": "Explain your selection criteria for who will be targeted.",
"simplifiedEapActionsStatement": "Trigger(s) statement",
"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.",
"simplifiedEapActionsLeadTime": "sEAP Lead Time",
"simplifiedEapActionsLeadTimeDescription": "This is the time between the trigger being met and the impact of the hazard, when the early actions are undertaken.",
"simplifiedEapActionsOperational": "Operational Timeframe",
"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.",
"simplifiedEapJustification": "Trigger threshold justification",
"simplifiedEapJustificationDescription": "Explain how the triggers(s) were set and provide information showing that the level chosen has caused humanitarian impact in the past.",
"simplifiedEapFullEap": "Next step towards full EAP",
"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."
}
}
173 changes: 173 additions & 0 deletions app/src/views/SimplifiedEapForm/EarlyAction/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
import {
Container,
InputSection,
TextArea,
TextInput,
} from '@ifrc-go/ui';
import { useTranslation } from '@ifrc-go/ui/hooks';
import {
type EntriesAsList,
type Error,
getErrorObject,
} from '@togglecorp/toggle-form';

import { type FormType } from '../schema';

import i18n from './i18n.json';

interface Props {
value: FormType;
setFieldValue: (...entries: EntriesAsList<FormType>) => void;
error: Error<FormType> | undefined;
disabled?: boolean;
}

function EarlyAction(props: Props) {
const {
value,
setFieldValue,
error: formError,
disabled,
} = props;

const strings = useTranslation(i18n);
const error = getErrorObject(formError);

return (
<Container
heading={strings.simplifiedEapActionHeading}
>
<InputSection
title={strings.simplifiedEapIntervention}
description={strings.simplifiedEapInterventionDescription}
withAsteriskOnTitle
>
<TextArea
label={strings.simplifiedEapActionDescription}
name="interventation"
value={value?.interventation}
onChange={setFieldValue}
error={undefined}
disabled={disabled}
/>
</InputSection>
{/* TODO: Add new component */}
<InputSection
title={strings.simplifiedEapActionPeopleTargeted}
description={strings.simplifiedEapActionPeopleTargetedDescription}
withAsteriskOnTitle
numPreferredColumns={2}
>
<TextInput
label={strings.simplifiedEapActionDescription}
name="people_targeted"
value={value?.people_targeted}
onChange={setFieldValue}
error={error?.people_targeted}
disabled={disabled}
/>
</InputSection>
<InputSection
title={strings.simplifiedEapActionOperation}
description={strings.simplifiedEapActionOperationDescription}
withAsteriskOnTitle
>
<TextArea
label={strings.simplifiedEapActionDescription}
name="assisted_operation"
value={value?.assisted_operation}
onChange={setFieldValue}
error={error?.assisted_operation}
disabled={disabled}
/>
</InputSection>
<InputSection
description={strings.simplifiedEapActionCriteria}
withAsteriskOnTitle
>
<TextArea
label={strings.simplifiedEapActionDescription}
name="targeted_criteria"
value={value?.targeted_criteria}
onChange={setFieldValue}
error={error?.targeted_criteria}
disabled={disabled}
/>
</InputSection>
<InputSection
title={strings.simplifiedEapActionsStatement}
description={strings.simplifiedEapActionsStatementDescription}
withAsteriskOnTitle
>
<TextArea
label={strings.simplifiedEapActionDescription}
name="trigger_statement"
value={value?.trigger_statement}
onChange={setFieldValue}
error={error?.trigger_statement}
disabled={disabled}
/>
</InputSection>
<InputSection
title={strings.simplifiedEapActionsLeadTime}
description={strings.simplifiedEapActionsLeadTimeDescription}
withAsteriskOnTitle
numPreferredColumns={2}
>
<TextInput
label={strings.simplifiedEapActionDescription}
name="simplified_eap_lead_time"
value={value?.simplified_eap_lead_time}
onChange={setFieldValue}
error={error?.simplified_eap_lead_time}
disabled={disabled}
/>
</InputSection>
<InputSection
title={strings.simplifiedEapActionsOperational}
description={strings.simplifiedEapActionsOperationalDescription}
withAsteriskOnTitle
numPreferredColumns={2}
>
<TextInput
label={strings.simplifiedEapActionDescription}
name="operation_timeframe"
value={value?.operation_timeframe}
onChange={setFieldValue}
error={error?.operation_timeframe}
disabled={disabled}
/>
</InputSection>
<InputSection
title={strings.simplifiedEapJustification}
description={strings.simplifiedEapJustificationDescription}
withAsteriskOnTitle
>
<TextArea
label={strings.simplifiedEapActionDescription}
name="trigger_threshold"
value={value?.trigger_threshold}
onChange={setFieldValue}
error={error?.trigger_threshold}
disabled={disabled}
/>
</InputSection>
<InputSection
title={strings.simplifiedEapFullEap}
description={strings.simplifiedEapFullEapDescription}
withAsteriskOnTitle
>
<TextArea
label={strings.simplifiedEapActionDescription}
name="full_eap"
value={value?.full_eap}
onChange={setFieldValue}
error={error?.full_eap}
disabled={disabled}
/>
</InputSection>
</Container>
);
}

export default EarlyAction;
Loading
Loading