chore: Discarding environment query params on Summary view BED-8766 #2947
chore: Discarding environment query params on Summary view BED-8766 #2947LucasParraF wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdates ChangesTab Navigation Update
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx (1)
156-159: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider adding a test for this branch.
No test currently covers the new conditional
discardQueryParamsfor the zones/labels tab switch. Since this determines whether query params are silently dropped or preserved depending onisSummaryPage, a regression here would be easy to miss.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx` around lines 156 - 159, Add a test that covers the labelsPath branch in PrivilegeZones.tsx and verifies the discardQueryParams behavior when switching tabs. Focus on the navigate call inside the switch case for labelsPath, and assert that isSummaryPage/summaryPath causes discardQueryParams to be set for the summary tab while it is not set for the other tab, so query params are preserved correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx`:
- Around line 156-159: Add a test that covers the labelsPath branch in
PrivilegeZones.tsx and verifies the discardQueryParams behavior when switching
tabs. Focus on the navigate call inside the switch case for labelsPath, and
assert that isSummaryPage/summaryPath causes discardQueryParams to be set for
the summary tab while it is not set for the other tab, so query params are
preserved correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 5ece032c-0480-431d-a37e-de2f0bfc0f78
📒 Files selected for processing (1)
packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx
|
LGTM |
Description
On the Privilege Zones page, there was a discrepancy between the displayed objects and the total count when an environment was selected.
This issue occurred because the object count request continued to include the environmentId parameter from the Details view, causing the Summary view to display counts for the previously selected environment instead of the current context.
Motivation and Context
Resolves BED-8766
How Has This Been Tested?
Tested locally
Screenshots (optional):
Types of changes
Checklist:
Summary by CodeRabbit
Summary by CodeRabbit