Skip to content

Commit

Permalink
use snake_case for added_groups propery
Browse files Browse the repository at this point in the history
  • Loading branch information
smarinier authored and zak39 committed Jun 14, 2024
1 parent def985c commit 8e73cf5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Service/WorkspaceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function addGroupsInfo(array|string $workspace): array {
}

$workspace['groups'] = GroupFormatter::formatGroups($groups);
$workspace['addedGroups'] = GroupFormatter::formatGroups($addedGroups);
$workspace['added_groups'] = GroupFormatter::formatGroups($addedGroups);

return $workspace;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SpaceMenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<NcAppNavigationCaption
:title="t('workspace', 'Added groups')" />
<GroupMenuItem
v-for="group in sortedGroups(Object.values(space.addedGroups ?? []), spaceName)"
v-for="group in sortedGroups(Object.values(space.added_groups ?? []), spaceName)"
:key="group.gid"
:group="group"
:space-name="spaceName"
Expand Down
8 changes: 4 additions & 4 deletions src/store/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export const getters = {
if (state.spaces[name].groups[gid]) {
return state.spaces[name].groups[gid].displayName
}
if (state.spaces[name].addedGroups[gid]) {
return state.spaces[name].addedGroups[gid].displayName
if (state.spaces[name].added_groups[gid]) {
return state.spaces[name].added_groups[gid].displayName
}
return '[' + gid + ']'
},
Expand All @@ -55,14 +55,14 @@ export const getters = {
},
// Test whether a user if from and added group from the space
isFromAddedGroups: state => (user, spaceName) => {
const addedGroups = Object.keys(state.spaces[spaceName].addedGroups)
const addedGroups = Object.keys(state.spaces[spaceName].added_groups)
const hasAddedGroups = user.groups.filter((group) => addedGroups.includes(group))
return hasAddedGroups.length > 0
},
// Test if group is from space added groups
isSpaceAddedGroup: state => (spaceName, groupName) => {
const space = state.spaces[spaceName]
return space.addedGroups[groupName]
return space.added_groups[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 8e73cf5

Please sign in to comment.