label multi shows color, sharing shows avatars (#1210)

label multi shows color, sharing shows avatars
This commit is contained in:
Julius Härtl
2019-08-30 15:55:31 +02:00
committed by GitHub
2 changed files with 42 additions and 10 deletions

View File

@@ -1,11 +1,13 @@
<template>
<div>
<multiselect v-model="addAcl" :options="unallocatedSharees" label="label"
@input="clickAddAcl" @search-change="asyncFind">
<template #option="scope">
{{ scope.option.label }}
</template>
</multiselect>
<multiselect
v-model="addAcl"
:options="formatedSharees"
:user-select="true"
label="displayName"
track-by="user"
@input="clickAddAcl"
@search-change="asyncFind" />
<ul
id="shareWithList"
@@ -71,6 +73,27 @@ export default {
...mapGetters({
sharees: 'sharees'
}),
formatedSharees() {
return this.unallocatedSharees.map(item => {
let sharee = {
user: item.label,
displayName: item.label,
icon: 'icon-user'
}
if (item.value.shareType === 1) {
sharee.icon = 'icon-group'
sharee.isNoUser = true
}
if (item.value.shareType === 7) {
sharee.icon = 'icon-circle'
sharee.isNoUser = true
}
return sharee
})
},
unallocatedSharees() {
return this.sharees.filter((sharee) => {
return Object.values(this.board.acl).findIndex((acl) => {
@@ -129,4 +152,7 @@ export default {
padding: 12px 9px;
flex-grow: 1;
}
.avatarLabel {
padding: 6px
}
</style>

View File

@@ -36,7 +36,7 @@
:taggable="true" label="title"
track-by="id" @select="addLabelToCard" @remove="removeLabelFromCard">
<template #option="scope">
<span>{{ scope.option.title }}</span>
<div :style="{ color: '#' + scope.option.color}">{{ scope.option.title }}</div>
</template>
</multiselect>
</div>
@@ -50,7 +50,8 @@
track-by="primaryKey"
@select="assignUserToCard" @remove="removeUserFromCard">
<template #option="scope">
{{ scope.option.displayname }}
<avatar :user="scope.option.primaryKey" />
<span class="avatarLabel">{{ scope.option.displayname }} </span>
</template>
</multiselect>
</div>
@@ -86,7 +87,7 @@
</template>
<script>
import { AppSidebar, AppSidebarTab, Multiselect, DatetimePicker } from 'nextcloud-vue'
import { AppSidebar, AppSidebarTab, Multiselect, DatetimePicker, Avatar } from 'nextcloud-vue'
import { mapState } from 'vuex'
import VueEasymde from 'vue-easymde'
import { Actions } from 'nextcloud-vue/dist/Components/Actions'
@@ -103,7 +104,8 @@ export default {
DatetimePicker,
VueEasymde,
Actions,
ActionButton
ActionButton,
Avatar
},
props: {
id: {
@@ -317,4 +319,8 @@ export default {
}
}
.avatarLabel {
padding: 6px
}
</style>