Closed ghachey closed 2 years ago
Feedback:
1) Works for MIEMIS (RMI) but not for FedEMIS (FSM)
This problem still exists as of version 01.10.21
This problem still exists as of version 02.11.21
Same thing as issue 15 : At the moment we are working on the fix. The issue is reproduced when user updates the version from an old one (released in June or before) to the newest. It can be solved for now by updating either RemoteSettings (Force fetch remote settings button) or context. Issue is not reproduced if it's the first app launch.
This can be considered fixed.
In anticipation of a school list that will need to change over time we need a better way to get the list of schools. The app shall add the ability to get/update the list of updated schools from the EMIS API with the configured context (e.g. FEDEMIS, MIEMIS, etc.). We keep the ability to load the list of schools has it currently does by loading the CSV file. But we add the ability to update it by getting list from the EMIS API.
The below highlighted in yellow remains untouched and continues to work as it does. Simply rename from Import schools to "Import schools from CSV". And below "Import schools from CSV" you add a new button "Update schools from $EMIS API" where $EMIS displayed is actually the context (settings just above).
This new "Update schools from $EMIS API" button simply triggers a REST API call to /api/schools (exact API URL will be provided soon). The data returned should be a JSON like this.
The data returned from the "Update schools from $EMIS API" call shall always completely replace the hard coded "Import schools from CSV" list of schools.
When setting up a new tablet and selecting the context the settings are fetched from Firebug. At that point the "Update schools from $EMIS API" should be executed in the background. If it works, then it replaces the schools. Otherwise it defaults to the CSV list.
An admin user should always be able to go in the settings and also force the "Update schools from $EMIS API".