Merge pull request #1726 from nextcloud/bugfix/sharing-search
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
"dompurify": "^2.0.8",
|
||||
"markdown-it": "^10.0.0",
|
||||
"markdown-it-task-lists": "^2.1.1",
|
||||
"lodash": "^4.17.15",
|
||||
"moment": "^2.24.0",
|
||||
"nextcloud-vue-collections": "^0.7.2",
|
||||
"p-queue": "^6.3.0",
|
||||
|
||||
@@ -132,10 +132,13 @@ export default {
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.asyncFind('')
|
||||
},
|
||||
methods: {
|
||||
asyncFind(query) {
|
||||
this.isLoading = true
|
||||
this.$store.dispatch('loadSharees').then(response => {
|
||||
this.$store.dispatch('loadSharees', query).then(response => {
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@ import card from './card'
|
||||
import comment from './comment'
|
||||
import trashbin from './trashbin'
|
||||
import attachment from './attachment'
|
||||
|
||||
import debounce from 'lodash/debounce'
|
||||
Vue.use(Vuex)
|
||||
|
||||
const apiClient = new BoardApi()
|
||||
@@ -181,7 +181,11 @@ export default new Vuex.Store({
|
||||
state.boards = boards
|
||||
},
|
||||
setSharees(state, shareesUsersAndGroups) {
|
||||
state.sharees = shareesUsersAndGroups.users
|
||||
state.sharees = shareesUsersAndGroups.exact.users
|
||||
state.sharees.push(...shareesUsersAndGroups.exact.groups)
|
||||
state.sharees.push(...shareesUsersAndGroups.exact.circles)
|
||||
|
||||
state.sharees.push(...shareesUsersAndGroups.users)
|
||||
state.sharees.push(...shareesUsersAndGroups.groups)
|
||||
state.sharees.push(...shareesUsersAndGroups.circles)
|
||||
},
|
||||
@@ -328,16 +332,20 @@ export default new Vuex.Store({
|
||||
const boards = await apiClient.loadBoards()
|
||||
commit('setBoards', boards)
|
||||
},
|
||||
loadSharees({ commit }) {
|
||||
loadSharees: debounce(function({ commit }, query) {
|
||||
const params = new URLSearchParams()
|
||||
if (typeof query === 'undefined') {
|
||||
return
|
||||
}
|
||||
params.append('search', query)
|
||||
params.append('format', 'json')
|
||||
params.append('perPage', 4)
|
||||
params.append('itemType', 0)
|
||||
params.append('itemType', 1)
|
||||
params.append('perPage', 20)
|
||||
params.append('itemType', [0, 1, 7])
|
||||
|
||||
axios.get(OC.linkToOCS('apps/files_sharing/api/v1') + 'sharees', { params }).then((response) => {
|
||||
commit('setSharees', response.data.ocs.data)
|
||||
})
|
||||
},
|
||||
}, 250),
|
||||
|
||||
setBoardFilter({ commmit }, filter) {
|
||||
commmit('setBoardFilter', filter)
|
||||
|
||||
Reference in New Issue
Block a user