Skip to content

Use "Example payload" for all payload example buttons and always enable example buttons - #47167

Merged
spalmesano0 merged 4 commits into
mainfrom
show-payload-buttons
Jun 17, 2026
Merged

Use "Example payload" for all payload example buttons and always enable example buttons#47167
spalmesano0 merged 4 commits into
mainfrom
show-payload-buttons

Conversation

@spalmesano0

@spalmesano0 spalmesano0 commented Jun 9, 2026

Copy link
Copy Markdown
Member

Related issue: #44719

Also, make sure the Dashboard > Activity > Automations modal is grayed out when in GitOps mode.

Checklist for submitter

Testing

  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • Style
    • Standardized button labels across modals to use "Example payload" / "Example data" consistently instead of mixed "Preview" or "Show/Hide" variants.
  • Bug Fixes
    • Disabled relevant controls (example toggles, payload preview, destination URL inputs, toggles) when GitOps mode is enabled so UI reflects read-only mode.

Copilot AI review requested due to automatic review settings June 9, 2026 12:49
@spalmesano0
spalmesano0 requested a review from a team as a code owner June 9, 2026 12:49

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 standardizes user-facing terminology for payload example/preview actions across multiple Fleet UI modals by changing button/reveal labels to “Example payload,” and updates the frontend patterns documentation to remove reliance on the old UI wording.

Changes:

  • Rename “Preview payload” buttons to “Example payload” in software automations and end user migration UI.
  • Update multiple RevealButton toggles from “Show/Hide example payload” to the single label “Example payload.”
  • Adjust frontend/docs/patterns.md wording to remove the coupling between *PreviewPayload naming and UI terminology.

Reviewed changes

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

Show a summary per file
File Description
frontend/pages/SoftwarePage/components/modals/ManageSoftwareAutomationsModal/ManageSoftwareAutomationsModal.tsx Renames the payload button label to “Example payload” in the software automations modal.
frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/OtherWorkflowsModal/OtherWorkflowsModal.tsx Updates the example payload reveal toggle copy (and is the policy webhook example toggle tied to the linked issue).
frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/CalendarEventsModal/CalendarEventsModal.tsx Updates the example payload reveal toggle copy in calendar automations.
frontend/pages/DashboardPage/components/ActivityFeedAutomationsModal/ActivityFeedAutomationsModal.tsx Updates the example payload reveal toggle copy in activity feed automations.
frontend/pages/admin/IntegrationsPage/cards/MdmSettings/components/EndUserMigrationSection/EndUserMigrationSection.tsx Renames the payload button label to “Example payload” for end user migration.
frontend/docs/patterns.md Updates guidance text to remove dependence on the “Preview payload” UI phrase.

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

hideText="Hide example payload"
showText="Show example payload"
hideText="Example payload"
showText="Example payload"
caretPosition="after"
onClick={() => setShowExamplePayload(!showExamplePayload)}
disabled={!isPolicyAutomationsEnabled}

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.

This is a good idea, I'll commit this soon.

Comment on lines 472 to +476
@@ -473,7 +473,7 @@ const ManageAutomationsModal = ({
onClick={togglePreviewPayloadModal}
disabled={!softwareAutomationsEnabled}
>
Preview payload
Example payload
@coderabbitai

coderabbitai Bot commented Jun 9, 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: 9f4126c7-4a88-47e1-8e49-5a2e673a1674

📥 Commits

Reviewing files that changed from the base of the PR and between 8d8d67d and 59eab87.

📒 Files selected for processing (4)
  • frontend/pages/DashboardPage/components/ActivityFeedAutomationsModal/ActivityFeedAutomationsModal.tsx
  • frontend/pages/SoftwarePage/components/modals/ManageSoftwareAutomationsModal/ManageSoftwareAutomationsModal.tsx
  • frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/CalendarEventsModal/CalendarEventsModal.tsx
  • frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/OtherWorkflowsModal/OtherWorkflowsModal.tsx
💤 Files with no reviewable changes (3)
  • frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/CalendarEventsModal/CalendarEventsModal.tsx
  • frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/OtherWorkflowsModal/OtherWorkflowsModal.tsx
  • frontend/pages/SoftwarePage/components/modals/ManageSoftwareAutomationsModal/ManageSoftwareAutomationsModal.tsx

Walkthrough

This PR standardizes preview/reveal button text across several automation modals (using “Example payload” or “Example data”), imports and uses useGitOpsMode in ActivityFeed to read gitOpsModeEnabled, and updates disabled logic so destination inputs, sliders, and example toggles consider gitOpsModeEnabled. Some RevealButton disabled props were removed or relocated; payload rendering and submit/validation flows were unchanged.

Possibly related issues

Possibly related PRs

  • fleetdm/fleet#46355: Modifies the same RevealButton configuration in CalendarEventsModal and OtherWorkflowsModal for GitOps-mode behavior.
  • fleetdm/fleet#46023: Introduced/refactored automations modal RevealButton behavior that these changes further adjust.
  • fleetdm/fleet#46056: Overlaps with policy automations UI changes related to Example payload RevealButton text and GitOps-aware disablement.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete relative to the template. It lacks required checklist items and missing sections like Changes files, Input validation, Testing, Database migrations, and configuration details. Complete the PR description by including all relevant checklist items from the template, marking appropriate boxes as checked/unchecked, and providing details on changes files and any other applicable sections.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately summarizes the main changes: standardizing payload example button labels to 'Example payload' and enabling example buttons across multiple modals.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 show-payload-buttons

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.

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

🧹 Nitpick comments (3)
frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/OtherWorkflowsModal/OtherWorkflowsModal.tsx (1)

247-248: ⚡ Quick win

Consider distinct labels for toggle states and consistent patterns.

Setting both hideText and showText to "Example payload" creates two concerns:

  1. Accessibility: The button label remains identical regardless of state. Screen reader users and keyboard-only users lose the semantic indication of the current state and the action the button will perform.

  2. Inconsistency: Within this same modal, the example ticket toggle (lines 278-279) uses distinct state-specific labels: hideText="Hide example ticket" / showText="Show example ticket". This creates an inconsistent user experience where similar toggle controls behave differently.

Consider using distinct labels for both toggles to maintain consistency and improve accessibility:

  • hideText="Hide example payload" / showText="Show example payload"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/OtherWorkflowsModal/OtherWorkflowsModal.tsx`
around lines 247 - 248, The toggle in OtherWorkflowsModal currently sets both
props hideText and showText to "Example payload"; update the toggle used in the
OtherWorkflowsModal component so the two props are distinct (e.g.,
hideText="Hide example payload" and showText="Show example payload") to match
the pattern used by the example ticket toggle and improve accessibility and
consistency; locate the toggle by the prop names hideText/showText inside
OtherWorkflowsModal and change the labels accordingly.
frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/CalendarEventsModal/CalendarEventsModal.tsx (1)

193-194: ⚡ Quick win

Consider distinct labels for toggle states to improve accessibility.

Setting both hideText and showText to "Example payload" means the button label remains identical regardless of whether the payload is shown or hidden. While the caret icon may provide a visual cue, screen reader users and keyboard-only users lose the semantic indication of the current state and the action the button will perform.

For better accessibility, consider using distinct labels such as:

  • hideText="Hide example payload" / showText="Show example payload", or
  • hideText="Example payload ▲" / showText="Example payload ▼"

This pattern improves clarity for all users about what will happen when they activate the button.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/CalendarEventsModal/CalendarEventsModal.tsx`
around lines 193 - 194, The toggle in CalendarEventsModal currently uses
identical labels for both states (hideText="Example payload" and
showText="Example payload"); update the props on the toggling control in
CalendarEventsModal so the two strings are distinct (e.g., showText="Show
example payload" and hideText="Hide example payload" or add directional markers
like "Example payload ▼" / "Example payload ▲") to ensure screen readers and
keyboard users can determine current state and action; locate the instance in
CalendarEventsModal.tsx where hideText and showText are passed and replace the
duplicate values with descriptive, contrasting labels.
frontend/pages/DashboardPage/components/ActivityFeedAutomationsModal/ActivityFeedAutomationsModal.tsx (1)

163-164: ⚡ Quick win

Consider distinct labels for toggle states to improve accessibility.

Setting both hideText and showText to "Example payload" means the button label remains identical regardless of whether the payload is shown or hidden. While the caret icon may provide a visual cue, screen reader users and keyboard-only users lose the semantic indication of the current state and the action the button will perform.

For better accessibility, consider using distinct labels such as:

  • hideText="Hide example payload" / showText="Show example payload", or
  • hideText="Example payload ▲" / showText="Example payload ▼"

This pattern improves clarity for all users about what will happen when they activate the button.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/pages/DashboardPage/components/ActivityFeedAutomationsModal/ActivityFeedAutomationsModal.tsx`
around lines 163 - 164, ActivityFeedAutomationsModal uses identical labels for
the toggle (hideText="Example payload" and showText="Example payload"), which
hides state for screen readers; update the props on the toggle control in
ActivityFeedAutomationsModal (where hideText and showText are set) to distinct,
descriptive strings (e.g., hideText="Hide example payload" and showText="Show
example payload" or include directional markers like "Example payload ▲" /
"Example payload ▼") so the button conveys both current state and action to
assistive tech.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@frontend/pages/DashboardPage/components/ActivityFeedAutomationsModal/ActivityFeedAutomationsModal.tsx`:
- Around line 163-164: ActivityFeedAutomationsModal uses identical labels for
the toggle (hideText="Example payload" and showText="Example payload"), which
hides state for screen readers; update the props on the toggle control in
ActivityFeedAutomationsModal (where hideText and showText are set) to distinct,
descriptive strings (e.g., hideText="Hide example payload" and showText="Show
example payload" or include directional markers like "Example payload ▲" /
"Example payload ▼") so the button conveys both current state and action to
assistive tech.

In
`@frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/CalendarEventsModal/CalendarEventsModal.tsx`:
- Around line 193-194: The toggle in CalendarEventsModal currently uses
identical labels for both states (hideText="Example payload" and
showText="Example payload"); update the props on the toggling control in
CalendarEventsModal so the two strings are distinct (e.g., showText="Show
example payload" and hideText="Hide example payload" or add directional markers
like "Example payload ▼" / "Example payload ▲") to ensure screen readers and
keyboard users can determine current state and action; locate the instance in
CalendarEventsModal.tsx where hideText and showText are passed and replace the
duplicate values with descriptive, contrasting labels.

In
`@frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/OtherWorkflowsModal/OtherWorkflowsModal.tsx`:
- Around line 247-248: The toggle in OtherWorkflowsModal currently sets both
props hideText and showText to "Example payload"; update the toggle used in the
OtherWorkflowsModal component so the two props are distinct (e.g.,
hideText="Hide example payload" and showText="Show example payload") to match
the pattern used by the example ticket toggle and improve accessibility and
consistency; locate the toggle by the prop names hideText/showText inside
OtherWorkflowsModal and change the labels accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1c51f39e-b6dc-4489-befb-06c416d71149

📥 Commits

Reviewing files that changed from the base of the PR and between ac16ca6 and b7b22eae82811673f92481bef85270ef36c03199.

⛔ Files ignored due to path filters (1)
  • frontend/docs/patterns.md is excluded by !**/*.md
📒 Files selected for processing (5)
  • frontend/pages/DashboardPage/components/ActivityFeedAutomationsModal/ActivityFeedAutomationsModal.tsx
  • frontend/pages/SoftwarePage/components/modals/ManageSoftwareAutomationsModal/ManageSoftwareAutomationsModal.tsx
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/components/EndUserMigrationSection/EndUserMigrationSection.tsx
  • frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/CalendarEventsModal/CalendarEventsModal.tsx
  • frontend/pages/policies/ManagePoliciesPage/components/AutomationsModal/components/OtherWorkflowsModal/OtherWorkflowsModal.tsx

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.18%. Comparing base (ac16ca6) to head (59eab87).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
...onents/OtherWorkflowsModal/OtherWorkflowsModal.tsx 0.00% 4 Missing ⚠️
...onents/CalendarEventsModal/CalendarEventsModal.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #47167      +/-   ##
==========================================
- Coverage   67.19%   67.18%   -0.01%     
==========================================
  Files        2917     2970      +53     
  Lines      226376   226484     +108     
  Branches    11720    11722       +2     
==========================================
+ Hits       152119   152172      +53     
- Misses      60514    60569      +55     
  Partials    13743    13743              
Flag Coverage Δ
frontend 57.87% <16.66%> (-0.03%) ⬇️

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.

@spalmesano0
spalmesano0 force-pushed the show-payload-buttons branch from b7b22ea to 8d8d67d Compare June 9, 2026 15:00
@spalmesano0 spalmesano0 changed the title Use "Example payload" for all payload example buttons Use "Example payload" for all payload example buttons and enable example buttons in GitOps even when the setting is disabled Jun 9, 2026
@spalmesano0
spalmesano0 marked this pull request as draft June 9, 2026 20:19
@spalmesano0 spalmesano0 changed the title Use "Example payload" for all payload example buttons and enable example buttons in GitOps even when the setting is disabled Use "Example payload" for all payload example buttons and always enable example buttons Jun 9, 2026
@spalmesano0
spalmesano0 marked this pull request as ready for review June 9, 2026 20:52
className="save-loading"
isLoading={isUpdating}
disabled={Object.keys(formErrors).length > 0}
>

@dantecatalfamo dantecatalfamo Jun 16, 2026

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.

Since you're modifying the disabled status of other fields based on gitops, should you apply it to the save button as well?

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.

@dantecatalfamo As in, enable the Save button in GitOps? If so, I don't think so. We don't want users to think they can save changes in GitOps mode.

@lucasmrod lucasmrod assigned lucasmrod and nulmete and unassigned lucasmrod Jun 17, 2026
@spalmesano0
spalmesano0 merged commit b6b3742 into main Jun 17, 2026
26 checks passed
@spalmesano0
spalmesano0 deleted the show-payload-buttons branch June 17, 2026 19:59
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.

'Show example payload' in failing policy webhook modal greyed out in GitOps mode

5 participants