dhis2 / aggregate-data-entry-app

Data entry app for DHIS 2
https://dhis2-data-entry.netlify.app
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

feat(DHIS2-16132): transpose section forms #367

Closed kabaros closed 7 months ago

kabaros commented 8 months ago

This PR implements the ability to display sections transposed, and grouped by category in the data entry app. Implements DHIS2-16132 .

transpose-different-options.webm

Default Section form - without pivoting (existing implementation)

image

Form pivoted (data elements moved to columns)

image

Single Category pivoted

image

Multiple categories (with one pivoted)

image

Data elements with different category combos

image

Notes about implementation

As an general approach, I aimed to decouple the display details (table, rows, columns, column and row spans) from our internal concepts (data elements, categories, category options, cocs etc...), to provide a middle layer (a matrix) that represents a form in our context. This middle layer can become the base of a form builder, for implementations that are cross-platform and other improvements in the future.

With the previous implementation, we were more than half-way there, but the data elements were tightly coupled to rows, and in turn the rows/data elements are tightly coupled to functionality like search, filters, highlighting current cell in the table etc... The next step should be to consolidate this implementation with the "normal" section form - there is a followup ticket for this: https://dhis2.atlassian.net/browse/LIBS-584

The only concept that remains metadata-aware is the date entry field - this was the existing design and it works well, as a self-contained component responsible of its own state, validation etc... regardless of where it appears in a form.

image

Background

We are aiming to add more form configuration options as part of an initiative to provide configurations natively to data entry forms to reduce the necessity for custom forms. Users are currently building custom forms as a workaround for shortcomings of the configuration options (ability to transpose, or customise a cell design) or implementation (such to avoid issues with RTL issues). This is an RFC that describes the approach and the priorities for form configuration options. This is based on a thorough investigation by the functional design team for custom form use cases in real-life implementations. Based on that investigation, the ability to transpose forms and adding free-text descriptions were one of the main reasons people choose to go the custom forms route so we're tackling these first.

Known limitations

ToDos (future)

Related PRs:

dhis2-bot commented 8 months ago

🚀 Deployed on https://pr-367--dhis2-data-entry.netlify.app

kabaros commented 7 months ago

@tomzemp thanks for testing - I fix the issue with the transposed form with one default combo or one category. Below is how it looks. Also removed the cool 🕶️ feature toggle.

image

dhis2-bot commented 7 months ago

:tada: This PR is included in version 100.4.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: