-
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
Show "Manage Automations" dropdown when no policies are present #26298
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #26298 +/- ##
==========================================
- Coverage 63.85% 63.84% -0.01%
==========================================
Files 1632 1632
Lines 157936 157938 +2
Branches 4038 4091 +53
==========================================
- Hits 100843 100838 -5
- Misses 49191 49198 +7
Partials 7902 7902
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@noahtalerman I only saw tooltip verbiage for one state, so I added variations for the free tier and for when "All Teams" is selected (see screenshots in description). Let me know if you want changes to the text. |
Hey @sgress454! Up to @marko-lisica (Product Designer for the user story): |
Great catch @sgress454! I just added these 2 cases to Figma here ![]() I noticed that the tooltips on the screenshots don't have a caret (arrow) pointing to the button and a copy doesn't match what's specified in Figma. We use one without caret only with underlined text. |
Thanks @marko-lisica! Updated:
|
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.
The only requested change is for the "top" positioning, everything else is nice-to-have
} | ||
|
||
automationsDropdown = ( | ||
<TooltipWrapper underline={false} tipContent={tipContent} showArrow> |
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.
looks like we want position="top"
/> | ||
</div> | ||
); | ||
if (!hasPoliciesToAutomateOrDelete) { |
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.
Our general pattern for this kind of thing would be more like:
const tipContent =
isPremiumTier && currentTeamId !== APP_CONTEXT_ALL_TEAMS_ID ? (
<>
To manage automations add a policy to this team.
<br />
For inherited policies select “All teams”.
</>
) : (
"To manage automations add a policy."
);
, though I like this let
-based version too. If you feel like we should shift in that direction in
general, can you bring it up as a topic at frontend sync? Otherwise let's stick with the
ternary-based approach please.
Also, nice effort towards using more semantic HTML! I will say in my experience in the codebase,
using <p>
tends to introduce more style issues than it solves. I'd support a concerted app-wide effort
to use more semantic markup, though caution that currently it tends to introduce more problems than
it solves.
@@ -55,6 +55,10 @@ | |||
.form-field { | |||
margin-bottom: 0; | |||
} | |||
|
|||
&__tooltip { | |||
text-align: center; |
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.
related to the <p>
, right?
For #23243
Checklist for submitter
changes/
,orbit/changes/
oree/fleetd-chrome/changes
.See Changes files for more information.
Details
This PR changes the behavior of the Manage Automations dropdown on the Manage Policies page. Any user that has permission to manage policies will now always see the dropdown. If there are no policies added for the selected team (or no policies at all, in the case of "All teams" or users on the free tier), the dropdown is disabled with a tooltip.
Screenshots
Free tier:
![image](https://private-user-images.githubusercontent.com/553428/412556391-37a3b97a-74b3-4495-ace4-bfece30b3822.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTQ4NjYsIm5iZiI6MTczOTU5NDU2NiwicGF0aCI6Ii81NTM0MjgvNDEyNTU2MzkxLTM3YTNiOTdhLTc0YjMtNDQ5NS1hY2U0LWJmZWNlMzBiMzgyMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQwNDQyNDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01ZTI1YmVhMzZjODYyOTdmNzJiYTJiZGZiN2ZjNzMyMGNhNjk3YTBmOTJjODIwNGIzNGQwMTgxZmYwZjQyNmVkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.2M4D9Q6G1FcnYHU5ydwUckdirw5CzLH5VTgqIeX3uLw)
Premium tier, All Teams:
![image](https://private-user-images.githubusercontent.com/553428/412556521-bedd9a5f-e2aa-49da-8943-61bc69af9744.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTQ4NjYsIm5iZiI6MTczOTU5NDU2NiwicGF0aCI6Ii81NTM0MjgvNDEyNTU2NTIxLWJlZGQ5YTVmLWUyYWEtNDlkYS04OTQzLTYxYmM2OWFmOTc0NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQwNDQyNDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02NmJiODhkOWYxN2QxMjNjMTgwZWU3ZTg4ODdjMzBjMjJlMjNkMWE4MGIwYjVlM2MwMGIxNjAyNjAzZDI1YmQ0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.nacptBfw7Ig_e8QHn6aBuBCeMieM0gq74vqpHsRVoSE)
Premium tier, team selected:
![image](https://private-user-images.githubusercontent.com/553428/412556599-e1c2397b-1d19-46f2-b78d-e7a923f91c8f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJ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