Skip to content

Commit

Permalink
fix(projects): Fixing clusters error validation (#7701) (#7704)
Browse files Browse the repository at this point in the history
  • Loading branch information
spinnakerbot authored and Travis Tomsu committed Dec 16, 2019
1 parent 12edf0a commit 87a97c4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/scripts/modules/core/src/projects/configure/Clusters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,17 @@ export class Clusters extends React.Component<IClustersProps> implements IWizard
}

const areStackAndDetailDisabled = this.areStackAndDetailDisabled(cluster);
errors.stack = areStackAndDetailDisabled && cluster.stack !== '*' && 'Only * is valid for the selected account';
errors.detail =

const stackErrors =
areStackAndDetailDisabled && cluster.stack !== '*' && 'Only * is valid for the selected account';
if (stackErrors) {
errors.stack = stackErrors;
}
const detailErrors =
areStackAndDetailDisabled && cluster.detail !== '*' && 'Only * is valid for the selected account';
if (detailErrors) {
errors.detail = detailErrors;
}

return Object.keys(errors).length ? errors : null;
});
Expand Down

0 comments on commit 87a97c4

Please sign in to comment.