mirror of
https://github.com/nextcloud/server.git
synced 2026-03-26 20:33:55 -04:00
Merge pull request #50957 from nextcloud/patch-14
fix: rename 'edit locally' to 'open locally'
This commit is contained in:
commit
a4ffc554d4
5 changed files with 14 additions and 14 deletions
|
|
@ -7,7 +7,7 @@ import { beforeAll, beforeEach, describe, expect, test, vi } from 'vitest'
|
|||
|
||||
import axios from '@nextcloud/axios'
|
||||
import * as nextcloudDialogs from '@nextcloud/dialogs'
|
||||
import { action } from './editLocallyAction'
|
||||
import { action } from './openLocallyAction'
|
||||
|
||||
vi.mock('@nextcloud/auth')
|
||||
vi.mock('@nextcloud/axios')
|
||||
|
|
@ -25,18 +25,18 @@ beforeAll(() => {
|
|||
(window as any).OCA = { Viewer: { open: vi.fn() } }
|
||||
})
|
||||
|
||||
describe('Edit locally action conditions tests', () => {
|
||||
describe('Open locally action conditions tests', () => {
|
||||
test('Default values', () => {
|
||||
expect(action).toBeInstanceOf(FileAction)
|
||||
expect(action.id).toBe('edit-locally')
|
||||
expect(action.displayName([], view)).toBe('Edit locally')
|
||||
expect(action.displayName([], view)).toBe('Open locally')
|
||||
expect(action.iconSvgInline([], view)).toMatch(/<svg.+<\/svg>/)
|
||||
expect(action.default).toBeUndefined()
|
||||
expect(action.order).toBe(25)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Edit locally action enabled tests', () => {
|
||||
describe('Open locally action enabled tests', () => {
|
||||
test('Enabled for file with UPDATE permission', () => {
|
||||
const file = new File({
|
||||
id: 1,
|
||||
|
|
@ -108,7 +108,7 @@ describe('Edit locally action enabled tests', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('Edit locally action execute tests', () => {
|
||||
describe('Open locally action execute tests', () => {
|
||||
let spyShowDialog
|
||||
beforeEach(() => {
|
||||
vi.resetAllMocks()
|
||||
|
|
@ -116,7 +116,7 @@ describe('Edit locally action execute tests', () => {
|
|||
.mockImplementation(() => Promise.resolve())
|
||||
})
|
||||
|
||||
test('Edit locally opens proper URL', async () => {
|
||||
test('Open locally opens proper URL', async () => {
|
||||
vi.spyOn(axios, 'post').mockImplementation(async () => ({
|
||||
data: { ocs: { data: { token: 'foobar' } } },
|
||||
}))
|
||||
|
|
@ -143,7 +143,7 @@ describe('Edit locally action execute tests', () => {
|
|||
expect(windowOpenSpy).toBeCalledWith('nc://open/test@nextcloud.local/foobar.txt?token=foobar', '_self')
|
||||
})
|
||||
|
||||
test('Edit locally fails and shows error', async () => {
|
||||
test('Open locally fails and shows error', async () => {
|
||||
vi.spyOn(axios, 'post').mockImplementation(async () => ({}))
|
||||
const showError = vi.spyOn(nextcloudDialogs, 'showError')
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ const confirmLocalEditDialog = (
|
|||
let callbackCalled = false
|
||||
|
||||
return (new DialogBuilder())
|
||||
.setName(t('files', 'Edit file locally'))
|
||||
.setName(t('files', 'Open file locally'))
|
||||
.setText(t('files', 'The file should now open on your device. If it doesn\'t, please check that you have the desktop app installed.'))
|
||||
.setButtons([
|
||||
{
|
||||
|
|
@ -31,7 +31,7 @@ const confirmLocalEditDialog = (
|
|||
},
|
||||
},
|
||||
{
|
||||
label: t('files', 'Edit online'),
|
||||
label: t('files', 'Open online'),
|
||||
icon: IconWeb,
|
||||
type: 'primary',
|
||||
callback: () => {
|
||||
|
|
@ -80,7 +80,7 @@ const openLocalClient = async function(path: string) {
|
|||
|
||||
export const action = new FileAction({
|
||||
id: 'edit-locally',
|
||||
displayName: () => t('files', 'Edit locally'),
|
||||
displayName: () => t('files', 'Open locally'),
|
||||
iconSvgInline: () => LaptopSvg,
|
||||
|
||||
// Only works on single files
|
||||
|
|
@ -6,7 +6,7 @@ import { addNewFileMenuEntry, registerDavProperty, registerFileAction } from '@n
|
|||
|
||||
import { action as deleteAction } from './actions/deleteAction'
|
||||
import { action as downloadAction } from './actions/downloadAction'
|
||||
import { action as editLocallyAction } from './actions/editLocallyAction'
|
||||
import { action as editLocallyAction } from './actions/openLocallyAction.ts'
|
||||
import { action as favoriteAction } from './actions/favoriteAction'
|
||||
import { action as moveOrCopyAction } from './actions/moveOrCopyAction'
|
||||
import { action as openFolderAction } from './actions/openFolderAction'
|
||||
|
|
|
|||
4
dist/files-init.js
vendored
4
dist/files-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-init.js.map
vendored
2
dist/files-init.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue