feat: allow many-to-one region mapping and multi-territory drill-down - #1243
feat: allow many-to-one region mapping and multi-territory drill-down#1243AdnanQuazi wants to merge 2 commits into
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
Confidence Score: 5/5Change is safe to merge; the fresh-query pattern in getDrillDownQuery makes the in-place filter mutation side-effect-free, and the logic correctly handles single- and multi-territory regions. The filter mutation targets a freshly-created query object each time, the rawValues Set correctly de-duplicates and accumulates territories under a shared mapped region, and the !mutated guard prevents returning a stale single-territory query when the filter structure doesn't match expectations. No files require special attention. Reviews (2): Last reviewed commit: "fix: return null when no matching filter..." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1243 +/- ##
===========================================
- Coverage 47.91% 47.70% -0.22%
===========================================
Files 76 76
Lines 5998 6002 +4
===========================================
- Hits 2874 2863 -11
- Misses 3124 3139 +15
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Overview
Resolves an issue where users could only map a single territory to a target region on Map charts (e.g., mapping
South India -> Indiablocked mappingNorth India -> IndiaorWest India -> India). Previously, mapping multiple territories resulted in region selection disappearing from the UI, and the map click index overwritten previous mappings so drill-down only queried the last-mapped territory (WHERE territory = 'West India').This PR removes the 1-to-1 UI restriction and updates the map chart indexing engine (
locationRowIndex) to accumulate all matching raw values. When a map polygon with multiple mapped territories is clicked, the drill-down query dynamically upgrades the exact-match (=) filter to aninfilter matching against the raw schema column name (WHERE territory IN ('South India', 'North India', 'West India')).Key Changes
RegionMappingDialog.vue): RemovedusedRegionsrestriction ingetOptions()so users can select and map multiple dataset locations/territories to the same target map region.ChartRenderer.vue): UpdatedlocationRowIndexfrom single-row overwriting to storing{ firstRow, rawValues: Set<string> }per map region. UpdatedhandleMapChartClickto upgrade the drill-down query's dimension filter from=toinusing the stable schema column (mapConfig.location_column.column_name) when multiple raw values resolve to the clicked map region.Closes #1085