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

lauraxia pushed a commit to branch kylin5
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/kylin5 by this push:
     new 51a41aa084 KYLIN-5729 Supports email notification when jobs are 
finished or discarded
51a41aa084 is described below

commit 51a41aa0849dd28428e7862220680fb1d9710748
Author: Qian Xia <lauraxiaq...@gmail.com>
AuthorDate: Fri Dec 1 15:52:59 2023 +0800

    KYLIN-5729 Supports email notification when jobs are finished or discarded
---
 .../src/components/setting/SettingAdvanced/SettingAdvanced.vue |  8 ++++----
 kystudio/src/components/setting/SettingAdvanced/handler.js     |  8 ++------
 kystudio/src/components/setting/SettingAdvanced/locales.js     |  5 ++++-
 .../studio/StudioModel/TableIndexEdit/tableindex_edit.vue      | 10 +++-------
 4 files changed, 13 insertions(+), 18 deletions(-)

diff --git 
a/kystudio/src/components/setting/SettingAdvanced/SettingAdvanced.vue 
b/kystudio/src/components/setting/SettingAdvanced/SettingAdvanced.vue
index e19ab86bbc..00cfa01621 100644
--- a/kystudio/src/components/setting/SettingAdvanced/SettingAdvanced.vue
+++ b/kystudio/src/components/setting/SettingAdvanced/SettingAdvanced.vue
@@ -58,9 +58,9 @@
         <span class="setting-label font-medium">{{$t('jobState')}} 
:</span><span class="setting-value fixed">
         </span>
          <span class="setting-value">
-              {{form.job_notification_states.map(states => $t(states)).join(', 
')}}
+              {{form.job_states_notification.map(states => $t(states)).join(', 
')}}
             </span>
-            <el-checkbox-group class="setting-input" 
:value="form.job_notification_states" @input="handleInputJobState">
+            <el-checkbox-group class="setting-input" 
:value="form.job_states_notification" @input="handleInputJobState">
               <el-checkbox
                 v-for="jobState in jobNotificationStateTypes"
                 :key="jobState"
@@ -416,7 +416,7 @@ export default class SettingAdvanced extends Vue {
     project: '',
     // tips_enabled: true,
     // threshold: 20,
-    job_notification_states: [],
+    job_states_notification: [],
     data_load_empty_notification_enabled: true,
     metadata_persist_notification_enabled: false,
     job_notification_emails: [],
@@ -1224,7 +1224,7 @@ export default class SettingAdvanced extends Vue {
   }
   handleInputJobState (value) {
     if (value.length >= 0) {
-      this.form.job_notification_states = value
+      this.form.job_states_notification = value
     }
   }
 }
diff --git a/kystudio/src/components/setting/SettingAdvanced/handler.js 
b/kystudio/src/components/setting/SettingAdvanced/handler.js
index f52c177b9f..942a767a59 100644
--- a/kystudio/src/components/setting/SettingAdvanced/handler.js
+++ b/kystudio/src/components/setting/SettingAdvanced/handler.js
@@ -39,7 +39,7 @@ export function _getJobAlertSettings (data, 
isArrayDefaultValue, isSort) {
     metadata_persist_notification_enabled: 
data.metadata_persist_notification_enabled,
     data_load_empty_notification_enabled: 
data.data_load_empty_notification_enabled,
     job_notification_emails: jobEmails,
-    job_notification_states: data.job_notification_states
+    job_states_notification: data.job_states_notification
   }
 }
 
@@ -98,8 +98,4 @@ export function _getKerberosSettings (data) {
   }
 }
 
-export const jobNotificationStateTypes = [
-  'Succeed',
-  'Error',
-  'Discard'
-]
+export const jobNotificationStateTypes = ['succeed', 'error', 'discarded']
diff --git a/kystudio/src/components/setting/SettingAdvanced/locales.js 
b/kystudio/src/components/setting/SettingAdvanced/locales.js
index e6da4a0ae2..121517fd63 100644
--- a/kystudio/src/components/setting/SettingAdvanced/locales.js
+++ b/kystudio/src/components/setting/SettingAdvanced/locales.js
@@ -94,6 +94,9 @@ export default {
     closeSecStorageTip: 'With this switch OFF, the data stored in the tiered 
storage will be cleared. The query performance might be affected.',
     affectedModels: 'The affected model:',
     secStorageInputTitle: 'Please enter "Turn Off Tiered Storage" to confirm.',
-    emptyTips: 'Can\'t be empty'
+    emptyTips: 'Can\'t be empty',
+    succeed: 'FINISHED',
+    error: 'ERROR',
+    discarded: 'DISCARDED'
   }
 }
diff --git 
a/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue 
b/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
index 1ff5f0bd10..8bff154a09 100644
--- 
a/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
+++ 
b/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
@@ -97,8 +97,8 @@
   import { mapState, mapMutations, mapActions, mapGetters } from 'vuex'
   import vuex from '../../../../store'
   import { BuildIndexStatus } from 'config/model'
-  import { handleSuccess, kylinConfirm, postCloudUrlMessage } from 
'util/business'
-  import { objectClone, getQueryString, indexOfObjWithSomeKey } from 
'util/index'
+  import { handleSuccess, kylinConfirm } from 'util/business'
+  import { objectClone, indexOfObjWithSomeKey } from 'util/index'
   import TransferData from '../../../common/CustomTransferData/TransferData'
   import locales from './locales'
   import store, { types } from './store'
@@ -375,11 +375,7 @@
     }
     // 跳转至job页面
     jumpToJobs () {
-      if (getQueryString('from') === 'cloud' || getQueryString('from') === 
'iframe') {
-        postCloudUrlMessage(this.$route, { name: 'kapJob' })
-      } else {
-        this.$router.push('/monitor/job')
-      }
+      this.$router.push('/monitor/job')
     }
   }
 </script>

Reply via email to