diff --git a/.github/workflows/cypress-e2e.yml b/.github/workflows/cypress-e2e.yml index b64c5608af2..ad13140550e 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, diff --git a/src/components/Menu/ActionAttachmentUpload.vue b/src/components/Menu/ActionAttachmentUpload.vue index 84401588359..ea196d0a772 100644 --- a/src/components/Menu/ActionAttachmentUpload.vue +++ b/src/components/Menu/ActionAttachmentUpload.vue @@ -54,7 +54,7 @@ :svg="template.iconSvgInline" /> - {{ template.actionLabel }} + {{ template.label }} @@ -116,7 +116,15 @@ 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 + // 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