Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: HDS adoption replace <ConfirmAction> component #21520

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3ba8b36
replace confirm-action dropdown with button+modal
hellobontempo Jun 30, 2023
9c69e5d
add modal frame to sidebar
hellobontempo Jun 30, 2023
4d26f12
fix weird paragraph indent
hellobontempo Jun 30, 2023
8ef70fe
pass button text as arg
hellobontempo Jun 30, 2023
e956d34
add warning color to rotate modals
hellobontempo Jun 30, 2023
c61423d
Merge branch 'main' into ui/VAULT-17329/replace-confirm-action-dropdo…
hellobontempo Jul 12, 2023
bb75f54
Merge branch 'main' into ui/VAULT-17329/replace-confirm-action-dropdo…
hellobontempo Nov 16, 2023
4395212
update seal action and config ssh
hellobontempo Nov 16, 2023
b879604
cleanup confirm action
hellobontempo Nov 16, 2023
3e3ea30
edit form
hellobontempo Nov 16, 2023
ffd2c5a
add dropdown arg
hellobontempo Nov 16, 2023
1c81900
put back seal text
hellobontempo Nov 16, 2023
2c73e4a
put back confirm button text
hellobontempo Nov 16, 2023
8b59da6
fix toolbar stylinggp
hellobontempo Nov 16, 2023
72be6c9
popup member group
hellobontempo Nov 16, 2023
9fc8854
move up title
hellobontempo Nov 16, 2023
a0be23b
finish popup- components
hellobontempo Nov 16, 2023
93419be
keymgmt
hellobontempo Nov 16, 2023
4225667
fix modal button logic
hellobontempo Nov 16, 2023
3c75577
remaining app template components
hellobontempo Nov 16, 2023
de38317
add period for angel
hellobontempo Nov 16, 2023
65917e4
vault cluster items
hellobontempo Nov 16, 2023
89ab510
add button text assertion
hellobontempo Nov 16, 2023
3210bf4
remaining instances
hellobontempo Nov 16, 2023
6b9ed16
remove arg for passing confirm text
hellobontempo Nov 16, 2023
5b6c0e7
contextual confirm action components
hellobontempo Nov 16, 2023
16fbe1a
delete old components
hellobontempo Nov 16, 2023
69f2952
update docs
hellobontempo Nov 16, 2023
44904ce
ammend dropdown loading states, add getter for confirm button color
hellobontempo Nov 16, 2023
ff4fcc9
address feedback
hellobontempo Nov 16, 2023
0f1c938
remove @disabled arg and add @disabledMessage
hellobontempo Nov 16, 2023
365992a
add changelog;
hellobontempo Nov 16, 2023
7059e1a
mfa tests
hellobontempo Nov 16, 2023
e975a28
update test selectors
hellobontempo Nov 16, 2023
8afc847
lol cleanup selectors
hellobontempo Nov 16, 2023
4a33842
start confirm action tests WIP
hellobontempo Nov 16, 2023
b60b6c0
Merge branch 'main' into ui/VAULT-17329/replace-confirm-action-dropdo…
hellobontempo Nov 17, 2023
e3b5222
move dropdown class directly to component
hellobontempo Nov 17, 2023
56f212f
add default color of isInDropdown
hellobontempo Nov 17, 2023
eda92ea
final cleanup
hellobontempo Nov 17, 2023
d085494
add tests
hellobontempo Nov 17, 2023
8b2d558
remove @buttonColor as arg for dropdown
hellobontempo Nov 17, 2023
009ddfb
update confirm action tests
hellobontempo Nov 17, 2023
8642aad
updae modals with disabled message
hellobontempo Nov 17, 2023
d490985
refactor provider edit test
hellobontempo Nov 17, 2023
de200d3
Merge branch 'main' into ui/VAULT-17329/replace-confirm-action-dropdo…
hellobontempo Nov 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions ui/app/components/seal-action.hbs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-15 at 7 03 46 PM

Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@

<div class="field is-grouped box is-fullwidth is-bottomless">
<ConfirmAction
@buttonClasses="button is-primary"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-15 at 7 03 46 PM

@buttonText="Seal"
@confirmTitle="Seal this cluster?"
@confirmMessage="You will not be able to read or write any data until the cluster is unsealed again."
@confirmButtonText="Seal"
@horizontalPosition="auto-left"
@onConfirmAction={{this.handleSeal}}
data-test-seal
>
Seal
</ConfirmAction>
/>
</div>
12 changes: 12 additions & 0 deletions ui/app/styles/components/popup-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@
width: 100%;
}

// TODO HDS polish - temp styling fix for ConfirmAction dropdown buttons
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How the popup menu styling looks - left is new component with this class, right is old component
Screenshot 2023-11-15 at 7 12 32 PM

// so they match other dropdown elements until we replace popup-menu with Hds::Dropdown
.hds-confirm-action-critical {
&:hover {
background-color: $ui-gray-050;
}
div {
font-size: $size-7;
font-weight: $font-weight-semibold;
}
}

button.link,
.ember-power-select-option,
.ember-power-select-option[aria-current='true'],
Expand Down
7 changes: 3 additions & 4 deletions ui/app/templates/components/configure-ssh-secret.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
</div>
<div class="control">
<ConfirmAction
@buttonClasses="button"
@buttonText="Delete"
@buttonColor="secondary"
@confirmMessage="This will remove the CA certificate information."
@onConfirmAction={{this.delete}}
>
Delete
</ConfirmAction>
/>
</div>
</div>
{{else}}
Expand Down
11 changes: 5 additions & 6 deletions ui/app/templates/components/database-connection.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,30 @@
{{/if}}
{{#if @model.canReset}}
<ConfirmAction
@buttonText="Reset connection"
@buttonClasses="toolbar-link"
@onConfirmAction={{action "reset"}}
@confirmTitle="Reset connection?"
@confirmMessage="This will close the connection and its underlying plugin and restart it with the configuration stored in the barrier."
@confirmButtonText="Reset"
data-test-database-connection-reset
>
Reset connection
</ConfirmAction>
/>
{{/if}}
{{#if (or @model.canReset @model.canDelete)}}
<div class="toolbar-separator"></div>
{{/if}}
{{#if @model.canRotateRoot}}
{{! template-lint-disable quotes }}
<ConfirmAction
@buttonText="Rotate root credentials"
@buttonClasses="toolbar-link"
@onConfirmAction={{this.rotate}}
@confirmTitle="Rotate credentials?"
@confirmMessage='This will rotate the "root" user credentials stored for the database connection. The password will not be accessible once rotated.'
@confirmButtonText="Rotate"
@color="warning"
data-test-database-connection-rotate
>
Rotate root credentials
</ConfirmAction>
/>
{{! template-lint-enable }}
{{/if}}
{{#if @model.canAddRole}}
Expand Down
5 changes: 2 additions & 3 deletions ui/app/templates/components/database-role-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
<ToolbarActions>
{{#if @model.canDelete}}
<ConfirmAction
@buttonText="Delete role"
@buttonClasses="toolbar-link"
@onConfirmAction={{action "delete"}}
@confirmTitle="Delete role?"
@confirmMessage="This role will be permanently deleted. You will need to recreate it to use it again."
@confirmButtonText="Delete"
data-test-database-role-delete
>
Delete role
</ConfirmAction>
/>
<div class="toolbar-separator"></div>
{{/if}}
{{#if (and @model.canRotateRoleCredentials (eq @model.type "static"))}}
Expand Down
6 changes: 2 additions & 4 deletions ui/app/templates/components/generated-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@
<Toolbar>
<ToolbarActions>
<ConfirmAction
@buttonText="Delete {{this.itemType}}"
@buttonClasses="toolbar-link"
@onConfirmAction={{action "deleteItem"}}
@confirmMessage={{concat "Are you sure you want to delete " this.itemType " " this.model.id "?"}}
@cancelButtonText="Cancel"
data-test-secret-delete="true"
>
Delete
{{this.itemType}}
</ConfirmAction>
/>
<div class="toolbar-separator"></div>
<ToolbarLink
@route="vault.cluster.access.method.item.edit"
Expand Down
8 changes: 3 additions & 5 deletions ui/app/templates/components/identity/edit-form.hbs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-15 at 7 37 03 PM

Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
<Toolbar>
<ToolbarActions>
<ConfirmAction
@buttonClasses="toolbar-link"
class="toolbar-button"
@buttonText="Delete {{this.model.identityType}}"
@onConfirmAction={{action "deleteItem" this.model}}
data-test-entity-item-delete="true"
>
Delete
{{this.model.identityType}}
</ConfirmAction>
/>
</ToolbarActions>
</Toolbar>
{{/if}}
Expand Down
5 changes: 2 additions & 3 deletions ui/app/templates/components/identity/popup-members.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
<ul class="menu-list">
<li class="action">
<ConfirmAction
@buttonText="Remove"
@buttonClasses="link is-destroy"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-15 at 7 42 35 PM

@confirmButtonText="Remove this group?"
@confirmMessage="This may affect permissions for this group."
@onConfirmAction={{action "performTransaction" this.model this.groupArray this.memberId}}
>
Remove
</ConfirmAction>
/>
</li>
</ul>
</nav>
Expand Down
5 changes: 2 additions & 3 deletions ui/app/templates/components/identity/popup-metadata.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
<ul class="menu-list">
<li class="action">
<ConfirmAction
@buttonText="Remove"
Copy link
Contributor Author

@hellobontempo hellobontempo Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-15 at 7 51 40 PM

@buttonClasses="link is-destroy"
@confirmTitle="Remove metadata?"
@confirmMessage="This data may be used outside of Vault."
@confirmButtonText="Remove"
@onConfirmAction={{action "performTransaction" this.model this.key}}
>
Remove
</ConfirmAction>
/>
</li>
</ul>
</nav>
Expand Down
6 changes: 2 additions & 4 deletions ui/app/templates/components/identity/popup-policy.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
</li>
<li class="action">
<ConfirmAction
@buttonText="Remove from {{this.model.identityType}}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-15 at 7 56 17 PM

@buttonClasses="link is-destroy"
@confirmButtonText="Remove"
@confirmMessage="This policy may affect permissions to access Vault data."
@onConfirmAction={{action "performTransaction" this.model this.policyName}}
>
Remove from
{{this.model.identityType}}
</ConfirmAction>
/>
</li>
</ul>
</nav>
Expand Down
11 changes: 5 additions & 6 deletions ui/app/templates/components/keymgmt/key-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -75,31 +75,30 @@
{{/if}}
{{#if @model.provider}}
<ConfirmAction
@buttonText="Remove key"
@buttonClasses="toolbar-link"
Copy link
Contributor Author

@hellobontempo hellobontempo Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-15 at 7 59 48 PM

@onConfirmAction={{perform this.removeKey}}
@confirmTitle="Remove this key?"
@confirmMessage="This will remove all versions of the key from the KMS provider. The key will stay in Vault."
@confirmButtonText="Remove"
@isRunning={{this.removeKey.isRunning}}
data-test-keymgmt-key-remove
>
Remove key
</ConfirmAction>
/>
{{/if}}
{{#if (or @model.canDelete @model.provider)}}
<div class="toolbar-separator"></div>
{{/if}}
<ConfirmAction
@buttonText="Rotate key"
@buttonClasses="toolbar-link"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-15 at 8 06 05 PM

@onConfirmAction={{perform this.rotateKey}}
@confirmTitle="Rotate this key?"
@confirmMessage="After rotation, all key actions will default to using the newest version of the key."
@confirmButtonText="Rotate"
@color="warning"
@isRunning={{this.rotateKey.isRunning}}
data-test-keymgmt-key-rotate
>
Rotate key
</ConfirmAction>
/>
{{#if @model.canEdit}}
<ToolbarSecretLink
@secret={{@model.id}}
Expand Down
5 changes: 2 additions & 3 deletions ui/app/templates/components/keymgmt/provider-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@
<ToolTip @verticalPosition="above" @horizontalPosition="center" as |T|>
<T.Trigger data-test-tooltip-trigger>
<ConfirmAction
@buttonText="Delete provider"
@buttonClasses="toolbar-link"
@onConfirmAction={{this.onDelete}}
@disabled={{@model.keys.length}}
data-test-kms-provider-delete={{true}}
>
Delete provider
</ConfirmAction>
/>
</T.Trigger>
{{#if @model.keys.length}}
<T.Content class="tool-tip">
Expand Down
4 changes: 1 addition & 3 deletions ui/app/templates/components/role-aws-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
<Toolbar>
<ToolbarActions>
{{#if this.model.canDelete}}
<ConfirmAction @buttonClasses="toolbar-link" @onConfirmAction={{action "delete"}}>
Delete role
</ConfirmAction>
<ConfirmAction @buttonText="Delete role" @buttonClasses="toolbar-link" @onConfirmAction={{action "delete"}} />
<div class="toolbar-separator"></div>
{{/if}}
{{#if this.model.canGenerate}}
Expand Down
4 changes: 1 addition & 3 deletions ui/app/templates/components/role-ssh-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
<Toolbar>
<ToolbarActions>
{{#if this.model.canDelete}}
<ConfirmAction @buttonClasses="toolbar-link" @onConfirmAction={{action "delete"}}>
Delete role
</ConfirmAction>
<ConfirmAction @buttonText="Delete role" @buttonClasses="toolbar-link" @onConfirmAction={{action "delete"}} />
<div class="toolbar-separator"></div>
{{/if}}
{{#if (eq this.model.keyType "otp")}}
Expand Down
6 changes: 2 additions & 4 deletions ui/app/templates/components/transform-role-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@
<ToolbarActions>
{{#if this.capabilities.canDelete}}
<ConfirmAction
@buttonText="Delete role"
@buttonClasses="toolbar-link"
@onConfirmAction={{action "delete"}}
@confirmTitle="Are you sure?"
@confirmMessage="Deleting this role means that you’ll need to recreate it and reassign any existing transformations to use it again."
@confirmButtonText="Delete"
data-test-transformation-role-delete
>
Delete role
</ConfirmAction>
/>
<div class="toolbar-separator"></div>
{{/if}}
{{#if this.capabilities.canUpdate}}
Expand Down
4 changes: 1 addition & 3 deletions ui/app/templates/components/transit-form-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@
</div>
</div>
{{#if (and @key.canDelete @capabilities.canDelete)}}
<ConfirmAction @buttonClasses="button" @onConfirmAction={{@deleteKey}}>
Delete transit key
</ConfirmAction>
<ConfirmAction @buttonText="Delete transit key" @buttonClasses="button" @onConfirmAction={{@deleteKey}} />
{{/if}}
</div>
</form>
2 changes: 2 additions & 0 deletions ui/app/templates/components/transit-key-actions.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
{{#if (eq this.selectedAction "rotate")}}
{{#if this.key.canRotate}}
<ConfirmAction
@buttonText="Rotate encryption key"
@buttonClasses="toolbar-link"
@confirmTitle="Rotate this key?"
@confirmMessage="After rotation, all key actions will default to using the newest version of the key."
@confirmButtonText="Rotate"
@color="warning"
@onConfirmAction={{action "doSubmit"}}
data-test-transit-key-rotate
>
Expand Down
14 changes: 6 additions & 8 deletions ui/app/templates/vault/cluster/access/leases/list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,26 @@
<div class="control">
{{#if (and this.capabilities.forceRevokePrefix.canUpdate (not this.confirmingRevoke))}}
<ConfirmAction
@buttonText="Force revoke prefix"
@buttonClasses="toolbar-link"
@confirmTitle="Disable this?"
@confirmMessage={{concat "All leases under this one will also be removed and disregard any errors encountered."}}
@confirmMessage="All leases under this one will also be removed and disregard any errors encountered."
hellobontempo marked this conversation as resolved.
Show resolved Hide resolved
@confirmButtonText="Revoke"
@onConfirmAction={{action "revokePrefix" this.baseKey.id true}}
>
Force revoke prefix
</ConfirmAction>
/>
{{/if}}
</div>
<div class="control">
{{#if (and this.capabilities.revokePrefix.canUpdate (not this.confirmingForceRevoke))}}
<ConfirmAction
@buttonText="Revoke prefix"
@buttonClasses="toolbar-link"
@confirmTitle="Revoke this?"
@confirmMessage={{concat "All leases under this one will also be removed"}}
@confirmMessage="All leases under this one will also be removed"
@confirmButtonText="Revoke"
@onConfirmAction={{action "revokePrefix" this.baseKey.id}}
data-test-lease-revoke-prefix="true"
>
Revoke prefix
</ConfirmAction>
/>
{{/if}}
</div>
{{/if}}
Expand Down
5 changes: 2 additions & 3 deletions ui/app/templates/vault/cluster/access/leases/show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@
<Toolbar>
<ToolbarActions>
<ConfirmAction
@buttonText="Revoke lease"
@buttonClasses="toolbar-link"
@confirmTitle="Revoke this?"
@confirmMessage={{concat "All leases under this one will also be removed"}}
@confirmButtonText="Confirm"
@onConfirmAction={{action "revokeLease" this.model}}
data-test-lease-revoke="true"
>
Revoke lease
</ConfirmAction>
/>
</ToolbarActions>
</Toolbar>
{{/if}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,9 @@
@buttonClasses="toolbar-link"
@disabled={{not (is-empty this.model.enforcements)}}
@onConfirmAction={{this.deleteMethod}}
@confirmTitle="Are you sure?"
@confirmMessage="Deleting this MFA configuration is permanent, and it will no longer be available."
@confirmButtonText="Delete"
>
Delete
</ConfirmAction>
/>
<ToolbarLink
@route="vault.cluster.access.mfa.methods.method.edit"
@model={{this.model.method.id}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@
<ToolbarActions>
{{#if @model.canDelete}}
<ConfirmAction
@buttonText="Delete assignment"
@buttonClasses="toolbar-link"
@onConfirmAction={{this.delete}}
@confirmTitle="Delete assignment?"
@confirmMessage="This assignment will be permanently deleted. You will not be able to recover it."
@confirmButtonText="Delete"
data-test-oidc-assignment-delete
>
Delete assignment
</ConfirmAction>
/>
<div class="toolbar-separator"></div>
{{/if}}
{{#if @model.canEdit}}
Expand Down
Loading
Loading