Skip to content

Commit 8a7ed4b

Browse files
enjeckbackportbot[bot]
authored andcommitted
fix: Add select event to AppNavigationGroupList and clear search functionality
Signed-off-by: Enjeck C. <patrathewhiz@gmail.com>
1 parent b15634c commit 8a7ed4b

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎apps/settings/src/components/AppNavigationGroupList.vue‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
:key="group.id"
4949
:active="selectedGroupDecoded === group.id"
5050
:name="group.title"
51-
:count="group.count" />
51+
:count="group.count"
52+
@select="emit('select')" />
5253
<div v-if="loadingGroups" role="note">
5354
<NcLoadingIcon :name="t('settings', 'Loading groups…')" />
5455
</div>
@@ -79,6 +80,10 @@ import logger from '../logger.ts'
7980
import { searchGroups } from '../service/groups.ts'
8081
import { useStore } from '../store/index.js'
8182
83+
const emit = defineEmits<{
84+
(e: 'select'): void
85+
}>()
86+
8287
const store = useStore()
8388
const route = useRoute()
8489
const router = useRouter()

‎apps/settings/src/components/GroupListItem.vue‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
:to="{ name: 'group', params: { selectedGroup: encodeURIComponent(id) } }"
4141
:loading="loadingRenameGroup"
4242
:menu-open="openGroupMenu"
43+
@click="$emit('select')"
4344
@update:menuOpen="handleGroupMenuOpen">
4445
<template #icon>
4546
<AccountGroup :size="20" />
@@ -141,6 +142,8 @@ export default {
141142
},
142143
},
143144
145+
emits: ['select'],
146+
144147
data() {
145148
return {
146149
loadingRenameGroup: false,

‎apps/settings/src/views/UserManagementNavigation.vue‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
</NcAppNavigationItem>
9595
</NcAppNavigationList>
9696

97-
<AppNavigationGroupList />
97+
<AppNavigationGroupList @select="clearSearch" />
9898

9999
<template #footer>
100100
<NcButton
@@ -146,6 +146,13 @@ watch(searchInput, (value) => commitSearch(value))
146146
147147
onBeforeUnmount(() => commitSearch.clear())
148148
149+
/** Clear the shared account and group search before changing groups. */
150+
function clearSearch() {
151+
searchInput.value = ''
152+
commitSearch.clear()
153+
store.commit('setSearchQuery', '')
154+
}
155+
149156
// Intercept Ctrl/Cmd+F to focus the local search. useHotKey ignores the
150157
// event when an input/textarea is already focused, so a second press falls
151158
// through to the browser's native find-in-page.

0 commit comments

Comments
 (0)