-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: Add copy button for Secret ID in Tokens list page #10735
Conversation
bd98116
to
77c176c
Compare
ui/packages/consul-ui/app/components/consul/token/list/index.hbs
Outdated
Show resolved
Hide resolved
789a52e
to
e93e5ce
Compare
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.
LGTM. Ty!
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.
Recommend either changing the text, adding a title attribute, and/or adding an aria attribute that includes the verb for the action. This would better communicate to users what happens when they activate the button. For example, "Copy Secret ID".
@randallmorey PR #10664 addresses this. |
🍒 If backport labels were added before merging, cherry-picking will start automatically. To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/418982. |
✨ Description:
Adds a copy button to each composite row in tokens list page, if Secret ID returns an actual ID.
Reuses the CopyButton component and some conditional logic to flag Secret ID returning an empty string or
'<hidden>'
.Adds secretID as a common consul translation.
Note: The styling changes did not impact the other composite rows with actions.
Demo Link
📸 Screenshots:
⚡ Backend Changes:
Implemented in #10546.
In the backend, user permission are checked.
If the user has the correct permission then the SecretID attribute returns an actual ID.
If the user does not have the correct permissions
'<hiddlen>'
is returned.It is rare but possible for SecretID to be an empty string. The endpoint would still return the attribute.
🤡 Updates to mock-api:
Updates made to /acl/tokens mock data.
Added SecretID attribute with 3 possible responses.
Updated the count of tokens and policies returned because it was making the composite row look very busy.
Busy composite row:
🧪 Testing:
No added tests. Simple conditional logic used and the CopyButton component has testing.
📌 Before merging: