From 18208cc8e27be8e1a46a9a66c6c05c4d8315ce93 Mon Sep 17 00:00:00 2001 From: mertmit Date: Mon, 9 Oct 2023 18:18:54 +0000 Subject: [PATCH] fix: disable closing create source modal while creating --- .../dashboard/settings/DataSources.vue | 14 +- .../settings/data-sources/CreateBase.vue | 518 ++++++++++-------- packages/nc-gui/components/general/Modal.vue | 6 +- .../nc-gui/components/project/AllTables.vue | 6 +- packages/nc-gui/components/workspace/View.vue | 11 - 5 files changed, 287 insertions(+), 268 deletions(-) diff --git a/packages/nc-gui/components/dashboard/settings/DataSources.vue b/packages/nc-gui/components/dashboard/settings/DataSources.vue index 083e47b273..d646149590 100644 --- a/packages/nc-gui/components/dashboard/settings/DataSources.vue +++ b/packages/nc-gui/components/dashboard/settings/DataSources.vue @@ -547,15 +547,11 @@ const isEditBaseModalOpen = computed({ - -
- -
-
+
diff --git a/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue b/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue index 32be622a7d..3b73ef38a1 100644 --- a/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue +++ b/packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue @@ -27,9 +27,11 @@ import { watch, } from '#imports' -const props = defineProps<{ connectionType?: ClientType }>() +const props = defineProps<{ open: boolean; connectionType?: ClientType }>() -const emit = defineEmits(['sourceCreated', 'close']) +const emit = defineEmits(['update:open', 'sourceCreated']) + +const vOpen = useVModel(props, 'open', emit) const connectionType = computed(() => props.connectionType ?? ClientType.MYSQL) @@ -284,7 +286,7 @@ const createSource = async () => { } emit('sourceCreated') - emit('close') + vOpen.value = false creatingSource.value = false } else if (status === JobStatus.FAILED) { message.error('Failed to create base') @@ -405,263 +407,295 @@ watch( }, { immediate: true }, ) +const toggleModal = (val: boolean) => { + vOpen.value = val +}