🐛 Fix missing isRefreshing in NamespaceRBAC card#4005
Conversation
Destructure isRefreshing from useClusters, useCachedNamespaces, useCachedK8sRoles, useCachedK8sRoleBindings, and useCachedK8sServiceAccounts hooks and pass the combined value to useCardLoadingState. Also add RefreshIndicator to the card header so users see a visual indicator when data is being refreshed. Fixes #4003 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @clubanderson — thanks for opening this PR!
This is an automated message. |
There was a problem hiding this comment.
Pull request overview
This PR updates the NamespaceRBAC card to properly surface background refresh activity from its data hooks, enabling the CardWrapper refresh animation and adding an in-header refresh indicator.
Changes:
- Destructures
isRefreshingfromuseClustersand the cached RBAC-related hooks. - Combines refresh states and passes
isRefreshingintouseCardLoadingStatefor CardWrapper refresh styling. - Adds a
RefreshIndicatorin the card header to visually indicate background updates.
| </StatusBadge> | ||
| <RefreshIndicator | ||
| isRefreshing={isRefreshing} | ||
| size="sm" |
There was a problem hiding this comment.
RefreshIndicator is rendered without lastUpdated, so when not refreshing it will display the default "pending" label and "Not yet updated" tooltip/aria-label indefinitely. Consider deriving a lastUpdated value from the hooks’ lastRefresh/lastUpdated (e.g., max timestamp across clusters/namespaces/roles/bindings/SAs) and pass it in, or set showLabel={false} if you only want the spinner without the status text.
| size="sm" | |
| size="sm" | |
| showLabel={false} |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
🔄 Auto-Applying Copilot Code ReviewCopilot code review found 1 code suggestion(s) and 0 general comment(s). @copilot Please apply all of the following code review suggestions:
Push all fixes in a single commit. Run Auto-generated by copilot-review-apply workflow. |
Summary
isRefreshingfrom all data hooks (useClusters,useCachedNamespaces,useCachedK8sRoles,useCachedK8sRoleBindings,useCachedK8sServiceAccounts)isRefreshingvalues and pass touseCardLoadingStateso CardWrapper can show refresh animationRefreshIndicatorcomponent to the card header for visual refresh feedbackFixes #4003
Test plan
isRefreshingand triggers its refresh border animationnpm run build)