Closed frozenhelium closed 3 years ago
Available for testing on: https://ifrc-go-feature-new-field-report-form.surge.sh/reports/new
@frozenhelium this is some really amazing work here.
@karitotp - would you be able to spend some time testing https://ifrc-go-feature-new-field-report-form.surge.sh/reports/new to create field reports, and verify that all the information on the created field report is correct? Will be good to try a few combinations of things, there likely will be minor issues.
@karitotp to note: @frozenhelium is working on fixing the visual / CSS issues to make it look like the previous form, but it will be great if you can test the functionality, the validation, saving, etc. Thanks!
@frozenhelium this one is a bit tricky:
The two fields Government Requires International Assistance and National Society Requests International Assistance need to be unselected by default and allow the user to provide a null
response - i.e. choose neither Yes nor No. This is a bit weird the way it works currently, but I believe we need this functionality. We can also discuss in the group, but just noting down as a change of behaviour from the existing form.
@frozenhelium @batpad, here my findings testing the creation of different Field Reports
In a event related to Covid, in situation tab, should the Source of figures and Date of data be required fields when the numeric fields is filled? If so, the validation of required fields is not working here.
When a FR is created, these fields are not displayed on the FR page. It seems that the imputs have not been saved, because when the FR is edited, those fields appear clean too.
In a FR no related to covid and a FR of Early Warning also there are numbers that are not been displayed.
@karitotp Thanks a million for testing these out. I've just pushed fixes for all of the issues mentioned above except the following one:
- In a event related to Covid, in situation tab, should the Source of figures and Date of data be required fields when the numeric fields is filled? If so, the validation of required fields is not working here.
Could you please take a look at it again? Thanks again!
@frozenhelium, all the above things is working good now :+1:
Status
is Early Warning / Early Action
COVID-19 Related Event
is Yes
Disaster type
is Epidemic
Status
is Event
COV
is subtype of EPI
and EPI
is subtype of EVT
Risk Analysis
will appear for EW
reports
Situation
will appear for other report types (EVT, EPI, COV
)
Early Action
will appear for report type EW
Action
will appear for other typesEPI
type report doesn't show intended fields for the Step2: SituationDisaster type
than the Epidemic
can be selected for COV
type of report along with the Early Warning / Early Action
as Status
which breaks the form when we proceed to Step2COV
type initially breaks the Step3: Action when we switch the report to EPI
(i.e. set COVID-19 Related Event
to No
)Check if the new system (Test server) matches closely with old system (Staging server). The known issues, mentioned above, should also be fixed
Check if the above mentioned logic, steps for the form is functional
Some of the labels, description of the fields change according to value of some other field (For example: In Step1: Context, date field has different label and description when disaster type is epidemic)
Epidemic
Epidemic
Some fields become conditionally required depending on the value of some other field (For example: As shown in the figure below, estimation becomes required when source is filled or vice-versa)
Some fields become conditionally optional when other field is filled. For example: In Step1: Context, Title
becomes optional when we link the report to an existing emergency.
When changing from Epidemic type of Event to EW/EA and back to Event, then a error message indicates the missing Disaster type. Disaster type should be cleared, but without error message. Error message should only appear when user tries to step to the next page.
@karitotp could you give this another test, based on @frozenhelium's comment above?
@batpad , all is working as @frozenhelium's comments and the field required message when a epidemic report is changed to Early warning reported by @tovari is still there.
@frozenhelium, here is a text duplication on Action tab, only 'Information Bulletin' should appear in bold text in the first line:
@frozenhelium, noticed that some of the field values are not saved: Situation tab:
When changing from Epidemic type of Event to EW/EA and back to Event, then a error message indicates the missing Disaster type. Disaster type should be cleared, but without error message. Error message should only appear when user tries to step to the next page.
@tovari This is expected behaviour (i.e. we set the validation to immediately trigger). This behaviour is consistent with other places as well, where the validation is immediately triggered when related fields are changed. Let me know if we should change this behaviour.
@karitotp could you do one final test of the Field Report form functionality that everything looks good after all the latest changes?
Some feedback from the UAT regarding Field Reports:
@batpad this is what I found
@anamariaescobar Thanks for the catch. I've fixed the "No" not being showed for the "International assistance requested". For the Epidemic FR actions taken by the IFRC, it appears different in the staging because it's loaded from the API. It'll be same as other 2 when it goes to production. I verified this in my local setup using the prod API.
Is your feature request related to a problem? Please describe. Most of the Field Report Form code is obsolete. It uses method of coding that was used few years ago. Since then, React itself has updated a lot and has introduced better and easier way, which allows better, cleaner and less error-prone coding. If the Field Report Form is left as-is, It would be a bit difficult and time consuming to add features or modify.
Describe the solution you'd like Refactor the Field Report Form to use better code, form validation