From c3a1b17381037bacebc74224100fbf1760a2ff5f Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Tue, 29 Mar 2022 11:29:45 +0200 Subject: [PATCH] add image upload via drag'n'drop remove image upload by link move 'image insertion from files' from MenuBar to EditorWrapper allow uploading multiple files Signed-off-by: Julien Veyssier --- cypress/integration/images.spec.js | 19 +---- src/components/EditorWrapper.vue | 75 +++++++++++++++++++- src/components/MenuBar.vue | 107 +++-------------------------- src/nodes/ImageView.vue | 1 + 4 files changed, 84 insertions(+), 118 deletions(-) diff --git a/cypress/integration/images.spec.js b/cypress/integration/images.spec.js index a63f7dbba83..67952fe0709 100644 --- a/cypress/integration/images.spec.js +++ b/cypress/integration/images.spec.js @@ -139,23 +139,6 @@ describe('Test all image insertion methods', () => { }) }) - it('Insert an image from a link', () => { - cy.openFile('test.md') - clickOnImageAction(ACTION_INSERT_FROM_LINK, (popoverId) => { - const requestAlias = 'insertLinkRequest' - cy.intercept({ method: 'POST', url: '**/link' }).as(requestAlias) - - cy.log('Type and validate') - cy.get('div#' + popoverId + ' li:nth-child(3) input[type=text]') - .type('https://nextcloud.com/wp-content/themes/next/assets/img/headers/engineering-small.jpg', { waitForAnimations: true }) - .type('{enter}', { waitForAnimations: true }) - // Clicking on the validation button is an alternative to typing {enter} - // cy.get('div#' + popoverId + ' li:nth-child(3) form > label').click() - - waitForRequestAndCheckImage(requestAlias) - }) - }) - it('Upload a local image', () => { cy.openFile('test.md') // in this case we almost could just attach the file to the input @@ -174,7 +157,7 @@ describe('Test all image insertion methods', () => { it('test if image files are in the attachment folder', () => { // check we stored the image names/ids - cy.expect(Object.keys(attachmentFileNameToId)).to.have.lengthOf(3) + cy.expect(Object.keys(attachmentFileNameToId)).to.have.lengthOf(2) cy.get(`#fileList tr[data-file="test.md"]`, { timeout: 10000 }) .should('have.attr', 'data-id') diff --git a/src/components/EditorWrapper.vue b/src/components/EditorWrapper.vue index e72f769d812..e589b221954 100644 --- a/src/components/EditorWrapper.vue +++ b/src/components/EditorWrapper.vue @@ -34,7 +34,12 @@