Merge pull request #54847 from nextcloud/fix/account-filter

fix: the account files filter should also work in trashbin
pull/54869/head
Andy Scherzinger 12 months ago committed by GitHub
commit 47669f5f38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      apps/files/src/components/FileListFilter/FileListFilter.vue
  2. 29
      apps/files_sharing/src/files_filters/AccountFilter.ts
  3. 4
      dist/files-init.js
  4. 2
      dist/files-init.js.map
  5. 4
      dist/files_sharing-init.js
  6. 3
      dist/files_sharing-init.js.license
  7. 2
      dist/files_sharing-init.js.map
  8. 4
      dist/settings-vue-settings-admin-basic-settings.js
  9. 2
      dist/settings-vue-settings-admin-basic-settings.js.map
  10. 4
      dist/settings-vue-settings-admin-delegation.js
  11. 2
      dist/settings-vue-settings-admin-delegation.js.map

@ -40,7 +40,7 @@ defineEmits<{
<style scoped>
.files-list-filter__clear-button :deep(.action-button__text) {
color: var(--color-error-text);
color: var(--color-text-error, var(--color-error-text));
}
:deep(.button-vue) {

@ -11,6 +11,7 @@ import Vue from 'vue'
import FileListFilterAccount from '../components/FileListFilterAccount.vue'
import { isPublicShare } from '@nextcloud/sharing/public'
import { TRASHBIN_VIEW_ID } from '../../../files_trashbin/src/files_views/trashbinView'
export interface IAccountData {
uid: string
@ -62,19 +63,30 @@ class AccountFilter extends FileListFilter {
const userIds = this.filterAccounts.map(({ uid }) => uid)
// Filter if the owner of the node is in the list of filtered accounts
return nodes.filter((node) => {
const sharees = node.attributes.sharees?.sharee as { id: string }[] | undefined
// If the node provides no information lets keep it
if (!node.owner && !sharees) {
return true
if (window.OCP.Files.Router.params.view === TRASHBIN_VIEW_ID) {
const deletedBy = node.attributes?.['trashbin-deleted-by-id']
if (deletedBy && userIds.includes(deletedBy)) {
return true
}
return false
}
// if the owner matches
if (node.owner && userIds.includes(node.owner)) {
return true
}
// Or any of the sharees (if only one share this will be an object, otherwise an array. So using `.flat()` to make it always an array)
const sharees = node.attributes.sharees?.sharee as { id: string }[] | undefined
if (sharees && [sharees].flat().some(({ id }) => userIds.includes(id))) {
return true
}
// If the node provides no information lets keep it
if (!node.owner && !sharees) {
return true
}
// Not a valid node for the current filter
return false
})
@ -139,6 +151,15 @@ class AccountFilter extends FileListFilter {
})
}
}
// lets also handle trashbin
const deletedBy = node.attributes?.['trashbin-deleted-by-id']
if (deletedBy) {
available.set(deletedBy, {
uid: deletedBy,
displayName: node.attributes?.['trashbin-deleted-by-display-name'] || deletedBy,
})
}
}
this.availableAccounts = [...available.values()]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -203,6 +203,9 @@ This file is generated from multiple sources. Included packages:
- vue-loader
- version: 15.11.1
- license: MIT
- vue-router
- version: 3.6.5
- license: MIT
- vue
- version: 2.7.16
- license: MIT

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save