Skip to content

[OCG] Fix: Save event when there are hidden sections#1

Open
tokland wants to merge 4 commits intov1.53.1from
fix/save-with-hidden-sections
Open

[OCG] Fix: Save event when there are hidden sections#1
tokland wants to merge 4 commits intov1.53.1from
fix/save-with-hidden-sections

Conversation

@tokland
Copy link
Copy Markdown

@tokland tokland commented Aug 14, 2024

Closes https://msf-ocg.atlassian.net/browse/DHIS-710

Analysis

It can be reproduced here: https://dhis2-uat.ocg.msf.org/dhis-web-capture/index.html#/new?orgUnitId=LHiU8UzwTGW&programId=HVo0WnZXaLI

Debugging the code, I found that the section "Pregnancy Status" (SN9dbnc770B) was not present in the validation object state.formsSectionsFieldsUI: https://github.com/dhis2/capture-app/blob/v1.53.1/src/core_modules/capture-core/components/DataEntry/withSaveHandler/withSaveHandler.js#L298

That's because the state only holds values for visible sections, and that section is only visible for Women (program rule yCnazxYijZI takes care of that).

  • Ignore hidden sections when validating.
  • Fix "switch to row view"
  • manifest.webapp is generated without core_app flag enabled. The problem is that the current @dhis2/cli-app-scripts (4.0.9) does not add core_app to the manifest from d2.config.js coreApp (https://developers.dhis2.org/docs/app-platform/config/d2-config-js-reference/). Upgrading to the first version with that (5.0.2) breaks all the CRA build process. To make it simple, and since this is temporal app, I'll simply paste the commands to build the ZIP:
$ yarn build
$ cat build/app/manifest.webapp | jq '. * {core_app: true}' | sponge build/app/manifest.webapp
$ ( cd build/app  && zip -r ../../capture-app.zip . )

Deploy

@tokland tokland marked this pull request as ready for review August 21, 2024 10:00
@adrianq adrianq changed the title [fix] Save event when there are hidden sections [OCG] Fix: Save event when there are hidden sections Mar 5, 2025
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.

1 participant