committed by
Julius Härtl
parent
3cb811bb79
commit
b8cb364f00
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<multiselect v-model="addAcl" :options="sharees" label="label"
|
<multiselect v-model="addAcl" :options="unallocatedSharees" label="label"
|
||||||
@input="clickAddAcl" @search-change="asyncFind">
|
@input="clickAddAcl" @search-change="asyncFind">
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
{{ scope.option.label }}
|
{{ scope.option.label }}
|
||||||
@@ -33,16 +33,17 @@
|
|||||||
<label for="checkbox">{{ t('deck', 'Manage') }}</label>
|
<label for="checkbox">{{ t('deck', 'Manage') }}</label>
|
||||||
|
|
||||||
<button v-tooltip="t('deck', 'Delete')" class="icon-delete" @click="clickDeleteAcl(acl)" />
|
<button v-tooltip="t('deck', 'Delete')" class="icon-delete" @click="clickDeleteAcl(acl)" />
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<CollaborationView />
|
|
||||||
|
<collection-list v-if="board.id" :id="board.id"
|
||||||
|
:name="board.title" type="deck" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Avatar, Multiselect } from 'nextcloud-vue'
|
import { Avatar, Multiselect } from 'nextcloud-vue'
|
||||||
import CollaborationView from '../CollaborationView'
|
import { CollectionList } from 'nextcloud-vue-collections'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -50,7 +51,7 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
Avatar,
|
Avatar,
|
||||||
Multiselect,
|
Multiselect,
|
||||||
CollaborationView
|
CollectionList
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
board: {
|
board: {
|
||||||
@@ -68,7 +69,24 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
sharees: 'sharees'
|
sharees: 'sharees'
|
||||||
|
}),
|
||||||
|
unallocatedSharees() {
|
||||||
|
let ret = []
|
||||||
|
|
||||||
|
let allocatedSharees = []
|
||||||
|
for (var user in this.board.acl) {
|
||||||
|
allocatedSharees.push(this.board.acl[user].participant.uid)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.sharees.forEach(function(sharee) {
|
||||||
|
if (allocatedSharees.indexOf(sharee.value.shareWith) === -1) {
|
||||||
|
ret.push(sharee)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
asyncFind(query) {
|
asyncFind(query) {
|
||||||
|
|||||||
@@ -134,6 +134,9 @@ export default new Vuex.Store({
|
|||||||
setSharees(state, sharees) {
|
setSharees(state, sharees) {
|
||||||
state.sharees = sharees
|
state.sharees = sharees
|
||||||
},
|
},
|
||||||
|
addShareesGroups(state, groups) {
|
||||||
|
state.sharees.push(...groups)
|
||||||
|
},
|
||||||
setBoardFilter(state, filter) {
|
setBoardFilter(state, filter) {
|
||||||
state.boardFilter = filter
|
state.boardFilter = filter
|
||||||
},
|
},
|
||||||
@@ -168,6 +171,9 @@ export default new Vuex.Store({
|
|||||||
// acl mutators
|
// acl mutators
|
||||||
addAclToCurrentBoard(state, acl) {
|
addAclToCurrentBoard(state, acl) {
|
||||||
console.log(state.currentBoard)
|
console.log(state.currentBoard)
|
||||||
|
let id = acl.participant.uid
|
||||||
|
state.currentBoard.acl[id] = acl
|
||||||
|
console.log(state.currentBoard)
|
||||||
},
|
},
|
||||||
updateAclFromCurrentBoard(state, acl) {
|
updateAclFromCurrentBoard(state, acl) {
|
||||||
for (var acl_ in state.currentBoard.acl) {
|
for (var acl_ in state.currentBoard.acl) {
|
||||||
@@ -178,11 +184,12 @@ export default new Vuex.Store({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteAclFromCurrentBoard(state, acl) {
|
deleteAclFromCurrentBoard(state, acl) {
|
||||||
for (var acl_ in state.currentBoard.acl) {
|
const removeIndex = state.currentBoard.acl.findIndex((a) => {
|
||||||
if (state.currentBoard.acl[acl_].participant.uid === acl.participant.uid) {
|
return a.participant.uid === acl.participant.uid
|
||||||
delete state.currentBoard.acl[acl_]
|
})
|
||||||
break
|
|
||||||
}
|
if (removeIndex > -1) {
|
||||||
|
state.currentBoard.acl.splice(removeIndex, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -245,6 +252,7 @@ export default new Vuex.Store({
|
|||||||
params.append('itemType', 1)
|
params.append('itemType', 1)
|
||||||
axios.get(OC.linkToOCS('apps/files_sharing/api/v1') + 'sharees', { params }).then((response) => {
|
axios.get(OC.linkToOCS('apps/files_sharing/api/v1') + 'sharees', { params }).then((response) => {
|
||||||
commit('setSharees', response.data.ocs.data.users)
|
commit('setSharees', response.data.ocs.data.users)
|
||||||
|
// commit('addShareesGroups', response.data.ocs.data.groups)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setBoardFilter({ commmit }, filter) {
|
setBoardFilter({ commmit }, filter) {
|
||||||
|
|||||||
Reference in New Issue
Block a user