medic / cht-conf

A command-line interface for configuring Community Health Toolkit applications
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
22 stars 25 forks source link

Upload forms with correct format in the internalID property #537

Open latin-panda opened 1 year ago

latin-panda commented 1 year ago

Describe the issue It's possible to upload a form without the prefix in its internalId:

To reproduce:

  1. Create an xls form with some questions.
  2. In xls file's settings sheet, add my_new_form in the form_id column.
  3. Convert and upload the form using cht-conf.
  4. Find the form in CouchDB.
  5. Note that internalId doesn't have the prefix.

Additional information Keep in mind that a form's properties.json file can override the internalId property in the form's CouchDB document. This still should have the correct prefix for the form type. Example:

// my_first_onboarding.properties.json
{
  "title": "",
  "internalId": "training:my_first_onboarding",
  "context": {
    "start_date": "2023-02-22",
    "duration": 60,
    "user_roles": [ "chw" ]
  }
}

Describe alternatives you've considered