Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dhis2 18142/category option group forms #422

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Chisomchima
Copy link
Contributor

No description provided.

@Chisomchima Chisomchima marked this pull request as draft October 17, 2024 11:42
Copy link

netlify bot commented Oct 17, 2024

Deploy Preview for dhis2-maintenance-app-beta ready!

Name Link
🔨 Latest commit 6033dfd
🔍 Latest deploy log https://app.netlify.com/sites/dhis2-maintenance-app-beta/deploys/6710f83eb41c66000824e06f
😎 Deploy Preview https://deploy-preview-422--dhis2-maintenance-app-beta.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines +13 to +21
...DEFAULT_FIELD_FILTERS,
'name',
'shortName',
'code',
'description',
'categoryOptions[id,displayName]',
'dataDimension',
'dataDimensionType',
'attributeValues[value,attribute[id]]',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but can we use the constant ATTRIBUTE_VALUES_FIELD_FILTERS. eg.

Suggested change
...DEFAULT_FIELD_FILTERS,
'name',
'shortName',
'code',
'description',
'categoryOptions[id,displayName]',
'dataDimension',
'dataDimensionType',
'attributeValues[value,attribute[id]]',
...DEFAULT_FIELD_FILTERS,
...ATTRIBUTE_VALUES_FIELD_FILTERS,
'name',
'shortName',
'code',
'description',
'categoryOptions[id,displayName]',
'dataDimension',
'dataDimensionType',

Comment on lines +24 to +26
export type CategoryFormValues = PickWithFieldFilters<
Category,
typeof fieldFilters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update name and Category import to CategoryOptionGroup.

fields: fieldFilters.concat(),
},
}
const categoryQuery = useQuery({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here; let's keep this categoryOptionGroupQuery and the same for related types.

Copy link
Member

@Birkbjo Birkbjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some minor remnants from copy-pasting (which is perfectly valid here btw!).

Can you also add an entry for categoryOptionGroup to sectionListViewsConfig?
I think it makes sense to have much of the same config as category, but without categoryCombo as a filter.

After #423 is merged, we could also add categoryOption as a filter.

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