From 3cb28a716d4c8a77010fb4495ca44df5bb688589 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 7 May 2025 14:23:45 +0200 Subject: [PATCH 1/3] fix(direct-editing): Use proper path in the save as dialog Signed-off-by: Julius Knorr --- src/document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/document.js b/src/document.js index 9d971ba8a9..1625332790 100644 --- a/src/document.js +++ b/src/document.js @@ -473,7 +473,7 @@ const documentsMain = { spawnDialog( SaveAs, { - path: documentsMain.filename, + path: documentsMain.fileName, format: args.Format, }, (value) => value && this.sendPostMessage('Action_SaveAs', { Filename: value, Notify: true }), From 91b4fd50d2df3ab12ed30fef70cd9b2cce12feaa Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 7 May 2025 14:24:21 +0200 Subject: [PATCH 2/3] fix(direct-editing): Use correct method to pass the Action_SaveAs post message Signed-off-by: Julius Knorr --- src/document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/document.js b/src/document.js index 1625332790..17f0c0cb4c 100644 --- a/src/document.js +++ b/src/document.js @@ -476,7 +476,7 @@ const documentsMain = { path: documentsMain.fileName, format: args.Format, }, - (value) => value && this.sendPostMessage('Action_SaveAs', { Filename: value, Notify: true }), + (value) => value && PostMessages.sendWOPIPostMessage('loolframe', 'Action_SaveAs', { Filename: value, Notify: true }), ) } else if (msgId === 'Action_Save_Resp') { if (args.success && args.fileName) { From 97c5b88689ddb6fa9bfc1cc98517525179570a07 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 7 May 2025 14:40:44 +0200 Subject: [PATCH 3/3] test(direct-editing): Add test for save as in direct editing Signed-off-by: Julius Knorr --- cypress/e2e/direct.spec.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/cypress/e2e/direct.spec.js b/cypress/e2e/direct.spec.js index 66bf0c6ba7..87541e845e 100644 --- a/cypress/e2e/direct.spec.js +++ b/cypress/e2e/direct.spec.js @@ -161,4 +161,41 @@ describe('Direct editing (legacy)', function() { }) }) + it('Save as', function() { + createDirectEditingLink(randUser, fileId) + .then((token) => { + cy.nextcloudTestingAppConfigSet('richdocuments', 'uiDefaults-UIMode', 'tabbed') + cy.logout() + cy.visit(token) + cy.waitForCollabora(false) + + cy.get('@loleafletframe').within(() => { + cy.get('.notebookbar-tabs-container', { timeout: 30_000 }) + .should('be.visible') + + cy.get('button[aria-label="File"]').click() + cy.get('button[aria-label="Save As"]').click() + + cy.get('#saveas-entries #saveas-entry-1').click() + }) + + cy.get('.saveas-dialog') + .should('be.visible') + cy.get('.saveas-dialog input[type=text]') + .should('be.visible') + .should('have.value', 'document.odt') + + cy.get('.saveas-dialog input[type=text]') + .clear() + cy.get('.saveas-dialog input[type=text]') + .type('/document.rtf') + + cy.get('.saveas-dialog button.button-vue--vue-primary').click() + + cy.get('@loleafletframe').within(() => { + cy.verifyOpen('document.rtf') + }) + }) + }) + })