-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat(org unit tree): allow request customization #681
base: master
Are you sure you want to change the base?
Conversation
e228deb
to
ed4649d
Compare
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
4d8a042
to
984da10
Compare
15a4024
to
3b7cdb1
Compare
components/organisation-unit-tree/src/organisation-unit-node/organisation-unit-node.js
Show resolved
Hide resolved
1eb0a74
to
6e838f9
Compare
ec9190c
to
bb23bc5
Compare
components/organisation-unit-tree/src/__stories__/custom-node-label.js
Outdated
Show resolved
Hide resolved
4568aec
to
2687816
Compare
* customize the node. In order to change the displayed node while keeping | ||
* the existing functionality intact, you can re-use the original prop | ||
* and overwrite the label property. | ||
/** Renders the actual node label content for each leaf, can be used to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSDocs was replaced with react-docgen in #688, so this prop's description needs to be updated to:
/** Renders the actual node component for each leaf, can be used to
* customize the node. The default function just returns the node's
* displayName
*
* Shape of the object passed to the callback:
* ```
* {
* label: string,
* node: {
* displayName: string,
* id: string,
* // Only provided once `loading` is false
* path?: string,
* // Only provided once `loading` is false
* children?: Array.<{
* id: string,
* path: string,
* displayName: string
* }>
* },
* loading: boolean,
* error: string,
* open: boolean,
* selected: string[],
* singleSelection: boolean,
* disableSelection: boolean,
* // If the request is being customized, then all responses except the org
* // unit's response data will be included in this object
* additional?: object
* }
* ``` */
renderNodeLabel: propTypes.func,
I'm converting this PR to a draft as after discussing with @HendrikThePendric we've agreed to implement these changes in the https://github.com/dhis2/approval-app repo. |
Hi! Due to a lack of activity on this issue over time (180 days) it seems to be stale. If still relevant, please provide information that moves it forward, e.g. additional information, a pull request with suggested changes, or a reason to keep it open. Any activity will keep it open, otherwise it will be closed automatically in 30 days. Thanks! 🤖 |
keep it open |
Hi! Due to a lack of activity on this issue over time (180 days) it seems to be stale. If still relevant, please provide information that moves it forward, e.g. additional information, a pull request with suggested changes, or a reason to keep it open. Any activity will keep it open, otherwise it will be closed automatically in 30 days. Thanks! 🤖 |
@HendrikThePendric is this PR of any relevance to you? |
This PR adds the possibility to customize the org unit tree requests. It also provides a possible style for our UI components to open up request customization:
A component with an app-runtime dependency exports two versions:
Advantages
Disadvantages
useDataQuery
callback with that option andlazy: true
organisationUnit
Neutral
Stories
As there were a lot of stories, I moved them into a folder called
__stories__
. In my opinion that makes it a lot easier to work on an individual story, but we'll have to talk (or at least agree) on the proposed structure