Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.0.82'
Browse files Browse the repository at this point in the history
  • Loading branch information
nnkogift committed Dec 20, 2022
2 parents 92277e0 + 039eda4 commit 047993a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hisptz/react-ui",
"homepage": "https://hisptz.github.io/react-ui",
"version": "1.0.81",
"version": "1.0.82",
"description": "A collection of reusable complex DHIS2 react ui components.",
"license": "BSD-3-Clause",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ function Tree({
const selectedOrgUnits = value?.orgUnits ?? [];

const onSelect = (orgUnit: any) => {
const orgUnitLevel = orgUnit.level ?? orgUnit.path.split("/").length - 1;
const allowSelection = limitSelectionToLevels?.includes(orgUnitLevel) ?? true;
if (limitSelectionToLevels !== undefined) {
if (!limitSelectionToLevels.includes(orgUnit.level)) {
if (!allowSelection) {
return;
}
}
Expand Down

0 comments on commit 047993a

Please sign in to comment.