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 29 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
8 changes: 2 additions & 6 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,10 @@

<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>
143 changes: 70 additions & 73 deletions ui/app/components/sidebar/user-menu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,83 +15,80 @@
<Hds::SideNav::Header::IconButton @icon="user" @ariaLabel="User menu" />
</Dropdown.Trigger>
<Dropdown.Content>
<Confirm as |c|>
<div class="popup-menu-content" data-test-user-menu-content>
<div class="box">
<div class="menu-label">
{{capitalize this.auth.authData.displayName}}
</div>
<nav class="menu">
<ul class="menu-list">
{{#if this.auth.allowExpiration}}
<li class="token-alert is-flex" data-test-user-menu-item="token alert">
<span><Icon @name="alert-triangle-fill" class="has-text-highlight" /></span>
<span class="is-size-8 has-text-semibold">
We've stopped auto-renewing your token due to inactivity. It will expire on
{{date-format this.auth.tokenExpirationDate "MMMM do yyyy, h:mm:ss a"}}.
</span>
</li>
{{/if}}
{{#if this.hasEntityId}}
<li class="action">
<LinkTo @route="vault.cluster.mfa-setup" data-test-user-menu-item="mfa">
Multi-factor authentication
</LinkTo>
</li>
{{/if}}
{{#if this.isUserpass}}
<li class="action">
<LinkTo @route="vault.cluster.access.reset-password" data-test-user-menu-item="reset-password">
Reset password
</LinkTo>
</li>
{{/if}}
<li class="action" id="container">
{{! container is required in navbar collapsed state }}
<Hds::Copy::Button
@text="Copy token"
@textToCopy={{this.auth.currentToken}}
@isFullWidth={{true}}
@container="#container"
class="in-dropdown link is-flex-start"
{{on "click" (fn (set-flash-message "Token copied!"))}}
/>
<div class="popup-menu-content" data-test-user-menu-content>
<div class="box">
<div class="menu-label">
{{capitalize this.auth.authData.displayName}}
</div>
<nav class="menu">
<ul class="menu-list">
{{#if this.auth.allowExpiration}}
<li class="token-alert is-flex" data-test-user-menu-item="token alert">
<span><Icon @name="alert-triangle-fill" class="has-text-highlight" /></span>
<span class="is-size-8 has-text-semibold">
We've stopped auto-renewing your token due to inactivity. It will expire on
{{date-format this.auth.tokenExpirationDate "MMMM do yyyy, h:mm:ss a"}}.
</span>
</li>
{{#if (is-before (now interval=1000) this.auth.tokenExpirationDate)}}
{{#if this.auth.authData.renewable}}
<li class="action">
{{! TODO Hds::Button replacement skipped in favor of updating it when there is a Hds::Dropdown swapout }}
<button
type="button"
{{on "click" this.renewToken}}
class="link button {{if this.isRenewing 'is-loading'}}"
data-test-user-menu-item="renew token"
>
Renew token
</button>
</li>
{{/if}}
<li class="action">
<c.Message
@id={{get this.auth "authData.displayName"}}
@title={{concat "Revoke " (get this.auth "authData.displayName") "?"}}
@onConfirm={{action "revokeToken"}}
@message="You will not be able to log in again with this token."
@triggerText="Revoke token"
@confirmButtonText="Revoke"
data-test-user-menu-item="revoke token"
/>
</li>
{{/if}}
{{/if}}
{{#if this.hasEntityId}}
<li class="action">
<LinkTo @route="vault.cluster.logout" @model={{this.currentCluster.cluster.name}} id="logout">
Log out
<LinkTo @route="vault.cluster.mfa-setup" data-test-user-menu-item="mfa">
Multi-factor authentication
</LinkTo>
</li>
</ul>
</nav>
</div>
{{/if}}
{{#if this.isUserpass}}
<li class="action">
<LinkTo @route="vault.cluster.access.reset-password" data-test-user-menu-item="reset-password">
Reset password
</LinkTo>
</li>
{{/if}}
<li class="action" id="container">
{{! container is required in navbar collapsed state }}
<Hds::Copy::Button
@text="Copy token"
@textToCopy={{this.auth.currentToken}}
@isFullWidth={{true}}
@container="#container"
class="in-dropdown link is-flex-start"
{{on "click" (fn (set-flash-message "Token copied!"))}}
/>
</li>
{{#if (is-before (now interval=1000) this.auth.tokenExpirationDate)}}
{{#if this.auth.authData.renewable}}
<li class="action">
{{! TODO Hds::Button replacement skipped in favor of updating it when there is a Hds::Dropdown swapout }}
<button
type="button"
{{on "click" this.renewToken}}
class="link button {{if this.isRenewing 'is-loading'}}"
data-test-user-menu-item="renew token"
>
Renew token
</button>
</li>
{{/if}}
<ConfirmAction
class="hds-confirm-action-critical"
@buttonColor="critical"
@isInDropdown={{true}}
@confirmTitle="Revoke {{get this.auth 'authData.displayName'}}?"
@onConfirmAction={{action "revokeToken"}}
@buttonText="Revoke token"
@confirmMessage="You will not be able to log in again with this token."
data-test-user-menu-item="revoke token"
/>
{{/if}}
<li class="action">
<LinkTo @route="vault.cluster.logout" @model={{this.currentCluster.cluster.name}} id="logout">
Log out
</LinkTo>
</li>
</ul>
</nav>
</div>
</Confirm>
</div>
</Dropdown.Content>
</BasicDropdown>
139 changes: 0 additions & 139 deletions ui/app/styles/components/confirm.scss

This file was deleted.

13 changes: 13 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,19 @@
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 {
margin-left: -$spacing-4;
font-size: $size-7;
font-weight: $font-weight-semibold;
}
}

button.link,
.ember-power-select-option,
.ember-power-select-option[aria-current='true'],
Expand Down
1 change: 0 additions & 1 deletion ui/app/styles/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
@import './components/calendar-widget';
@import './components/cluster-banners';
@import './components/codemirror';
@import './components/confirm';
@import './components/console-ui-panel';
@import './components/control-group';
@import './components/doc-link';
Expand Down
13 changes: 5 additions & 8 deletions ui/app/templates/components/configure-ssh-secret.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,15 @@
</div>
</div>
<div class="field is-grouped-split box is-fullwidth is-bottomless">
<div class="control">
<Hds::ButtonSet>
<Hds::Copy::Button @text="Copy" @textToCopy={{@model.publicKey}} class="primary" />
</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>
/>
</Hds::ButtonSet>
</div>
{{else}}
<form {{on "submit" this.saveConfig}} data-test-ssh-configure-form="true">
Expand Down
Loading
Loading