aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/src/components/AppNavigationGroupList.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/src/components/AppNavigationGroupList.vue')
-rw-r--r--apps/settings/src/components/AppNavigationGroupList.vue20
1 files changed, 16 insertions, 4 deletions
diff --git a/apps/settings/src/components/AppNavigationGroupList.vue b/apps/settings/src/components/AppNavigationGroupList.vue
index 5c648a17098..8f21d18d695 100644
--- a/apps/settings/src/components/AppNavigationGroupList.vue
+++ b/apps/settings/src/components/AppNavigationGroupList.vue
@@ -18,7 +18,7 @@
<template v-if="isAdminOrDelegatedAdmin" #actions>
<NcActionText>
<template #icon>
- <NcIconSvgWrapper :path="mdiAccountGroup" />
+ <NcIconSvgWrapper :path="mdiAccountGroupOutline" />
</template>
{{ t('settings', 'Create group') }}
</NcActionText>
@@ -42,7 +42,7 @@
<NcAppNavigationList class="account-management__group-list"
aria-describedby="group-list-desc"
data-cy-users-settings-navigation-groups="custom">
- <GroupListItem v-for="group in userGroups"
+ <GroupListItem v-for="group in filteredGroups"
:id="group.id"
ref="groupListItems"
:key="group.id"
@@ -60,7 +60,7 @@
import type CancelablePromise from 'cancelable-promise'
import type { IGroup } from '../views/user-types.d.ts'
-import { mdiAccountGroup, mdiPlus } from '@mdi/js'
+import { mdiAccountGroupOutline, mdiPlus } from '@mdi/js'
import { showError } from '@nextcloud/dialogs'
import { t } from '@nextcloud/l10n'
import { useElementVisibility } from '@vueuse/core'
@@ -96,7 +96,11 @@ const selectedGroup = computed(() => route.params?.selectedGroup)
/** Current active group - URL decoded */
const selectedGroupDecoded = computed(() => selectedGroup.value ? decodeURIComponent(selectedGroup.value) : null)
/** All available groups */
-const groups = computed(() => store.getters.getSortedGroups)
+const groups = computed(() => {
+ return isAdminOrDelegatedAdmin.value
+ ? store.getters.getSortedGroups
+ : store.getters.getSubAdminGroups
+})
/** User groups */
const { userGroups } = useFormatGroups(groups)
/** Server settings for current user */
@@ -119,6 +123,14 @@ const loadingGroups = ref(false)
const offset = ref(0)
/** Search query for groups */
const groupsSearchQuery = ref('')
+const filteredGroups = computed(() => {
+ if (isAdminOrDelegatedAdmin.value) {
+ return userGroups.value
+ }
+
+ const substring = groupsSearchQuery.value.toLowerCase()
+ return userGroups.value.filter(group => group.id.toLowerCase().search(substring) !== -1 || group.title.toLowerCase().search(substring) !== -1)
+})
const groupListItems = ref([])
const lastGroupListItem = computed(() => {