Skip to content

Commit a4ffc55

Browse files
authored
Merge pull request #50957 from nextcloud/patch-14
fix: rename 'edit locally' to 'open locally'
2 parents 21eb6d5 + 28e69f3 commit a4ffc55

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

apps/files/src/actions/editLocallyAction.spec.ts renamed to apps/files/src/actions/openLocallyAction.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { beforeAll, beforeEach, describe, expect, test, vi } from 'vitest'
77

88
import axios from '@nextcloud/axios'
99
import * as nextcloudDialogs from '@nextcloud/dialogs'
10-
import { action } from './editLocallyAction'
10+
import { action } from './openLocallyAction'
1111

1212
vi.mock('@nextcloud/auth')
1313
vi.mock('@nextcloud/axios')
@@ -25,18 +25,18 @@ beforeAll(() => {
2525
(window as any).OCA = { Viewer: { open: vi.fn() } }
2626
})
2727

28-
describe('Edit locally action conditions tests', () => {
28+
describe('Open locally action conditions tests', () => {
2929
test('Default values', () => {
3030
expect(action).toBeInstanceOf(FileAction)
3131
expect(action.id).toBe('edit-locally')
32-
expect(action.displayName([], view)).toBe('Edit locally')
32+
expect(action.displayName([], view)).toBe('Open locally')
3333
expect(action.iconSvgInline([], view)).toMatch(/<svg.+<\/svg>/)
3434
expect(action.default).toBeUndefined()
3535
expect(action.order).toBe(25)
3636
})
3737
})
3838

39-
describe('Edit locally action enabled tests', () => {
39+
describe('Open locally action enabled tests', () => {
4040
test('Enabled for file with UPDATE permission', () => {
4141
const file = new File({
4242
id: 1,
@@ -108,15 +108,15 @@ describe('Edit locally action enabled tests', () => {
108108
})
109109
})
110110

111-
describe('Edit locally action execute tests', () => {
111+
describe('Open locally action execute tests', () => {
112112
let spyShowDialog
113113
beforeEach(() => {
114114
vi.resetAllMocks()
115115
spyShowDialog = vi.spyOn(nextcloudDialogs.Dialog.prototype, 'show')
116116
.mockImplementation(() => Promise.resolve())
117117
})
118118

119-
test('Edit locally opens proper URL', async () => {
119+
test('Open locally opens proper URL', async () => {
120120
vi.spyOn(axios, 'post').mockImplementation(async () => ({
121121
data: { ocs: { data: { token: 'foobar' } } },
122122
}))
@@ -143,7 +143,7 @@ describe('Edit locally action execute tests', () => {
143143
expect(windowOpenSpy).toBeCalledWith('nc://open/test@nextcloud.local/foobar.txt?token=foobar', '_self')
144144
})
145145

146-
test('Edit locally fails and shows error', async () => {
146+
test('Open locally fails and shows error', async () => {
147147
vi.spyOn(axios, 'post').mockImplementation(async () => ({}))
148148
const showError = vi.spyOn(nextcloudDialogs, 'showError')
149149

apps/files/src/actions/editLocallyAction.ts renamed to apps/files/src/actions/openLocallyAction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const confirmLocalEditDialog = (
1919
let callbackCalled = false
2020

2121
return (new DialogBuilder())
22-
.setName(t('files', 'Edit file locally'))
22+
.setName(t('files', 'Open file locally'))
2323
.setText(t('files', 'The file should now open on your device. If it doesn\'t, please check that you have the desktop app installed.'))
2424
.setButtons([
2525
{
@@ -31,7 +31,7 @@ const confirmLocalEditDialog = (
3131
},
3232
},
3333
{
34-
label: t('files', 'Edit online'),
34+
label: t('files', 'Open online'),
3535
icon: IconWeb,
3636
type: 'primary',
3737
callback: () => {
@@ -80,7 +80,7 @@ const openLocalClient = async function(path: string) {
8080

8181
export const action = new FileAction({
8282
id: 'edit-locally',
83-
displayName: () => t('files', 'Edit locally'),
83+
displayName: () => t('files', 'Open locally'),
8484
iconSvgInline: () => LaptopSvg,
8585

8686
// Only works on single files

apps/files/src/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { addNewFileMenuEntry, registerDavProperty, registerFileAction } from '@n
66

77
import { action as deleteAction } from './actions/deleteAction'
88
import { action as downloadAction } from './actions/downloadAction'
9-
import { action as editLocallyAction } from './actions/editLocallyAction'
9+
import { action as editLocallyAction } from './actions/openLocallyAction.ts'
1010
import { action as favoriteAction } from './actions/favoriteAction'
1111
import { action as moveOrCopyAction } from './actions/moveOrCopyAction'
1212
import { action as openFolderAction } from './actions/openFolderAction'

dist/files-init.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-init.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)