Skip to content

Commit 122bf06

Browse files
authored
Merge pull request #4739 from nextcloud/fix/save-as-direct-editing
Fix save as on mobile with direct editing
2 parents 307c09a + 0c43550 commit 122bf06

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

cypress/e2e/direct.spec.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,41 @@ describe('Direct editing (legacy)', function() {
161161
})
162162
})
163163

164+
it('Save as', function() {
165+
createDirectEditingLink(randUser, fileId)
166+
.then((token) => {
167+
cy.nextcloudTestingAppConfigSet('richdocuments', 'uiDefaults-UIMode', 'tabbed')
168+
cy.logout()
169+
cy.visit(token)
170+
cy.waitForCollabora(false)
171+
172+
cy.get('@loleafletframe').within(() => {
173+
cy.get('.notebookbar-tabs-container', { timeout: 30_000 })
174+
.should('be.visible')
175+
176+
cy.get('button[aria-label="File"]').click()
177+
cy.get('button[aria-label="Save As"]').click()
178+
179+
cy.get('#saveas-entries #saveas-entry-1').click()
180+
})
181+
182+
cy.get('.saveas-dialog')
183+
.should('be.visible')
184+
cy.get('.saveas-dialog input[type=text]')
185+
.should('be.visible')
186+
.should('have.value', 'document.odt')
187+
188+
cy.get('.saveas-dialog input[type=text]')
189+
.clear()
190+
cy.get('.saveas-dialog input[type=text]')
191+
.type('/document.rtf')
192+
193+
cy.get('.saveas-dialog button.button-vue--vue-primary').click()
194+
195+
cy.get('@loleafletframe').within(() => {
196+
cy.verifyOpen('document.rtf')
197+
})
198+
})
199+
})
200+
164201
})

src/document.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,10 @@ const documentsMain = {
473473
spawnDialog(
474474
SaveAs,
475475
{
476-
path: documentsMain.filename,
476+
path: documentsMain.fileName,
477477
format: args.Format,
478478
},
479-
(value) => value && this.sendPostMessage('Action_SaveAs', { Filename: value, Notify: true }),
479+
(value) => value && PostMessages.sendWOPIPostMessage('loolframe', 'Action_SaveAs', { Filename: value, Notify: true }),
480480
)
481481
} else if (msgId === 'Action_Save_Resp') {
482482
if (args.success && args.fileName) {

0 commit comments

Comments
 (0)