cht-conf icon indicating copy to clipboard operation
cht-conf copied to clipboard

Allow 'settings.inherit.json' to filter XForms

Open mukesh2006 opened this issue 6 years ago • 7 comments

When a standard project is setup, the TLs manually delete the unused forms from the instance. It would be great if we've filter option in settings.inherit.json for XForms similar to JSON forms.

Related Issue: https://github.com/medic/medic-projects/issues/4452 and https://github.com/medic/medic-conf/issues/49

cc @abbyad @shreyakb @jillrshah @alxndrsn

mukesh2006 avatar Jul 25 '18 06:07 mukesh2006

@mukesh2006 what command are you running, and from what path, to upload the inherited forms? For example given in the doc you linked, I am only getting the pregnancy form as-per what's available in the git repo at forms/app for that project.

alxndrsn avatar Oct 18 '18 15:10 alxndrsn

@alxndrsn Here's what i do to upload the latest settings of standard project (let's say xyz-project):

  1. Change the "inherit": "./node_modules/medic/config/standard" to "inherit": "../../medic-webapp/config/standard" (i.e. my latest local repo of medic-webapp) in the file settings.inherit.json of the xyz-project.

  2. Run medic-conf --instance xyz-project.app command from the project folder of medic-projects/xyz-project.

  3. Revert back the changes made in settings.inherit.json

This causes uploading all the JSON forms available in the standard. An option to select the JSON forms would help upload selected forms only.

mukesh2006 avatar Nov 01 '18 08:11 mukesh2006

@mukesh2006 couldn't you just update the package.json for xyz-project to depend on the latest medic-webapp, and then the standard forms should be picked correctly from "./node_modules/medic/config/standard" as required?

alxndrsn avatar Nov 06 '18 10:11 alxndrsn

That would help, but I don't think resolves this issue. We would still need a way to specify which forms to exclude, or perhaps better, only the ones that you want to include. Is that what you are requesting @mukesh2006?

abbyad avatar Nov 16 '18 16:11 abbyad

@abbyad Yes, it'd be better if we have a way to specify which forms to include/upload (including is better option than excluding). Currently all the forms are uploaded and then have to manually delete the unwanted forms from the instance.

cc @alxndrsn

mukesh2006 avatar Nov 23 '18 07:11 mukesh2006

Thanks @mukesh2006. Do you want to make a proposal for what that could look like in the current structure, in settings.inherit.json or otherwise?

Here are some possibilities:

  1. a special key in filter for "app_forms"
  2. a new top level field called "forms" with filter/delete/replace arrays in there
  3. a /forms/apps/settings.json with filter/delete arrays
  4. something completely different (please make suggestions!)

abbyad avatar Nov 23 '18 15:11 abbyad

@abbyad A special key in filter for "apps_forms" in settings.inherit.json would be a good feature to have.

mukesh2006 avatar Nov 26 '18 06:11 mukesh2006