Skip to content

Open Manage automations modal for policies without automations + inherited policies - #46271

Merged
nulmete merged 3 commits into
policy-automations-continuous-retriesfrom
45148-open-manage-automations-empty-inherited
May 29, 2026
Merged

Open Manage automations modal for policies without automations + inherited policies#46271
nulmete merged 3 commits into
policy-automations-continuous-retriesfrom
45148-open-manage-automations-empty-inherited

Conversation

@nulmete

@nulmete nulmete commented May 27, 2026

Copy link
Copy Markdown
Member

Related issue: #45148 and #45145

Summary

Stacked on top of the Manage automations modal PR (#46254). Two follow-up tweaks:

  • Open the modal from the empty ("---") automations cell. Policies with no automations configured were previously a non-interactive cell. Now, for users who can edit, the empty cell is clickable.
  • Handle inherited policies opened from a fleet's list. An inherited policy has team_id === null even when viewed from within a specific fleet. It's now treated as global (only the webhook/ticket row, no continuous-retry option) and the modal is routed to the global config for its automations, instead of inferring "global" from the selected-team view.

Testing

  • QA'd all new/changed functionality manually
Screen.Recording.2026-05-27.at.3.00.11.PM.mov
Screen.Recording.2026-05-27.at.3.00.42.PM.mov

@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 16.32653% with 41 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (policy-automations-continuous-retries@c083625). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...policies/ManagePoliciesPage/ManagePoliciesPage.tsx 2.56% 38 Missing ⚠️
...e/components/PoliciesTable/PoliciesTableConfig.tsx 70.00% 3 Missing ⚠️
Additional details and impacted files
@@                           Coverage Diff                            @@
##             policy-automations-continuous-retries   #46271   +/-   ##
========================================================================
  Coverage                                         ?   66.78%           
========================================================================
  Files                                            ?     2762           
  Lines                                            ?   219981           
  Branches                                         ?    11018           
========================================================================
  Hits                                             ?   146918           
  Misses                                           ?    59794           
  Partials                                         ?    13269           
Flag Coverage Δ
frontend 55.67% <16.32%> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

@nulmete
nulmete marked this pull request as ready for review May 27, 2026 18:22
@nulmete
nulmete requested a review from a team as a code owner May 27, 2026 18:22

@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.


// NOTE: backend uses webhook_settings to store automated policy ids for both
// webhooks and integrations.
const getWebhookOrTicketPolicyIds = (

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.

@nulmete nulmete May 29, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Technically yes because we can derive both the state and the IDs in one go. (I simplified this in one of the follow-up PRs so that we return an object with both values.)

See getWebhookOrTicketInfo here: https://github.com/fleetdm/fleet/pull/46326/changes#diff-b779b6619418992f803e16110ef8fcb475a40a9f153c71e7dccefa68b0a465caR16

@nulmete

nulmete commented May 29, 2026

Copy link
Copy Markdown
Member Author

@juan-fdz-hawa In the latest commit, 289363e, I added a small fix for a specific edge case: if a global policy had "Send webhook" configured, it would not be rendered in the Automations cell on the fleet/team view. Now it's properly displayed.

Screen.Recording.2026-05-29.at.11.34.08.AM.mov

Base automatically changed from 45148-manage-automations-frontend-new-manage to policy-automations-continuous-retries May 29, 2026 14:57
nulmete added 3 commits May 29, 2026 12:03
…rited policies

- Make the empty ("---") automations cell open the modal (with pencil
  affordance) for users who can edit; read-only users keep the plain cell.
- Treat an inherited policy (team_id === null) as global even when viewed
  from within a fleet's list, routing the modal to the global config.
The empty, single, and multiple automation cells all wrapped their content
in the same role="button" + pencil affordance. Pull that into one local
component; call sites now pass only the aria-label, optional class, and the
content shown left of the pencil.
@nulmete
nulmete force-pushed the 45148-open-manage-automations-empty-inherited branch from 289363e to 09c4700 Compare May 29, 2026 15:05
@nulmete
nulmete merged commit 7d925d8 into policy-automations-continuous-retries May 29, 2026
16 checks passed
@nulmete
nulmete deleted the 45148-open-manage-automations-empty-inherited branch May 29, 2026 15:11
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.

2 participants