coder999o opened a new pull request, #5797: URL: https://github.com/apache/rocketmq-dashboard/pull/5797
## What is the purpose of the change Restoring a metrics history entry whose profile no longer exists wiped the explorer state: `handleRestoreHistory` applied the entry's time range and closed the history dialog before checking whether the profile still exists, so the failed restore reset the current range selection and left the user outside the dialog with nothing restored. The range update and dialog close now happen only on paths that actually restore an entry, and the unavailable-profile path only shows the warning. ## Brief changelog - Move the range update and history dialog close in `handleRestoreHistory` below the removed-profile early return (and into the custom-entry branch), so a failed restore leaves the active query untouched. - Add a regression test that restores a history entry referencing a removed profile and asserts the range, the open dialog, and the query count stay unchanged. ## Verifying this change - `npx vitest run src/components/__tests__/MetricsExplorer.test.tsx -t "keeps the active query unchanged when history references a removed profile"` fails without the fix and passes with it. - `npx vitest run src/components/__tests__/MetricsExplorer.test.tsx`: all 36 tests pass. - `npx eslint` on the changed files and `npx tsc -b` both pass. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
