diff options
-rw-r--r-- | apps/files/src/actions/editLocallyAction.spec.ts | 2 | ||||
-rw-r--r-- | apps/files/src/actions/editLocallyAction.ts | 1 | ||||
-rw-r--r-- | apps/files/src/actions/favoriteAction.ts | 7 | ||||
-rw-r--r-- | apps/files/src/actions/sidebarAction.spec.ts | 4 | ||||
-rw-r--r-- | apps/files/src/actions/sidebarAction.ts | 1 |
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, }) |