Skip to content

Commit

Permalink
fix(vue,js): Check if a group is an added group or not
Browse files Browse the repository at this point in the history
  • Loading branch information
zak39 committed Oct 29, 2024
1 parent 350b9a5 commit 46731ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/GroupDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</NcActions>
</div>
<NcActions ref="ncAction">
<NcActionButton v-if="!$store.getters.isGEorUGroup($route.params.space, decodeURIComponent(decodeURIComponent($route.params.slug)) && !isAddedGroup)"
<NcActionButton v-if="!$store.getters.isGEorUGroup($route.params.space, decodeURIComponent(decodeURIComponent($route.params.slug))) && !isAddedGroup"
v-show="!showRenameGroupInput"
icon="icon-rename"
@click="toggleShowRenameGroupInput">
Expand All @@ -53,7 +53,7 @@
@submit="onRenameGroup">
{{ t('workspace', 'Group name') }}
</NcActionInput>
<NcActionButton v-if="!$store.getters.isGEorUGroup($route.params.space, decodeURIComponent(decodeURIComponent($route.params.slug)) && !isAddedGroup)"
<NcActionButton v-if="!$store.getters.isGEorUGroup($route.params.space, decodeURIComponent(decodeURIComponent($route.params.slug))) && !isAddedGroup"
icon="icon-delete"
@click="toggleRemoveGroupModal">
{{ t('workspace', 'Delete group') }}
Expand Down
3 changes: 2 additions & 1 deletion src/store/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export const getters = {
// Test if group is from space added groups
isSpaceAddedGroup: state => (spaceName, groupName) => {
const space = state.spaces[spaceName]
return space.added_groups[groupName]
const gids = Object.keys(space.added_groups)
return gids.includes(groupName)
},
// Tests wheter a group is the GE or U group of a space
isGEorUGroup: (state, getters) => (spaceName, gid) => {
Expand Down

0 comments on commit 46731ba

Please sign in to comment.