-
Notifications
You must be signed in to change notification settings - Fork 604
Show "Manage Automations" dropdown when no policies are present #26298
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #26298 +/- ##
==========================================
- Coverage 63.85% 63.85% -0.01%
==========================================
Files 1632 1634 +2
Lines 157936 157985 +49
Branches 4038 4059 +21
==========================================
+ Hits 100843 100874 +31
- Misses 49191 49208 +17
- Partials 7902 7903 +1
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"
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.
@jacobshandling If we do position top, it gets cut off by the site nav. And the tooltip style sheet currently has:
z-index: 99; // not more than the site nav
which makes that seem intentional.
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.
Hmm, I'm not sure why I put that there. Since the Figma has the tooltip up (see here) I'd say it's fine to override, either by locally setting z-index, or you might need to set TooltipWrapper
's fixedPositionStrategy
prop
/> | ||
</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.
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.
It needs to be a real container since it has a style associated with it. I can change it to <div>
. I wasn't really trying to make a policy statement, just force of habit 😄 . As far as the let
vs. ternary, an earlier version had more variations that made that necessary; since there's only two I can switch back to ternary. That's not a style-guideline consistency hill I'd want to die on.
@@ -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?
@jacobshandling Updated this to use "top" positioning and replaced |
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
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:

Premium tier, All Teams:

Premium tier, team selected:
