From c94ebf0cb271d682235870bb628124ac73b24914 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 11 Aug 2021 18:02:33 +0530 Subject: [PATCH] feat: Add download icon for attachment re #335, re #440 Signed-off-by: Pranav C --- .../editableCell/editableAttachmentCell.vue | 47 +++++++++++++----- packages/nc-gui/nuxt.config.js | 12 ++++- packages/nc-gui/package-lock.json | 5 ++ packages/nc-gui/package.json | 1 + packages/nc-gui/static/icon.png | Bin 0 -> 192578 bytes packages/nc-lib-gui/package.json | 2 +- packages/nocodb/package-lock.json | 8 +-- packages/nocodb/package.json | 2 +- 8 files changed, 57 insertions(+), 20 deletions(-) create mode 100644 packages/nc-gui/static/icon.png diff --git a/packages/nc-gui/components/project/spreadsheet/components/editableCell/editableAttachmentCell.vue b/packages/nc-gui/components/project/spreadsheet/components/editableCell/editableAttachmentCell.vue index 75292b8420..80885f36c9 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/editableCell/editableAttachmentCell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/editableCell/editableAttachmentCell.vue @@ -78,12 +78,14 @@ > - - - mdi-link-variant - - Attach File - +
+ + + mdi-link-variant + + Attach File + +
@@ -97,6 +99,9 @@ mdi-close-circle + + mdi-download +

{{ item.title }} + + mdi-download +

-
import { isImage } from '@/components/project/spreadsheet/helpers/imageExt' - +import FileSaver from 'file-saver' export default { name: 'EditableAttachmentCell', props: ['dbAlias', 'value', 'active', 'isLocked', 'meta', 'column'], @@ -299,6 +306,9 @@ export default { this.$emit('input', JSON.stringify(this.localState)) this.$emit('update') }, + downloadItem(item) { + FileSaver.saveAs(item.url, item.title) + }, onArrowDown(e) { if (!this.showImage) { return @@ -321,7 +331,7 @@ export default { } -