From 398297b449e0906e6dd251a694815ec98f08fd84 Mon Sep 17 00:00:00 2001 From: ArcticFall <23174635+ArcticFall@users.noreply.github.com> Date: Mon, 29 Nov 2021 23:18:01 +0100 Subject: [PATCH] Add new component for the group list items. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Jänel Signed-off-by: Louis Chemineau --- .../settings/src/components/GroupListItem.vue | 143 ++++++++++++++++++ apps/settings/src/store/users.js | 8 +- apps/settings/src/views/Users.vue | 63 +------- 3 files changed, 152 insertions(+), 62 deletions(-) create mode 100644 apps/settings/src/components/GroupListItem.vue diff --git a/apps/settings/src/components/GroupListItem.vue b/apps/settings/src/components/GroupListItem.vue new file mode 100644 index 00000000000..f5c3726d5bf --- /dev/null +++ b/apps/settings/src/components/GroupListItem.vue @@ -0,0 +1,143 @@ + + + + + diff --git a/apps/settings/src/store/users.js b/apps/settings/src/store/users.js index f09df7fb8b5..b38c282965c 100644 --- a/apps/settings/src/store/users.js +++ b/apps/settings/src/store/users.js @@ -96,12 +96,12 @@ const mutations = { console.error('Can\'t create group', e) } }, - renameGroup(state, { gid, displayname }) { + renameGroup(state, { gid, displayName }) { const groupIndex = state.groups.findIndex(groupSearch => groupSearch.id === gid) if (groupIndex >= 0) { const updatedGroup = state.groups[groupIndex] - updatedGroup.name = displayname - state.groups[groupIndex] = updatedGroup + updatedGroup.name = displayName + state.groups.splice(groupIndex, 1, updatedGroup) state.groups = orderGroups(state.groups, state.orderBy) } }, @@ -362,7 +362,7 @@ const actions = { return api.requireAdmin().then((response) => { return api.put(generateOcsUrl('cloud/groups/{groupId}', { groupId: encodeURIComponent(groupid) }), { key: 'displayname', value: displayName }) .then((response) => { - context.commit('renameGroup', { gid: groupid, displayname: displayName }) + context.commit('renameGroup', { gid: groupid, displayName }) return { groupid, displayName } }) .catch((error) => { throw error }) diff --git a/apps/settings/src/views/Users.vue b/apps/settings/src/views/Users.vue index a606600b6ca..c3d3d9f3c72 100644 --- a/apps/settings/src/views/Users.vue +++ b/apps/settings/src/views/Users.vue @@ -72,31 +72,11 @@ - - - {{ group.count }} - - - + :count="group.count" />