Skip to content

Commit

Permalink
Remove container tag for ConfirmAction
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaogle committed May 16, 2019
1 parent e03ce83 commit 9ed84e7
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 53 deletions.
2 changes: 1 addition & 1 deletion ui/app/templates/components/identity/edit-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@onConfirmAction={{action "deleteItem" model}}
data-test-entity-item-delete="true"
>
Delete
Delete {{model.identityType}}
</ConfirmAction>
</ToolbarActions>
</Toolbar>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/pki-cert-show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@buttonClasses="button"
@onConfirmAction={{action "delete"}}
@confirmTitle="Revoke this cert?"
@confirmMessage="This may affect access to Vault data."
@confirmMessage="Any services using this cert may be affected."
@confirmButtonText="Revoke"
>
Revoke
Expand Down
4 changes: 2 additions & 2 deletions ui/app/templates/components/role-aws-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
Generate credentials
</ToolbarSecretLink>
{{/if}}
{{#if (and model.canGenerate (or model.canDelete model.canUpdate))}}
{{#if (and model.canGenerate (or model.canDelete model.canEdit))}}
<div class="toolbar-separator" />
{{/if}}
{{#if model.canDelete}}
Expand All @@ -44,7 +44,7 @@
Delete role
</ConfirmAction>
{{/if}}
{{#if (or model.canUpdate model.canDelete)}}
{{#if model.canEdit}}
<ToolbarSecretLink
@secret={{model.id}}
@mode="edit"
Expand Down
4 changes: 2 additions & 2 deletions ui/app/templates/components/role-pki-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Sign Certificate
</ToolbarSecretLink>
{{/if}}
{{#if (and (or model.canGenerate model.canSign) (or model.canDelete model.canUpdate))}}
{{#if (and (or model.canGenerate model.canSign) (or model.canDelete model.canEdit))}}
<div class="toolbar-separator" />
{{/if}}
{{#if model.canDelete}}
Expand All @@ -56,7 +56,7 @@
Delete role
</ConfirmAction>
{{/if}}
{{#if (or model.canUpdate model.canDelete)}}
{{#if model.canEdit}}
<ToolbarSecretLink
@secret={{model.id}}
@mode="edit"
Expand Down
4 changes: 2 additions & 2 deletions ui/lib/core/addon/components/confirm-action.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Component from '@ember/component';
import hbs from 'htmlbars-inline-precompile';
import layout from '../templates/components/confirm-action';

/**
Expand Down Expand Up @@ -27,7 +26,8 @@ import layout from '../templates/components/confirm-action';

export default Component.extend({
layout,
classNames: ['confirm-action'],
tagName: '',
supportsDataTestProperties: true,
buttonText: 'Delete',
confirmTitle: 'Delete this?',
confirmMessage: 'You will not be able to recover it later.',
Expand Down
97 changes: 53 additions & 44 deletions ui/lib/core/addon/templates/components/confirm-action.hbs
Original file line number Diff line number Diff line change
@@ -1,46 +1,55 @@
{{#basic-dropdown class="popup-menu" horizontalPosition=horizontalPosition verticalPosition=verticalPosition onOpen=(action "toggleConfirm") onClose=(action "toggleConfirm") as |d|}}
{{#d.trigger
tagName="button"
type="button"
class=(concat buttonClasses " popup-menu-trigger" (if d.isOpen " is-active"))
disabled=disabled
data-test-confirm-action-trigger="true"
}}
{{yield}}
{{#if (eq buttonClasses 'toolbar-link')}}
<Chevron @direction={{if showConfirm 'up' 'down'}} />
{{/if}}
{{/d.trigger}}
{{#d.content class=(concat "popup-menu-content")}}
<div class="box confirm-action-message">
<div class="message is-highlight">
<div class="message-title">
<Icon @glyph="alert-triangle" />
{{if disabled disabledTitle confirmTitle}}
<div class="confirm-action" ...attributes>
<BasicDropdown
@horizontalPosition={{horizontalPosition}}
@verticalPosition={{verticalPosition}}
@onOpen={{action "toggleConfirm"}}
@onClose={{action "toggleConfirm"}}
as |d|>
<d.trigger
@tagName="button"
class={{concat buttonClasses " popup-menu-trigger" (if d.isOpen " is-active")}}
type="button"
disabled={{disabled}}
data-test-confirm-action-trigger="true"
>
{{yield}}
{{#if (eq buttonClasses 'toolbar-link')}}
<Chevron @direction={{if showConfirm 'up' 'down'}} />
{{/if}}
</d.trigger>
<d.content
@class="popup-menu-content"
>
<div class="box confirm-action-message">
<div class="message is-highlight">
<div class="message-title">
<Icon @glyph="alert-triangle" />
{{if disabled disabledTitle confirmTitle}}
</div>
<p>
{{if disabled disabledMessage confirmMessage}}
</p>
</div>
<div class="confirm-action-options">
<button
type="button"
disabled={{disabled}}
class="link is-destroy"
data-test-confirm-button="true"
{{action 'onConfirm'}}
>
{{confirmButtonText}}
</button>
<button
type="button"
class="link"
data-test-confirm-cancel-button="true"
{{action d.actions.close}}
>
{{cancelButtonText}}
</button>
</div>
<p>
{{if disabled disabledMessage confirmMessage}}
</p>
</div>
<div class="confirm-action-options">
<button
type="button"
disabled={{disabled}}
class="link is-destroy"
data-test-confirm-button="true"
{{action 'onConfirm'}}
>
{{confirmButtonText}}
</button>
<button
type="button"
class="link"
data-test-confirm-cancel-button="true"
{{action d.actions.close}}
>
{{cancelButtonText}}
</button>
</div>
</div>
{{/d.content}}
{{/basic-dropdown}}
</d.content>
</BasicDropdown>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@buttonClasses="toolbar-link"
@confirmMessage="This will affect which data gets replicated to this secondary."
@onConfirmAction={{action "saveConfig" model.config true}}
@data-test-delete-mount-config="true"
data-test-delete-mount-config="true"
>
Delete config
</ConfirmAction>
Expand Down

0 comments on commit 9ed84e7

Please sign in to comment.