Feature/eap full form#2122
Conversation
|
d10a0db to
5ccc1bc
Compare
0adbb63 to
c9c84d0
Compare
c9c84d0 to
a172ce2
Compare
e52c062 to
4c88096
Compare
f8aabc4 to
1cb8802
Compare
1cb8802 to
04d7790
Compare
There was a problem hiding this comment.
Do not prefix string key with namespace
There was a problem hiding this comment.
Do not prefix string key with namespace, lets remove unused keys
| function getNextStep(current: TabKeys, direction: 1 | -1) { | ||
| if (direction === 1) { | ||
| const mapping: { [key in TabKeys]?: TabKeys } = { | ||
| overview: 'riskAnalysis', | ||
| riskAnalysis: 'triggerModel', | ||
| triggerModel: 'selectionActions', | ||
| selectionActions: 'eapActivation', | ||
| eapActivation: 'meal', | ||
| meal: 'nationalSocietyCapacity', | ||
| nationalSocietyCapacity: 'financeLogistics', | ||
| }; | ||
| return mapping[current]; | ||
| } | ||
| if (direction === -1) { | ||
| const mapping: { [key in TabKeys]?: TabKeys } = { | ||
| financeLogistics: 'nationalSocietyCapacity', | ||
| nationalSocietyCapacity: 'meal', | ||
| meal: 'eapActivation', | ||
| eapActivation: 'selectionActions', | ||
| selectionActions: 'triggerModel', | ||
| triggerModel: 'riskAnalysis', | ||
| riskAnalysis: 'overview', | ||
| }; | ||
| return mapping[current]; | ||
| } | ||
| return undefined; | ||
| } |
There was a problem hiding this comment.
Create a utility function and reuse it
4c88096 to
84b47e5
Compare
1131875 to
1bdee06
Compare
| alert.show('Status updated successfully!', { variant: 'success' }); | ||
| }, | ||
| formData: true, | ||
| onFailure: () => { | ||
| alert.show('Failed to update the status!', { variant: 'danger' }); |
| <NumberInput | ||
| label={strings.financeTotalBudgetLabel} | ||
| name="total_budget" | ||
| value={value?.total_budget} |
There was a problem hiding this comment.
As value is always defined, I don't think we need a ? here
| fileIdToUrlMap={fileIdToUrlMap} | ||
| onChange={setFieldValue} | ||
| url="/api/v2/eap-file/multiple/" | ||
| value={value?.meal_relevant_files} |
|
|
||
| const strings = useTranslation(i18n); | ||
| const error = getErrorObject(formError); | ||
| const noop = () => { }; |
There was a problem hiding this comment.
Why is there here? Add note.
| onChange={setFieldValue} | ||
| disabled={disabled} | ||
| /> | ||
| </InputSection> | ||
| <InputSection | ||
| title={strings.objectiveTitle} | ||
| description={strings.objectiveDescription} | ||
| withAsteriskOnTitle | ||
| > | ||
| <TextArea | ||
| label={strings.workWithGovernmentDescriptionLabel} | ||
| name="objective" | ||
| value={value?.objective} |
There was a problem hiding this comment.
Why aren't errors handled here?
| emptyMessage={strings.noIndicatorsMessage} | ||
| > | ||
| <ListView layout="block"> | ||
| {value.indicators?.map((indicator, i) => ( |
| const selectedSectors = value?.planned_operations?.map( | ||
| ({ sector }) => sector, | ||
| ); |
| const selectedApproaches = value?.enable_approaches?.map( | ||
| ({ approach }) => approach, | ||
| ); |
| const latestFullEapId = eapDetailResponse?.full_eap_details?.toSorted( | ||
| (a, b) => compareNumber(a.version, b.version, -1), | ||
| )?.[0]?.id; |
79e1e7a to
2da8205
Compare
| [onFieldChange], | ||
| ); | ||
|
|
||
| return ( |
There was a problem hiding this comment.
Missed this comment can we do this in another PR?
There was a problem hiding this comment.
resolved this changes please check @frozenhelium


Summary
Implement of full eap form with add edit functionality
Depends On
IFRCGo/go-api#2590
Changes
This PR Ensures:
console.logstatements meant for debugging