Is your feature request related to a problem? Please describe.
To display forms in the app there is currently a manual process where a user must first upload to kobotoolbox, deploy to enketo, and then extract the generated json from the enketo website indexeddb entry. This is highly technical and not very administrator friendly.
Describe the solution you'd like
Create a UI component within the dashboard monitoring form page to upload an xlsx file.
Deploy cloud function that can convert the xlsx to xlsform
Use the function to automatically convert when a user uploads an xlsx file and update the database accordingly
To make matters more challenging, only specific python and node versions are supported, making it hard to use standard cloud function providers (e.g. firebase functions). As such the scripts need to be compiled into a docker image to be deployed to a platform like Google Cloud Run
It would be recommended that a standalone git repo be setup to handle the cloud function, based on the example code and then extended to support passing the form in a http request (instead of the example which expects to find the form stored locally).
Describe alternatives you've considered
We could try using kobotoolbox rest api to submit form xlsx files and generate enketo links, however this may be difficult to implement and would remove the availability for the dashboard to operate independent of kobotoolbox (which may be desirable for data protection reasons)
Additional context
See existing supabase file upload component at libs\shared\src\services\core\supabase\components\upload\supabase-upload.component.ts
An example xlsx file for conversion can be found in apps\picsa-server\supabase\data\storage\global\monitoring\forms\widgets.xlsx
Is your feature request related to a problem? Please describe. To display forms in the app there is currently a manual process where a user must first upload to kobotoolbox, deploy to enketo, and then extract the generated json from the enketo website indexeddb entry. This is highly technical and not very administrator friendly.
Describe the solution you'd like
The largest part of this is the creation of the cloud function. In order to convert xlsx files to the correct format there are separate scripts that must be executed in python and javascript. An example of the scripts can be found at: https://github.com/IDEMSInternational/parenting-app-ui/tree/master/packages/@idemsInternational/xlsform-converter
To make matters more challenging, only specific python and node versions are supported, making it hard to use standard cloud function providers (e.g. firebase functions). As such the scripts need to be compiled into a docker image to be deployed to a platform like Google Cloud Run
It would be recommended that a standalone git repo be setup to handle the cloud function, based on the example code and then extended to support passing the form in a http request (instead of the example which expects to find the form stored locally).
Describe alternatives you've considered We could try using kobotoolbox rest api to submit form xlsx files and generate enketo links, however this may be difficult to implement and would remove the availability for the dashboard to operate independent of kobotoolbox (which may be desirable for data protection reasons)
Additional context
libs\shared\src\services\core\supabase\components\upload\supabase-upload.component.ts
apps\picsa-server\supabase\data\storage\global\monitoring\forms\widgets.xlsx