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

Commit

Permalink
feat(resource management): hide selection if existence is unmodifiable
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Nov 20, 2022
1 parent 449a88b commit 5cacdd7
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,17 @@ function batchRestore() {
}
function canSelect(id: string) {
return maySelect.value && props.selectedIDs.indexOf(id) === -1
const canBeSelected = maySelect.value && props.selectedIDs.indexOf(id) === -1
return canBeSelected && props.list.some(
data => data.id === id && (data.mayArchive || data.mayRestore)
)
}
function canDeselect(id: string) {
return maySelect.value && props.selectedIDs.indexOf(id) > -1
const canBeDeselected = maySelect.value && props.selectedIDs.indexOf(id) > -1
return canBeDeselected && props.list.some(
data => data.id === id && (data.mayArchive || data.mayRestore)
)
}
function select(id: string) {
Expand Down

0 comments on commit 5cacdd7

Please sign in to comment.