cht-conf
cht-conf copied to clipboard
Allow 'settings.inherit.json' to filter XForms
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 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 Here's what i do to upload the latest settings of standard project (let's say xyz-project
):
-
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 filesettings.inherit.json
of thexyz-project
. -
Run
medic-conf --instance xyz-project.app
command from the project folder ofmedic-projects/xyz-project
. -
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 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?
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 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
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:
- a special key in
filter
for "app_forms" - a new top level field called "forms" with
filter
/delete
/replace
arrays in there - a
/forms/apps/settings.json
withfilter
/delete
arrays - something completely different (please make suggestions!)
@abbyad A special key in filter
for "apps_forms" in settings.inherit.json
would be a good feature to have.