Skip to content

Commit

Permalink
Fixed: Error messages aren't displaying on the remote container creat…
Browse files Browse the repository at this point in the history
…e form

Issue: AAH-1845

PR Checks

PR checks
  • Loading branch information
MilanPospisil committed Aug 1, 2022
1 parent 5dabe0c commit e6d2343
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/1845.bug
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EE detail now shows error in name column, when there are duplicate names in adding new EE.
16 changes: 16 additions & 0 deletions src/components/execution-environment/repository-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export class RepositoryForm extends React.Component<IProps, IState> {
isDisabled={true}
type='text'
/>
{this.renderNameError(formError)}
</FormGroup>

<FormGroup
Expand Down Expand Up @@ -207,6 +208,7 @@ export class RepositoryForm extends React.Component<IProps, IState> {
onChange={(value) => this.setState({ name: value })}
validated={this.validateName(name)}
/>
{this.renderNameError(formError)}
</FormGroup>

<FormGroup
Expand Down Expand Up @@ -581,4 +583,18 @@ export class RepositoryForm extends React.Component<IProps, IState> {
}
return isEmpty(xorWith(original, newOne, isEqual)) && same;
}

private renderNameError(formError) {
const nameError = formError
? formError.find((e) => e.field == 'name')
: null;

return (
nameError && (
<Alert title={nameError.title} variant='danger' isInline>
{nameError.detail}
</Alert>
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ class ExecutionEnvironmentList extends React.Component<
return {
title: error.title,
detail: error.source.parameter + ': ' + error.detail,
field: error.source.parameter,
};
}),
});
Expand Down

0 comments on commit e6d2343

Please sign in to comment.