Skip to content

Commit f497ece

Browse files
authored
Merge pull request #4740 from nextcloud/backport/4739/stable29
[stable29] Fix save as on mobile with direct editing
2 parents 83221a8 + 3abbf61 commit f497ece

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
@@ -118,4 +118,41 @@ describe('Direct editing (legacy)', function() {
118118
})
119119
})
120120

121+
it('Save as', function() {
122+
createDirectEditingLink(randUser, fileId)
123+
.then((token) => {
124+
cy.nextcloudTestingAppConfigSet('richdocuments', 'uiDefaults-UIMode', 'tabbed')
125+
cy.logout()
126+
cy.visit(token)
127+
cy.waitForCollabora(false)
128+
129+
cy.get('@loleafletframe').within(() => {
130+
cy.get('.notebookbar-tabs-container', { timeout: 30_000 })
131+
.should('be.visible')
132+
133+
cy.get('button[aria-label="File"]').click()
134+
cy.get('button[aria-label="Save As"]').click()
135+
136+
cy.get('#saveas-entries #saveas-entry-1').click()
137+
})
138+
139+
cy.get('.saveas-dialog')
140+
.should('be.visible')
141+
cy.get('.saveas-dialog input[type=text]')
142+
.should('be.visible')
143+
.should('have.value', 'document.odt')
144+
145+
cy.get('.saveas-dialog input[type=text]')
146+
.clear()
147+
cy.get('.saveas-dialog input[type=text]')
148+
.type('/document.rtf')
149+
150+
cy.get('.saveas-dialog button.button-vue--vue-primary').click()
151+
152+
cy.get('@loleafletframe').within(() => {
153+
cy.verifyOpen('document.rtf')
154+
})
155+
})
156+
})
157+
121158
})

src/document.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ const documentsMain = {
464464
spawnDialog(
465465
SaveAs,
466466
{
467-
path: documentsMain.filename,
467+
path: documentsMain.fileName,
468468
format: args.Format,
469469
},
470-
(value) => value && this.sendPostMessage('Action_SaveAs', { Filename: value, Notify: true }),
470+
(value) => value && PostMessages.sendWOPIPostMessage('loolframe', 'Action_SaveAs', { Filename: value, Notify: true }),
471471
)
472472
} else if (msgId === 'Action_Save_Resp') {
473473
if (args.success && args.fileName) {

0 commit comments

Comments
 (0)