Skip to content

UI for scheduling batch scripts#31885

Merged
sgress454 merged 8 commits into
mainfrom
28390-frontend-feature
Aug 14, 2025
Merged

UI for scheduling batch scripts#31885
sgress454 merged 8 commits into
mainfrom
28390-frontend-feature

Conversation

@sgress454
Copy link
Copy Markdown
Contributor

Details

This PR merges the feature branch for the scheduled scripts UI into main. This includes the following previously-approved PRs:

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

Testing

sgress454 and others added 5 commits August 8, 2025 13:47
for #30526 

# Details

This PR updates the "Run batch script" modal to allow for scheduling
scripts in the future. When a script is selected from the list, rather
than running immediately, it now presents a choice of "Run now" and
"Schedule for later". If the user opts to schedule for later, they are
presented with a form for choosing the date and time to run the script.

Run now example:


https://github.com/user-attachments/assets/6fe3a77e-a271-4b58-abfd-c9ad9196d0b5

Schedule for later example:



https://github.com/user-attachments/assets/ca43eab6-03f6-4c0b-929c-aabfb69f2e5f




# Checklist for submitter

## Testing

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually
…s section, add new progress bar component (#31750)

# #31224 and #31225

## Summary
* **New Features**
* Introduced a modular Scripts management area with side navigation,
including a "Script Library" and "Batch Progress" views.
* Added a progress bar component with visual segments and Storybook/test
coverage.
* Implemented paginated batch execution summaries with status tabs,
progress visualization, and detailed modal views.
* Added new utility functions and endpoints to support script batch
operations.

* **Improvements**
* Enhanced type safety and prop definitions for navigation and card
components.
  * Improved documentation and comments for better clarity.
* Updated routing to support section-based navigation within the Scripts
area.

* **Bug Fixes**
* Corrected and unified types across hosts, scripts, and related
components for batch status and summaries.

### Controls > Scripts > Batch progress

![ezgif-80a97182cccb3b](https://github.com/user-attachments/assets/cd623e9b-b3ab-4d77-8783-f74daa4d9dc9)

![empty
states](https://github.com/user-attachments/assets/729a9b71-1883-4678-b607-b1293e78038c)

### Progress bar component:
<img width="265" height="852" alt="Screenshot 2025-08-08 at 5 13 12 PM"
src="https://github.com/user-attachments/assets/d67ee2a1-c7db-4f0c-a856-ed5e45d65822"
/>

- [x] Changes file added for user-visible changes in `changes/`
- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
Co-authored-by: Scott Gress <scott@fleetdm.com>
# Details

This PR updates the current "batch script summary" modal to allow
canceling the script directly from the modal. This is a first iteration
of the cancelation feature which will be replaced by [the "batch script
details"
page](https://www.figma.com/design/Q18CcrFKmgOp0f5slpH35T/-28390-Schedule-scripts-to-run-at-a-specific-time?node-id=5861-25818&t=knTGlZtgFTj4NIUK-0).

It also updates the modal to display the # of canceled items in the
batch.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [X] QA'd all new/changed functionality manually
@sgress454 sgress454 requested a review from a team as a code owner August 13, 2025 20:36
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 74.50980% with 65 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.79%. Comparing base (83db2cc) to head (770a7a8).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
...criptBatchSummaryModal/ScriptBatchSummaryModal.tsx 0.00% 23 Missing ⚠️
.../cards/ScriptBatchProgress/ScriptBatchProgress.tsx 71.79% 22 Missing ⚠️
...onents/RunScriptBatchModal/RunScriptBatchModal.tsx 76.27% 14 Missing ⚠️
frontend/services/entities/scripts.ts 42.85% 4 Missing ⚠️
...ostsPage/components/RunScriptBatchModal/helpers.ts 97.77% 1 Missing ⚠️
frontend/utilities/endpoints.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #31885      +/-   ##
==========================================
+ Coverage   63.77%   63.79%   +0.02%     
==========================================
  Files        1966     1970       +4     
  Lines      192570   192823     +253     
  Branches     6377     6358      -19     
==========================================
+ Hits       122802   123006     +204     
- Misses      60153    60202      +49     
  Partials     9615     9615              
Flag Coverage Δ
frontend 50.92% <74.50%> (+0.40%) ⬆️

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.

@sgress454 sgress454 merged commit e985d20 into main Aug 14, 2025
16 checks passed
@sgress454 sgress454 deleted the 28390-frontend-feature branch August 14, 2025 15:10
BCTBB pushed a commit that referenced this pull request Aug 19, 2025
# Details

This PR merges the feature branch for the scheduled scripts UI into
main. This includes the following previously-approved PRs:

* #31750
* #31604
* #31797


# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [X] Added/updated automated tests
- [X] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [X] QA'd all new/changed functionality manually

---------

Co-authored-by: jacobshandling <61553566+jacobshandling@users.noreply.github.com>
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
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.

3 participants