mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
fix(files): also use open-in-files for the search view
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
2c3774892e
commit
d5a4eb8139
3 changed files with 12 additions and 10 deletions
|
|
@ -19,7 +19,7 @@ const recentView = {
|
|||
describe('Open in files action conditions tests', () => {
|
||||
test('Default values', () => {
|
||||
expect(action).toBeInstanceOf(FileAction)
|
||||
expect(action.id).toBe('open-in-files-recent')
|
||||
expect(action.id).toBe('open-in-files')
|
||||
expect(action.displayName([], recentView)).toBe('Open in Files')
|
||||
expect(action.iconSvgInline([], recentView)).toBe('')
|
||||
expect(action.default).toBe(DefaultType.HIDDEN)
|
||||
|
|
|
|||
|
|
@ -2,19 +2,21 @@
|
|||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
import { translate as t } from '@nextcloud/l10n'
|
||||
import { type Node, FileType, FileAction, DefaultType } from '@nextcloud/files'
|
||||
|
||||
/**
|
||||
* TODO: Move away from a redirect and handle
|
||||
* navigation straight out of the recent view
|
||||
*/
|
||||
import type { Node } from '@nextcloud/files'
|
||||
|
||||
import { t } from '@nextcloud/l10n'
|
||||
import { FileType, FileAction, DefaultType } from '@nextcloud/files'
|
||||
import { VIEW_ID as SEARCH_VIEW_ID } from '../views/search'
|
||||
|
||||
export const action = new FileAction({
|
||||
id: 'open-in-files-recent',
|
||||
id: 'open-in-files',
|
||||
displayName: () => t('files', 'Open in Files'),
|
||||
iconSvgInline: () => '',
|
||||
|
||||
enabled: (nodes, view) => view.id === 'recent',
|
||||
enabled(nodes, view) {
|
||||
return view.id === 'recent' || view.id === SEARCH_VIEW_ID
|
||||
},
|
||||
|
||||
async exec(node: Node) {
|
||||
let dir = node.dirname
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const invalidViews = [
|
|||
describe('Open in files action conditions tests', () => {
|
||||
test('Default values', () => {
|
||||
expect(action).toBeInstanceOf(FileAction)
|
||||
expect(action.id).toBe('open-in-files')
|
||||
expect(action.id).toBe('files_sharing:open-in-files')
|
||||
expect(action.displayName([], validViews[0])).toBe('Open in Files')
|
||||
expect(action.iconSvgInline([], validViews[0])).toBe('')
|
||||
expect(action.default).toBe(DefaultType.HIDDEN)
|
||||
|
|
|
|||
Loading…
Reference in a new issue