Skip to content

Reuse Policies' Automations button on Dashboard, Software, and Reports - #46846

Merged
nulmete merged 5 commits into
mainfrom
reuse-automations-gear-icon-for-manage-automations
Jun 5, 2026
Merged

Reuse Policies' Automations button on Dashboard, Software, and Reports#46846
nulmete merged 5 commits into
mainfrom
reuse-automations-gear-icon-for-manage-automations

Conversation

@nulmete

@nulmete nulmete commented Jun 4, 2026

Copy link
Copy Markdown
Member

Resolves #45147 (AutomationsButton introduced as part of that issue)

Screenshot 2026-06-04 at 3 51 45 PM

Testing

  • QA'd all new/changed functionality manually
Screenshot 2026-06-04 at 3 49 49 PM Screenshot 2026-06-04 at 3 49 53 PM Screenshot 2026-06-04 at 3 50 05 PM

Summary by CodeRabbit

  • New Features
    • Introduces a standardized "Automations" button (settings icon + label) and replaces prior controls across Dashboard, Software, Policies, and Queries pages.
    • Info cards and page actions now support an "automations" action type to consistently open automation management from relevant UIs.

…, and Reports

Extracts the gear-icon + "Automations" button into a reusable
AutomationsButton component and uses it across the Policies, Software,
and Reports pages. The Dashboard Activity card reuses it via a new
"automations" action type on useInfoCard. No modal/behavior changes.
@nulmete
nulmete marked this pull request as ready for review June 4, 2026 18:51
@nulmete
nulmete requested a review from a team as a code owner June 4, 2026 18:51
Copilot AI review requested due to automatic review settings June 4, 2026 18:51

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.96%. Comparing base (dd3ab4f) to head (6cd2c0c).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...ts/buttons/AutomationsButton/AutomationsButton.tsx 40.00% 3 Missing ⚠️
...es/queries/ManageQueriesPage/ManageQueriesPage.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #46846    +/-   ##
========================================
  Coverage   66.95%   66.96%            
========================================
  Files        2851     2854     +3     
  Lines      225402   225533   +131     
  Branches    11547    11592    +45     
========================================
+ Hits       150915   151024   +109     
- Misses      60789    60811    +22     
  Partials    13698    13698            
Flag Coverage Δ
frontend 56.96% <33.33%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a reusable AutomationsButton component (matching the existing Policies “Automations” button) and replaces bespoke “Manage automations” button implementations across Dashboard, Software, and Reports/Queries for consistent UI and reuse.

Changes:

  • Added components/buttons/AutomationsButton (TSX + SCSS + index export).
  • Replaced existing inverse buttons in Software, Queries, and Policies pages with AutomationsButton.
  • Updated Dashboard InfoCard action handling to support an automations action type and render the new button.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/pages/SoftwarePage/SoftwarePage.tsx Swaps the “Manage automations” inverse button for AutomationsButton within the tooltip wrapper.
frontend/pages/queries/ManageQueriesPage/ManageQueriesPage.tsx Reuses AutomationsButton for the reports automations entrypoint (enabled + disabled states).
frontend/pages/policies/ManagePoliciesPage/ManagePoliciesPage.tsx Replaces the inline Icon+Button “Automations” control with AutomationsButton.
frontend/pages/DashboardPage/DashboardPage.tsx Changes Activity card action config to use a new automations action type.
frontend/pages/DashboardPage/components/InfoCard/InfoCard.tsx Adds rendering support for action.type === "automations" using AutomationsButton.
frontend/components/buttons/AutomationsButton/index.ts Adds barrel export for the new button component.
frontend/components/buttons/AutomationsButton/AutomationsButton.tsx Implements the reusable AutomationsButton wrapper around Button.
frontend/components/buttons/AutomationsButton/_styles.scss Adds styling for the new button.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +5
.automations-button {
display: flex;
align-items: center;
gap: $pad-small;
}
Comment on lines +7 to +14
const baseClass = "automations-button";

export interface IAutomationsButtonProps {
onClick?: (evt: React.MouseEvent<HTMLButtonElement>) => void;
disabled?: boolean;
className?: string;
size?: "small" | "wide" | "default";
}
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4f11b6fe-85b9-46fa-9e95-060d43413a34

📥 Commits

Reviewing files that changed from the base of the PR and between 53a3a65 and 6cd2c0c.

📒 Files selected for processing (2)
  • frontend/components/buttons/AutomationsButton/AutomationsButton.tsx
  • frontend/components/buttons/Button/index.ts
💤 Files with no reviewable changes (1)
  • frontend/components/buttons/AutomationsButton/AutomationsButton.tsx
✅ Files skipped from review due to trivial changes (1)
  • frontend/components/buttons/Button/index.ts

Walkthrough

This PR introduces a reusable AutomationsButton component to consolidate "Manage automations" action rendering across the application. The new component wraps a shared Button with variant="inverse", displays a settings icon and "Automations" label, and is exported from a dedicated module. The component is wired into InfoCard as a new action type ("automations"), enabling the DashboardPage to render automations actions via ActivityFeedCard. SoftwarePage, ManagePoliciesPage, and ManageQueriesPage are updated to use AutomationsButton instead of inline button patterns, with SCSS styling removed from ManagePoliciesPage due to the component's self-contained structure.

Possibly related PRs

  • fleetdm/fleet#46023: Modifies ManagePoliciesPage permission logic and automations modal entry points, directly aligned with this PR's CTA refactor on the same page.
  • fleetdm/fleet#46056: Substantially refactors ManagePoliciesPage's automations settings flow and modal control, overlapping with this PR's AutomationsButton integration at the same UI entry point.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: reusing the Automations button component across multiple pages (Dashboard, Software, and Reports) for consistency.
Description check ✅ Passed The description references the related issue (#45147), includes testing confirmation (QA'd manually), and provides visual evidence via screenshots showing the changes across pages.
Linked Issues check ✅ Passed The PR fulfills #45147's objective by creating a reusable AutomationsButton component and implementing it consistently across Dashboard, Software, and Reports pages as shown in the provided screenshots.
Out of Scope Changes check ✅ Passed All changes are scoped to creating and integrating the AutomationsButton component across specified pages; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch reuse-automations-gear-icon-for-manage-automations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…types from Button

- Remove _styles.scss: the gap was applied to the <button> element, but
  icon/text live in Button's .children-wrapper; spacing is already
  provided by the --inverse variant's children-wrapper gap.
- Derive IAutomationsButtonProps from Button's IButtonProps so onClick/size
  stay in sync (onClick now also accepts keyboard/generic handlers).
- Drop the now-redundant manage-policies__automations-button rule/className.
The Button directory's index.ts only re-exported the default, so
importing the IButtonProps type via "components/buttons/Button" failed
(TS2614). Re-export the named types alongside the default.

@RachelElysia RachelElysia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm!

@nulmete
nulmete merged commit 43edf1a into main Jun 5, 2026
24 checks passed
@nulmete
nulmete deleted the reuse-automations-gear-icon-for-manage-automations branch June 5, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Manage automations] Frontend: New automations modal (settings for team view)

3 participants