From 761ca6eacc48d4633c04166641ac35a9bb0e9ad3 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 12 Aug 2022 17:11:56 +0800 Subject: [PATCH] refactor(gui-v2): use message instead of notification --- .../components/cell/attachment/utils.ts | 6 +-- .../dashboard/settings/AppStore.vue | 14 ++--- .../dashboard/settings/Metadata.vue | 10 ++-- .../components/dashboard/settings/UIAcl.vue | 10 ++-- .../settings/app-store/AppInstall.vue | 22 +++----- .../components/dlg/AirtableImport.vue | 10 ++-- .../nc-gui-v2/components/dlg/QuickImport.vue | 33 ++++-------- .../nc-gui-v2/components/dlg/TableRename.vue | 12 ++--- .../nc-gui-v2/components/dlg/ViewCreate.vue | 10 ++-- .../nc-gui-v2/components/dlg/ViewDelete.vue | 12 ++--- .../components/smartsheet-header/Menu.vue | 14 ++--- .../smartsheet-toolbar/MoreActions.vue | 14 ++--- .../smartsheet-toolbar/ShareView.vue | 18 ++----- .../smartsheet-toolbar/SharedViewList.vue | 10 ++-- .../nc-gui-v2/components/smartsheet/Form.vue | 29 +++-------- .../components/smartsheet/sidebar/MenuTop.vue | 12 ++--- .../smartsheet/sidebar/RenameableMenuItem.vue | 7 +-- .../smartsheet/sidebar/menu/ApiSnippet.vue | 4 +- .../smartsheet/sidebar/toolbar/LockMenu.vue | 14 ++--- .../tabs/auth/ApiTokenManagement.vue | 22 +++----- .../components/tabs/auth/UserManagement.vue | 34 ++++--------- .../tabs/auth/user-management/ShareBase.vue | 26 +++------- .../tabs/auth/user-management/UsersModal.vue | 14 ++--- .../nc-gui-v2/components/template/Editor.vue | 51 ++++--------------- .../nc-gui-v2/components/webhook/Editor.vue | 18 ++----- .../nc-gui-v2/components/webhook/List.vue | 14 ++--- .../nc-gui-v2/components/webhook/Test.vue | 10 ++-- .../composables/useColumnCreateStore.ts | 18 ++----- .../composables/useExpandedFormStore.ts | 9 ++-- .../composables/useGlobal/actions.ts | 9 +--- .../nc-gui-v2/composables/useLTARStore.ts | 27 +++------- .../composables/useSmartsheetRowStore.ts | 7 +-- packages/nc-gui-v2/composables/useTable.ts | 20 +++----- packages/nc-gui-v2/composables/useViewData.ts | 45 +++++----------- packages/nc-gui-v2/pages/index/index.vue | 6 +-- .../nc-gui-v2/pages/project/index/[id].vue | 10 ++-- .../pages/project/index/create-external.vue | 14 ++--- .../nc-gui-v2/pages/project/index/create.vue | 6 +-- packages/nc-gui-v2/pages/projects/index.vue | 6 +-- 39 files changed, 174 insertions(+), 453 deletions(-) diff --git a/packages/nc-gui-v2/components/cell/attachment/utils.ts b/packages/nc-gui-v2/components/cell/attachment/utils.ts index 7d9bf002ab..bbfa6b86e4 100644 --- a/packages/nc-gui-v2/components/cell/attachment/utils.ts +++ b/packages/nc-gui-v2/components/cell/attachment/utils.ts @@ -1,4 +1,4 @@ -import { notification } from 'ant-design-vue' +import { message } from 'ant-design-vue' import FileSaver from 'file-saver' import { computed, inject, ref, useApi, useFileDialog, useInjectionState, useProject, watch } from '#imports' import { ColumnInj, EditModeInj, MetaInj, ReadonlyInj } from '~/context' @@ -88,9 +88,7 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState( newAttachments.push(...data) } catch (e: any) { - notification.error({ - message: e.message || 'Some internal error occurred', - }) + message.error(e.message || 'Some internal error occurred') } } diff --git a/packages/nc-gui-v2/components/dashboard/settings/AppStore.vue b/packages/nc-gui-v2/components/dashboard/settings/AppStore.vue index 90b268e94a..b848d4456b 100644 --- a/packages/nc-gui-v2/components/dashboard/settings/AppStore.vue +++ b/packages/nc-gui-v2/components/dashboard/settings/AppStore.vue @@ -1,5 +1,5 @@ diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue index 7b967d147e..c03942f0c0 100644 --- a/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue @@ -2,7 +2,7 @@ import { useClipboard } from '@vueuse/core' import { ViewTypes } from 'nocodb-sdk' import { computed } from 'vue' -import { message, notification } from 'ant-design-vue' +import { message } from 'ant-design-vue' import { useNuxtApp } from '#app' import { useSmartsheetStoreOrThrow } from '#imports' import { extractSdkResponseErrorMsg } from '~/utils' @@ -70,13 +70,9 @@ async function saveAllowCSVDownload() { await $api.dbViewShare.update(shared.value.id, { meta, } as any) - notification.success({ - message: 'Successfully updated', - }) + message.success('Successfully updated') } catch (e: any) { - notification.error({ - message: await extractSdkResponseErrorMsg(e), - }) + message.error(await extractSdkResponseErrorMsg(e)) } if (allowCSVDownload?.value) { $e('a:view:share:enable-csv-download') @@ -90,13 +86,9 @@ const saveShareLinkPassword = async () => { await $api.dbViewShare.update(shared.value.id, { password: shared.value.password, }) - notification.success({ - message: 'Successfully updated', - }) + message.success('Successfully updated') } catch (e: any) { - notification.error({ - message: await extractSdkResponseErrorMsg(e), - }) + message.error(await extractSdkResponseErrorMsg(e)) } $e('a:view:share:enable-pwd') diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/SharedViewList.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/SharedViewList.vue index 9733c5d5ac..91dfc5fb82 100644 --- a/packages/nc-gui-v2/components/smartsheet-toolbar/SharedViewList.vue +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/SharedViewList.vue @@ -1,7 +1,7 @@ diff --git a/packages/nc-gui-v2/components/smartsheet/Form.vue b/packages/nc-gui-v2/components/smartsheet/Form.vue index 34ce001247..725256cb7c 100644 --- a/packages/nc-gui-v2/components/smartsheet/Form.vue +++ b/packages/nc-gui-v2/components/smartsheet/Form.vue @@ -1,7 +1,7 @@