From 7e5f6b33dd851f4464b9218db669746530a332c8 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 2 Mar 2026 20:22:43 +0100 Subject: [PATCH 1/3] fix(menu): use templates from collectives initialState if available Signed-off-by: Jonas --- src/components/Menu/ActionAttachmentUpload.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Menu/ActionAttachmentUpload.vue b/src/components/Menu/ActionAttachmentUpload.vue index 84401588359..9bc1d2b2506 100644 --- a/src/components/Menu/ActionAttachmentUpload.vue +++ b/src/components/Menu/ActionAttachmentUpload.vue @@ -116,7 +116,11 @@ export default { return this.$uploadingState.isUploadingAttachments }, templates() { - return loadState('files', 'templates', []) + let templates = loadState('collectives', 'templates', []) + if (!templates.length) { + templates = loadState('files', 'templates', []) + } + return templates }, isUploadDisabled() { return !this.openData?.hasOwner || !this.networkOnline From cecbb1c9f13e8545409898cd067ab420ae4bbda9 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 3 Mar 2026 09:36:52 +0100 Subject: [PATCH 2/3] fix(menu): exclude "New text file" from create file menu options Signed-off-by: Jonas --- src/components/Menu/ActionAttachmentUpload.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Menu/ActionAttachmentUpload.vue b/src/components/Menu/ActionAttachmentUpload.vue index 9bc1d2b2506..9d9243772cc 100644 --- a/src/components/Menu/ActionAttachmentUpload.vue +++ b/src/components/Menu/ActionAttachmentUpload.vue @@ -120,7 +120,11 @@ export default { if (!templates.length) { templates = loadState('files', 'templates', []) } - return templates + return ( + templates + // Exclude "New text file" as it doesn't make much sense from a text file + .filter((t) => !(t.app === 'text' && t.extension === '.md')) + ) }, isUploadDisabled() { return !this.openData?.hasOwner || !this.networkOnline From fac9248e6b44f010ba2b6da6b7ba41479e46ba23 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 3 Mar 2026 12:23:23 +0100 Subject: [PATCH 3/3] test(cypress): test creating whiteboard attachment Signed-off-by: Jonas --- .github/workflows/cypress-e2e.yml | 1 + cypress/e2e/attachments.spec.js | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cypress-e2e.yml b/.github/workflows/cypress-e2e.yml index 7d7d1c472fb..80436dc3954 100644 --- a/.github/workflows/cypress-e2e.yml +++ b/.github/workflows/cypress-e2e.yml @@ -166,6 +166,7 @@ jobs: php occ app:enable text php occ app:enable assistant --force php occ app:enable testing + php occ app:enable whiteboard --force php occ app:list php occ background:cron php occ config:system:set session_keepalive --value=false --type=boolean diff --git a/cypress/e2e/attachments.spec.js b/cypress/e2e/attachments.spec.js index 47190904221..cdddfbfbdfa 100644 --- a/cypress/e2e/attachments.spec.js +++ b/cypress/e2e/attachments.spec.js @@ -12,7 +12,7 @@ const attachmentFileNameToId = {} const ACTION_UPLOAD_LOCAL_FILE = 'insert-attachment-upload' const ACTION_INSERT_FROM_FILES = 'insert-attachment-insert' -const ACTION_CREATE_NEW_TEXT_FILE = 'insert-attachment-add-text-0' +const ACTION_CREATE_NEW_WHITEBOARD_FILE = 'insert-attachment-add-whiteboard-0' /** * @param {string} name name of file @@ -298,17 +298,14 @@ describe('Test all attachment insertion methods', () => { cy.closeFile() }) - it('Create a new text file as an attachment', () => { + it('Create a new whiteboard file as an attachment', () => { const check = (documentId, fileName) => { cy.log( 'Check the attachment is visible and well formed', documentId, fileName, ) - return cy - .get(`.text-editor [basename="${fileName}"]`) - .find('.text-editor__wrapper') - .should('be.visible') + return cy.get('.preview .widget-file.whiteboard').should('be.visible') } cy.visit('/apps/files') @@ -319,7 +316,7 @@ describe('Test all attachment insertion methods', () => { cy.intercept({ method: 'POST', url: '**/text/attachment/create' }).as( requestAlias, ) - clickOnAttachmentAction(ACTION_CREATE_NEW_TEXT_FILE).then(() => { + clickOnAttachmentAction(ACTION_CREATE_NEW_WHITEBOARD_FILE).then(() => { return waitForRequestAndCheckAttachment( requestAlias, undefined,