aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2024-01-27 12:54:12 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2024-01-27 12:54:12 +0100
commit1ffb13cf5dfd1ceb9d0b091d25d3d0e8055f2afa (patch)
tree570eb9346c8f37c3632c7f5369b47dda4666a41c /apps
parentd06ed4d7cbc6117078e4cb46fdb60f17560db148 (diff)
downloadnextcloud-server-1ffb13cf5dfd1ceb9d0b091d25d3d0e8055f2afa.tar.gz
nextcloud-server-1ffb13cf5dfd1ceb9d0b091d25d3d0e8055f2afa.zip
chore(assets): Recompile assets
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/src/actions/deleteAction.spec.ts20
-rw-r--r--apps/files/src/actions/deleteAction.ts26
2 files changed, 11 insertions, 35 deletions
diff --git a/apps/files/src/actions/deleteAction.spec.ts b/apps/files/src/actions/deleteAction.spec.ts
index afc7ec5b921..c568ec59d9d 100644
--- a/apps/files/src/actions/deleteAction.spec.ts
+++ b/apps/files/src/actions/deleteAction.spec.ts
@@ -50,13 +50,13 @@ describe('Delete action conditions tests', () => {
permissions: Permission.ALL,
})
- const file2 = new File({
- id: 1,
- source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
- owner: 'admin',
- mime: 'text/plain',
- permissions: Permission.ALL,
- })
+ // const file2 = new File({
+ // id: 1,
+ // source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
+ // owner: 'admin',
+ // mime: 'text/plain',
+ // permissions: Permission.ALL,
+ // })
test('Default values', () => {
expect(action).toBeInstanceOf(FileAction)
@@ -77,9 +77,9 @@ describe('Delete action conditions tests', () => {
// expect(action.displayName([file2], view)).toBe('Unshare')
// })
- test('Shared and owned nodes values', () => {
- expect(action.displayName([file, file2], view)).toBe('Delete and unshare')
- })
+ // test('Shared and owned nodes values', () => {
+ // expect(action.displayName([file, file2], view)).toBe('Delete and unshare')
+ // })
})
describe('Delete action enabled tests', () => {
diff --git a/apps/files/src/actions/deleteAction.ts b/apps/files/src/actions/deleteAction.ts
index 9e7fae71d47..1bc07aaa6f9 100644
--- a/apps/files/src/actions/deleteAction.ts
+++ b/apps/files/src/actions/deleteAction.ts
@@ -24,41 +24,17 @@ import { Permission, Node, View, FileAction } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
import axios from '@nextcloud/axios'
import TrashCanSvg from '@mdi/svg/svg/trash-can.svg?raw'
-import CloseSvg from '@mdi/svg/svg/close.svg?raw'
import logger from '../logger.js'
-import { getCurrentUser } from '@nextcloud/auth'
-
-const isAllUnshare = (nodes: Node[]) => {
- return !nodes.some(node => node.owner === getCurrentUser()?.uid)
-}
-
-const isMixedUnshareAndDelete = (nodes: Node[]) => {
- const hasUnshareItems = nodes.some(node => node.owner !== getCurrentUser()?.uid)
- const hasDeleteItems = nodes.some(node => node.owner === getCurrentUser()?.uid)
- return hasUnshareItems && hasDeleteItems
-}
export const action = new FileAction({
id: 'delete',
displayName(nodes: Node[], view: View) {
- if (isMixedUnshareAndDelete(nodes)) {
- return t('files', 'Delete and unshare')
- }
-
- // Temporary disabled until fixed on 28.0.3
- // if (isAllUnshare(nodes)) {
- // return t('files', 'Unshare')
- // }
-
return view.id === 'trashbin'
? t('files', 'Delete permanently')
: t('files', 'Delete')
},
- iconSvgInline: (nodes: Node[]) => {
- if (isAllUnshare(nodes)) {
- return CloseSvg
- }
+ iconSvgInline: () => {
return TrashCanSvg
},