You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by ji...@apache.org on 2024/07/04 09:34:26 UTC

(amoro) branch master updated: [AMORO-2996] Reload catalogs page after removing the existing catalog (#2998)

This is an automated email from the ASF dual-hosted git repository.

jinsongzhou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git


The following commit(s) were added to refs/heads/master by this push:
     new 69445d723 [AMORO-2996] Reload catalogs page after removing the existing catalog (#2998)
69445d723 is described below

commit 69445d723a0be30aa845d5c4d9013e0ff05d1fc6
Author: tcodehuber <tc...@gmail.com>
AuthorDate: Thu Jul 4 17:34:21 2024 +0800

    [AMORO-2996] Reload catalogs page after removing the existing catalog (#2998)
    
    * [AMORO-2996] Reload catalogs page after removing the existing catalog
    
    * typo
---
 amoro-ams/amoro-ams-dashboard/src/language/en.ts   |  2 +-
 amoro-ams/amoro-ams-dashboard/src/language/zh.ts   |  7 +++----
 .../src/views/catalogs/Detail.vue                  | 22 +++++++++++++++-------
 .../src/views/hive-details/components/ErrorMsg.vue |  4 ++--
 .../src/views/hive-details/index.vue               |  2 +-
 .../src/views/tables/components/Operations.vue     |  6 +++---
 6 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/amoro-ams/amoro-ams-dashboard/src/language/en.ts b/amoro-ams/amoro-ams-dashboard/src/language/en.ts
index a9b887582..b49d680ac 100644
--- a/amoro-ams/amoro-ams-dashboard/src/language/en.ts
+++ b/amoro-ams/amoro-ams-dashboard/src/language/en.ts
@@ -204,5 +204,5 @@ export default {
   fileSearchPlaceholder: 'Filter partitions',
   noResourceGroupsTitle: 'No resource groups available.',
   noResourceGroupsContent: 'Please create an optimizer group first.',
-  goToButtonText: 'Go'
+  goToButtonText: 'Go',
 }
diff --git a/amoro-ams/amoro-ams-dashboard/src/language/zh.ts b/amoro-ams/amoro-ams-dashboard/src/language/zh.ts
index 242fb5a2c..d8bb45b15 100644
--- a/amoro-ams/amoro-ams-dashboard/src/language/zh.ts
+++ b/amoro-ams/amoro-ams-dashboard/src/language/zh.ts
@@ -172,7 +172,7 @@ export default {
   remove: '移除',
   edit: '编辑',
   deleteCatalogModalTitle: '移除此目录?',
-  cannotDeleteModalTitle: "不能移除这个目录",
+  cannotDeleteModalTitle: '不能移除这个目录',
   cannotDeleteModalContent: '这个目录已被使用',
   success: '成功',
   optimzeGroup: '优化组',
@@ -183,7 +183,7 @@ export default {
   invalidInput: '非法输入',
   addgroup: '添加组',
   editgroup: '编辑组',
-  cannotDeleteGroupModalTitle: "不能移除这个组",
+  cannotDeleteGroupModalTitle: '不能移除这个组',
   cannotDeleteGroupModalContent: '这个组已被使用',
   deleteGroupModalTitle: '移除这个组',
   processId: '进程 ID',
@@ -204,6 +204,5 @@ export default {
   fileSearchPlaceholder: '过滤分区',
   noResourceGroupsTitle: '没有任何优化组',
   noResourceGroupsContent: '需要首先创建一个默认优化组',
-  goToButtonText: '前往'
+  goToButtonText: '前往',
 }
-
diff --git a/amoro-ams/amoro-ams-dashboard/src/views/catalogs/Detail.vue b/amoro-ams/amoro-ams-dashboard/src/views/catalogs/Detail.vue
index 68690f04b..bce5d3174 100644
--- a/amoro-ams/amoro-ams-dashboard/src/views/catalogs/Detail.vue
+++ b/amoro-ams/amoro-ams-dashboard/src/views/catalogs/Detail.vue
@@ -206,12 +206,14 @@ async function getOptimizerGroupList() {
       onOk: async () => {
         try {
           router.push({ path: '/optimizing', query: { tab: 'optimizergroup' } })
-        } catch (error) {
+        }
+        catch (error) {
           console.error('Navigation error:', error)
         }
       },
     })
-  } else {
+  }
+  else {
     optimizerGroupList.value = list
   }
 }
@@ -524,7 +526,7 @@ function handleSave() {
     .catch(() => {
     })
 }
-function handleCancle() {
+function handleCancel() {
   formRef.value.resetFields()
   emit('updateEdit', false)
   getConfigInfo()
@@ -533,9 +535,15 @@ async function deleteCatalogModal() {
   Modal.confirm({
     title: t('deleteCatalogModalTitle'),
     onOk: async () => {
-      await delCatalog(formState.catalog.name || '')
-      message.success(`${t('remove')} ${t('success')}`)
-      emit('updateEdit', false)
+      try {
+        await delCatalog(formState.catalog.name || '')
+        message.success(`${t('remove')} ${t('success')}`, 1, () => {
+          router.replace({ path: '/catalogs', query: {} }).then(() => router.go(0))
+        })
+      }
+      catch (error) {
+        message.error(`${t('remove')} ${t('failed')}`)
+      }
     },
   })
 }
@@ -770,7 +778,7 @@ onMounted(() => {
       <a-button type="primary" class="save-btn g-mr-12" @click="handleSave">
         {{ $t('save') }}
       </a-button>
-      <a-button @click="handleCancle">
+      <a-button @click="handleCancel">
         {{ $t('cancel') }}
       </a-button>
     </div>
diff --git a/amoro-ams/amoro-ams-dashboard/src/views/hive-details/components/ErrorMsg.vue b/amoro-ams/amoro-ams-dashboard/src/views/hive-details/components/ErrorMsg.vue
index 3f31c3bd2..609dcadd9 100644
--- a/amoro-ams/amoro-ams-dashboard/src/views/hive-details/components/ErrorMsg.vue
+++ b/amoro-ams/amoro-ams-dashboard/src/views/hive-details/components/ErrorMsg.vue
@@ -22,7 +22,7 @@ import { ref } from 'vue'
 
 const props = defineProps<{ msg: string }>()
 const emit = defineEmits<{
-  (e: 'cancle'): void
+  (e: 'cancel'): void
 }>()
 const open = ref(true)
 </script>
@@ -34,7 +34,7 @@ const open = ref(true)
     :title="`${$t('errorMessage')}`"
     :footer="null"
     class="upgrade-error"
-    @cancel="emit('cancle')"
+    @cancel="emit('cancel')"
   >
     <p class="msg">
       {{ props.msg }}
diff --git a/amoro-ams/amoro-ams-dashboard/src/views/hive-details/index.vue b/amoro-ams/amoro-ams-dashboard/src/views/hive-details/index.vue
index 2f0335179..3e67c8c76 100644
--- a/amoro-ams/amoro-ams-dashboard/src/views/hive-details/index.vue
+++ b/amoro-ams/amoro-ams-dashboard/src/views/hive-details/index.vue
@@ -202,7 +202,7 @@ export default defineComponent({
     <u-loading v-if="loading" />
     <!-- upgrade table secondary page -->
     <router-view v-if="isSecondaryNav" @go-back="goBack" @refresh="refresh" />
-    <ErrorMsg v-if="showErrorMsg" :msg="errorMessage" @cancle="showErrorMsg = false" />
+    <ErrorMsg v-if="showErrorMsg" :msg="errorMessage" @cancel="showErrorMsg = false" />
   </div>
 </template>
 
diff --git a/amoro-ams/amoro-ams-dashboard/src/views/tables/components/Operations.vue b/amoro-ams/amoro-ams-dashboard/src/views/tables/components/Operations.vue
index 753b0b0d7..c9cd4e748 100644
--- a/amoro-ams/amoro-ams-dashboard/src/views/tables/components/Operations.vue
+++ b/amoro-ams/amoro-ams-dashboard/src/views/tables/components/Operations.vue
@@ -86,7 +86,7 @@ function viewDetail(record: OperationItem) {
   activeCopyText.value = record.operation
 }
 
-function cancle() {
+function cancel() {
   visible.value = false
 }
 
@@ -94,7 +94,7 @@ async function onCopy() {
   try {
     await toClipboard(activeCopyText.value)
     message.success(t('copySuccess'))
-    cancle()
+    cancel()
   }
   catch (error) {}
 }
@@ -128,7 +128,7 @@ onMounted(() => {
     :width="560"
     :title="`${$t('operationDetails')}`"
     class="operation-wrap"
-    @cancel="cancle"
+    @cancel="cancel"
   >
     {{ activeCopyText }}
     <template #footer>