Skip to content

Commit

Permalink
fix: 文案优化 & 版本发布-新建版本判断是否有任务正在执行修复
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 18155
  • Loading branch information
leafage-collb committed Sep 11, 2024
1 parent 2d51cab commit d2eea4c
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 15 deletions.
5 changes: 4 additions & 1 deletion webfe/package_vue/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -2767,7 +2767,7 @@ export default {
申请灰度发布: 'Apply for Gray Release',
扩大灰度范围: 'Expand Gray Release Scope',
申请全量发布: 'Apply for Full Release',
重新申请: 'Reapply',
申请扩大灰度范围: 'Apply to expand the gray range',
已测试版本: 'Tested Version',
最小范围可以选择中心: 'Minimum Scope Can Select Center',
'灰度发布审批中,请耐心等待': 'Gray release approval in progress, please wait patiently',
Expand All @@ -2776,4 +2776,7 @@ export default {
'灰度发布需由<em>工具管理员</em>进行审批;若选择了灰度组织范围,还需要由<em>工具发布者的组长</em>同时进行审批。': 'Gray release needs to be approved by the <em>tool administrator</em>; if a gray organization scope is selected, it also needs to be approved by the <em>team leader of the tool publisher</em>.',
已终止当前的发布版本: 'The current release version has been terminated',
扩大灰度范围不允许删除已经灰度过的组织: 'Expanding the gray range does not allow deleting organizations that have already been grayed out',
测试号: 'Test number',
已终止: 'Terminated',
'主版本号、次版本号、修正版本号': 'Major version number, minor version number, patch version number',
};
5 changes: 4 additions & 1 deletion webfe/package_vue/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -2904,7 +2904,7 @@ export default {
申请灰度发布: '申请灰度发布',
扩大灰度范围: '扩大灰度范围',
申请全量发布: '申请全量发布',
重新申请: '重新申请',
申请扩大灰度范围: '申请扩大灰度范围',
已测试版本: '已测试版本',
最小范围可以选择中心: '最小范围可以选择中心',
'灰度发布审批中,请耐心等待': '灰度发布审批中,请耐心等待',
Expand All @@ -2913,4 +2913,7 @@ export default {
'灰度发布需由<em>工具管理员</em>进行审批;若选择了灰度组织范围,还需要由<em>工具发布者的组长</em>同时进行审批。': '灰度发布需由<em>工具管理员</em>进行审批;若选择了灰度组织范围,还需要由<em>工具发布者的组长</em>同时进行审批。',
已终止当前的发布版本: '已终止当前的发布版本',
扩大灰度范围不允许删除已经灰度过的组织: '扩大灰度范围不允许删除已经灰度过的组织',
测试号: '测试号',
已终止: '已终止',
'主版本号、次版本号、修正版本号': '主版本号、次版本号、修正版本号',
};
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ export default {
version: [
{
required: true,
message: '必填项',
message: this.$t('必填项'),
trigger: 'blur',
},
],
comment: [
{
required: true,
message: '必填项',
message: this.$t('必填项'),
trigger: 'blur',
},
],
Expand Down Expand Up @@ -220,7 +220,7 @@ export default {
deep: true,
},
'releaseContent.version'(newVal) {
this.releaseContent.versionDisplay = `${newVal} (主版本号、次版本号、修正版本号)`;
this.releaseContent.versionDisplay = `${newVal} (${this.$t('主版本号、次版本号、修正版本号')})`;
},
'releaseContent.source_versions'() {
this.releaseContent.comment = this.curVersionData.message;
Expand Down Expand Up @@ -259,16 +259,16 @@ export default {
'self-fill': '',
};
this.releaseContent.version = versionMapping[data.version_no] || '';
// 重新申请默认值
// 重新发布默认值
if (this.versionId) {
this.setVersionDefaultValue(data);
}
},
// 重新申请设置默认值
// 重新发布设置默认值
setVersionDefaultValue() {
const { source_version_name, semver_type, comment } = this.versionData;
const version = this.versionTypes.find(v => v.key === semver_type).value;
const versionDisplay = `${version} (主版本号、次版本号、修正版本号)`;
const versionDisplay = `${version} (${this.$t('主版本号、次版本号、修正版本号')})`;
this.releaseContent = {
...this.releaseContent,
source_versions: source_version_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:error-display-type="'normal'"
:rules="rules.strategy"
>
<bk-radio-group v-model="releaseStrategy.strategy">
<bk-radio-group v-model="releaseStrategy.strategy" @change="handleChange">
<bk-radio
v-for="item in releaseStrategyMap"
:value="item.value"
Expand Down Expand Up @@ -211,7 +211,7 @@ export default {
strategy: [
{
required: true,
message: '必填项',
message: this.$t('必填项'),
trigger: 'blur',
},
],
Expand Down Expand Up @@ -366,6 +366,9 @@ export default {
if (!this.isDetailStep) return false;
return this.initDepartments.findIndex(v => v.id === id) !== -1;
},
handleChange(value) {
this.$emit('strategy-change', value);
},
},
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ export default {
this.curVersionType = this.$route.query.type || 'test';
}
this.getVersionList();
this.getReleasedVersion();
if (this.isCodecc) {
this.getRollbackVersion();
}
Expand Down Expand Up @@ -580,6 +581,25 @@ export default {
return statusParams;
},
// 获取指定状态版本,判断是否有版本正在灰度或者发布中
async getReleasedVersion() {
if (!this.isOfficialVersion) return;
try {
const res = await this.$store.dispatch('plugin/getVersionsManagerList', {
data: {
pdId: this.pdId,
pluginId: this.pluginId,
},
pageParams: { type: 'prod' },
statusParams: 'status=pending&status=initial',
});
// 当前是否已有任务进行中
this.curIsPending = !!res.results.length;
} catch (e) {
console.error(e);
}
},
// 获取版本列表
async getVersionList(page = 1) {
this.isTableLoading = true;
Expand All @@ -597,8 +617,6 @@ export default {
});
this.versionList = res.results;
this.pagination.count = res.count;
// 当前是否已有任务进行中
this.curIsPending = this.versionList.find(item => item.status === 'pending');
this.updateTableEmptyConfig();
this.tableEmptyConf.isAbnormal = false;
} catch (e) {
Expand Down Expand Up @@ -933,6 +951,7 @@ export default {
message: this.$t('已终止当前的发布版本'),
});
this.getVersionList();
this.getReleasedVersion();
} catch (e) {
this.$bkMessage({
theme: 'error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
:mode="releaseStrategyMode"
:data="versionData"
step="release"
@strategy-change="handleStrategyChange"
/>
<!-- 发布结果 -->
<release-result :url="versionData.report_url" />
Expand All @@ -98,7 +99,7 @@
class="mr8"
@click="handleReapply"
>
{{ $t('重新申请') }}
{{ $t('重新发布') }}
</bk-button>
<!-- 审批中 -->
<bk-button
Expand Down Expand Up @@ -137,7 +138,7 @@
:loading="isApplyLoading"
@click="handleSubmit"
>
{{ $t('申请扩大灰度范围') }}
{{ $t(submitText) }}
</bk-button>
<bk-button
:theme="'default'"
Expand Down Expand Up @@ -195,6 +196,7 @@ export default {
source_versions: [],
},
canTerminateStatus: ['gray_approval_in_progress', 'full_approval_in_progress', 'in_gray'],
submitText: '申请扩大灰度范围',
};
},
computed: {
Expand Down Expand Up @@ -272,6 +274,7 @@ export default {
// 只允许扩大灰度范围
this.releaseStrategyMode = 'edit';
this.isRequestGrayRelease = true;
this.submitText = type === 'full' ? '申请全量发布' : '申请扩大灰度范围';
if (type === 'full') {
// 全量
this.versionData.latest_release_strategy.strategy = 'full';
Expand Down Expand Up @@ -368,7 +371,7 @@ export default {
}
},
// 重新申请
// 重新发布
handleReapply() {
this.$router.push({
name: 'pluginVersionEditor',
Expand Down Expand Up @@ -413,6 +416,10 @@ export default {
},
});
},
handleStrategyChange(type) {
this.submitText = type === 'full' ? '申请全量发布' : '申请扩大灰度范围';
},
},
};
</script>
Expand Down

0 comments on commit d2eea4c

Please sign in to comment.