7575 <NcAppSettingsSection id =" default-settings"
7676 :name =" t('settings', 'Defaults')" >
7777 <NcSelect v-model =" defaultQuota"
78+ :clearable =" false"
79+ :create-option =" validateQuota"
80+ :filter-by =" filterQuotas"
7881 :input-label =" t('settings', 'Default quota')"
79- placement =" top"
80- :taggable =" true"
8182 :options =" quotaOptions"
82- :create-option = " validateQuota "
83+ placement = " top "
8384 :placeholder =" t('settings', 'Select default quota')"
84- :clearable = " false "
85+ taggable
8586 @option:selected =" setDefaultQuota" />
8687 </NcAppSettingsSection >
8788 </NcAppSettingsDialog >
@@ -100,6 +101,7 @@ import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
100101
101102import { GroupSorting } from ' ../../constants/GroupManagement.ts'
102103import { unlimitedQuota } from ' ../../utils/userUtils.ts'
104+ import logger from ' ../../logger.ts'
103105
104106export default {
105107 name: ' UserSettingsDialog' ,
@@ -243,8 +245,8 @@ export default {
243245 newUserSendEmail: value,
244246 })
245247 await axios .post (generateUrl (' /settings/users/preferences/newUser.sendEmail' ), { value: value ? ' yes' : ' no' })
246- } catch (e ) {
247- console .error (' could not update newUser.sendEmail preference: ' + e . message , e )
248+ } catch (error ) {
249+ logger .error (' Could not update newUser.sendEmail preference' , { error } )
248250 } finally {
249251 this .loadingSendMail = false
250252 }
@@ -253,6 +255,22 @@ export default {
253255 },
254256
255257 methods: {
258+ /**
259+ * Check if a quota matches the current search.
260+ * This is a custom filter function to allow to map "1GB" to the label "1 GB" (ignoring whitespaces).
261+ *
262+ * @param option The quota to check
263+ * @param label The label of the quota
264+ * @param search The search string
265+ */
266+ filterQuotas (option , label , search ) {
267+ const searchValue = search .toLocaleLowerCase ().replaceAll (/ \s / g , ' ' )
268+ return (label || ' ' )
269+ .toLocaleLowerCase ()
270+ .replaceAll (/ \s / g , ' ' )
271+ .indexOf (searchValue) > - 1
272+ },
273+
256274 setShowConfig (key , status ) {
257275 this .$store .commit (' setShowConfig' , { key, value: status })
258276 },
@@ -268,14 +286,13 @@ export default {
268286 quota = quota? .id || quota .label
269287 }
270288 // only used for new presets sent through @Tag
271- const validQuota = parseFileSize (quota)
289+ const validQuota = parseFileSize (quota, true )
272290 if (validQuota === null ) {
273291 return unlimitedQuota
274- } else {
275- // unify format output
276- quota = formatFileSize (parseFileSize (quota))
277- return { id: quota, label: quota }
278292 }
293+ // unify format output
294+ quota = formatFileSize (validQuota)
295+ return { id: quota, label: quota }
279296 },
280297
281298 /**
0 commit comments