yousoph opened a new pull request, #40929:
URL: https://github.com/apache/superset/pull/40929

   ### SUMMARY
   
   Dashboards opened with a legacy `?native_filters=` Rison URL (e.g. from a 
bookmark or shared link generated before April 2021) would correctly apply 
filter values to chart queries but the filter panel UI showed no active filter 
state — filters appeared unset even though data was filtered.
   
   **Root cause:** PR #13983 renamed the per-filter state key from 
`currentState` to `filterState` in the DataMask schema. Old-format URLs still 
encode the value under `currentState`, but the filter panel UI reads only 
`filterState`. When the legacy Rison blob was passed directly to 
`hydrateDashboard`, `fillNativeFilters` spread `currentState` into the dataMask 
entry as an unknown key while leaving `filterState` empty, so charts filtered 
correctly (they consume `extraFormData`) but the filter panel showed nothing 
active.
   
   **Fix:** In `DashboardPage.tsx`, when the legacy `?native_filters=` URL 
param is present, normalize each filter entry in the decoded Rison object: if 
`currentState` is present but `filterState` is absent, copy `currentState` into 
`filterState` before passing to `hydrateDashboard`. Modern `filterState` 
entries are passed through unchanged.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — the fix is in data flow, not visual layout. Filter panel indicator 
dots are now visible when loading a legacy-format `native_filters` URL.
   
   ### TESTING INSTRUCTIONS
   
   1. Find or create a dashboard with at least one native filter.
   2. Manually construct a legacy-format URL:
      ```
      
/superset/dashboard/<id>/?native_filters=(NATIVE_FILTER-<id>:(extraFormData:(filters:!((col:region,op:IN,val:!(California)))),currentState:(value:!(California))))
      ```
   3. **Before fix:** charts are filtered (data shows only California) but the 
filter panel shows no active state.
   4. **After fix:** both charts and the filter panel reflect the active filter.
   
   Alternatively, run the unit tests:
   ```bash
   cd superset-frontend
   npm run test -- src/dashboard/containers/DashboardPage.test.tsx
   ```
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to