-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Confirm Action as a popover #6741
Changes from 4 commits
68fb008
3e87d93
678532d
2551502
c28d76b
8fd5b97
767d35b
e03ce83
9ed84e7
bad833a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,16 @@ | |
on {{date-format auth.tokenExpirationDate 'MMMM Do YYYY, h:mm:ss a'}}" /> | ||
</li> | ||
{{/if}} | ||
<li class="action"> | ||
<button type="button" class="link" onclick={{action "restartGuide"}}> | ||
Restart guide | ||
</button> | ||
</li> | ||
<li class="action"> | ||
<CopyButton @clipboardText={{auth.currentToken}} class="link" @buttonType="button" @success={{action (set-flash-message 'Token copied!')}}> | ||
Copy token | ||
</CopyButton> | ||
</li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gathering the "destructive actions" at the bottom of the list, so moving these up |
||
{{#if (is-before (now interval=1000) auth.tokenExpirationDate)}} | ||
{{#if auth.authData.renewable}} | ||
<li class="action"> | ||
|
@@ -20,50 +30,32 @@ | |
</button> | ||
</li> | ||
<li class="action"> | ||
{{#confirm-action | ||
onConfirmAction=(action "revokeToken") | ||
confirmMessage=(concat "Are you sure you want to revoke the token for " (get auth 'authData.displayName') "?") | ||
confirmButtonText="Revoke" | ||
confirmButtonClasses="button is-primary" | ||
buttonClasses="button link" | ||
showConfirm=shouldRevoke | ||
class=(if shouldRevoke "message is-block is-warning is-outline") | ||
containerClasses="message-body is-block" | ||
messageClasses="is-block" | ||
}} | ||
<ConfirmAction | ||
@buttonClasses="button link is-destroy" | ||
@confirmTitle={{concat "Revoke " (get auth 'authData.displayName') "?"}} | ||
@confirmMessage={{concat "You will not be able to log in again with this token."}} | ||
@confirmButtonText="Revoke" | ||
@onConfirmAction={{action "revokeToken"}} | ||
> | ||
Revoke token | ||
{{/confirm-action}} | ||
</ConfirmAction> | ||
</li> | ||
{{else}} | ||
<li class="action text-right"> | ||
{{#confirm-action | ||
onConfirmAction=(action "revokeToken") | ||
confirmMessage=(concat "Are you sure you want to revoke the token for " (get auth 'authData.displayName') "?") | ||
confirmButtonText="Revoke" | ||
confirmButtonClasses="button is-primary" | ||
buttonClasses="button link" | ||
showConfirm=shouldRevoke | ||
class=(if shouldRevoke "message is-block is-warning is-outline") | ||
containerClasses="message-body is-block" | ||
messageClasses="is-block" | ||
}} | ||
<ConfirmAction | ||
@buttonClasses="button link is-destroy" | ||
@confirmTitle={{concat "Revoke " (get auth 'authData.displayName') "?"}} | ||
@confirmMessage={{concat "You will not be able to log in again with this token."}} | ||
@confirmButtonText="Revoke" | ||
@onConfirmAction={{action "revokeToken"}} | ||
> | ||
Revoke token | ||
{{/confirm-action}} | ||
</ConfirmAction> | ||
</li> | ||
{{/if}} | ||
{{/if}} | ||
<li class="action"> | ||
<CopyButton @clipboardText={{auth.currentToken}} class="link" @buttonType="button" @success={{action (set-flash-message 'Token copied!')}}> | ||
Copy token | ||
</CopyButton> | ||
</li> | ||
<li class="action"> | ||
<button type="button" class="link" onclick={{action "restartGuide"}}> | ||
Restart guide | ||
</button> | ||
</li> | ||
<li class="action"> | ||
{{#link-to "vault.cluster.logout" activeClusterName id="logout" invokeAction=onLinkClick}} | ||
{{#link-to "vault.cluster.logout" activeClusterName id="logout" class="is-destroy" invokeAction=onLinkClick}} | ||
Sign out | ||
{{/link-to}} | ||
</li> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,16 @@ | |
</li> | ||
{{#if item.canRevoke}} | ||
<li class="action"> | ||
{{#confirm-action | ||
confirmButtonClasses="button is-primary" | ||
buttonClasses="link is-destroy" | ||
onConfirmAction=(action "delete" item) | ||
confirmMessage=(concat "Are you sure you want to revoke " item.id "?") | ||
showConfirm=(get this (concat "shouldDelete-" (dot-to-dash item.id))) | ||
class=(if (get this (concat "shouldDelete-" (dot-to-dash item.id))) "message is-block is-warning is-outline") | ||
containerClasses="message-body is-block" | ||
messageClasses="is-block" | ||
confirmButtonText="Revoke" | ||
data-test-cert-revoke-delete=item.id | ||
}} | ||
<ConfirmAction | ||
@buttonClasses="link is-destroy" | ||
@onConfirmAction={{action "delete" item}} | ||
@confirmTitle="Revoke this cert?" | ||
@confirmMessage="This may affect access to Vault data." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be true, but we really don't have a way to tell what they're using the certs for (whether it's vault authentication or something else). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about something more generic like "Any services using this cert may be affected."? I'm trying to give them an idea of the consequences, but certs are a tricky one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👌 |
||
@confirmButtonText="Revoke" | ||
data-test-cert-revoke-delete={{item.id}} | ||
> | ||
Revoke | ||
{{/confirm-action}} | ||
</ConfirmAction> | ||
</li> | ||
{{/if}} | ||
</ul> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be good to introduce an "Icon button" style rather than do it this way, but this is an easy reset for now