Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
29 changes: 25 additions & 4 deletions apps/files_sharing/src/files_filters/AccountFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
})
Expand Down Expand Up @@ -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()]
Expand Down
4 changes: 2 additions & 2 deletions dist/files-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-init.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions dist/files_sharing-init.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SPDX-FileCopyrightText: Matt Zabriskie
SPDX-FileCopyrightText: Joyent
SPDX-FileCopyrightText: Jonas Schade <derzade@gmail.com>
SPDX-FileCopyrightText: Jacob Clevenger<https://github.com/wheatjs>
SPDX-FileCopyrightText: Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)
SPDX-FileCopyrightText: Guillaume Chau <guillaume.b.chau@gmail.com>
SPDX-FileCopyrightText: GitHub Inc.
SPDX-FileCopyrightText: Feross Aboukhadijeh
Expand Down Expand Up @@ -77,6 +78,9 @@ This file is generated from multiple sources. Included packages:
- @nextcloud/logger
- version: 3.0.2
- license: GPL-3.0-or-later
- @nextcloud/moment
- version: 1.3.5
- license: GPL-3.0-or-later
- @nextcloud/paths
- version: 2.2.1
- license: GPL-3.0-or-later
Expand Down Expand Up @@ -140,6 +144,9 @@ This file is generated from multiple sources. Included packages:
- md5
- version: 2.3.0
- license: BSD-3-Clause
- moment
- version: 2.30.1
- license: MIT
- buffer
- version: 6.0.3
- license: MIT
Expand Down Expand Up @@ -185,6 +192,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
Expand Down
2 changes: 1 addition & 1 deletion dist/files_sharing-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-personal-password.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-personal-password.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/systemtags-admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/systemtags-admin.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/twofactor_backupcodes-settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/twofactor_backupcodes-settings.js.map

Large diffs are not rendered by default.

Loading