Skip to content

Commit

Permalink
Bug Fix: Show Error messages on Auth Configuration page (#8500)
Browse files Browse the repository at this point in the history
* manually trigger error handler

* add a catch

* remove uneeded return
  • Loading branch information
Monkeychip authored and andaley committed Mar 13, 2020
1 parent 8fdef4f commit 2b2d169
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ui/app/components/auth-config-form/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export default AuthConfigComponent.extend({
if (err instanceof DS.AdapterError === false) {
throw err;
}
// because we're not calling model.save the model never updates with
// the error. Forcing the error message by manually setting the errorMessage
try {
this.model.set('errorMessage', err.errors.firstObject);
} catch {
// do nothing
}
return;
}
if (this.wizard.currentMachine === 'authentication' && this.wizard.featureState === 'config') {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/auth-config-form/options.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form {{action (perform saveModel) on="submit"}}>
<div class="box is-sideless is-fullwidth is-marginless">
<MessageError @model={{model}} @errorMessage={{model.errorMessage}}/>
<NamespaceReminder @mode="save" @noun="Auth Method" />
{{message-error model=model}}
{{#each model.tuneAttrs as |attr|}}
{{form-field data-test-field attr=attr model=model}}
{{/each}}
Expand Down

0 comments on commit 2b2d169

Please sign in to comment.