From 9746870ad6c891f73b37638a21603b59b64bb453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 30 Aug 2024 13:17:42 +0200 Subject: [PATCH 1/2] fix: Properly show attachment extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- cypress/e2e/cardFeatures.js | 3 ++- src/components/card/AttachmentList.vue | 14 ++++++++++++-- src/components/card/Description.vue | 7 +++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/cardFeatures.js b/cypress/e2e/cardFeatures.js index 71eb0f001..8ba320e17 100644 --- a/cypress/e2e/cardFeatures.js +++ b/cypress/e2e/cardFeatures.js @@ -114,7 +114,8 @@ describe('Card', function() { cy.get('.file-picker__main [data-filename="welcome.txt"]').should('be.visible') .click() cy.get('.dialog__actions button.button-vue--vue-primary').click() - cy.get('.attachment-list .basename').contains('welcome.txt') + cy.get('.attachment-list .filename').contains('welcome') + cy.get('.attachment-list .filename .extension').contains('txt') }) it('Shows the modal with the editor', () => { diff --git a/src/components/card/AttachmentList.vue b/src/components/card/AttachmentList.vue index 96a171ab2..756f0cc28 100644 --- a/src/components/card/AttachmentList.vue +++ b/src/components/card/AttachmentList.vue @@ -41,7 +41,8 @@
- {{ attachment.name }} + {{ attachmentBasename(attachment) }} + .{{ attachmentExtension(attachment) }}
@@ -58,7 +59,8 @@
- {{ attachment.data }} + {{ attachmentBasename(attachment) }} + .{{ attachmentExtension(attachment) }}
{{ formattedFileSize(attachment.extendedData.filesize) }} @@ -200,6 +202,14 @@ export default { return t('deck', 'Drop your files to upload') } }, + attachmentBasename() { + return (attachment) => attachment?.extendedData?.info.filename + ?? (attachment?.name ?? attachment.data).replace(/\.[^/.]+$/, '') + }, + attachmentExtension() { + return (attachment) => attachment?.extendedData?.info?.extension + ?? (attachment?.name ?? attachment.data).split('.').pop() + }, }, watch: { cardId: { diff --git a/src/components/card/Description.vue b/src/components/card/Description.vue index 4369b9abb..f71103976 100644 --- a/src/components/card/Description.vue +++ b/src/components/card/Description.vue @@ -255,15 +255,18 @@ export default { }, addAttachment(attachment) { const asImage = (attachment.type === 'file' && attachment.extendedData.hasPreview) || attachment.extendedData.mimetype.includes('image') + // We need to strip those as text does not support rtl yet, so we cannot insert them separately + const stripRTLO = (text) => text.replaceAll('\u202e', '') + const fileName = stripRTLO(attachment.extendedData.info.filename) + '.' + stripRTLO(attachment.extendedData.info.extension) if (this.editor) { this.editor.insertAtCursor( asImage ? `${attachment.data}` - : `${attachment.data}`, + : `${fileName}`, ) return } else { - const attachmentString = (asImage ? '!' : '') + '[📎 ' + attachment.data + '](' + this.attachmentPreview(attachment) + ')' + const attachmentString = (asImage ? '!' : '') + '[📎 ' + fileName + '](' + this.attachmentPreview(attachment) + ')' const descString = this.$refs.markdownEditor.easymde.value() const newContent = descString + '\n' + attachmentString this.$refs.markdownEditor.easymde.value(newContent) From 3f7389d7733c7be73853c46ba76d2444dbdeae1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Dec 2023 02:13:47 +0000 Subject: [PATCH 2/2] Chore(deps): Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/appbuild.yml | 2 +- .github/workflows/cypress.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/appbuild.yml b/.github/workflows/appbuild.yml index 9f72c13ba..7fd5600a9 100644 --- a/.github/workflows/appbuild.yml +++ b/.github/workflows/appbuild.yml @@ -37,7 +37,7 @@ jobs: uname -a RUST_BACKTRACE=1 krankerl --version RUST_BACKTRACE=1 krankerl package - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: Deck app tarball path: build/artifacts/deck.tar.gz diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 5ec20bb33..e7824ec09 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -108,7 +108,7 @@ jobs: npm_package_name: ${{ env.APP_NAME }} - name: Upload test failure screenshots - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: Upload screenshots @@ -116,7 +116,7 @@ jobs: retention-days: 5 - name: Upload nextcloud logs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: Upload nextcloud log