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

Added slot for children in orgunit label and disabled state prop #243

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

p3rcypj
Copy link

@p3rcypj p3rcypj commented Dec 2, 2024

📌 References

CLPC Facial reconstruction https://github.com/EyeSeeTea/emergency-responses-app/pull/70

📝 Implementation

  • Added children slot for labels, in order to allow jsx next to the label
  • Added disabled prop to disallow selecting an orgunit (for loading states where the component is used)

🎨 Screenshots

image
Added Chip tag as an example

image
Disabled state; it still allow expanding the tree, but not selecting any orgunit

🔥 Testing

docker.eyeseetea.com/samaritans/dhis2-data:40.4.1-sp-ip-develop-est

In EMR app, go to http://localhost:8081/#/frr and select 'Responses Configuration'. If you don't see anything or it says you are not in the user group, you should add your user to the needed user groups. If you don't have user, ask to project manager.

image

On 'Responses configuration' you will see the orgunit tree. If you select a country and later click on 'Create response for country level' and confirm the dialog, you will see the disabled state while the request outside is loading. Check video media on the attached PR if needed.

Copy link
Contributor

@tokland tokland left a comment

Choose a reason for hiding this comment

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

code-wise, all good

parent: true,
},
extraFields
);
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to change it, but typically: {id: true, ...., ..extraFields}

Copy link
Author

@p3rcypj p3rcypj Dec 2, 2024

Choose a reason for hiding this comment

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

But extraFields might be undefined. Thats why I used Object.assign, I tried in console to do { hello:"a", ...undefined } at console and it gave me error

Copy link
Contributor

@tokland tokland Dec 2, 2024

Choose a reason for hiding this comment

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

In the browser console, object literals appear to require parentheses: ({ hello:"a", ...undefined }).

However, even if "undefined" were problematic, you'd typically use something like ' ...(extraFields || {})`.

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