Skip to content

Commit 9f9b8ac

Browse files
committed
fix(settings): apply consistent style by using proper components
Use the proper app navigation components for the account management navigation. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 3c848b4 commit 9f9b8ac

1 file changed

Lines changed: 18 additions & 27 deletions

File tree

apps/settings/src/views/UserManagementNavigation.vue

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,10 @@
1717
</template>
1818
</NcAppNavigationNew>
1919

20-
<div class="account-management__search" role="search" :aria-label="t('settings', 'Search accounts and groups')">
21-
<NcInputField
22-
ref="searchField"
23-
v-model="searchInput"
24-
:label="t('settings', 'Search accounts and groups…')"
25-
:show-trailing-button="searchInput !== ''"
26-
:trailingButtonLabel="t('settings', 'Clear search')"
27-
@trailing-button-click="clearSearch">
28-
<template #icon>
29-
<NcIconSvgWrapper :path="mdiMagnify" />
30-
</template>
31-
<template #trailing-button-icon>
32-
<NcIconSvgWrapper :path="mdiClose" />
33-
</template>
34-
</NcInputField>
35-
</div>
20+
<NcAppNavigationSearch
21+
ref="searchField"
22+
v-model="searchInput"
23+
:label="t('settings', 'Search accounts and groups…')" />
3624

3725
<NcAppNavigationList
3826
class="account-management__system-list"
@@ -112,19 +100,22 @@
112100
<NcButton
113101
class="account-management__settings-toggle"
114102
variant="tertiary"
103+
wide
115104
@click="isDialogOpen = true">
116105
<template #icon>
117106
<NcIconSvgWrapper :path="mdiCogOutline" />
118107
</template>
119-
{{ t('settings', 'Account management settings') }}
108+
<span class="account-management__settings-toggle-text">
109+
{{ t('settings', 'Account management settings') }}
110+
</span>
120111
</NcButton>
121112
<UserSettingsDialog :open.sync="isDialogOpen" />
122113
</template>
123114
</NcAppNavigation>
124115
</template>
125116

126117
<script setup lang="ts">
127-
import { mdiAccountOffOutline, mdiAccountOutline, mdiClose, mdiCogOutline, mdiHistory, mdiMagnify, mdiPlus, mdiShieldAccountOutline } from '@mdi/js'
118+
import { mdiAccountOffOutline, mdiAccountOutline, mdiCogOutline, mdiHistory, mdiPlus, mdiShieldAccountOutline } from '@mdi/js'
128119
import { translate as t } from '@nextcloud/l10n'
129120
import { useHotKey } from '@nextcloud/vue/composables/useHotKey'
130121
import debounce from 'debounce'
@@ -134,10 +125,10 @@ import NcAppNavigation from '@nextcloud/vue/components/NcAppNavigation'
134125
import NcAppNavigationItem from '@nextcloud/vue/components/NcAppNavigationItem'
135126
import NcAppNavigationList from '@nextcloud/vue/components/NcAppNavigationList'
136127
import NcAppNavigationNew from '@nextcloud/vue/components/NcAppNavigationNew'
128+
import NcAppNavigationSearch from '@nextcloud/vue/components/NcAppNavigationSearch'
137129
import NcButton from '@nextcloud/vue/components/NcButton'
138130
import NcCounterBubble from '@nextcloud/vue/components/NcCounterBubble'
139131
import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
140-
import NcInputField from '@nextcloud/vue/components/NcInputField'
141132
import AppNavigationGroupList from '../components/AppNavigationGroupList.vue'
142133
import UserSettingsDialog from '../components/Users/UserSettingsDialog.vue'
143134
import { useFormatGroups } from '../composables/useGroupsNavigation.js'
@@ -146,23 +137,19 @@ import { useStore } from '../store/index.js'
146137
const route = useRoute()
147138
const store = useStore()
148139
149-
const searchField = ref<InstanceType<typeof NcInputField>>()
140+
const searchField = ref<InstanceType<typeof NcAppNavigationSearch>>()
150141
const searchInput = ref('')
151142
const commitSearch = debounce((query: string) => {
152143
store.commit('setSearchQuery', query)
153144
}, 300)
154145
watch(searchInput, (value) => commitSearch(value))
155-
function clearSearch() {
156-
commitSearch.clear()
157-
searchInput.value = ''
158-
store.commit('setSearchQuery', '')
159-
}
146+
160147
onBeforeUnmount(() => commitSearch.clear())
161148
162149
// Intercept Ctrl/Cmd+F to focus the local search. useHotKey ignores the
163150
// event when an input/textarea is already focused, so a second press falls
164151
// through to the browser's native find-in-page.
165-
useHotKey('f', () => searchField.value?.focus(), { ctrl: true, stop: true, prevent: true })
152+
useHotKey('f', () => searchField.value?.$refs.inputElement?.focus(), { ctrl: true, stop: true, prevent: true })
166153
167154
/** State of the 'new-account' dialog */
168155
const isDialogOpen = ref(false)
@@ -216,7 +203,11 @@ function showNewUserMenu() {
216203
}
217204
218205
&__settings-toggle {
219-
margin-bottom: 12px;
206+
margin-bottom: var(--body-container-margin);
207+
208+
&-text {
209+
font-weight: 500;
210+
}
220211
}
221212
}
222213
</style>

0 commit comments

Comments
 (0)