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/Truncate long secret names #13032

Merged
merged 7 commits into from
Nov 4, 2021
Merged

UI/Truncate long secret names #13032

merged 7 commits into from
Nov 4, 2021

Conversation

hellobontempo
Copy link
Contributor

@hellobontempo hellobontempo commented Nov 3, 2021

Fixes overflow problem of long secret key values mentioned in #12962

Previous behavior:
image

Current behavior:

truncate-long-labels

@vercel vercel bot temporarily deployed to Preview – vault November 3, 2021 17:44 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook November 3, 2021 17:49 Inactive
@ivana-mcconnell
Copy link

👍 The tooltip behaves as expected, but is it possible to have the pointer centered on the name of the key, rather than at the end of the name?

@@ -19,7 +19,7 @@
* @param {string} title - title of the chart
* @param {array} mapLegend - array of objects with key names 'key' and 'label' for the map legend
* @param {object} dataset - dataset for the chart
* @param {array} tooltipData - misc. information needed to display tooltip (i.e. total clients from query params)
* @param {any} tooltipData - misc. information needed to display tooltip (i.e. total clients from query params)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I've seen every before. Does it come in as an object, or varies? Maybe describe / give example of types in the description?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Monkeychip I added it after seeing it somewhere else...but yeah. Going to open a separate PR that will address some tweaks this file needs.

Copy link
Contributor

@Monkeychip Monkeychip left a comment

Choose a reason for hiding this comment

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

Nice. At first I was wondering about a test, but then I'm not sure if it's super relevant. I'll leave it up to you.

Copy link
Contributor

@zofskeez zofskeez left a comment

Choose a reason for hiding this comment

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

Nice work and thanks again for adding the isTooltipCopyable property to the InfoTableRow story that I forgot!

tooltipText: text('tooltipText', 'This is tooltipText'),
isTooltipCopyable: boolean('Allow tooltip to be copied', true),
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding this for me!

if (labelText.offsetWidth > labelDiv.offsetWidth) {
labelDiv.classList.add('label-overflow');
this.set('hasLabelOverflow', true);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice work! didInsertElement is a good place for this. I'm wondering if it is worthwhile to add a test to check if the label-overflow class is applied to the element and that the tooltip appears for long labels?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @zofskeez! I'd gone back and forth on a test..but I think that you're right to suggest it- this component shows up so many places it's probably worthwhile to include. I'll add!

@hellobontempo hellobontempo merged commit dfd8852 into main Nov 4, 2021
@hellobontempo hellobontempo deleted the ui/fix-long-names branch November 4, 2021 23:59
@mladlow mladlow added this to the 1.10-rc1 milestone Nov 8, 2021
@hellobontempo hellobontempo modified the milestones: 1.10-rc1, 1.10 Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI - Long key names overlap values
5 participants