From c966f21f0f701200309f24ff2bd264619fd57fe5 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 17 Aug 2022 17:58:04 +0800 Subject: [PATCH] feat(gui-v2): disable csv in locked view --- .../components/smartsheet-toolbar/MoreActions.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/MoreActions.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/MoreActions.vue index f852b05a24..1b621f3da8 100644 --- a/packages/nc-gui-v2/components/smartsheet-toolbar/MoreActions.vue +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/MoreActions.vue @@ -7,6 +7,7 @@ import { message } from 'ant-design-vue' import { ActiveViewInj, FieldsInj, + IsLockedInj, IsPublicInj, MetaInj, extractSdkResponseErrorMsg, @@ -35,9 +36,13 @@ const { project } = useProject() const { $api } = useNuxtApp() const meta = inject(MetaInj) + const fields = inject(FieldsInj, ref([])) + const selectedView = inject(ActiveViewInj) +const isLocked = inject(IsLockedInj) + const showWebhookDrawer = ref(false) const quickImportDialog = ref(false) @@ -124,7 +129,8 @@ const exportFile = async (exportType: ExportTypes) => { v-if="isUIAllowed('csvImport') && !isView && !isPublicView" v-t="['a:actions:upload-csv']" class="nc-menu-item" - @click="quickImportDialog = true" + :class="{ disabled: isLocked }" + @click="!isLocked ? (quickImportDialog = true) : {}" >