Skip to content

Commit

Permalink
Fix duplicate expressions and null values
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent99 committed Jan 6, 2021
1 parent 844ae9a commit 4d614ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion components/form/MatchExpressions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ export default {
return;
}
matchExpression.values = val ? val.split(/\s*,\s*/).filter(x => !!x) : null;
if ( val !== null ) {
matchExpression.values = val.split(/\s*,\s*/).filter(x => !!x);
}
return matchExpression;
}).filter(x => !!x);
Expand Down
12 changes: 7 additions & 5 deletions edit/fleet.cattle.io.clustergroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@ export default {
};
}
this.updateMatchingClusters();
const expressions = convert(
this.value.spec.selector.matchLabels || {},
this.value.spec.selector.matchExpressions || []
);
this.matchChanged(expressions);
},
data() {
return {
allClusters: null,
allWorkspaces: null,
matchingClusters: null,
expressions: [
...convert(this.value.spec.selector.matchLabels || {}),
...(this.value.spec.selector.matchExpressions || []),
],
expressions: null,
};
},
Expand Down

0 comments on commit 4d614ee

Please sign in to comment.