Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#12550 - Hide jurisdiction fields when configured #12618

Merged
merged 11 commits into from
Oct 26, 2023

Conversation

MateStrysewske
Copy link
Contributor

Fixes #12550

@sormas-vitagroup
Copy link
Contributor

@sergiupacurariu
Copy link
Contributor

sergiupacurariu commented Oct 10, 2023

the server cannot be started because in the StartupShutdownService the "createConstantFacilities()" method runs before "upgrade()" method. This leads to an error as the "defaultInfrastructure" field is not created yet.

@sergiupacurariu
Copy link
Contributor

sergiupacurariu commented Oct 11, 2023

  • In the Configuration menu is not possible to check whether there is or not a default value set for an infrastructure type. It is very unpleasant to change it since the only way to do it is to find it and deselect it then go and select default a new one. The default one should be marked somehow.
  • Environment forms created and edited have to be modified the same way as for cases. Currently, the facilities available in the form are connected to the user's jurisdiction and not related to the default infrastructure set in Configuration.
  • The same changes are needed on the Environment Samples form as on the Environment forms.
  • it is possible to set default infrastructure that is not related, meaning you can choose default Region1 and default District from different regions. On case save all the Infrastructure fields on the case (region_id, district_id, community_id) will be null. Even when the default infrastructure is selected consistently (e.g. default District is from the default Region) the case is saved with empty infrastructure fields.
  • Case grid - the cases cannot be seen in the case grid. (they are available on Android). A case created on Android and synchronized can be seen on the web app both in the Case and Person grid
  • Person grid - no persons are seen in the grid despite the creation of a few cases that also have a person who should be accessible
  • Android - not sure if this was required but the jurisdiction fields are not hidden on cases

- Only regions, districts and communities can be made default
- Add parent validation to make sure that e.g. a district from another region than the default region can be set as default
- Add column to grids
@MateStrysewske
Copy link
Contributor Author

@sergiupacurariu

  • Only regions, districts and communities can be default infrastructures now
  • Added a column to those grids so users can see which is the default
  • Added validation that prevents e.g. a district being set as default when it's not in the default region

Apart from that:

  • Android doesn't need to be covered
  • Environments don't need to be covered for now; I will add a respective warning to the Wiki and release notes
  • It's also fine for now that users won't see data entered by them if they're not in the default jurisdiction, because this is not how this feature is supposed to be used

This is still pretty messy and I'd like to have it more consistent, but that would mean A LOT more effort that won't really be necessary at this point.

@sormas-vitagroup
Copy link
Contributor

@@ -3141,6 +3141,12 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
getDao(PathogenTest.class)
.executeRaw("ALTER TABLE pathogentest ADD COLUMN testedPathogen varchar(255);");

case 353:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this version needs to be updated to 354

@sergiupacurariu
Copy link
Contributor

  • on all three Region, District and Community grids - the defaultInfrastructure field is not added in the sorting properties so filtering by Default crashes the grid
  • the defaultInftrastructureCache is not populated after the default Region is saved and also when the default region is changed conducting to an error while trying to save a district from the default Region. Because of this I even managed to save a district that was from the old region which was still stored in the cache leading to a situation of having a default district from outside the default region.
  • if there is a default district and community set it is possible to remove the default district while we still have a default community (without a default district). After this, it is also possible to save a new default district that is different from the default community district.

@sormas-vitagroup
Copy link
Contributor

@sergiupacurariu
Copy link
Contributor

  • the DatabaseHelper must be updated with the latest change version
  • shouldn't we write somewhere that this feature is incompatible at this point with multiple jurisdictions and Android because on the app a user can create cases for example only with their own jurisdiction not with the default one

@MateStrysewske
Copy link
Contributor Author

@sergiupacurariu Updated DatabaseHelper. Yes, that needs to be mentioned, but since these changes are only on dev until the next release, it doesn't make sense to add these hints right now. I'll add them to the release notes and the Wiki page during the release.

@sormas-vitagroup
Copy link
Contributor

@sergiupacurariu sergiupacurariu merged commit e69439b into development Oct 26, 2023
10 of 11 checks passed
@sergiupacurariu sergiupacurariu deleted the feature-12550-hide_jurisdiction_fields branch October 26, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to hide the jurisdiction fields from cases and use default values [5]
3 participants