Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/cypress-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 4 additions & 7 deletions cypress/e2e/attachments.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand All @@ -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,
Expand Down
12 changes: 10 additions & 2 deletions src/components/Menu/ActionAttachmentUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
:svg="template.iconSvgInline" />
<Plus v-else />
</template>
{{ template.actionLabel }}
{{ template.label }}
</NcActionButton>
</template>
</NcActions>
Expand Down Expand Up @@ -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
Expand Down
Loading