aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-07-05 15:59:44 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-07-05 16:20:34 +0200
commit9b0e3a97cb2f852188a07c102a6565e609ae1a64 (patch)
tree5b62e432c9a65894d21ab41d9836f1e1868c51cf /apps/files
parent3e99d815749596768740217d987e9fd81ee5db3e (diff)
downloadnextcloud-server-9b0e3a97cb2f852188a07c102a6565e609ae1a64.tar.gz
nextcloud-server-9b0e3a97cb2f852188a07c102a6565e609ae1a64.zip
fix(files): invalid default actions
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/src/actions/editLocallyAction.spec.ts2
-rw-r--r--apps/files/src/actions/editLocallyAction.ts1
-rw-r--r--apps/files/src/actions/favoriteAction.ts7
-rw-r--r--apps/files/src/actions/sidebarAction.spec.ts4
-rw-r--r--apps/files/src/actions/sidebarAction.ts1
5 files changed, 9 insertions, 6 deletions
diff --git a/apps/files/src/actions/editLocallyAction.spec.ts b/apps/files/src/actions/editLocallyAction.spec.ts
index af3e2bf7553..f40b3b558db 100644
--- a/apps/files/src/actions/editLocallyAction.spec.ts
+++ b/apps/files/src/actions/editLocallyAction.spec.ts
@@ -38,7 +38,7 @@ describe('Edit locally action conditions tests', () => {
expect(action.id).toBe('edit-locally')
expect(action.displayName([], view)).toBe('Edit locally')
expect(action.iconSvgInline([], view)).toBe('<svg>SvgMock</svg>')
- expect(action.default).toBe(DefaultType.DEFAULT)
+ expect(action.default).toBeUndefined()
expect(action.order).toBe(25)
})
})
diff --git a/apps/files/src/actions/editLocallyAction.ts b/apps/files/src/actions/editLocallyAction.ts
index 3f042884624..ce693adc157 100644
--- a/apps/files/src/actions/editLocallyAction.ts
+++ b/apps/files/src/actions/editLocallyAction.ts
@@ -65,7 +65,6 @@ export const action = new FileAction({
return null
},
- default: DefaultType.DEFAULT,
order: 25,
})
diff --git a/apps/files/src/actions/favoriteAction.ts b/apps/files/src/actions/favoriteAction.ts
index c15564247e2..1ae77b6fb21 100644
--- a/apps/files/src/actions/favoriteAction.ts
+++ b/apps/files/src/actions/favoriteAction.ts
@@ -23,6 +23,7 @@ import { emit } from '@nextcloud/event-bus'
import { translate as t } from '@nextcloud/l10n'
import axios from '@nextcloud/axios'
import StarSvg from '@mdi/svg/svg/star.svg?raw'
+import StarOutlineSvg from '@mdi/svg/svg/star-outline.svg?raw'
import type { Node } from '@nextcloud/files'
import { generateUrl } from '@nextcloud/router'
@@ -77,7 +78,11 @@ export const action = new FileAction({
? t('files', 'Add to favorites')
: t('files', 'Remove from favorites')
},
- iconSvgInline: () => StarSvg,
+ iconSvgInline: (nodes: Node[]) => {
+ return shouldFavorite(nodes)
+ ? StarOutlineSvg
+ : StarSvg
+ },
enabled(nodes: Node[]) {
// We can only favorite nodes within files
diff --git a/apps/files/src/actions/sidebarAction.spec.ts b/apps/files/src/actions/sidebarAction.spec.ts
index 6c6c5b140e8..c4750092ebc 100644
--- a/apps/files/src/actions/sidebarAction.spec.ts
+++ b/apps/files/src/actions/sidebarAction.spec.ts
@@ -22,7 +22,7 @@
import { action } from './sidebarAction'
import { expect } from '@jest/globals'
import { File } from '@nextcloud/files'
-import { DefaultType, FileAction } from '../services/FileAction'
+import { FileAction } from '../services/FileAction'
import type { Navigation } from '../services/Navigation'
import logger from '../logger'
@@ -37,7 +37,7 @@ describe('Open sidebar action conditions tests', () => {
expect(action.id).toBe('details')
expect(action.displayName([], view)).toBe('Open details')
expect(action.iconSvgInline([], view)).toBe('<svg>SvgMock</svg>')
- expect(action.default).toBe(DefaultType.DEFAULT)
+ expect(action.default).toBeUndefined()
expect(action.order).toBe(-50)
})
})
diff --git a/apps/files/src/actions/sidebarAction.ts b/apps/files/src/actions/sidebarAction.ts
index d3d6e2b5ec7..141cd75ff19 100644
--- a/apps/files/src/actions/sidebarAction.ts
+++ b/apps/files/src/actions/sidebarAction.ts
@@ -60,7 +60,6 @@ export const action = new FileAction({
}
},
- default: DefaultType.DEFAULT,
order: -50,
})