mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-18 04:27:02 +02:00
* Remove component: diff version selector * delete SecretVersionMenu * remove secret logic from GetCredentialsCard * remove DiffVersionSelector hbs file and references * delete more css for diff version view * remove diff route * fix credential card selector * ui: refactor SecretFormShow (#22723) * refactor secret form show * fix selector typo * remove version route (#22738) * Remove old KV2 delete things (#23015) * remove kv2 old delete things * comment * Remove old metadata (#22747) * wip to remove metadata * review comments * UI/remove kv2 secret create or update (#23039) * remove is v2 param * permissions clean up * remove version things * remove excess from form show * clean up * created time was never a thing for cubbyhole, confirmed on api * update tune test * fix control group tests: * Remove kv v2 models (#23087) * remove is v2 param * permissions clean up * remove version things * remove excess from form show * clean up * created time was never a thing for cubbyhole, confirmed on api * update tune test * fix control group tests: * remove models * Update ui/app/models/secret-engine.js Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> * blah prettier --------- Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> * UI/config update (#23111) * sweep through clean up * remove component * remove unused selectors * remove unncessary --------- Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com> Co-authored-by: clairebontempo@gmail.com <clairebontempo@gmail.com> Co-authored-by: Angel Garbarino <Monkeychip@users.noreply.github.com> Co-authored-by: Angel Garbarino <angel@hashicorp.com>
56 lines
1.8 KiB
JavaScript
56 lines
1.8 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
/**
|
|
* @module GetCredentialsCard
|
|
* Card-like component that display a title, and SearchSelect component that sends you to a credentials route for the selected item.
|
|
* They are designed to be used in containers that act as flexbox or css grid containers. At this time, only used in the database
|
|
* overview page to select a role and generate credentials
|
|
*
|
|
* @example
|
|
* ```js
|
|
* <GetCredentialsCard
|
|
* @title="Get Credentials"
|
|
* @searchLabel="Role to use"
|
|
* @models={{array 'database/roles'}}
|
|
* @backend={{model.backend}}
|
|
* />
|
|
* ```
|
|
* @param {string} title - The title displays the card title
|
|
* @param {string} searchLabel - The text above the searchSelect component
|
|
* @param {array} models - An array of model types to fetch from the API. Passed through to SearchSelect component
|
|
* @param {string} [placeholder] - Input placeholder text (default for SearchSelect is 'Search', none for InputSearch)
|
|
* @param {string} backend - Passed to SearchSelect query method to fetch dropdown options
|
|
*/
|
|
|
|
import Component from '@glimmer/component';
|
|
import { inject as service } from '@ember/service';
|
|
import { action } from '@ember/object';
|
|
import { tracked } from '@glimmer/tracking';
|
|
|
|
export default class GetCredentialsCard extends Component {
|
|
@service router;
|
|
@tracked role = '';
|
|
|
|
@action
|
|
transitionToCredential(evt) {
|
|
evt.preventDefault();
|
|
const role = this.role;
|
|
if (role) {
|
|
this.router.transitionTo('vault.cluster.secrets.backend.credentials', role);
|
|
}
|
|
}
|
|
|
|
@action
|
|
handleInput(value) {
|
|
// if it comes in from the fallback component then the value is a string otherwise it's an array
|
|
if (Array.isArray(value)) {
|
|
this.role = value[0];
|
|
} else {
|
|
this.role = value;
|
|
}
|
|
}
|
|
}
|