XLAB Add modal for default manual effort and automation creation time #3832
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3832"
general
weight: 0.35
kcagran
Summary
AAP-99277
Adds a Set template defaults action and a Set template default values modal to the Automation Dashboard. It sets the default "Time taken to manually execute" and "Time taken to create automation" and applies them to all job templates at once.
dashboard_reports/template_metadata/defaults/(minutes, integer, 1–1,000,000, same limits as the inline table inputs), help text that refers to the "Include time taken to create automation in calculations" toggle, and Apply to templates / Cancel actions.PATCHtodashboard_reports/template_metadata/. On success the modal closes, a success toast shows the number of updated templates, the table shows the new values right away, and the report (table + savings/ROI widgets) is reloaded.PATCHis sent, so a late per-template save cannot overwrite the bulk values. After a bulk update, unsaved or invalid inline edits are dropped.DashboardExportButtonis renamed toDashboardMainTableActions(it now holds both header actions, and the disabled export shows a tooltip explaining why). Number validation is shared inutils/numberInputValidation.ts, used by the inline inputs and the modal.Points for review
GET dashboard_reports/template_metadata/defaults/(time_taken_manually_execute_minutes,time_taken_create_automation_minutes) and prefills the fields. A spinner is shown while they load. If the request fails, a warning is shown and the fields stay empty, so the values can still be entered by hand. A missing ornullvalue leaves its field empty.Type of Change
Risk Analysis - REQUIRED
All changes are in
frontend/awx/analytics/automation-dashboard/.Shared Framework Scope
framework/changes with unrelated feature work or product rollout changes. If it does, split the work into a dedicated framework PR and follow-up PRs, or explain why splitting is not feasible.framework/, it includes complete relevant framework test coverage and representative validation of affected consuming workspaces.framework/, its description documents the compatibility impact, including affected consumers or supported behavior.Dependencies
Requires the backend bulk
PATCH dashboard_reports/template_metadata/endpoint (returns{ "updated": <count> }) andGET dashboard_reports/template_metadata/defaults/.Testing
Ephemeral E2E Tests
Once PR is ready and preliminary checks pass, trigger tests by posting a comment
/run-playwrighton this PR.Unit tests
useSetTemplateValuesDialog.test.tsx: modal content, prefilled default values (loading, missing value, load error), validation, confirmation checkbox, PATCH payload, API error handling, cancel/close, waiting for pending inline saves.DashboardMainTableCard.setTemplateValues.test.tsx: button visibility (superuser / non-superuser / no results), disabled states, table update after apply.DashboardMainTableActions.test.tsx,numberInputValidation.test.ts,useSerializedSave.test.ts(waitForIdle).Manual Testing
1. Log in as a superuser and open Analytics → Automation Dashboard, select a report with results.
2. Click Set template defaults in the main table header. Check that the fields are prefilled with the default values.
3. Check that Apply to templates is disabled until the confirmation checkbox is ticked.
4. Enter invalid values (empty, 0, decimal, > 1,000,000) and check the validation messages.
5. Enter valid values, tick the checkbox and apply. Check that the toast shows the number of updated templates, the table shows the new values and the savings/ROI widgets are updated.
6. Change filters and check that templates that were hidden also have the new values.
7. Log in as a non-superuser and check that the button is not shown.
Screenshots
<img width="1011" height="529" alt="image" src="https://github.com/user-attachments/assets/5cd91558-a022-48b7-8d43-57fc94d591fa" />
<img width="857" height="619" alt="image" src="https://github.com/user-attachments/assets/7e153acb-b724-426b-9048-4ea0cea233f8" />
<img width="857" height="619" alt="image" src="https://github.com/user-attachments/assets/086fd6a6-ee94-4552-9599-8c41086adf46" />