refactor: Migrate to built-in NcSelect input label

Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
Christopher Ng 2024-05-14 15:08:39 -07:00
parent 6f63ecfc80
commit 45ba61bbfb

View file

@ -77,12 +77,8 @@
spellcheck="false"
:required="newUser.password === '' || settings.newUserRequireEmail" />
<div class="dialog__item">
<label class="dialog__label"
for="new-user-groups">
{{ !settings.isAdmin ? t('settings', 'Groups (required)') : t('settings', 'Groups') }}
</label>
<NcSelect class="dialog__select"
input-id="new-user-groups"
:input-label="!settings.isAdmin ? t('settings', 'Groups (required)') : t('settings', 'Groups')"
:placeholder="t('settings', 'Set account groups')"
:disabled="loading.groups || loading.all"
:options="canAddGroups"
@ -100,13 +96,9 @@
</div>
<div v-if="subAdminsGroups.length > 0"
class="dialog__item">
<label class="dialog__label"
for="new-user-sub-admin">
{{ t('settings', 'Administered groups') }}
</label>
<NcSelect v-model="newUser.subAdminsGroups"
class="dialog__select"
input-id="new-user-sub-admin"
:input-label="t('settings', 'Administered groups')"
:placeholder="t('settings', 'Set account as admin for …')"
:options="subAdminsGroups"
:close-on-select="false"
@ -114,13 +106,9 @@
label="name" />
</div>
<div class="dialog__item">
<label class="dialog__label"
for="new-user-quota">
{{ t('settings', 'Quota') }}
</label>
<NcSelect v-model="newUser.quota"
class="dialog__select"
input-id="new-user-quota"
:input-label="t('settings', 'Quota')"
:placeholder="t('settings', 'Set account quota')"
:options="quotaOptions"
:clearable="false"
@ -129,13 +117,9 @@
</div>
<div v-if="showConfig.showLanguages"
class="dialog__item">
<label class="dialog__label"
for="new-user-language">
{{ t('settings', 'Language') }}
</label>
<NcSelect v-model="newUser.language"
class="dialog__select"
input-id="new-user-language"
:input-label="t('settings', 'Language')"
:placeholder="t('settings', 'Set default language')"
:clearable="false"
:selectable="option => !option.languages"
@ -144,14 +128,9 @@
label="name" />
</div>
<div :class="['dialog__item dialog__managers', { 'icon-loading-small': loading.manager }]">
<label class="dialog__label"
for="new-user-manager">
<!-- TRANSLATORS This string describes a manager in the context of an organization -->
{{ t('settings', 'Manager') }}
</label>
<NcSelect v-model="newUser.manager"
class="dialog__select"
input-id="new-user-manager"
:input-label="managerInputLabel"
:placeholder="managerLabel"
:options="possibleManagers"
:user-select="true"
@ -211,6 +190,8 @@ export default {
return {
possibleManagers: [],
// TRANSLATORS This string describes a manager in the context of an organization
managerInputLabel: t('settings', 'Manager'),
// TRANSLATORS This string describes a manager in the context of an organization
managerLabel: t('settings', 'Set account manager'),
}
},