Skip to content

Commit

Permalink
Merge pull request #5113 from akvo/4910-invalid-selected-card
Browse files Browse the repository at this point in the history
[#4910] Fix project card not clickable in the hierarchy tab
  • Loading branch information
zuhdil committed Sep 16, 2022
2 parents 3c298ac + 27695d8 commit 42ce016
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion akvo/rsr/spa/app/modules/hierarchy/card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Card = ({ project, selected, onClick, filterCountry, countryFilter, level,
<li
className={classNames('card', {
selected,
clickable: childrenCount > 0 || (program && canCreateProjects),
clickable: canCreateProjects,
referenced: (referenced && isReff)
})}
onClick={onClick}
Expand Down
3 changes: 2 additions & 1 deletion akvo/rsr/spa/app/modules/hierarchy/hierarchy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const Hierarchy = ({ match: { params }, program, userRdr, asProjectTab }) => {
const itemIndex = selected.findIndex(it => it === item)
if(itemIndex !== -1){
setSelected(selected.slice(0, colIndex + 1))
} else if((item.children && item.children.length > 0) || (program && canCreateProjects)) {
}
if(canCreateProjects) {
setSelected([...(selected[colIndex] ? selected.slice(0, colIndex + 1) : selected), item])
}
}
Expand Down

0 comments on commit 42ce016

Please sign in to comment.