Skip to content
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

Merged
merged 3 commits into from
Mar 8, 2023

Conversation

hellobontempo
Copy link
Contributor

Fixes form submission issue preventing updates to an ssh config

Before fix:

ssh


After fix:

ssh

@hellobontempo hellobontempo added ui bug Used to indicate a potential bug backport/1.13.x labels Mar 2, 2023
@hellobontempo hellobontempo added this to the 1.13.1 milestone Mar 2, 2023
@@ -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(() => {
Copy link
Contributor Author

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

Copy link
Contributor

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}}
Copy link
Contributor Author

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

@hellobontempo hellobontempo enabled auto-merge (squash) March 2, 2023 23:37
Copy link
Contributor

@hashishaw hashishaw left a 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(() => {
Copy link
Contributor

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 });
Copy link
Contributor

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 😄

@hellobontempo hellobontempo merged commit 75efaf0 into main Mar 8, 2023
@hellobontempo hellobontempo deleted the ui/VAULT-14126/fix-ssh-delete-public-key-bug branch March 8, 2023 17:42
raymonstah pushed a commit that referenced this pull request Mar 17, 2023
* fix delete not working for ssh config

* add test

* add changelog;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants