CoffeeWriter opened a new pull request, #36083: URL: https://github.com/apache/superset/pull/36083
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY <!--- Describe the change below, including rationale and design decisions --> For client-side pagination, the search filter stays on the client, so totals must be recalculated locally. Add a useEffect in DataTable.tsx to detect changes in displayed rows, compute new totals, and notify the parent using a callback passed from TableChart.tsx. For server-side pagination, totals currently ignore search text because the search filter is added after the totals query is built. Move the search-filter injection in buildQuery.ts to the point where queryObject.filter is created, before it is passed to extraQueries, so totals are calculated with the same filtered dataset. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> Before: (client-side pagination) <img width="900" height="493" alt="image" src="https://github.com/user-attachments/assets/72faa577-75bb-44b3-aa81-33b18eb54f5f" /> (server-side pagination) <img width="907" height="487" alt="image" src="https://github.com/user-attachments/assets/a569328c-40df-4fcb-9774-3848e3f5016e" /> After: (client-side pagination) <img width="1440" height="778" alt="image" src="https://github.com/user-attachments/assets/d4290810-7b14-4cc9-af88-02a7ed132ea9" /> (server-side pagination) <img width="1440" height="779" alt="image" src="https://github.com/user-attachments/assets/5e10b031-4887-41bf-8802-27c43f5d449e" /> ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> 1. Go to superset-frontend `cd superset-frontend` 2. Run these two commands `npm run test ./plugins/plugin-chart-table/test/TableChart.test.tsx` `npm run test ./plugins/plugin-chart-table/test/buildQuery.test.ts` ※ If you want to test manually 1. Go to a Table that has a Search bar and Show Summary enabled (we used the "birth_name" dataset above) 2. Populate the table 3. Perform a search using the search bar for specific values within the table. 4. Observe that the table adjusts to show only the rows matching the search criteria. 5. Check the "Show Summary" calculation displayed at the bottom of the numerical column. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [x] Has associated issue: https://github.com/apache/superset/issues/28318 - [ ] 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]
