vault/ui/app/components/secret-engine/configure-ssh.js
Angel Garbarino a81b482158
Prep for configuration.edit refactor (#27948)
* move files around

* move fetches to config to the configuration.index route

* working... for aws, lots of clean up left

* move error handling to parent route

* standarize configModel param

* add test coverage

* welp a miss for non configurable engines

* pr comments

* remove mirage interrupts and test actual api

* update configuration details test to test for template only things

* api error coverage
2024-08-05 13:39:10 -06:00

39 lines
899 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Component from '@glimmer/component';
import { action } from '@ember/object';
/**
* @module ConfigureSshSComponent
*
* @example
* ```js
* <SecretEngine::ConfigureSsh
* @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 ConfigureSshComponent extends Component {
@action
delete() {
this.args.saveConfig({ delete: true });
}
@action
saveConfig(event) {
event.preventDefault();
this.args.saveConfig({ delete: false });
}
}