-
Notifications
You must be signed in to change notification settings - Fork 478
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
Update "used by" display and tooltip styling #26262
base: main
Are you sure you want to change the base?
Conversation
return deviceMapping.slice(1).map((d) => ( | ||
return deviceMapping.map((d) => ( |
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.
Show all emails in the tooltip, since the first one may be truncated.
<span className="device-mapping__primary-user"> | ||
{email}{" "} | ||
<span className="device-mapping__source">{`(${source})`}</span> | ||
</> | ||
</span> |
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.
New class to allow for truncating the email w/ ellipses.
color: $ui-fleet-black-50; | ||
} | ||
&__primary-user { | ||
max-width: 270px; |
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.
This allows for up to "+ 999 more" without cutting of the "more" text.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26262 +/- ##
=======================================
Coverage 63.65% 63.66%
=======================================
Files 1631 1631
Lines 156543 156538 -5
Branches 4045 4089 +44
=======================================
Hits 99655 99655
+ Misses 49038 49032 -6
- Partials 7850 7851 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
&__source { | ||
color: $ui-fleet-black-75; | ||
} | ||
&__more { | ||
color: $ui-fleet-black-50; |
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.
These were not being used because __data isn't a thing in this component as far as I can see. Moved them out from under __data and now the "More" link is grey as intended.
let className = "device-mapping__primary-user"; | ||
if (newDeviceMapping.length > 1) { | ||
className += " multiple"; | ||
} |
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.
We tend to namespace our class names and use the baseClass
as the root of the class name. This helps flatten out the scss styles so they are less nested and easier to read. We also use the classnames
package to handle conditional classes. This could replace line 132:
const classNames = classnames(`${baseClass}__device-mapping__primary-user`, {
[`${baseClass}__multiple": newDeviceMapping.length > 1
}
I know it's a nitpick, and I know we're not doing it everywhere, but I do think it's better to follow the pattern that we are using across the majority of the codebase.
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.
Updated. The styles were nested under .info-flex
but didn't need to be, so this works!
Putting this back in draft as we decided in standup to use |
For #25283
Checklist for submitter
changes/
,orbit/changes/
oree/fleetd-chrome/changes
.See Changes files for more information.
Details
This PR updates the styling on the "Used by" line of the host details page in the following ways:
Screenshots
With extra long email:
![image](https://private-user-images.githubusercontent.com/553428/412083635-6f1b98ed-ee1e-4209-9a77-909dee5d23d2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2Nzc3OTIsIm5iZiI6MTczOTY3NzQ5MiwicGF0aCI6Ii81NTM0MjgvNDEyMDgzNjM1LTZmMWI5OGVkLWVlMWUtNDIwOS05YTc3LTkwOWRlZTVkMjNkMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwMzQ0NTJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00ZWNiOGU0ZjAwYWUwMjIwODEzOWY3ZWZkMzZmNmZmNDRmZDg3YThlN2I2NzliMTQxMWMzMWI0ZjI5MWU3OGM5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.8J-K-hzQqGQOvHM-iqLGxIsDhbSfQMGNoBJFb5VOrjw)
Tooltip:
![image](https://private-user-images.githubusercontent.com/553428/412083681-9a352136-1481-46c7-bdf2-3159313e5026.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2Nzc3OTIsIm5iZiI6MTczOTY3NzQ5MiwicGF0aCI6Ii81NTM0MjgvNDEyMDgzNjgxLTlhMzUyMTM2LTE0ODEtNDZjNy1iZGYyLTMxNTkzMTNlNTAyNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwMzQ0NTJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yYzRkYWYwMjcxMDJmMGEzNGFiYzNhOGQ5N2U1MGI2NWFlMDFkODEyZWYyOTk3N2ZmN2FiZTBhZTY5ZTA3NDVkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.V26ralHOS6Nz4bZ1-LGu_POc7IRtdc0VmLioYEzdW7k)
With regular email:
![image](https://private-user-images.githubusercontent.com/553428/412084090-43fefa6c-c629-4d7c-b5a7-e456ab96f14b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2Nzc3OTIsIm5iZiI6MTczOTY3NzQ5MiwicGF0aCI6Ii81NTM0MjgvNDE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M0YTU3ZDRjZDAwNDY0MzVlNTBmZTgxODRjZjFhYTBkMjA2YjE2NDhhYTFiOGY3Y2ExYjNmYjVmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.jVfq1LORBFEENemTYo8w4KOForAY3sM4k9M8sYz3Vog)
With one long email:
![image](https://private-user-images.githubusercontent.com/553428/412089278-ba9837e5-0df7-4185-9ccb-85f8ca04046d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2Nzc3OTIsIm5iZiI6MTczOTY3NzQ5MiwicGF0aCI6Ii81NTM0MjgvNDEyMDg5Mjc4LWJhOTgzN2U1LTBkZjctNDE4NS05Y2NiLTg1ZjhjYTA0MDQ2ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwMzQ0NTJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03OTQzZjA1NGUzODczZWYzYWRhZWU5NWE2NjFmNGNjYjcxNjQ4ZjQ3NWIzNDg5ZGVhNTMwNjcxYzU2M2VjYjJmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.GsuD43NQzpaXejl8SVtw1ICngHy6UVrlGyLDXYhfUS0)
^ ideally we'd be able to hover over this to get the whole email. The simplest way to do this would be to just always have the tooltip be active all the time, but that's a product decision. I at least have it dedicating more space to the address if there's only one.