vault/ui/app/components/configure-ssh-secret.js
claire bontempo 75efaf09fb
UI: fix delete for SSH engine config (#19448)
* fix delete not working for ssh config

* add test

* add changelog;
2023-03-08 11:37:53 -06:00

34 lines
823 B
JavaScript

import Component from '@glimmer/component';
import { action } from '@ember/object';
/**
* @module ConfigureSshSecretComponent
*
* @example
* ```js
* <ConfigureSshSecret
* @model={{this.model}}
* @configured={{this.configured}}
* @saveConfig={{action "saveConfig"}}
* @loading={{this.loading}}
* />
* ```
*
* @param {string} model - ssh secret engine model
* @param {Function} saveConfig - parent action which updates the configuration
* @param {boolean} loading - property in parent that updates depending on status of parent's action
*
*/
export default class ConfigureSshSecretComponent extends Component {
@action
delete() {
this.args.saveConfig({ delete: true });
}
@action
saveConfig(event) {
event.preventDefault();
this.args.saveConfig({ delete: false });
}
}