[Customer Portal][Webapp] Enable multi-select for severity and deployment filters on dashboard cases table - #783
Conversation
…ployment filters on dashboard
📝 WalkthroughWalkthroughThe pull request updates the cases table filtering mechanism to support plural array-based filter fields for severities and deployments. The type definition is updated to use ChangesMulti-select filter pluralization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesTable.tsx (1)
111-116:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winHide deployment filters consistently when
includeDeploymentFilteris off.Line 115 still clears the removed
deploymentIdkey. If a deployment was already selected, Lines 207-210 will keep sending the hiddendeploymentIdsto the API, and Line 314 will still count that hidden filter as active.Suggested fix
const effectiveFilters: CasesTableFilterValues = useMemo( () => includeDeploymentFilter ? filters - : { ...filters, deploymentId: undefined }, + : { ...filters, deploymentIds: undefined }, [filters, includeDeploymentFilter], ); @@ - const activeFiltersCount = countCasesTableActiveFilters(filters); + const activeFiltersCount = countCasesTableActiveFilters(effectiveFilters);Also applies to: 207-210, 314-314
🤖 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 `@apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesTable.tsx` around lines 111 - 116, The code still sends and counts a hidden deploymentId because parts of the component use the original filters instead of the computed effectiveFilters; update all places that build the API request payload and the active-filter count to use effectiveFilters (or explicitly omit deploymentId when includeDeploymentFilter is false) so deploymentId is removed from the outgoing query and not counted as an active filter; specifically, ensure the API request construction (where filters are sent) and the active-filters calculation reference effectiveFilters (and/or perform a conditional delete of deploymentId when includeDeploymentFilter === false) rather than the raw filters variable.
🤖 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.
Outside diff comments:
In
`@apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesTable.tsx`:
- Around line 111-116: The code still sends and counts a hidden deploymentId
because parts of the component use the original filters instead of the computed
effectiveFilters; update all places that build the API request payload and the
active-filter count to use effectiveFilters (or explicitly omit deploymentId
when includeDeploymentFilter is false) so deploymentId is removed from the
outgoing query and not counted as an active filter; specifically, ensure the API
request construction (where filters are sent) and the active-filters calculation
reference effectiveFilters (and/or perform a conditional delete of deploymentId
when includeDeploymentFilter === false) rather than the raw filters variable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3bc5f1ee-6ff2-4107-9a06-f9559e134082
📒 Files selected for processing (2)
apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesTable.tsxapps/customer-portal/webapp/src/features/dashboard/types/casesTable.ts
Purpose
Summary by CodeRabbit
Release Notes