[x] Show tabs if subnational version tab is required. (Tab appears if some org unit children has assigned snakebite subnational dataset)
[x] Refactor to move the sheetsee.js library to the common folder to share it
[x] Read subnationalDatasetId from the data store
[x] Calculate totals in subnational tab
[x] Fix head and first column with sticky
[x] Show info icon in header cell
[x] Show info icon in section -DE header cell
To store custom metadata we are using the data store.
It's necessary to create the snake-bite namespace with a customMetadata key in the data store and with the next structure:
{
"dataElements": {
"uidDE1": {
"totalName": "DE Text", // (if not exists the text total is shown)
"info": "Info text, it will appear next to Data element text", //(if not exists the info icon is not visible)
},
....
},
"optionCombos": {
"uidCatOptionCombo1": {
"name": "CatOptionCombo text", // (if not exists the CatOptionCombo name is shown)
"info": "Info text, it will appear next to CatOptionCombo header text", // (if not exists the info icon is not visible),
"order": 2 //(order into DE row, if not exist 0 is asigned)
},
...
},
"subnationalDataSet": "SAV16xEdCZW" // (data set uid used by subnational tab)
}
Important: The subnational data set must be assigned to correct org units
To generate Snakebite custom form is necessary changes in metadata:
Create sections in the snakebite data set
Rename formName in the data elements
Create snakebite subnational
Create sections in the data set
Create data store namespace and key according to structure design
:art: Screenshots
National tab
Subnational tab
:fire: Is there anything the reviewer should know to test it?
To generate the custom form:
cd /HEP-data-entry
yarn build
node lib/cli.js --url='http://user:pwd!@dhisUrl' --dataset-id='XBgvNrxpcDC' --module='snakebite'
Important: the command uploads all data set to the server.
Important: Sometimes to generate the custom form, age category options are duplicated in data elements. I think this is an API bug.
:pushpin: References
https://app.clickup.com/t/buyc7q
:memo: Implementation
To store custom metadata we are using the data store.
It's necessary to create the snake-bite namespace with a customMetadata key in the data store and with the next structure:
Important: The subnational data set must be assigned to correct org units
Example used in development content in this json: customMetadata.json.zip
To generate Snakebite custom form is necessary changes in metadata:
:art: Screenshots
National tab
Subnational tab
:fire: Is there anything the reviewer should know to test it?
To generate the custom form:
Important: the command uploads all data set to the server. Important: Sometimes to generate the custom form, age category options are duplicated in data elements. I think this is an API bug.
:bookmark_tabs: Others