vault/ui/app/components/dashboard/quick-actions-card.hbs
Vault Automation bf32d52450
[UI] Ember Data Migration - KV Cleanup (#9623) (#9794)
* adds error handling for control groups to api service as post request middleware

* updates kv list route to use api service

* updates kv config route to use api service

* updates kv secrets overview route to use api service

* updates kv secret details route to use api service

* adds kv form

* updates kv metadata details route to use api service

* updates kv paths and version history routes to use api service

* refactors kv-data-fields component to form component

* updates kv secret create route to use api service

* updates kv secret edit route to use api service

* updates kv metadata edit route to use api service

* adds waitFor to async middleware in api service to attempt to fix race conditions in tests

* adds kvMetadata path to capabilities path map

* fixes kv list item delete test selector

* removes kv models, adapters and serializers

* removes store from kv addon

* removes ember data related test helpers from kv-run-commands

* updates comments that referred to kv ember data models

* updates kv-page-header tests

* updates model-form-fields test to use totp-key model rather than kv/data

* removes another reference to kv/data model from path-help test

* fixes kv v2 workflow create tests

* fixes issue returning metadata for secret when latest version is deleted

* decodes uri in path returned by api service parseError method

* fixes kv v2 edge cases tests

* fixes issue deleteing control group token in api service

* decodes url for control group token lookup in api service

* fixes version history linked block link

* defaults cas to 0 when creating new secret

* removes log

* adds ember-template-lint to kv engine

* more test fixes

* updates kv-suggestion-input component to use api service

* removes kv metadata model reference from quick actions card

* fixes sync destination sync secrets tests

* updates kv helpers from classic format

* updates kv helpers imports

* reverts to use secret.version in details edit route

* fixes isDeleted import in kv version history test

* adds waitFor to api service parseError method

* reverts removing async from addQueryParams api method

* attempts to fix test flakiness requesting custom metadata from data endpoint

* more tweaks to requesting metadata from data

* adds waitFor to requestData method

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>
2025-10-02 12:52:26 -06:00

104 lines
3.9 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
<Hds::Card::Container @hasBorder={{true}} class="has-padding-l" data-test-card="quick-actions">
<h2 class="title is-4">Quick actions</h2>
{{#if this.filteredSecretEngines}}
<div class="has-top-margin-m has-bottom-margin-m">
<h3 class="title is-marginless is-6" data-test-card-subtitle="secrets-engines">Secrets engines</h3>
<p class="is-size-8 has-top-margin-xxs has-bottom-margin-s has-text-grey">Supported engines include databases, KV
version 2, and PKI.</p>
<SearchSelect
@id="type-to-select-a-mount"
@options={{this.mountOptions}}
@selectLimit="1"
@disallowNewItems={{true}}
@fallbackComponent="input-search"
@onChange={{this.handleSearchEngineSelect}}
@placeholder="Type to select a mount"
@displayInherit={{true}}
@shouldRenderName={{true}}
@passObject={{true}}
@objectKeys={{array "type" "version"}}
class="is-marginless"
data-test-search-select="secrets-engines"
/>
</div>
{{#if this.selectedEngine}}
<h3 id="action-select-title" class="title is-6" data-test-card-subtitle="secrets-engines">Action</h3>
<Select
@name="action-select"
@options={{this.actionOptions}}
@isFullwidth={{true}}
@selectedValue={{this.selectedAction}}
@onChange={{this.setSelectedAction}}
@noDefault={{true}}
@ariaLabel="Action"
/>
{{#if this.selectedAction}}
{{! use special input to allow searching for KVv2 secrets inside a directory }}
{{#if this.searchSelectParams.isKV}}
<KvSuggestionInput
@label="Secret Path"
@value={{this.paramValue}}
@mountPath={{this.selectedEngine.id}}
@onChange={{fn (mut this.paramValue)}}
/>
{{else if this.searchSelectParams.model}}
<h3 class="title is-6" data-test-card-subtitle="param">{{this.searchSelectParams.title}}</h3>
<SearchSelect
class="is-flex-grow-1"
@ariaLabel={{this.searchSelectParams.title}}
@selectLimit="1"
@models={{array this.searchSelectParams.model}}
@placeholder={{this.searchSelectParams.placeholder}}
@disallowNewItems={{true}}
@onChange={{this.handleActionSelect}}
@fallbackComponent="input-search"
@disabled={{not this.searchSelectParams.model}}
@nameKey={{this.searchSelectParams.nameKey}}
@queryObject={{this.searchSelectParams.queryObject}}
@objectKeys={{this.searchSelectParams.objectKeys}}
@passObject={{true}}
@shouldRenderName={{this.searchSelectParams.nameKey}}
data-test-search-select="params"
/>
{{/if}}
<div>
<Hds::Button
@text={{this.searchSelectParams.buttonText}}
class="has-top-margin-m"
disabled={{(not (and this.selectedAction this.selectedEngine this.paramValue))}}
{{on "click" this.navigateToPage}}
data-test-button={{this.searchSelectParams.buttonText}}
/>
</div>
{{/if}}
{{else}}
<EmptyState
@title="No mount selected"
@message="Select a mount above to get started."
data-test-empty-state="no-mount-selected"
/>
{{/if}}
{{else}}
<EmptyState
@title="Welcome to quick actions"
@message="Access secret engine actions easily. Enable a compatible secret engine (such as database, KV version 2, or PKI) to get started."
data-test-empty-state="quick-actions"
>
<Hds::Link::Standalone
@icon="chevron-right"
@iconPosition="trailing"
@text="Enable a secrets engine"
@route="vault.cluster.secrets.mounts"
/>
</EmptyState>
{{/if}}
</Hds::Card::Container>