mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
fixes issue saving edited k8s role (#19133)
This commit is contained in:
@@ -27,7 +27,10 @@ export default class CreateAndEditRolePageComponent extends Component {
|
||||
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.initRoleRules();
|
||||
// generated role rules are only rendered for the full object chain option
|
||||
if (this.args.model.generationPreference === 'full') {
|
||||
this.initRoleRules();
|
||||
}
|
||||
// if editing and annotations or labels exist expand the section
|
||||
const { extraAnnotations, extraLabels } = this.args.model;
|
||||
if (extraAnnotations || extraLabels) {
|
||||
@@ -127,7 +130,7 @@ export default class CreateAndEditRolePageComponent extends Component {
|
||||
*save() {
|
||||
try {
|
||||
// set generatedRoleRoles to value of selected template
|
||||
const selectedTemplate = this.roleRulesTemplates.findBy('id', this.selectedTemplateId);
|
||||
const selectedTemplate = this.roleRulesTemplates?.findBy('id', this.selectedTemplateId);
|
||||
if (selectedTemplate) {
|
||||
this.args.model.generatedRoleRules = selectedTemplate.rules;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user