Data Integrity Actions #354
Unanswered
jbee
asked this question in
Specs & RFCs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
This proposal details an extension of the YAML file based data integrity checks to enable checks to not just find issues but also offer solutions to fix them.
Use cases
Issues found by data integrity can be roughly classified in 3 categories:
Proposal
Add a
actions
map to the check information that outlines the details of "generic" actions that are available for the found issues.They are generic in the sense that they connect the check details output of an issue to a API call based on fixed schema for an action.
An Action object has the following properties:
method
: the HTTP method to use to make the API callurl
: the URL template to use for the API call; it might contain placeholders{id}
: is replaced with theIssue
'sid
property{refs.id}: is replaced with the comma separated list of the
Issue's
refsobjects
id` field (new)body
(optional): a JSON body to send with the API call (mostly used for patch)confirm
(optional): If present a confirmation dialog showing this text should be displayed to inform the user of alternatives or consequences of the chosen action.The UI isn't aware what actions entail or how they work. All actions are handled the same.
The UI only has to inspect the
url
to look for the presence or absence of placeholders to decide if individual issue buttonsand checkboxes are available or not.
UI
The issues should be rendered as a list or table.
In this example there are 2 issues, each having a delete and an edit button, one has a comment for context.
The checkboxes can be used to bulk delete the selected entries.
[delete all selected]
[delete]
[edit]
(comment1)[delete]
[edit]
For another check there might only be one bulk action which no template placeholders.
Therefore no checkboxes can be supported. The action always affects all entries.
[delete all]
Example
A
actions
map that has 2 actions, delete and edit:Analysis
See https://github.com/dhis2/dhis2-core/wiki/Component-%E2%80%90-Data-Integrity-Checks#usage-analysis-for-actions
Beta Was this translation helpful? Give feedback.
All reactions