@@ -200,6 +218,14 @@ export default {
departmentsFn: {
type: Function,
},
+ clearable: {
+ type: Boolean,
+ default: false,
+ },
+ organizeDisableIconFn: {
+ type: Function,
+ default: () => false,
+ },
},
data() {
return {
@@ -709,6 +735,8 @@ export default {
name: item.name,
id: item.id,
type: 'department',
+ // 兼容插件
+ ...(this.departmentsType === 'tc' && { tof_id: item.extras?.code || '' }),
});
});
if (!this.customClose) {
diff --git a/webfe/package_vue/src/language/lang/en.js b/webfe/package_vue/src/language/lang/en.js
index 97c38012ab..0c1e7dca7a 100644
--- a/webfe/package_vue/src/language/lang/en.js
+++ b/webfe/package_vue/src/language/lang/en.js
@@ -2775,4 +2775,5 @@ export default {
'请输入蓝盾项目 ID,多个 ID 以英文分号分隔,最多可输入 10 个 ID': 'Please enter Blue Shield Project IDs, separate multiple IDs with English semicolons, up to 10 IDs',
'灰度发布需由
工具管理员进行审批;若选择了灰度组织范围,还需要由
工具发布者的组长同时进行审批。': 'Gray release needs to be approved by the
tool administrator; if a gray organization scope is selected, it also needs to be approved by the
team leader of the tool publisher.',
已终止当前的发布版本: 'The current release version has been terminated',
+ 扩大灰度范围不允许删除已经灰度过的组织: 'Expanding the gray range does not allow deleting organizations that have already been grayed out',
};
diff --git a/webfe/package_vue/src/language/lang/zh.js b/webfe/package_vue/src/language/lang/zh.js
index a204268bc2..e138ccb980 100644
--- a/webfe/package_vue/src/language/lang/zh.js
+++ b/webfe/package_vue/src/language/lang/zh.js
@@ -2912,4 +2912,5 @@ export default {
'请输入蓝盾项目 ID,多个 ID 以英文分号分隔,最多可输入 10 个 ID': '请输入蓝盾项目 ID,多个 ID 以英文分号分隔,最多可输入 10 个 ID',
'灰度发布需由
工具管理员进行审批;若选择了灰度组织范围,还需要由
工具发布者的组长同时进行审批。': '灰度发布需由
工具管理员进行审批;若选择了灰度组织范围,还需要由
工具发布者的组长同时进行审批。',
已终止当前的发布版本: '已终止当前的发布版本',
+ 扩大灰度范围不允许删除已经灰度过的组织: '扩大灰度范围不允许删除已经灰度过的组织',
};
diff --git a/webfe/package_vue/src/views/plugin-center/plugin/base-config/visible-range.vue b/webfe/package_vue/src/views/plugin-center/plugin/base-config/visible-range.vue
index 94ea482105..8c98d3f9b5 100644
--- a/webfe/package_vue/src/views/plugin-center/plugin/base-config/visible-range.vue
+++ b/webfe/package_vue/src/views/plugin-center/plugin/base-config/visible-range.vue
@@ -2,7 +2,7 @@
import card from '@/components/card/card.vue';
import viewMode from './view-mode.vue';
+import pluginBaseMixin from '@/mixins/plugin-base-mixin';
export default {
name: 'ReleaseContent',
@@ -136,6 +137,7 @@ export default {
card,
viewMode,
},
+ mixins: [pluginBaseMixin],
props: {
mode: {
type: String,
@@ -298,13 +300,8 @@ export default {
toTestDetails() {
const url = this.isEdit ? this.curVersionData.url : this.versionInfo.url;
const id = url.split('=')[1];
- this.$router.push({
- name: 'pluginVersionRelease',
- query: {
- release_id: id,
- type: 'test',
- },
- });
+ const newTabUrl = `${location.origin}/plugin-center/plugin/${this.pdId}/${this.pluginId}/version-release?release_id=${id}&type=test`;
+ window.open(newTabUrl, '_blank');
},
},
};
diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-strategy.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-strategy.vue
index 116c9b9f68..d32242a8db 100644
--- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-strategy.vue
+++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-strategy.vue
@@ -148,6 +148,8 @@
:custom-close="true"
:range="'departments'"
:departments-fn="handleDepartments"
+ :clearable="isDetailStep"
+ :organize-disable-icon-fn="handleDisableIconFn"
departments-type="tc"
@sumbit="handleSubmit"
/>
@@ -198,6 +200,7 @@ export default {
isShow: false,
apiHost: window.BK_COMPONENT_API_URL,
departments: [],
+ initDepartments: [],
releaseStrategyMap: [
{ value: 'gray', name: this.$t('先灰度后全量发布') },
{ value: 'full', name: this.$t('直接全量发布') },
@@ -246,6 +249,7 @@ export default {
if (this.isDetailStep) {
this.releaseStrategy = cloneDeep(newValue?.latest_release_strategy || {});
this.departments = newValue.latest_release_strategy?.organization || [];
+ this.initDepartments = cloneDeep(this.departments);
if (this.departments.length) {
this.requestAllOrganization(this.departments);
}
@@ -307,9 +311,9 @@ export default {
this.isShow = true;
},
async handleSubmit(payload) {
+ await this.requestAllOrganization(payload);
this.releaseStrategy.organization = payload;
this.departments = payload;
- await this.requestAllOrganization(payload);
this.isShow = false;
},
// 请求组织的层级结构
@@ -357,6 +361,11 @@ export default {
this.releaseStrategy.bkci_project.push(input);
}
},
+ // 是否允许删除已勾选的组织
+ handleDisableIconFn(id) {
+ if (!this.isDetailStep) return false;
+ return this.initDepartments.findIndex(v => v.id === id) !== -1;
+ },
},
};
diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-details/index.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-details/index.vue
index ff9ff1586b..61f2233836 100644
--- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-details/index.vue
+++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-details/index.vue
@@ -137,7 +137,7 @@
:loading="isApplyLoading"
@click="handleSubmit"
>
- {{ $t('申请灰度发布') }}
+ {{ $t('申请扩大灰度范围') }}