From 29485a0d71d4e2f45f595fe47bea7020fcd34cbe Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 17 Aug 2022 02:16:06 +0530 Subject: [PATCH] fix(gui-v2): validation correction Signed-off-by: Pranav C --- .../components/cell/attachment/index.vue | 26 +++++++++++++++-- .../components/cell/attachment/utils.ts | 3 +- .../nc-gui-v2/components/shared-view/Form.vue | 29 +++++++------------ .../composables/useSharedFormViewStore.ts | 22 ++++++++++---- .../pages/[projectType]/form/[viewId].vue | 7 ++--- 5 files changed, 53 insertions(+), 34 deletions(-) diff --git a/packages/nc-gui-v2/components/cell/attachment/index.vue b/packages/nc-gui-v2/components/cell/attachment/index.vue index 28912f4314..10133de3a2 100644 --- a/packages/nc-gui-v2/components/cell/attachment/index.vue +++ b/packages/nc-gui-v2/components/cell/attachment/index.vue @@ -4,7 +4,16 @@ import { useProvideAttachmentCell } from './utils' import { useSortable } from './sort' import Modal from './Modal.vue' import Carousel from './Carousel.vue' -import { computed, isImage, openLink, ref, useDropZone, useSmartsheetStoreOrThrow, watch, useSmartsheetRowStoreOrThrow } from '#imports' +import { + computed, + isImage, + openLink, + ref, + useDropZone, + useSmartsheetRowStoreOrThrow, + useSmartsheetStoreOrThrow, + watch, +} from '#imports' interface Props { modelValue: string | Record[] | null @@ -23,8 +32,19 @@ const sortableRef = ref() const { cellRefs } = useSmartsheetStoreOrThrow()! -const { column, modalVisible, attachments, visibleItems, onDrop, isLoading, open, FileIcon, selectedImage, isReadonly, storedFilesRefs, } = - useProvideAttachmentCell(updateModelValue) +const { + column, + modalVisible, + attachments, + visibleItems, + onDrop, + isLoading, + open, + FileIcon, + selectedImage, + isReadonly, + storedFilesRefs, +} = useProvideAttachmentCell(updateModelValue) const currentCellRef = computed(() => cellRefs.value.find((cell) => cell.dataset.key === `${rowIndex}${column.value.id}`)) diff --git a/packages/nc-gui-v2/components/cell/attachment/utils.ts b/packages/nc-gui-v2/components/cell/attachment/utils.ts index e6a0c450d5..63089f28b9 100644 --- a/packages/nc-gui-v2/components/cell/attachment/utils.ts +++ b/packages/nc-gui-v2/components/cell/attachment/utils.ts @@ -10,7 +10,6 @@ import MdiFilePowerpointBox from '~icons/mdi/file-powerpoint-box' import MdiFileExcelOutline from '~icons/mdi/file-excel-outline' import IcOutlineInsertDriveFile from '~icons/ic/outline-insert-drive-file' - interface AttachmentProps { data?: any file: File @@ -172,7 +171,7 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState( downloadFile, updateModelValue, selectedImage, - storedFilesRefs + storedFilesRefs, } }, 'useAttachmentCell', diff --git a/packages/nc-gui-v2/components/shared-view/Form.vue b/packages/nc-gui-v2/components/shared-view/Form.vue index 9bd81515cc..d9cb2b6c9b 100644 --- a/packages/nc-gui-v2/components/shared-view/Form.vue +++ b/packages/nc-gui-v2/components/shared-view/Form.vue @@ -1,8 +1,8 @@