You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by xx...@apache.org on 2023/03/28 03:05:08 UTC

[kylin] branch kylin5 updated (8c213bdab1 -> 28d284d416)

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

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


    from 8c213bdab1 KYLIN-5407 KYLIN-5467 KYLIN-5468 KYLIN-5469 KYLIN-5470 KYLIN-5471 KYLIN-5476  (#2103)
     new 26013268bf KYLIN-5478 upgrade sql-formatter to 8.2.0
     new 858d9b2acb KYLIN-5479 fix search user by usergroup issue
     new 8c8cffdf71 KYLIN-5481 fix assign user to usergroup issue
     new 5707c5489d KYLIN-5480 show the loading icon when segment job was running
     new 5fd4475cb6 KYLIN-5482 special character of col name issue
     new 2794384883 KYLIN-5483 support IE
     new 321547ec79 KYLIN-5484 remove duplicate partition time format
     new c72fe0bd0c KYLIN-5485 auto complete editor keywords
     new 4d152f1783 KYLIN-5486 format yyyyMMdd date time
     new bb348f3f19 KYLIN-5487 refine sync comment name issue
     new 479f4e45fb KYLIN-5488 refine query chart issue
     new 28d284d416 KYLIN-5489 refine user transfer css issue

The 12 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 kystudio/package.json                              | 26 +++---
 .../common/GlobalDialog/dialog/detail_dialog.vue   |  3 +-
 .../src/components/common/GroupEditModal/index.vue |  7 +-
 .../src/components/common/UserEditModal/index.vue  |  7 +-
 kystudio/src/components/common/editor.vue          |  8 +-
 .../monitor/batchJobs/buildSegmentDetail.vue       |  4 +-
 kystudio/src/components/query/insight.vue          | 23 ------
 .../src/components/query/query_history_table.vue   |  6 +-
 kystudio/src/components/query/query_result.vue     | 13 +--
 .../studio/StudioModel/AddMeasure/index.vue        | 13 ---
 .../studio/StudioModel/BatchMeasureModal/index.vue | 42 ++++++----
 .../studio/StudioModel/DimensionsModal/index.vue   | 93 ++++++++--------------
 .../studio/StudioModel/ModelEdit/index.vue         |  2 +-
 .../ModelList/Components/ModelTitleDescription.vue |  6 +-
 .../ModelList/ModelAggregate/indexDetails.vue      | 13 ++-
 .../ModelList/ModelBuildModal/build.vue            |  2 +-
 .../ModelList/ModelLayout/modelLayout.vue          |  2 +-
 .../StudioModel/ModelList/ModelPartition/index.vue |  2 +-
 .../ModelList/ModelSaveConfig/index.vue            | 35 ++++----
 .../studio/StudioModel/ModelList/index.vue         |  2 +-
 kystudio/src/config/index.js                       |  8 ++
 21 files changed, 142 insertions(+), 175 deletions(-)


[kylin] 03/12: KYLIN-5481 fix assign user to usergroup issue

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8c8cffdf71a15ed7715659a8d6f106a8d1b4cbeb
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 15:00:32 2023 +0800

    KYLIN-5481 fix assign user to usergroup issue
---
 kystudio/src/components/common/UserEditModal/index.vue | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kystudio/src/components/common/UserEditModal/index.vue b/kystudio/src/components/common/UserEditModal/index.vue
index d44e591ea7..fc182ae7e6 100644
--- a/kystudio/src/components/common/UserEditModal/index.vue
+++ b/kystudio/src/components/common/UserEditModal/index.vue
@@ -390,7 +390,7 @@ export default class UserEditModal extends Vue {
     // const project = this.currentSelectedProject // 处理资源组时,发现这个接口不用传 project 参数
     const { data: { data: totalGroups } } = await this.getGroupList()
 
-    this.setModal({ totalGroups })
+    this.setModal({ totalGroups: totalGroups.value })
   }
 }
 </script>


[kylin] 11/12: KYLIN-5488 refine query chart issue

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 479f4e45fbee4e8534d80205153a52f3b5d3506c
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 18:40:39 2023 +0800

    KYLIN-5488 refine query chart issue
---
 kystudio/src/components/query/insight.vue      | 23 -----------------------
 kystudio/src/components/query/query_result.vue | 13 +------------
 2 files changed, 1 insertion(+), 35 deletions(-)

diff --git a/kystudio/src/components/query/insight.vue b/kystudio/src/components/query/insight.vue
index 348b28c84a..11ad7de46b 100644
--- a/kystudio/src/components/query/insight.vue
+++ b/kystudio/src/components/query/insight.vue
@@ -471,14 +471,6 @@ export default class NewQuery extends Vue {
         line-height: 21px;
       }
     }
-    // .nodata {
-    //   text-align: center;
-    //   color: @text-disabled-color;
-    //   position: absolute;
-    //   top: 50%;
-    //   left: 50%;
-    //   transform: translate(-50%, -50%);
-    // }
     .form_block {
       .query_check {
         display: flex;
@@ -603,13 +595,6 @@ export default class NewQuery extends Vue {
         margin: 20px;
       }
       .el-tabs{
-        // margin-top: 3px;
-        // .el-tabs__nav-wrap {
-        //   width: calc(~'100% - 250px');
-        //   &::after {
-        //     background-color: transparent;
-        //   }
-        // }
         .el-tabs__content{
           padding: 0px;
           .el-tab-pane{
@@ -620,14 +605,6 @@ export default class NewQuery extends Vue {
           .el-tab-pane{
             padding-top: 8px;
           }
-          .el-tabs__header {
-            width: 136px;
-          }
-        }
-        &.en-model {
-          .el-tabs__header {
-            width: 174px !important;
-          }
         }
       }
     }
diff --git a/kystudio/src/components/query/query_result.vue b/kystudio/src/components/query/query_result.vue
index 9b8438a003..021d21f8e5 100644
--- a/kystudio/src/components/query/query_result.vue
+++ b/kystudio/src/components/query/query_result.vue
@@ -126,7 +126,7 @@
             </form>
           </el-tab-pane>
           <el-tab-pane :label="$t('visualizationBtn')" name="visualization">
-            <div class="chart-headers" v-if="charts.dimension && charts.measure">
+            <div class="chart-headers" v-if="charts.dimension && charts.measure && activeResultType === 'visualization'">
               <el-row class="ksd-mt-10" :gutter="5">
                 <el-col :span="4" class="title">{{$t('chartType')}}</el-col>
                 <el-col :span="10" class="title">{{$t('chartDimension')}}</el-col>
@@ -836,15 +836,6 @@ export default class queryResult extends Vue {
         width: 245px;
       }
     }
-    // .result-layout-btns {
-    //   margin-top: 16px;
-    //   .el-button.active {
-    //     color: #5c5c5c;
-    //     background: #f4f4f4;
-    //     border: 1px solid #cccccc;
-    //     box-shadow: inset 1px 1px 2px 0 #ddd;
-    //   }
-    // }
     .chart-headers {
       .title {
         font-weight: bold;
@@ -879,8 +870,6 @@ export default class queryResult extends Vue {
     }
   }
   .table-cell-text{
-    // word-wrap: break-word;
-    // word-break: break-all;
     white-space: pre;
     color: @text-normal-color;
     font-family: Lato,"Noto Sans S Chinese",sans-serif;


[kylin] 02/12: KYLIN-5479 fix search user by usergroup issue

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 858d9b2acb9f9654bfcd5c41b964b80c6248e7d2
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 14:29:43 2023 +0800

    KYLIN-5479 fix search user by usergroup issue
---
 .../src/components/common/GlobalDialog/dialog/detail_dialog.vue    | 3 ++-
 kystudio/src/components/common/GroupEditModal/index.vue            | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/kystudio/src/components/common/GlobalDialog/dialog/detail_dialog.vue b/kystudio/src/components/common/GlobalDialog/dialog/detail_dialog.vue
index 6d1b972a46..1307c2f737 100644
--- a/kystudio/src/components/common/GlobalDialog/dialog/detail_dialog.vue
+++ b/kystudio/src/components/common/GlobalDialog/dialog/detail_dialog.vue
@@ -330,7 +330,8 @@ export default class DetailDialogModal extends Vue {
     .dialog-detail-scroll{
       max-height:95px;
       ul {
-        margin:10px;
+        padding: 10px;
+        box-sizing: border-box;
         li {
           font-size: 12px;
         }
diff --git a/kystudio/src/components/common/GroupEditModal/index.vue b/kystudio/src/components/common/GroupEditModal/index.vue
index 227bcc04a1..564fa3d96a 100644
--- a/kystudio/src/components/common/GroupEditModal/index.vue
+++ b/kystudio/src/components/common/GroupEditModal/index.vue
@@ -159,9 +159,9 @@ export default class GroupEditModal extends Vue {
     const that = this
     return new Promise(async (resolve, reject) => {
       if (title === that.$t('willCheckGroup')) {
+        this.page_offset = 0
         clearTimeout(this.timer)
         this.timer = setTimeout(async function () {
-          this.page_offset = 0
           await that.setModal({totalUsers: []})
           await that.fetchUsers(query)
           resolve()
@@ -293,6 +293,11 @@ export default class GroupEditModal extends Vue {
   .el-transfer-panel {
     width: 250px;
   }
+  .el-transfer__buttons {
+    .button-text {
+      min-width: initial;
+    }
+  }
   .load-more-uers {
     color: @text-title-color;
     font-size: @text-assist-size;


[kylin] 08/12: KYLIN-5485 auto complete editor keywords

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c72fe0bd0cc503287bd69b515790bf2266c4f2b8
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 18:08:59 2023 +0800

    KYLIN-5485 auto complete editor keywords
---
 .../ModelList/ModelSaveConfig/index.vue            | 33 +++++++++++-----------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
index 1136808697..80f2ae78ea 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
@@ -577,23 +577,6 @@ export default class ModelPartitionModal extends Vue {
     // })
     return result
   }
-  // get formatList () {
-  //   if (!this.partitionMeta.column) {
-  //     return []
-  //   }
-  //   let partitionColumn = this.getColumnInfo(this.partitionMeta.column)
-  //   if (!partitionColumn) {
-  //     return []
-  //   } else {
-  //     if (timeDataType.indexOf(partitionColumn.datatype) === -1) {
-  //       this.partitionMeta.format = 'yyyy-MM-dd'
-  //       return this.integerFormat
-  //     } else {
-  //       this.partitionMeta.format = ''
-  //       return this.dateFormat
-  //     }
-  //   }
-  // }
   getColumnInfo (column) {
     if (this.selectedTable) {
       let len = this.selectedTable.columns && this.selectedTable.columns.length || 0
@@ -631,6 +614,9 @@ export default class ModelPartitionModal extends Vue {
       }
       this.filterCondition = this.modelDesc.filter_condition
       this.originFilterCondition = this.modelDesc.filter_condition
+      this.$nextTick(() => {
+        this.setAutoCompleteData()
+      })
     } else {
       this.resetForm()
     }
@@ -883,6 +869,19 @@ export default class ModelPartitionModal extends Vue {
     })
     return others
   }
+  setAutoCompleteData () {
+    const columnList = this.modelInstance.getTableColumns()
+    let ad = columnList.map((col) => {
+      return {
+        meta: col.datatype,
+        caption: col.full_colname,
+        value: col.full_colname,
+        id: col.id,
+        scope: 1
+      }
+    })
+    this.$refs.dataFilterCond.$emit('setAutoCompleteData', ad)
+  }
 }
 </script>
 


[kylin] 09/12: KYLIN-5486 format yyyyMMdd date time

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4d152f17832cfa965a1e643e03ad7b40a2981920
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 18:16:46 2023 +0800

    KYLIN-5486 format yyyyMMdd date time
---
 kystudio/src/components/query/query_history_table.vue               | 3 +--
 .../StudioModel/ModelList/Components/ModelTitleDescription.vue      | 6 +++++-
 .../studio/StudioModel/ModelList/ModelLayout/modelLayout.vue        | 2 +-
 kystudio/src/components/studio/StudioModel/ModelList/index.vue      | 2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/kystudio/src/components/query/query_history_table.vue b/kystudio/src/components/query/query_history_table.vue
index d267cbc29c..bf32a9f1f9 100644
--- a/kystudio/src/components/query/query_history_table.vue
+++ b/kystudio/src/components/query/query_history_table.vue
@@ -302,9 +302,8 @@ import Vue from 'vue'
 import { mapActions, mapGetters } from 'vuex'
 import { Component, Watch } from 'vue-property-decorator'
 // import $ from 'jquery'
-import { sqlRowsLimit, sqlStrLenLimit , formatSQLConfig} from '../../config/index'
+import { sqlRowsLimit, sqlStrLenLimit, formatSQLConfig } from '../../config/index'
 import { format } from 'sql-formatter'
-import sqlFormatter from 'sql-formatter'
 import IndexDetails from '../studio/StudioModel/ModelList/ModelAggregate/indexDetails'
 import Diagnostic from 'components/admin/Diagnostic/index'
 @Component({
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/Components/ModelTitleDescription.vue b/kystudio/src/components/studio/StudioModel/ModelList/Components/ModelTitleDescription.vue
index 8d264fd8c7..a764df0a60 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/Components/ModelTitleDescription.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/Components/ModelTitleDescription.vue
@@ -13,6 +13,7 @@
           <div v-if="modelData.status === 'WARNING' && modelData.empty_indexes_count">{{$t('emptyIndexTips')}}</div>
           <div v-if="modelData.status === 'WARNING' && (modelData.segment_holes && modelData.segment_holes.length && modelData.model_type === 'BATCH') || (modelData.batch_segment_holes && modelData.batch_segment_holes.length && modelData.model_type === 'HYBRID')">
             <span>{{modelData.model_type === 'HYBRID' ? $t('modelSegmentHoleTips1') : $t('modelSegmentHoleTips')}}</span><span
+              v-if="!['modelEdit'].includes(source)"
               style="color:#0988DE;cursor: pointer;"
               @click="autoFix(modelData.alias, modelData.model_type === 'HYBRID' ? modelData.batch_id : modelData.uuid, modelData.model_type === 'HYBRID' ? modelData.batch_segment_holes : modelData.segment_holes)">{{$t('seeDetail')}}</span>
           </div>
@@ -21,7 +22,7 @@
           </div>
           <div v-if="modelData.status === 'WARNING' && modelData.inconsistent_segment_count">
             <span>{{$t('modelMetadataChangedTips')}}</span><span
-              v-if="!['modelLayout', 'modelEdit'].includes(source)"
+              v-if="!['modelEdit'].includes(source)"
               style="color:#0988DE;cursor: pointer;"
               @click="openComplementSegment(model, true)">{{$t('seeDetail')}}</span>
           </div>
@@ -111,6 +112,9 @@
     openComplementSegment (model, status) {
       this.$emit('openSegment', model, status)
     }
+    autoFix (...args) {
+      this.$emit('autoFix', ...args)
+    }
   }
   </script>
   
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
index dc8838e576..d56c6e5a0b 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
@@ -2,7 +2,7 @@
   <div class="model-layout" :key="randomKey">
     <div class="header-layout">
       <div class="title"><el-button type="primary" text icon-button-mini icon="el-ksd-icon-arrow_left_16" size="small" @click="jumpBack"></el-button>
-        <model-title-description :modelData="currentModelRow" source="modelLayout" v-if="currentModelRow" hideTimeTooltip />
+        <model-title-description :modelData="currentModelRow" @autoFix="autoFix" @openSegment="openComplementSegment" source="modelLayout" v-if="currentModelRow" hideTimeTooltip />
         <el-button class="ksd-ml-8" type="primary" text @click.stop="showModelList = !showModelList" icon-button-mini icon="el-ksd-icon-arrow_down_16" size="small"></el-button>
         <div class="model-filter-list" v-if="showModelList">
           <div class="search-bar"><el-input class="search-model-input" v-model="searchModelName" size="small" :placeholder="$t('kylinLang.common.pleaseInput')" prefix-icon="el-ksd-icon-search_22" v-global-key-event.enter.debounce="searchModel" @clear="searchModel()"></el-input></div>
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/index.vue
index 15e664c761..80670ea147 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/index.vue
@@ -106,7 +106,7 @@
           prop="alias"
           :label="modelTableTitle">
           <template slot-scope="scope">
-            <model-title-description :modelData="scope.row" @openSegment="openComplementSegment" source="modelList" />
+            <model-title-description :modelData="scope.row" @openSegment="openComplementSegment" @autoFix="autoFix" source="modelList" />
             <!-- 工具栏 -->
             <model-actions :currentModel="scope.row" @loadModelsList="loadModelsList"/>
 


[kylin] 04/12: KYLIN-5480 show the loading icon when segment job was running

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5707c5489d5bb7dee7503d7c25cf0b0b4f88230d
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 15:06:05 2023 +0800

    KYLIN-5480 show the loading icon when segment job was running
---
 kystudio/src/components/monitor/batchJobs/buildSegmentDetail.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kystudio/src/components/monitor/batchJobs/buildSegmentDetail.vue b/kystudio/src/components/monitor/batchJobs/buildSegmentDetail.vue
index cfc1d03689..ebd38bda6e 100644
--- a/kystudio/src/components/monitor/batchJobs/buildSegmentDetail.vue
+++ b/kystudio/src/components/monitor/batchJobs/buildSegmentDetail.vue
@@ -46,7 +46,7 @@
           <li>
             <!-- 当 job 主步骤为暂停状态时,所有的未完成的子步骤都变更为 STOP 状态 -->
             <el-tooltip placement="bottom" :content="getStepStatusTips(jobStatus === 'STOPPED' && sub.step_status !== 'SKIP' ? 'STOPPED' : sub.step_status)">
-              <span :class="[jobStatus === 'STOPPED' && sub.step_status !== 'FINISHED' && sub.step_status !== 'SKIP' ? 'sub-tasks-status is-stop' : getSubTaskStatus(sub)]"></span>
+              <span :class="[jobStatus === 'STOPPED' && sub.step_status !== 'FINISHED' && sub.step_status !== 'SKIP' ? 'sub-tasks-status is-stop' : getSubTaskStatus(sub)]"><i class="el-icon-loading" v-if="jobStatus !== 'STOPPED' && sub.step_status === 'RUNNING'"></i></span>
             </el-tooltip>
             <span class="sub-tasks-name">{{getTaskName(sub.name)}}</span>
             <span class="sub-tasks-layouts" v-if="sub.name === 'Build indexes by layer'"><span class="success-layout-count">{{sub.success_index_count}}</span>{{`/${sub.index_count}`}}</span>
@@ -155,7 +155,7 @@ export default class BuildSegmentDetail extends Vue {
         color: @text-placeholder-color;
       }
       .mutiple-color-icon {
-        font-size: 16px;
+        font-size: 15px;
         vertical-align: middle;
         margin-top: -3px;
         &.is-running {


[kylin] 12/12: KYLIN-5489 refine user transfer css issue

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 28d284d416dce0eef99e7a2b664604ba707fd6dd
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 18:43:28 2023 +0800

    KYLIN-5489 refine user transfer css issue
---
 kystudio/src/components/common/UserEditModal/index.vue | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kystudio/src/components/common/UserEditModal/index.vue b/kystudio/src/components/common/UserEditModal/index.vue
index fc182ae7e6..631dc39b34 100644
--- a/kystudio/src/components/common/UserEditModal/index.vue
+++ b/kystudio/src/components/common/UserEditModal/index.vue
@@ -410,6 +410,11 @@ export default class UserEditModal extends Vue {
   .el-transfer-panel {
     width: 250px;
   }
+  .el-transfer__buttons {
+    .button-text {
+      min-width: initial;
+    }
+  }
   .change-system-password-tip {
     margin-bottom: 15px;
     font-size: 14px;


[kylin] 05/12: KYLIN-5482 special character of col name issue

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5fd4475cb6c4a89fa1560eac72a4d62b07f86cdf
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 15:34:58 2023 +0800

    KYLIN-5482 special character of col name issue
---
 .../studio/StudioModel/AddMeasure/index.vue        | 13 ----
 .../studio/StudioModel/BatchMeasureModal/index.vue | 33 +++++---
 .../studio/StudioModel/DimensionsModal/index.vue   | 87 +++++++---------------
 kystudio/src/config/index.js                       |  1 +
 4 files changed, 50 insertions(+), 84 deletions(-)

diff --git a/kystudio/src/components/studio/StudioModel/AddMeasure/index.vue b/kystudio/src/components/studio/StudioModel/AddMeasure/index.vue
index cc4b55ef62..bf07683e19 100644
--- a/kystudio/src/components/studio/StudioModel/AddMeasure/index.vue
+++ b/kystudio/src/components/studio/StudioModel/AddMeasure/index.vue
@@ -280,19 +280,6 @@ export default class AddMeasure extends Vue {
   ccGroups = []
   newCCList = []
   allTableColumns = []
-  // expressionsConf = [
-  //   {label: 'SUM (column)', value: 'SUM(column)'},
-  //   {label: 'SUM (constant)', value: 'SUM(constant)'},
-  //   {label: 'MIN', value: 'MIN'},
-  //   {label: 'MAX', value: 'MAX'},
-  //   {label: 'TOP_N', value: 'TOP_N'},
-  //   {label: 'COUNT (column)', value: 'COUNT(column)'},
-  //   // {label: 'COUNT (constant)', value: 'COUNT(constant)'}, 去除 count(constant) 函数,默认添加 count_all 度量
-  //   {label: 'COUNT_DISTINCT', value: 'COUNT_DISTINCT'},
-  //   {label: 'CORR (column1, column2)', value: 'CORR'},
-  //   {label: 'PERCENTILE_APPROX', value: 'PERCENTILE_APPROX'},
-  //   {label: 'COLLECT_SET', value: 'COLLECT_SET'}
-  // ]
   topNTypes = [
     {name: 'Top 10', value: 'topn(10)'},
     {name: 'Top 100', value: 'topn(100)'},
diff --git a/kystudio/src/components/studio/StudioModel/BatchMeasureModal/index.vue b/kystudio/src/components/studio/StudioModel/BatchMeasureModal/index.vue
index d01d6d9dff..b1ac218c7d 100644
--- a/kystudio/src/components/studio/StudioModel/BatchMeasureModal/index.vue
+++ b/kystudio/src/components/studio/StudioModel/BatchMeasureModal/index.vue
@@ -197,8 +197,8 @@ import { mapState, mapGetters, mapMutations } from 'vuex'
 import vuex from '../../../../store'
 import locales from './locales'
 import store, { types } from './store'
-import { objectClone, sampleGuid } from '../../../../util'
-import { pageCount, measuresDataType, measureSumAndTopNDataType, pageRefTags } from '../../../../config'
+import { objectClone, sampleGuid, indexOfObjWithSomeKey, getObjectBySomeKeys } from '../../../../util'
+import { pageCount, measuresDataType, measureSumAndTopNDataType, pageRefTags, unIncludedNameRegex } from '../../../../config'
 vuex.registerModule(['modals', 'BatchMeasureModal'], store)
 @Component({
   computed: {
@@ -258,14 +258,22 @@ export default class BatchMeasureModal extends Vue {
   }
 
   checkHasSameName (arr, val, column) {
-    let flag = false
-    for (let i = 0; i < arr.length; i++) {
-      if (arr[i].name === val && (arr[i].table_guid || arr[i].guid) !== column.table_guid) {
-        flag = true
-        break
+    const arrrReverse = objectClone(arr).reverse()
+    let uniqueName = val
+    while(indexOfObjWithSomeKey(arrrReverse, 'name' ,uniqueName) !== -1) {
+      const lastIndex = uniqueName.lastIndexOf('_')
+      let sameCount = +uniqueName.substring(lastIndex + 1)
+      const sameNameMes = getObjectBySomeKeys(arrrReverse, 'name' ,uniqueName)
+      if ((sameNameMes.table_guid || sameNameMes.guid) !== column.table_guid) {
+        uniqueName = uniqueName + '_' + column.table_alias
+      } else if (!isNaN(parseFloat(sameCount))) { // 是数字
+        sameCount++
+        uniqueName = uniqueName.substring(0, lastIndex + 1) + sameCount
+      } else {
+        uniqueName = uniqueName + '_1'
       }
     }
-    return flag
+    return uniqueName
   }
   submit () {
     let allMeasureArr = [...this.modelDesc.all_measures]
@@ -287,10 +295,11 @@ export default class BatchMeasureModal extends Vue {
     }
     columns.forEach((column) => {
       if (column.isMeasureCol) {
+        const colName = column.name.replace(unIncludedNameRegex, '') // 去除不符合度量命名的字符
         if (column.SUM.value && !column.SUM.isShouldDisable) {
           // 如果存在同名的,添加上表别名,如果不同名,就是列名+函数
           const measure = {
-            name: this.checkHasSameName(allMeasureArr, column.name + '_SUM', column) ? column.name + '_SUM_' + column.table_alias : column.name + '_SUM',
+            name: this.checkHasSameName(allMeasureArr, colName + '_SUM', column),
             guid: sampleGuid(),
             expression: 'SUM',
             parameter_value: [{type: 'column', value: column.table_alias + '.' + (column.column ?? column.columnName), table_guid: column.table_guid}],
@@ -301,7 +310,7 @@ export default class BatchMeasureModal extends Vue {
         }
         if (column.MIN.value && !column.MIN.isShouldDisable) {
           const measure = {
-            name: this.checkHasSameName(allMeasureArr, column.name + '_MIN', column) ? column.name + '_MIN_' + column.table_alias : column.name + '_MIN',
+            name: this.checkHasSameName(allMeasureArr, colName + '_MIN', column),
             guid: sampleGuid(),
             expression: 'MIN',
             parameter_value: [{type: 'column', value: column.table_alias + '.' + (column.column ?? column.columnName), table_guid: column.table_guid}],
@@ -312,7 +321,7 @@ export default class BatchMeasureModal extends Vue {
         }
         if (column.MAX.value && !column.MAX.isShouldDisable) {
           const measure = {
-            name: this.checkHasSameName(allMeasureArr, column.name + '_MAX', column) ? column.name + '_MAX_' + column.table_alias : column.name + '_MAX',
+            name: this.checkHasSameName(allMeasureArr, colName + '_MAX', column),
             guid: sampleGuid(),
             expression: 'MAX',
             parameter_value: [{type: 'column', value: column.table_alias + '.' + (column.column ?? column.columnName), table_guid: column.table_guid}],
@@ -323,7 +332,7 @@ export default class BatchMeasureModal extends Vue {
         }
         if (column.COUNT.value && !column.COUNT.isShouldDisable) {
           const measure = {
-            name: this.checkHasSameName(allMeasureArr, column.name + '_COUNT', column) ? column.name + '_COUNT_' + column.table_alias : column.name + '_COUNT',
+            name: this.checkHasSameName(allMeasureArr, colName + '_COUNT', column),
             guid: sampleGuid(),
             expression: 'COUNT',
             parameter_value: [{type: 'column', value: column.table_alias + '.' + (column.column ?? column.columnName), table_guid: column.table_guid}],
diff --git a/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue b/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue
index ece5442666..6e6ffdf5af 100644
--- a/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue
+++ b/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue
@@ -94,7 +94,6 @@
                   </el-table-column>
                 </el-table>
               </div>
-              <!-- <div class="same-name-tip" v-if="filterErrorContent(table)">{{$t('sameNameTip')}}</div> -->
             </div>
             <!-- 维度表 -->
             <div v-for="(table, index) in lookupTable" class="ksd-mb-10" :key="index">
@@ -174,7 +173,6 @@
                   </el-table-column>
                 </el-table>
               </div>
-              <!-- <div class="same-name-tip" v-if="filterErrorContent(table)">{{$t('sameNameTip')}}</div> -->
             </div>
             <!-- 可计算列 -->
             <template v-if="ccTable.columns.length">
@@ -237,7 +235,6 @@
                     </el-table-column>
                   </el-table>
                 </div>
-                <!-- <div class="same-name-tip" v-if="filterErrorContent(ccTable)">{{$t('sameNameTip')}}</div> -->
               </div>
             </template>
           </div>
@@ -307,8 +304,8 @@ import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
 import vuex from '../../../../store'
 import locales from './locales'
 import store, { types } from './store'
-import { NamedRegex1, pageCount, pageRefTags } from '../../../../config'
-import { objectClone, sampleGuid, filterObjectArray, countObjWithSomeKey } from '../../../../util'
+import { NamedRegex1, pageCount, pageRefTags, unIncludedNameRegex } from '../../../../config'
+import { objectClone, sampleGuid, filterObjectArray, countObjWithSomeKey, indexOfObjWithSomeKey, indexOfObjWithSomeKeys } from '../../../../util'
 vuex.registerModule(['modals', 'DimensionsModal'], store)
 @Component({
   computed: {
@@ -372,6 +369,8 @@ export default class DimensionsModal extends Vue {
   }
   isClickSubmit = false
   errorGuidList = []
+  uniqueAliasObj = {}
+  uniqueAliasCommentObj = {}
 
   filterErrorContent (table) {
     return this.isClickSubmit && table.columns.filter(item => item.validateSameName || item.validateNameRule || item.validateNameMaxLen).length
@@ -430,18 +429,13 @@ export default class DimensionsModal extends Vue {
   }
 
   syncCommentName () {
-    let tempArr = [];
+    this.uniqueAliasCommentObj = {};
     [...this.factTable, ...this.lookupTable].forEach((item, index, self) => {
       for (let it of item.columns) {
-        if ('comment' in it && it.comment && it.comment.trim() && this.checkDimensionNameRegex(it.comment)) {
-          let name = it.comment.slice(0, 100)
+        if ('comment' in it && it.comment && it.comment.trim()) {
+          let name = it.comment.replace(unIncludedNameRegex, '').slice(0, 100)
           it.oldName = it.alias
-          if (tempArr.includes(name)) {
-            this.$set(it, 'alias', `${it.name}_${name}`.slice(0, 100))
-          } else {
-            tempArr.push(name)
-            this.$set(it, 'alias', name)
-          }
+          this.$set(it, 'alias', this.getUniqueAlias(this.uniqueAliasCommentObj, name))
         } else {
           continue
         }
@@ -458,33 +452,6 @@ export default class DimensionsModal extends Vue {
     })
   }
 
-  // renderNameHeader (h, { column, $index }) {
-  //   return (<span class="ky-hover-icon" onClick={e => (e.stopPropagation())}>
-  //     <span>{this.$t('name')}</span>&nbsp;
-  //     <common-tip placement="top" content={this.$t('nameTip')}>
-  //      <span class='el-icon-ksd-what'></span>
-  //     </common-tip>
-  //   </span>)
-  // }
-
-  // renderCardinalityHeader (h, { column, $index }) {
-  //   return (<span class="ky-hover-icon" onClick={e => (e.stopPropagation())}>
-  //     <span>{this.$t('cardinality')}</span>&nbsp;
-  //     <common-tip placement="top" content={this.$t('cardinalityTip')}>
-  //      <span class='el-icon-ksd-what'></span>
-  //     </common-tip>
-  //   </span>)
-  // }
-
-  // renderCommentHeader (h, { column, $index }) {
-  //   return (<span class="ky-hover-icon" onClick={e => (e.stopPropagation())}>
-  //     <span>{this.$t('comment')}</span>&nbsp;
-  //     <common-tip placement="top" content={this.$t('commentTip')}>
-  //      <span class='el-icon-ksd-what'></span>
-  //     </common-tip>
-  //   </span>)
-  // }
-
   changeSearchVal (val) {
     clearTimeout(this.ST)
     this.ST = setTimeout(() => {
@@ -577,6 +544,15 @@ export default class DimensionsModal extends Vue {
     })
     this.renderTableColumnSelected(this.ccTable)
   }
+  getUniqueAlias (obj, name) {
+    if (obj[name] === undefined) {
+      obj[name] = 0
+      return name
+    } else {
+      obj[name]++
+      return name + '_' + obj[name]
+    }
+  }
   // 获取所有的table columns,并渲染已经选择过的dimension
   getRenderDimensionData () {
     this.getRenderCCData()
@@ -601,27 +577,21 @@ export default class DimensionsModal extends Vue {
       // 将已经选上的dimension回显到界面上
       table.columns && table.columns.forEach((col, index) => {
         this.$set(col, 'tableName', table.alias)
-        this.$set(col, 'alias', col.name)
+        this.$set(col, 'alias', this.getUniqueAlias(this.uniqueAliasObj, col.name.replace(unIncludedNameRegex, ''))) // 去除不符合维度命名的字符)
         this.$set(col, 'isSelected', false)
         this.$set(col, 'guid', null)
-        let len = this.usedColumns.length
-        for (let i = 0; i < len; i++) {
-          let d = this.usedColumns[i]
-          if (table.alias + '.' + col.name === d.column && d.status === 'DIMENSION') {
-            col.alias = d.name
-            col.isSelected = true
-            col.guid = d.guid
-            break
-          }
+        const selectedColIndex = indexOfObjWithSomeKeys(this.usedColumns, 'column', table.alias + '.' + col.name, 'status', 'DIMENSION' )
+        if (selectedColIndex !== -1) {
+          col.alias = col.name.replace(unIncludedNameRegex, '') !== this.usedColumns[selectedColIndex].name.replace(unIncludedNameRegex, '') ? this.getUniqueAlias(this.uniqueAliasObj, this.usedColumns[selectedColIndex].name.replace(unIncludedNameRegex, '')) : col.alias
+          col.isSelected = true
+          col.guid = this.usedColumns[selectedColIndex].guid
         }
-        for (let it of others) {
-          if (`${table.alias}.${col.name}` === it.column && !selectedColumns.includes(it.column)) {
-            this.$set(col, 'alias', it.name)
-            break
-          }
+        const otherColIndex = indexOfObjWithSomeKey(others, 'column', `${table.alias}.${col.name}`)
+        if (otherColIndex !== -1 && !selectedColumns.includes(others[otherColIndex].column) && others[otherColIndex].name.replace(unIncludedNameRegex, '') !== col.name.replace(unIncludedNameRegex, '')) {
+          this.$set(col, 'alias', this.getUniqueAlias(this.uniqueAliasObj, others[otherColIndex].name.replace(unIncludedNameRegex, ''))) // 去除不符合维度命名的字符)
         }
         if (names.indexOf(col.name) !== names.lastIndexOf(col.name) && !col.isSelected) {
-          this.$set(col, 'alias', col.name + '_' + table.alias)
+          this.$set(col, 'alias', this.getUniqueAlias(this.uniqueAliasObj, col.name.replace(unIncludedNameRegex, '') + '_' + table.alias))// 去除不符合维度命名的字符)
         }
       })
       this.renderTableColumnSelected(table)
@@ -718,10 +688,9 @@ export default class DimensionsModal extends Vue {
       }, 200)
     }
   }
-  mounted () {
-  }
   handleClose (isSubmit, data) {
     this.hideModal()
+    this.uniqueAliasObj = {}
     setTimeout(() => {
       this.resetModalForm()
       this.callback && this.callback({
diff --git a/kystudio/src/config/index.js b/kystudio/src/config/index.js
index df910cb3a2..9b51bf0819 100644
--- a/kystudio/src/config/index.js
+++ b/kystudio/src/config/index.js
@@ -183,6 +183,7 @@ export const SystemPwdRegex = /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*(){}|:"<>?[
 export const NamedRegex = /^\w+$/
 export const NamedRegex1 = /^[\u4e00-\u9fa5_\-(()%?)a-zA-Z0-9\s]+$/
 export const measureNameRegex = /^[\u4e00-\u9fa5_\-(()%?).a-zA-Z0-9\s]+$/
+export const unIncludedNameRegex = /[^\u4e00-\u9fa5_\-(()%?).a-zA-Z0-9\s]/g
 export const positiveNumberRegex = /^[1-9][0-9]*$/ // 的正整数
 export const DatePartitionRule = [/^date$/, /^timestamp$/, /^string$/, /^bigint$/, /^int$/, /^integer$/, /^varchar/]
 export const TimePartitionRule = [/^long$/, /^bigint$/, /^int$/, /^short$/, /^integer$/, /^tinyint$/, /^string$/, /^varchar/, /^char/]


[kylin] 06/12: KYLIN-5483 support IE

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2794384883b95687e584caa6c963ca5c4d072c9e
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 17:36:32 2023 +0800

    KYLIN-5483 support IE
---
 .../components/studio/StudioModel/DimensionsModal/index.vue |  6 +++++-
 .../StudioModel/ModelList/ModelAggregate/indexDetails.vue   | 13 ++++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue b/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue
index 6e6ffdf5af..5ed456fb2d 100644
--- a/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue
+++ b/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue
@@ -114,9 +114,10 @@
                 </div>
                 <el-table
                   v-if="table.show || isGuideMode"
+                  :ref="table.guid"
                   :class="[flattenLookupTables.includes(table.alias) && 'is-disabled']"
                   :row-class-name="(para) => tableRowClassName(para, table)"
-                  :data="table.columns" :ref="table.guid"
+                  :data="table.columns"
                   @row-click="(row) => {rowClick(row, table.guid)}"
                   @select-all="(selection) => {selectionAllChange(selection, table.guid)}"
                   @select="(selection, row) => {selectionChange(selection, row, table.guid)}">
@@ -762,6 +763,9 @@ export default class DimensionsModal extends Vue {
   toggleTableShow (table) {
     table.show = !table.show
     this.renderTableColumnSelected(table)
+    this.$nextTick(() => {
+      this.$refs[table.guid] && this.$refs[table.guid][0].doLayout()
+    })
   }
   // 单个表渲染已选择的行
   renderTableColumnSelected (table) {
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/indexDetails.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/indexDetails.vue
index 4b181bca0c..cd7d4294b3 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/indexDetails.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/indexDetails.vue
@@ -16,7 +16,7 @@
       <span><el-tooltip :content="$t('modifiedTime')" placement="top"><i class="el-icon-ksd-type_time"></i></el-tooltip> {{cuboidDetail.modifiedTime || showTableIndexDetail.modifiedTime}}</span>
     </div>
     <template v-if="detailType === 'aggDetail'">
-      <el-table class="cuboid-content" :data="cuboidDetail.cuboidContent" size="small" border>
+      <el-table ref="aggTableDetails" class="cuboid-content" :data="cuboidDetail.cuboidContent" size="small" border>
         <el-table-column type="index" :label="$t('order')" width="64">
         </el-table-column>
         <el-table-column prop="content" show-overflow-tooltip :label="$t('content')">
@@ -49,6 +49,7 @@
     <div v-else>
         <el-table
         size="small"
+        ref="indexTableDetails"
         :data="showTableIndexDetail.renderData"
         border class="table-index-detail">
         <!-- <el-table-column
@@ -174,6 +175,16 @@ export default class indexDetails extends Vue {
     // this.$emit('close')
     this.resetDetail()
   }
+
+  mounted () {
+    this.$nextTick(() => {
+      if (this.detailType === 'aggDetail') {
+        this.$refs.aggTableDetails && this.$refs.aggTableDetails.doLayout()
+      } else {
+        this.$refs.indexTableDetails && this.$refs.indexTableDetails.doLayout()
+      }
+    })
+  }
 }
 </script>
 


[kylin] 01/12: KYLIN-5478 upgrade sql-formatter to 8.2.0

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 26013268bf1b71cd3a6985d0a6bc1deafa66074c
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 11:21:33 2023 +0800

    KYLIN-5478 upgrade sql-formatter to 8.2.0
---
 kystudio/package.json                     | 2 +-
 kystudio/src/components/common/editor.vue | 8 ++++----
 kystudio/src/config/index.js              | 7 +++++++
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/kystudio/package.json b/kystudio/package.json
index c2ed13cacb..7cedf37632 100644
--- a/kystudio/package.json
+++ b/kystudio/package.json
@@ -33,7 +33,7 @@
     "nprogress": "0.2.0",
     "nvd3": "1.8.4",
     "smooth-scrollbar": "7.4.0",
-    "sql-formatter": "2.3.1",
+    "sql-formatter": "8.2.0",
     "uuid": "8.3.2",
     "vue": "2.5.2",
     "vue-clipboard2": "0.0.6",
diff --git a/kystudio/src/components/common/editor.vue b/kystudio/src/components/common/editor.vue
index c837c74462..83aecc434d 100644
--- a/kystudio/src/components/common/editor.vue
+++ b/kystudio/src/components/common/editor.vue
@@ -26,8 +26,8 @@
   </div>
 </template>
 <script>
-import sqlFormatter from 'sql-formatter'
-import { sqlRowsLimit, sqlStrLenLimit } from '../../config/index'
+import { format } from 'sql-formatter'
+import { sqlRowsLimit, sqlStrLenLimit, formatSQLConfig } from '../../config/index'
 import { mapState } from 'vuex'
 import Vue from 'vue'
 import { Component } from 'vue-property-decorator'
@@ -145,8 +145,8 @@ import { Component } from 'vue-property-decorator'
         const data = this.editorData.length > sqlStrLenLimit ? `${this.editorData.slice(0, sqlStrLenLimit)}...` : this.editorData
         // 是否显示 tips 取决于填入的 sql 字符数是否超过全局配置的
         this.showLimitTip = this.editorData.length > sqlStrLenLimit
-        this.formatData = sqlFormatter.format(data)
-        this.fullFormatData = sqlFormatter.format(this.editorData)
+        this.formatData = format(data, formatSQLConfig)
+        this.fullFormatData = format(this.editorData, formatSQLConfig)
       } else {
         const data = this.editorData.split('\n')
         // 是否显示 tips 取决于填入的 sql 行数是否超过全局配置的
diff --git a/kystudio/src/config/index.js b/kystudio/src/config/index.js
index f43fc831ef..df910cb3a2 100644
--- a/kystudio/src/config/index.js
+++ b/kystudio/src/config/index.js
@@ -721,4 +721,11 @@ export const getAffectedModelsType = {
   RELOAD_ROOT_FACT: 'RELOAD_ROOT_FACT'
 }
 
+export const formatSQLConfig = {
+  language: 'sql',
+  tabWidth: 2,
+  // keywordCase: 'upper',
+  linesBetweenQueries: 2
+}
+
 export { projectCfgs } from './projectCfgs'


[kylin] 10/12: KYLIN-5487 refine sync comment name issue

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bb348f3f19c6b6413dd6277c4cedc8f9fb9cfb78
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 18:36:17 2023 +0800

    KYLIN-5487 refine sync comment name issue
---
 kystudio/package.json                              | 24 +++++++++++-----------
 .../studio/StudioModel/BatchMeasureModal/index.vue | 11 +++++-----
 .../studio/StudioModel/ModelEdit/index.vue         |  2 +-
 3 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/kystudio/package.json b/kystudio/package.json
index 7cedf37632..e48263d1f1 100644
--- a/kystudio/package.json
+++ b/kystudio/package.json
@@ -46,23 +46,23 @@
     "vuex": "2.5.0"
   },
   "devDependencies": {
-    "@babel/core": "^7.15.8",
-    "@babel/helper-module-imports": "^7.15.4",
-    "@babel/plugin-proposal-decorators": "^7.15.8",
-    "@babel/plugin-syntax-dynamic-import": "^7.8.3",
-    "@babel/plugin-syntax-jsx": "^7.14.5",
-    "@babel/plugin-transform-runtime": "^7.15.8",
-    "@babel/preset-env": "^7.15.8",
-    "@babel/register": "^7.15.3",
-    "@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
-    "@vue/babel-preset-jsx": "^1.2.4",
+    "@babel/core": "7.15.8",
+    "@babel/helper-module-imports": "7.15.4",
+    "@babel/plugin-proposal-decorators": "7.15.8",
+    "@babel/plugin-syntax-dynamic-import": "7.8.3",
+    "@babel/plugin-syntax-jsx": "7.14.5",
+    "@babel/plugin-transform-runtime": "7.15.8",
+    "@babel/preset-env": "7.15.8",
+    "@babel/register": "7.15.3",
+    "@vue/babel-helper-vue-jsx-merge-props": "1.2.1",
+    "@vue/babel-preset-jsx": "1.2.4",
     "@vue/test-utils": "1.1.3",
     "autoprefixer": "^6.7.2",
     "babel-core": "7.0.0-bridge.0",
     "babel-eslint": "^8.2.6",
     "babel-jest": "24.9.0",
-    "babel-loader": "^8.0.6",
-    "babel-plugin-istanbul": "^3.1.2",
+    "babel-loader": "8.0.6",
+    "babel-plugin-istanbul": "3.1.2",
     "chai": "^3.5.0",
     "chalk": "^1.1.3",
     "connect-history-api-fallback": "^1.3.0",
diff --git a/kystudio/src/components/studio/StudioModel/BatchMeasureModal/index.vue b/kystudio/src/components/studio/StudioModel/BatchMeasureModal/index.vue
index b1ac218c7d..452c3020bf 100644
--- a/kystudio/src/components/studio/StudioModel/BatchMeasureModal/index.vue
+++ b/kystudio/src/components/studio/StudioModel/BatchMeasureModal/index.vue
@@ -264,7 +264,7 @@ export default class BatchMeasureModal extends Vue {
       const lastIndex = uniqueName.lastIndexOf('_')
       let sameCount = +uniqueName.substring(lastIndex + 1)
       const sameNameMes = getObjectBySomeKeys(arrrReverse, 'name' ,uniqueName)
-      if ((sameNameMes.table_guid || sameNameMes.guid) !== column.table_guid) {
+      if (sameNameMes.parameter_value.length && sameNameMes.parameter_value[0].table_guid !== column.table_guid) {
         uniqueName = uniqueName + '_' + column.table_alias
       } else if (!isNaN(parseFloat(sameCount))) { // 是数字
         sameCount++
@@ -288,7 +288,7 @@ export default class BatchMeasureModal extends Vue {
     if (this.syncComment) {
       allMeasureArr.forEach(item => {
         if (item.parameter_value.length > 0) {
-          const column = columns.filter(it => it.full_colname === item.parameter_value[0].value)
+          const column = columns.filter(it => (it.full_colname || `${it.table_alias}.${it.column}`) === item.parameter_value[0].value)
           column.length > 0 && column[0].comment && (item.comment = column[0].comment)
         }
       })
@@ -542,12 +542,11 @@ export default class BatchMeasureModal extends Vue {
           this.$set(col, 'table_guid', table.guid)
           this.$set(col, 'table_alias', table.alias)
           const len = this.usedColumns.length
-          const selectedColumns = this.usedColumns.filter(it => this.expressions.indexOf(it.expression) !== -1).map(item => item.parameter_value[0].value)
-          let others = this.otherColumns.length ? this.otherColumns : this.modelDesc.all_named_columns.filter(item => !selectedColumns.includes(item.column))
+          let others = this.otherColumns.length ? [...this.otherColumns, ...this.modelDesc.dimensions] : this.modelDesc.all_named_columns
           for (let i = 0; i < len; i++) {
             let d = this.usedColumns[i]
             if (this.expressions.indexOf(d.expression) !== -1 && d.parameter_value[0].value === table.alias + '.' + col.column) {
-              let regxt = new RegExp(`\\_${d.expression}$`)
+              let regxt = new RegExp(`\\_${d.expression}(\\_\\d+)?$`)
               let name = d.name.trim() ? d.name.replace(regxt, '') : col.name
               col[d.expression].value = true
               col[d.expression].isShouldDisable = true
@@ -557,7 +556,7 @@ export default class BatchMeasureModal extends Vue {
             }
           }
           for (let it of others) {
-            if (`${col.table_alias}.${col.column}` === it.column && !selectedColumns.includes(it.column)) {
+            if (`${col.table_alias}.${col.column}` === it.column) {
               this.$set(col, 'name', it.name.trim() ? it.name : col.column)
               break
             }
diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
index af21fb6ecb..689de2c4d8 100644
--- a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
@@ -1283,6 +1283,7 @@ export default class ModelEdit extends Vue {
     })
   }
   async initModelDesc (cb) {
+    this.resetOtherColumns()
     if (this.extraoption.modelName && this.extraoption.action === 'edit') {
       this.getModelByModelName({model_name: this.extraoption.modelName, project: this.extraoption.project}).then((response) => {
         handleSuccess(response, (data) => {
@@ -1290,7 +1291,6 @@ export default class ModelEdit extends Vue {
             this.modelData = data.value[0]
             this.modelData.project = this.currentSelectedProject
             this.modelData.anti_flatten_lookups = []
-            this.resetOtherColumns()
             cb(this.modelData)
           } else {
             kylinMessage(this.$t('modelDataNullTip'), {type: 'warning'})


[kylin] 07/12: KYLIN-5484 remove duplicate partition time format

Posted by xx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 321547ec798d76f90d19a33532fc06f6b9f546a6
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Mar 24 17:51:51 2023 +0800

    KYLIN-5484 remove duplicate partition time format
---
 kystudio/src/components/query/query_history_table.vue                | 5 +++--
 .../studio/StudioModel/ModelList/ModelBuildModal/build.vue           | 2 +-
 .../components/studio/StudioModel/ModelList/ModelPartition/index.vue | 2 +-
 .../studio/StudioModel/ModelList/ModelSaveConfig/index.vue           | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/kystudio/src/components/query/query_history_table.vue b/kystudio/src/components/query/query_history_table.vue
index f09db8b504..d267cbc29c 100644
--- a/kystudio/src/components/query/query_history_table.vue
+++ b/kystudio/src/components/query/query_history_table.vue
@@ -302,7 +302,8 @@ import Vue from 'vue'
 import { mapActions, mapGetters } from 'vuex'
 import { Component, Watch } from 'vue-property-decorator'
 // import $ from 'jquery'
-import { sqlRowsLimit, sqlStrLenLimit } from '../../config/index'
+import { sqlRowsLimit, sqlStrLenLimit , formatSQLConfig} from '../../config/index'
+import { format } from 'sql-formatter'
 import sqlFormatter from 'sql-formatter'
 import IndexDetails from '../studio/StudioModel/ModelList/ModelAggregate/indexDetails'
 import Diagnostic from 'components/admin/Diagnostic/index'
@@ -434,7 +435,7 @@ export default class QueryHistoryTable extends Vue {
       const sql = element.sql_text
       const sql_limit = this.sqlOverLimit(sql) ? `${sql.slice(0, this.sqlLimitRows)}...` : sql
       const sqlTextArr = sql.split('\n') // 换行符超过一个,说明用户查询行自定义过format格式,则保留
-      element['sql_limit'] = sqlTextArr.length > 1 ? sql_limit : sqlFormatter.format(sql_limit)
+      element['sql_limit'] = sqlTextArr.length > 1 ? sql_limit : format(sql_limit, formatSQLConfig)
       element['server'] = [element['server']]
       element['flexHeight'] = 0
       element['editorH'] = 0
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
index 8a63c62ea3..fa2941c6c7 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
@@ -79,7 +79,7 @@
                     default-first-option
                     :placeholder="$t('pleaseInputColumn')">
                     <el-option-group>
-                      <el-option v-if="prevPartitionMeta.format.indexOf(dateFormatsOptions) === -1&&prevPartitionMeta.format" :label="prevPartitionMeta.format" :value="prevPartitionMeta.format"></el-option>
+                      <el-option v-if="dateFormatsOptions.map(it => it.value).indexOf(prevPartitionMeta.format) === -1 && prevPartitionMeta.format" :label="prevPartitionMeta.format" :value="prevPartitionMeta.format"></el-option>
                       <el-option :label="f.label" :value="f.value" v-for="f in dateFormatsOptions" :key="f.label"></el-option>
                     </el-option-group>
                   </el-select>
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue
index 06fb663e09..ca48d1a37d 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue
@@ -65,7 +65,7 @@
               @change="val => changePartitionSetting('format', val)"
               :placeholder="$t('pleaseInputColumn')">
               <el-option-group>
-                <el-option v-if="prevPartitionMeta.format.indexOf(dateFormatsOptions) === -1&&prevPartitionMeta.format" :label="prevPartitionMeta.format" :value="prevPartitionMeta.format"></el-option>
+                <el-option v-if="dateFormatsOptions.map(it => it.value).indexOf(prevPartitionMeta.format) === -1 && prevPartitionMeta.format" :label="prevPartitionMeta.format" :value="prevPartitionMeta.format"></el-option>
                 <el-option :label="f.label" :value="f.value" v-for="f in dateFormatsOptions" :key="f.label"></el-option>
                 <!-- <el-option label="" value="" v-if="partitionMeta.column && timeDataType.indexOf(getColumnInfo(partitionMeta.column).datatype)===-1"></el-option> -->
               </el-option-group>
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
index 622e95d598..1136808697 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
@@ -106,7 +106,7 @@
                 @change="val => changeColumn('format', val)"
               >
                 <el-option-group>
-                  <el-option v-if="prevPartitionMeta.format.indexOf(dateFormatsOptions) === -1&&prevPartitionMeta.format" :label="prevPartitionMeta.format" :value="prevPartitionMeta.format"></el-option>
+                  <el-option v-if="dateFormatsOptions.map(it => it.value).indexOf(prevPartitionMeta.format) === -1 && prevPartitionMeta.format" :label="prevPartitionMeta.format" :value="prevPartitionMeta.format"></el-option>
                   <el-option :label="f.label" :value="f.value" v-for="f in dateFormatsOptions" :key="f.label"></el-option>
                   <!-- <el-option label="" value="" v-if="partitionMeta.column && timeDataType.indexOf(getColumnInfo(partitionMeta.column).datatype)===-1"></el-option> -->
                 </el-option-group>