Skip to content

Commit

Permalink
fix(iam): resource selection does not change on error (#9711)
Browse files Browse the repository at this point in the history
ref: MANAGER-11933

Signed-off-by: Yann Lojewski <[email protected]>
  • Loading branch information
y4nnL authored Jul 28, 2023
1 parent f33c5a3 commit 7b06a23
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ export default class ResourceSelectController {
* @returns {boolean}
*/
get hasSelectedResourceTypes() {
return this.model.types?.length > 0 || false;
const { model, resourceTypesControl } = this;
return (
model.types?.length > 0 ||
resourceTypesControl?.$$rawModelValue?.length > 0 ||
false
);
}

/**
Expand Down Expand Up @@ -133,7 +138,9 @@ export default class ResourceSelectController {
onModelChanged() {
this.requiredNgModel.$setViewValue({
selection: this.model.selection,
types: this.model.types.map(({ value }) => value),
types: this.resourceTypesControl.$$rawModelValue?.map(
({ value }) => value,
),
});
}

Expand Down

0 comments on commit 7b06a23

Please sign in to comment.