Skip to content

Commit

Permalink
move acl user/group select to NcSelect
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Jan 11, 2024
1 parent 229c120 commit 3846aa4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
2 changes: 0 additions & 2 deletions src/components/AclStateButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
import Check from 'vue-material-design-icons/Check.vue'
import Cancel from 'vue-material-design-icons/Cancel.vue'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcPopoverMenu from '@nextcloud/vue/dist/Components/NcPopoverMenu.js'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionRadio from '@nextcloud/vue/dist/Components/NcActionRadio.js'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
Expand All @@ -87,7 +86,6 @@ export default {
tooltip: Tooltip,
},
components: {
NcPopoverMenu,
NcButton,
NcActions,
NcActionRadio,
Expand Down
32 changes: 15 additions & 17 deletions src/components/SharingSidebarView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,27 +133,23 @@
</template>
{{ t('groupfolders', 'Add advanced permission rule') }}
</NcButton>
<NcMultiselect v-if="isAdmin && !loading"
<NcSelect v-if="isAdmin && !loading"
v-show="showAclCreate"
ref="select"
v-model="value"
:options="options"
:reset-after="true"
:clear-search-on-select="true"

Check failure on line 141 in src/components/SharingSidebarView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected "\t" character, but found " " character
:loading="isSearching"
:internal-search="false"
:filterable="false"

Check failure on line 143 in src/components/SharingSidebarView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected "\t" character, but found " " character
:placeholder="t('groupfolders', 'Select a user or group')"
track-by="unique"
@select="createAcl"
@search-change="searchMappings">
<template slot="singleLabel" slot-scope="props">
<NcAvatar :user="props.option.id" :is-no-user="props.option.type !== 'user'" />
{{ getFullDisplayName(props.option.displayname, props.option.type) }}
:getOptionKey="() => 'unique'"

Check failure on line 145 in src/components/SharingSidebarView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected "\t" character, but found " " character

Check warning on line 145 in src/components/SharingSidebarView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Attribute ':getOptionKey' must be hyphenated
@input="createAcl"
@search="searchMappings">
<template #option="option">
<NcAvatar :user="option.id" :is-no-user="option.type !== 'user'" />
{{ option.label }}
</template>
<template slot="option" slot-scope="props">
<NcAvatar :user="props.option.id" :is-no-user="props.option.type !== 'user'" />
{{ getFullDisplayName(props.option.displayname, props.option.type) }}
</template>
</NcMultiselect>
</NcSelect>
</div>
</template>

Expand All @@ -167,7 +163,7 @@ import BinaryTools from './../BinaryTools.js'
import client from './../client.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcMultiselect from '@nextcloud/vue/dist/Components/NcMultiselect.js'
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
import Plus from 'vue-material-design-icons/Plus.vue'
import Close from 'vue-material-design-icons/Close.vue'
Expand All @@ -181,7 +177,7 @@ export default {
},
components: {
NcAvatar,
NcMultiselect,
NcSelect,

Check failure on line 180 in src/components/SharingSidebarView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected indentation of 2 tabs but found 4 spaces
NcButton,
AclStateButton,
Plus,
Expand Down Expand Up @@ -279,6 +275,7 @@ export default {
type: 'group',
id: group.gid,
displayname: group.displayname,
label: this.getFullDisplayName(group.displayname, 'group'),

Check failure on line 278 in src/components/SharingSidebarView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected indentation of 6 tabs but found 12 spaces
}
})
const users = Object.values(result.data.ocs.data.users).map((user) => {
Expand All @@ -287,6 +284,7 @@ export default {
type: 'user',
id: user.uid,
displayname: user.displayname,
label: this.getFullDisplayName(user.displayname, 'user'),

Check failure on line 287 in src/components/SharingSidebarView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected indentation of 6 tabs but found 12 spaces
}
})
this.options = [...groups, ...users].filter((entry) => {
Expand All @@ -295,7 +293,7 @@ export default {
})
}).catch((error) => {
if (!axios.isCancel(error)) {
console.error('Failed to l search results for groupfolder ACL')
console.error('Failed to search results for groupfolder ACL')
}
})
},
Expand Down

0 comments on commit 3846aa4

Please sign in to comment.