Closed warjiang closed 2 months ago
/assign @RainbowMango @samzong
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: RainbowMango
The full list of commands accepted by this bot can be found here.
The pull request process is described here
What type of PR is this? /kind bug
What this PR does / why we need it: When we introduce the i18n feature for dashboard, it would cause the empty breadcrumbs. Comparison as following: before:
after:
The reason is that
useMatches
only load once, and after that, even if the global route object refreshed, theuseMatches
hooks will not return the latestmatches
object. https://github.com/karmada-io/dashboard/blob/650ef60ee15a29576702c45d518826d00bf23b59/ui/apps/dashboard/src/components/panel/index.tsx#L21 What I do is to traverse the global route object again, and get the sidebarName from the matched route entry.Which issue(s) this PR fixes: Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: