Skip to content

feat(#566): implement auto-inclusion of task and target and contact s…#784

Open
inromualdo wants to merge 6 commits intomainfrom
feature/566_reusable_comp
Open

feat(#566): implement auto-inclusion of task and target and contact s…#784
inromualdo wants to merge 6 commits intomainfrom
feature/566_reusable_comp

Conversation

@inromualdo
Copy link

Description

Ability to compile and upload tasks and contact summary from reusable componnent. This PR auto include any file end by .tasks.js, .targets.js and .contact-summary.js

#566

Code review items

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or integration tests where appropriate
  • Backwards compatible: Works with existing data and configuration. Any breaking changes documented in the release notes.

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@inromualdo inromualdo marked this pull request as draft January 14, 2026 07:50
@jkuester jkuester self-requested a review March 5, 2026 16:41
@jkuester
Copy link
Contributor

jkuester commented Mar 5, 2026

@inromualdo sorry for the delay! Very interested in the feature you have added here!

Before I get too far into reviewing the code, can you help me understand a bit better how this is expected to work? Here is how I think things go and maybe you can correct me if I get anything wrong:

  • Currently tasks.js and targets.js each export an array. The PR would basically allow any file ending in .tasks.js or .targets.js to export an array and then entries from all the arrays will be concated together when webpacking tasks/targets for the app_settings.json.
  • Similar functionality is true for the contact-summary where the exported cards and fields arrays are concated and the exported context objects are merged using Object.assign.
  • Basically all this allows for dynamically extending the configuration by adding additional files without having to edit the base files.

There are some tradeoffs here between clarity and convenience. (There is more complexity when we are merging files behind the scenes and it adds another level of abstraction between what is seen in the config files and what is actually uploaded to the server. On the other hand, making configuration more reusable has clear benefits as well.)

I think I see how this works for just dropping new files into the project directory. How will this work for config coming from re-usable NPM libs like https://github.com/medic/cht-stock-monitoring-workflow? Would I still have to manually copy files from that repo into my local config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants