From b3e96463a2e577203f2d640d88988eee56b4b00c 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 26433c17f108e7ddb33baf5dfacd12ab09b56147 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 1899e28f5d7b8597fb9a16966c6eefa191d5d53c 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') + }) + }) + }) + })