Skip to content

Commit

Permalink
Merge pull request #2946 from nextcloud/backport/2944/stable26
Browse files Browse the repository at this point in the history
  • Loading branch information
juliushaertl committed May 16, 2023
2 parents 6ad8223 + 39530bb commit 0661123
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/components/AdminSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,9 @@ export default {
input[type='text'],
.multiselect {
width: 100%;
max-width: 400px;
width: auto;
min-width: 200px;
max-width: 100%;
}
input#wopi_url {
Expand Down
16 changes: 12 additions & 4 deletions src/components/SettingsSelectGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@
<template>
<NcMultiselect v-model="inputValObjects"
:options="groupsArray"
:options-limit="5"
:auto-limit="false"
:placeholder="label"
track-by="id"
label="displayname"
class="multiselect-vue"
:multiple="true"
:close-on-select="false"
:tag-width="60"
:disabled="disabled"
@input="update"
@search-change="asyncFindGroup">
Expand Down Expand Up @@ -78,7 +77,9 @@ export default {
return 'settings-select-group-' + this.uuid
},
groupsArray() {
return Object.values(this.groups)
return Object.values(this.groups).sort((a, b) => {
return this.inputValObjects.indexOf(b) - this.inputValObjects.indexOf(a)
})
},
},
watch: {
Expand All @@ -89,6 +90,13 @@ export default {
created() {
this.uuid = uuid.toString()
uuid += 1
// Preseed with placeholder entries for groups
this.getValueObject().forEach((element) => {
this.$set(this.groups, element.id, element)
})
this.inputValObjects = this.getValueObject()
// Fetch actual group metadata
this.asyncFindGroup('').then((result) => {
this.inputValObjects = this.getValueObject()
})
Expand All @@ -112,7 +120,7 @@ export default {
},
asyncFindGroup(query) {
query = typeof query === 'string' ? encodeURI(query) : ''
return axios.get(generateOcsUrl(`cloud/groups/details?search=${query}&limit=10`, 2))
return axios.get(generateOcsUrl(`cloud/groups/details?search=${query}&limit=100`, 2))
.then((response) => {
if (Object.keys(response.data.ocs.data.groups).length > 0) {
response.data.ocs.data.groups.forEach((element) => {
Expand Down

0 comments on commit 0661123

Please sign in to comment.