Skip to content

Commit ca0bda6

Browse files
silverkszlomejo-
authored andcommitted
refactor(CollisionResolveDialog): rephrase btns in CollisionResolveDialog
Rename buttons to hopefully make them more understandable. Signed-off-by: silver <s.szmajduch@posteo.de>
1 parent b2d31ec commit ca0bda6

2 files changed

Lines changed: 29 additions & 10 deletions

File tree

playwright/e2e/conflict.spec.ts

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ test.beforeEach(async ({ open }) => {
2222
const resolutionVariants = [
2323
{
2424
source: 'local',
25-
buttonName: /Overwrite the file and save /,
25+
buttonName: /Keep my local changes and overwrite the remote version/,
2626
headingName: 'Hello world',
2727
},
2828
{
2929
source: 'server',
30-
buttonName: /Discard the changes and edit /,
30+
buttonName: /Discard my local changes and use the remote version/,
3131
headingName: 'Good bye',
3232
},
3333
]
@@ -120,12 +120,12 @@ test.describe('Plaintext conflict resolution', () => {
120120
const plaintextResolutionVariants = [
121121
{
122122
source: 'local',
123-
buttonName: /Overwrite the file and save /,
123+
buttonName: /Keep my local changes and overwrite the remote version/,
124124
content: 'Hello world',
125125
},
126126
{
127127
source: 'server',
128-
buttonName: /Discard the changes and edit /,
128+
buttonName: /Discard my local changes and use the remote version/,
129129
content: 'Good bye',
130130
},
131131
]
@@ -174,7 +174,11 @@ test('[conflict] automatic resolution if no unsaved changes', async ({
174174
// Should show latest content, no conflict dialog
175175
await expect(editor.getHeading({ name: 'Good bye' })).toBeVisible()
176176
await expect(reader.content).not.toBeVisible()
177-
await expect(container.getButton({ name: /Overwrite/ })).not.toBeVisible()
177+
await expect(
178+
container.getButton({
179+
name: /Keep my local changes and overwrite the remote version/,
180+
}),
181+
).not.toBeVisible()
178182
})
179183

180184
test('readonly session hides conflict dialog', async ({
@@ -203,7 +207,11 @@ test('readonly session hides conflict dialog', async ({
203207

204208
// Should show latest content, no conflict dialog
205209
await expect(editor.getHeading({ name: 'Good bye' })).toBeVisible()
206-
await expect(container.getButton({ name: /Overwrite/ })).not.toBeVisible()
210+
await expect(
211+
container.getButton({
212+
name: /Keep my local changes and overwrite the remote version/,
213+
}),
214+
).not.toBeVisible()
207215
})
208216

209217
test('no conflict when uploading identical content with unsaved changes', async ({
@@ -288,7 +296,11 @@ test('no conflict when uploading identical content with local unsaved changes af
288296

289297
await expect(editor.getHeading({ name: 'Hello world' })).toBeVisible()
290298
await expect(reader.content).not.toBeVisible()
291-
await expect(container.getButton({ name: /Overwrite/ })).not.toBeVisible()
299+
await expect(
300+
container.getButton({
301+
name: /Keep my local changes and overwrite the remote version/,
302+
}),
303+
).not.toBeVisible()
292304
await expect(editor.getHeading({ name: 'Hello world' })).toBeVisible()
293305
})
294306

@@ -325,6 +337,10 @@ test('conflict dialog is sticky when scrolling', async ({
325337
// Scroll down
326338
await reader.getHeading({ name: 'Section 7' }).scrollIntoViewIfNeeded()
327339

328-
await expect(container.getButton({ name: /Overwrite/ })).toBeVisible()
340+
await expect(
341+
container.getButton({
342+
name: /Keep my local changes and overwrite the remote version/,
343+
}),
344+
).toBeVisible()
329345
await expect(page.locator('.document-status')).toBeVisible()
330346
})

src/components/CollisionResolveDialog.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ export default {
5959
const { setContent, setEditable } = useEditorMethods(editor)
6060
const editorSource = props.readerSource === 'local' ? 'server' : 'local'
6161
const textForSource = {
62-
local: t('text', 'Overwrite the file and save the unsaved changes'),
63-
server: t('text', 'Discard the changes and edit the latest version'),
62+
local: t(
63+
'text',
64+
'Keep my local changes and overwrite the remote version',
65+
),
66+
server: t('text', 'Discard my local changes and use the remote version'),
6467
}
6568
return {
6669
editorSource,

0 commit comments

Comments
 (0)