From 3592f99a77d26fab4b7e205f20f46b7c5e99d8da Mon Sep 17 00:00:00 2001 From: LiuYan <361112237@qq.com> Date: Mon, 29 Apr 2024 15:01:56 +0800 Subject: [PATCH] fix(Project/ClusterMemberEditor): fix find roleTemplates bug --- shell/components/form/Members/ClusterPermissionsEditor.vue | 2 +- shell/components/form/ProjectMemberEditor.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/components/form/Members/ClusterPermissionsEditor.vue b/shell/components/form/Members/ClusterPermissionsEditor.vue index 45f6252f7e0..7a354ce5f74 100644 --- a/shell/components/form/Members/ClusterPermissionsEditor.vue +++ b/shell/components/form/Members/ClusterPermissionsEditor.vue @@ -177,7 +177,7 @@ export default { }, customPermissionsUpdate() { return this.customPermissions.reduce((acc, customPermissionsItem) => { - const lockedExist = this.roleTemplates.find((roleTemplateItem) => roleTemplateItem.displayName === customPermissionsItem.label); + const lockedExist = this.roleTemplates.find((roleTemplateItem) => roleTemplateItem.id === customPermissionsItem.key); if (lockedExist.locked) { customPermissionsItem['locked'] = true; diff --git a/shell/components/form/ProjectMemberEditor.vue b/shell/components/form/ProjectMemberEditor.vue index fd6702e0f8a..b15e7623647 100644 --- a/shell/components/form/ProjectMemberEditor.vue +++ b/shell/components/form/ProjectMemberEditor.vue @@ -192,7 +192,7 @@ export default { }, customPermissionsUpdate() { return this.customPermissions.reduce((acc, customPermissionsItem) => { - const lockedExist = this.roleTemplates.find((roleTemplateItem) => roleTemplateItem.displayName === customPermissionsItem.label); + const lockedExist = this.roleTemplates.find((roleTemplateItem) => roleTemplateItem.id === customPermissionsItem.key); if (lockedExist.locked) { customPermissionsItem['locked'] = true;