mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
* 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
96 lines
3.7 KiB
Handlebars
96 lines
3.7 KiB
Handlebars
{{!
|
|
Copyright (c) HashiCorp, Inc.
|
|
SPDX-License-Identifier: BUSL-1.1
|
|
~}}
|
|
|
|
<BasicDropdown
|
|
@horizontalPosition="right"
|
|
@verticalPosition="below"
|
|
@renderInPlace={{true}}
|
|
class="sidebar-user-menu"
|
|
data-test-user-menu
|
|
as |Dropdown|
|
|
>
|
|
<Dropdown.Trigger data-test-user-menu-trigger>
|
|
<Hds::Button @isIconOnly={{true}} @size="large" @icon="user" @text="User menu" />
|
|
</Dropdown.Trigger>
|
|
<Dropdown.Content>
|
|
<div class="popup-menu-content" data-test-user-menu-content>
|
|
<div class="box">
|
|
<div class="menu-label overflow-wrap">
|
|
{{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>
|
|
<LinkTo @route="vault.cluster.mfa-setup" data-test-user-menu-item="mfa">
|
|
Multi-factor authentication
|
|
</LinkTo>
|
|
</li>
|
|
{{/if}}
|
|
{{#if this.isUserpass}}
|
|
<li>
|
|
<LinkTo @route="vault.cluster.access.reset-password" data-test-user-menu-item="reset-password">
|
|
Reset password
|
|
</LinkTo>
|
|
</li>
|
|
{{/if}}
|
|
<li 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"
|
|
@onSuccess={{(fn (set-flash-message "Token copied!"))}}
|
|
@onError={{(fn
|
|
(set-flash-message "Clipboard copy failed. The Clipboard API requires a secure context." "danger")
|
|
)}}
|
|
data-test-copy-button={{this.auth.currentToken}}
|
|
/>
|
|
</li>
|
|
{{#if (is-before (now interval=1000) this.auth.tokenExpirationDate)}}
|
|
{{#if this.auth.authData.renewable}}
|
|
<li>
|
|
{{! 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
|
|
@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>
|
|
<LinkTo @route="vault.cluster.logout" @model={{this.currentCluster.cluster.name}} id="logout">
|
|
Log out
|
|
</LinkTo>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</Dropdown.Content>
|
|
</BasicDropdown> |