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 871fafaedc14346b6ba4e2516943b658464c4fc1 Author: Qian Xia <lauraxiaq...@gmail.com> AuthorDate: Fri Jul 21 11:09:16 2023 +0800 KYLIN-5666 add tip when add base index --- .../studio/StudioModel/ModelList/ModelAggregate/index.vue | 10 +++++++++- .../studio/StudioModel/ModelList/ModelAggregate/locales.js | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue index c8389b2a8b..6f4e55eaf1 100644 --- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue +++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue @@ -43,7 +43,7 @@ <span :title="Object.keys(indexStat).length && !indexStat.need_create_base_agg_index ? $t('unCreateBaseAggIndexTip') : ''" @click="createBaseIndex('BASE_AGG_INDEX')">{{$t('BASE_AGG_INDEX')}}</span> </el-dropdown-item> <el-dropdown-item :class="{'action-disabled': Object.keys(indexStat).length && !indexStat.need_create_base_table_index}" v-if="model.model_type === 'HYBRID' ? switchModelType !== 'STREAMING' : model.model_type !== 'STREAMING'"> - <span :title="Object.keys(indexStat).length && !indexStat.need_create_base_table_index ? $t('unCreateBaseTableIndexTip') : ''" @click="createBaseIndex('BASE_TABLE_INDEX')">{{$t('BASE_TABLE_INDEX')}}</span> + <span :title="Object.keys(indexStat).length && !indexStat.need_create_base_table_index ? showBaseAggIndexTip : ''" @click="createBaseIndex('BASE_TABLE_INDEX')">{{$t('BASE_TABLE_INDEX')}}</span> </el-dropdown-item> <el-dropdown-item class="dropdown-group-title" divided v-if="isShowEditAgg || (isShowTableIndexActions&&!isHideEdit)"> <span>{{$t('custom')}}</span> @@ -422,6 +422,14 @@ export default class ModelAggregate extends Vue { this.checkedList = val } + get showBaseAggIndexTip () { + if (this.model?.simplified_dimensions?.length > 0) { + return this.$t('unCreateBaseTableIndexTip') + } else { + return this.$t('unCreateBaseAggIndexNoDimensionTip') + } + } + get isDisableDelBaseIndex () { let isHaveBaseTableIndex = false for (let i = 0; i < this.checkedList.length; i++) { diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js index 545f76e14b..e6c15b6352 100644 --- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js +++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js @@ -85,6 +85,6 @@ export default { disabledDelBaseIndexTips: 'To delete the base table index, please turn off tiered storage for the model.', refuseAddIndexTip: 'Can\'t add streaming indexes. Please stop the streaming job and then delete all the streaming segments.', refuseRemoveIndexTip: 'Can\'t delete streaming indexes. Please stop the streaming job and then delete all the streaming segments.', - disabledBuildIndexTips: 'disabledBuildIndexTips' + unCreateBaseAggIndexNoDimensionTip: 'Can\'t add the base table index, as there are no dimensions in the model. Please add and try again.' } }