Fix group navigation

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-02-25 19:06:55 +01:00
parent 4ddf5f700c
commit 2978dae22b
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
2 changed files with 9 additions and 4 deletions

View file

@ -53,7 +53,7 @@ export default new Router({
name: 'users', name: 'users',
children: [ children: [
{ {
path: ':selectedGroup(.*)', path: ':selectedGroup',
name: 'group', name: 'group',
component: Users, component: Users,
}, },

View file

@ -49,10 +49,11 @@
</AppNavigationCounter> </AppNavigationCounter>
</AppNavigationItem> </AppNavigationItem>
<AppNavigationItem <AppNavigationItem
v-if="settings.isAdmin"
id="admin" id="admin"
:exact="true" :exact="true"
:title="t('settings', 'Admins')" :title="t('settings', 'Admins')"
:to="{ name: 'users', params: { selectedGroup: 'admin' } }" :to="{ name: 'group', params: { selectedGroup: 'admin' } }"
icon="icon-user-admin"> icon="icon-user-admin">
<AppNavigationCounter v-if="adminGroupMenu.count" slot="counter"> <AppNavigationCounter v-if="adminGroupMenu.count" slot="counter">
{{ adminGroupMenu.count }} {{ adminGroupMenu.count }}
@ -65,7 +66,7 @@
id="disabled" id="disabled"
:exact="true" :exact="true"
:title="t('settings', 'Disabled users')" :title="t('settings', 'Disabled users')"
:to="{ name: 'users', params: { selectedGroup: 'disabled' } }" :to="{ name: 'group', params: { selectedGroup: 'disabled' } }"
icon="icon-disabled-users"> icon="icon-disabled-users">
<AppNavigationCounter v-if="disabledGroupMenu.usercount > 0" slot="counter"> <AppNavigationCounter v-if="disabledGroupMenu.usercount > 0" slot="counter">
{{ disabledGroupMenu.usercount }} {{ disabledGroupMenu.usercount }}
@ -78,7 +79,7 @@
:key="group.id" :key="group.id"
:exact="true" :exact="true"
:title="group.title" :title="group.title"
:to="{ name: 'users', params: { selectedGroup: group.id } }"> :to="{ name: 'group', params: { selectedGroup: group.id } }">
<AppNavigationCounter v-if="group.count" slot="counter"> <AppNavigationCounter v-if="group.count" slot="counter">
{{ group.count }} {{ group.count }}
</AppNavigationCounter> </AppNavigationCounter>
@ -489,6 +490,10 @@ export default {
*/ */
formatGroupMenu(group) { formatGroupMenu(group) {
const item = {} const item = {}
if (typeof group === 'undefined') {
return {}
}
item.id = group.id item.id = group.id
item.title = group.name item.title = group.name
item.usercount = group.usercount item.usercount = group.usercount