Navigate back to the report details page after saving a report (#46754)
**Related issue:** Resolves #38928 # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. ## Testing - [x] QA'd all new/changed functionality manually <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * After saving report edits, the UI now redirects users back to the report details page. * URL context (host_id and fleet_id) is preserved during this navigation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -0,0 +1 @@
|
||||
- Navigate back to the report details page after saving changes to a report.
|
||||
@@ -315,7 +315,12 @@ const EditQueryPage = ({
|
||||
try {
|
||||
await queryAPI.update(queryId, updatedQuery);
|
||||
renderFlash("success", "Report updated.");
|
||||
refetchStoredQuery(); // Required to compare recently saved query to a subsequent save to the query
|
||||
router.push(
|
||||
getPathWithQueryParams(PATHS.REPORT_DETAILS(queryId), {
|
||||
host_id: location.query.host_id,
|
||||
fleet_id: location.query.fleet_id,
|
||||
})
|
||||
);
|
||||
} catch (updateError) {
|
||||
console.error(updateError);
|
||||
const reason = getErrorReason(updateError);
|
||||
|
||||
Reference in New Issue
Block a user