Skip to content

Commit

Permalink
feat(org unit tree): pass request error to renderNodeLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammer5 committed Aug 3, 2021
1 parent d3aa503 commit 15a4024
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const OrganisationUnitNode = ({
hasChildren,
hasSelectedDescendants,
loading,
error,
onChange,
selected,
onToggleOpen,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,19 @@ OrganisationUnitTree.propTypes = {
isUserDataViewFallback: propTypes.bool,

/** Renders the actual node component for each leaf, can be used to
* customize the node. In order to change the displayed node while keeping
* 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 node's displayName.
* and overwrite the label property.
*
* @example
* renderNodeLabel={data => {
* return OrganisationUnitTree.defaultProps.renderNodeLabel({
* ...data,
* node: {
* ...data.node,
* displayName: (
* <MyCustomComponent>
* {data.node.displayName}
* </MyCustomComponent>
* ),
* },
* label: (
* <MyCustomComponent>
* {data.node.displayName}
* </MyCustomComponent>
* ),
* })
* }}
*
Expand All @@ -177,6 +174,7 @@ OrganisationUnitTree.propTypes = {
* @param {string} [data.node.path] Only provided once `loading` is false
* @param {Object} [data.node.children] Only provided once `loading` is false
* @param {string} data.dataTest
* @param {string} [data.error]
* @param {string[]} data.selected
* @param {boolean} data.disableSelection
* @param {boolean} data.hasChildren
Expand Down

0 comments on commit 15a4024

Please sign in to comment.