Files
vault/ui/lib/core/addon/components/confirm-action.hbs
claire bontempo 05f32b69ee UI: upgrade HDS to 4.12.0 (#28525)
* update hds to latest version

* yield dropdown Interactive text instead of use @text arg, results after running codemod

* remaining dropdown changes

* address sidebar nav IconButton deprecation, fix secret tests

* revert

* explicitly select popupmenu

* more test changes

* fix pki toggle button

* remove tracked prop in oidc client controller

* aaand more test updates

* change to tilde

* tilde yarn lock changes

* small cleanup items
2024-10-04 20:07:48 +00:00

38 lines
1.0 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
{{#if @isInDropdown}}
{{! Hds component renders <li> and <button> elements }}
<Hds::Dropdown::ListItem::Interactive
data-test-confirm-action-trigger
@color="critical"
{{on "click" (fn (mut this.showConfirmModal) true)}}
...attributes
{{! remove class when dropdown/popup menus are replaced with Hds::Dropdown }}
class="hds-confirm-action-critical"
>
{{@buttonText}}
</Hds::Dropdown::ListItem::Interactive>
{{else}}
<Hds::Button
data-test-confirm-action-trigger
@text={{@buttonText}}
@color={{@buttonColor}}
{{on "click" (fn (mut this.showConfirmModal) true)}}
...attributes
/>
{{/if}}
{{#if this.showConfirmModal}}
<ConfirmModal
@color={{this.modalColor}}
@onClose={{fn (mut this.showConfirmModal) false}}
@onConfirm={{this.onConfirm}}
@confirmTitle={{@confirmTitle}}
@confirmMessage={{this.confirmMessage}}
@disabledMessage={{@disabledMessage}}
@isRunning={{@isRunning}}
/>
{{/if}}