-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI: fix delete for SSH engine config #19448
UI: fix delete for SSH engine config #19448
Conversation
@@ -43,6 +42,9 @@ export default Controller.extend(CONFIG_ATTRS, { | |||
.catch((error) => { | |||
const errorMessage = error.errors ? error.errors.join('. ') : error; | |||
this.flashMessages.danger(errorMessage); | |||
}) | |||
.finally(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the other method in this file uses finally()
so opted for this instead of adding it to the catch block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes perfect sense, since we want the loading state to be true whether the action results in a failure or success!
@@ -31,14 +31,14 @@ | |||
<ConfirmAction | |||
@buttonClasses="button" | |||
@confirmMessage="This will remove the CA certificate information." | |||
@onConfirmAction={{action "saveConfig" (hash delete=true)}} | |||
@onConfirmAction={{this.delete}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered calling @saveConfig
directly here and on line 41 but decided against because the parent isn't expecting a form event and I wanted to avoid making any changes higher up that could potentially introduce regressions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
@@ -43,6 +42,9 @@ export default Controller.extend(CONFIG_ATTRS, { | |||
.catch((error) => { | |||
const errorMessage = error.errors ? error.errors.join('. ') : error; | |||
this.flashMessages.danger(errorMessage); | |||
}) | |||
.finally(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes perfect sense, since we want the loading state to be true whether the action results in a failure or success!
*/ | ||
export default class ConfigureSshSecretComponent extends Component { | ||
@action | ||
saveConfig(data, event) { | ||
delete() { | ||
this.args.saveConfig({ delete: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that this is more explicit now! And we don't have to track down other files to see what data
is supposed to be 😄
* fix delete not working for ssh config * add test * add changelog;
Fixes form submission issue preventing updates to an ssh config
Before fix:
After fix: