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: Add copy button for Secret ID in Tokens list page #10735

Merged
merged 6 commits into from
Jul 30, 2021

Conversation

kaxcode
Copy link
Contributor

@kaxcode kaxcode commented Jul 30, 2021

✨ 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:

Screen Shot 2021-07-30 at 10 35 35 AM

⚡ 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:
Screen Shot 2021-07-30 at 10 34 56 AM

🧪 Testing:

No added tests. Simple conditional logic used and the CopyButton component has testing.

📌 Before merging:

  • Changelog
  • Demo Link

@kaxcode kaxcode added the theme/ui Anything related to the UI label Jul 30, 2021
@kaxcode kaxcode requested review from gsusmi and a user July 30, 2021 15:11
@kaxcode kaxcode force-pushed the ui/feature/acls-copy-secret-id branch from 789a52e to e93e5ce Compare July 30, 2021 15:22
@vercel vercel bot temporarily deployed to Preview – consul July 30, 2021 15:22 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging July 30, 2021 15:22 Inactive
Copy link

@gsusmi gsusmi left a comment

Choose a reason for hiding this comment

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

LGTM. Ty!

Copy link

@ghost ghost left a 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".

@kaxcode
Copy link
Contributor Author

kaxcode commented Jul 30, 2021

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.

@kaxcode kaxcode requested a review from a user July 30, 2021 16:55
@kaxcode kaxcode merged commit 2ee501b into main Jul 30, 2021
@kaxcode kaxcode deleted the ui/feature/acls-copy-secret-id branch July 30, 2021 17:52
@hc-github-team-consul-core
Copy link
Contributor

🍒 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants