SORMAS-Project
SORMAS-Project copied to clipboard
Allow the saving (create and edit) of events and environments without country when the hide jurisdiction related featuretype is enabled
Problem Description
With #12550 the hide jurisdiction was introduced for events and environments too.
However, there is one corner case that was not covered and events or environments that have no country selected can not be created if hide jurisdiction featuretype is enabled.
Proposed Change
Cover the mentioned corner case for events:
Prerequisite - have a default country set in your sormas properties (D:\newsormas\opt\domains\sormas)
I. Have the featuretype configuration 'hide jurisdiction fields' set to false
1. In the web app navigate to Events
2. Open the Create new event from
3. Fill in the mandatory information
4. For the location fields - in the country field you should see the default country you have on your system
5. Empty the country field
Expected behavior that is happening: The country field is empty but the BE knows that there you have your default country, the region and district fields are mandatory and need to be filled with a region and district. The only options for regions and district are those that belong to the default country you have set on your system. You can save the form.
II. Have the featuretype configuration 'hide jurisdiction fields' set to true
1. In the web app navigate to Events
2. Open the Create new event from
3. Fill in the mandatory information
4. For the location fields - in the country field you should see the default country you have on your system
5. Empty the country field
Actual behavior: The country field is empty, but you can not save your form as it requires regin and district. When hide jurisdiction feature is set to true, the region and district fields that are hidden in events basically seem to not know that the default country is there even though the country field is empty.
Expected behavior: you should be able to save that form the same way that you are able to do it when the hide jurisdiction fields is set to false.
Cover the mentioned corner case for environments:
- in creation and edit forms - if the user switches once between the initial empty value in the country field, to another value and then back to the empty value they can no longer create or edit the entity as they are requested to enter a region and district. But if the form is left in the initial state, with the initial empty value in the country field the user can save the entity.
Expected behavior - the user should be able to save the entity with the empty value in country as it should always consider the default region, district and community (if set) as default.
Added Value/Benefit
Consistency.
Acceptance Criteria
- [ ] when the hide jurisdiction featuretype is set to true, and a default country exists in the sormas.properties, and default region and district were set from that country - the user should be able to save new events or edit existing ones that have an empty value in the 'Country' field;
- [ ] maintain the rest of the current logic that was implemented with #12550 and is present on events when the hide jursdiction featurtype is set to true.
- [ ] make sure toapply the changes to the environments creation and edit forms as well - the user should be able to save the entity with the empty value in country as it should always consider the default region, district and community (if set) as default.
Implementation Details
No response
Mockups
No response
Additional Information
No response