fix(AsyncSelect): call fireOnChange() only when past actually updates…#39298
fix(AsyncSelect): call fireOnChange() only when past actually updates…#39298JCelento wants to merge 7 commits intoapache:masterfrom
Conversation
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
Outdated
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (99.81%) is below the target coverage (100.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #39298 +/- ##
=======================================
Coverage 64.41% 64.42%
=======================================
Files 2554 2554
Lines 132660 132667 +7
Branches 30778 30780 +2
=======================================
+ Hits 85459 85466 +7
Misses 45715 45715
Partials 1486 1486
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code Review Agent Run #42db95Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
Outdated
Show resolved
Hide resolved
Code Review Agent Run #d53417Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
52e3b57 to
6d97c75
Compare
…s/Select/AsyncSelect.tsx Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
7196f5b to
fd8f980
Compare
Code Review Agent Run #adf21dActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
AsyncSelectpaste:onChangeis only fired when paste actually changes the value. In single mode, pasting a value equal to the current selection no longer triggersonChange. In multiple mode, building the next value fromselectValueRefavoids stale closures; pasting only tokens that are already selected does not update state or callonChange. Unit tests cover paste, deduplication, and the no-oponChangecase for multiple modes.Alerts / reports (
AlertReportModal): The Chart field usesallowClearso the selection can be cleared from the UI.getChartVisualizationTypereturns early when the chart value is missing or invalid so/api/v1/chart/:idis not called with bad input after clear. Adds a test that clearing the chart drives the expected empty state.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE
AFTER
TESTING INSTRUCTIONS
Unit tests:
cd superset-frontend && npm run test -- packages/superset-ui-core/src/components/Select/AsyncSelect.test.tsxnpm run test -- src/features/alerts/AlertReportModal.test.tsx(or full suite as you prefer).Manual :
Expected results:
The pasted text should be used to search and filter the list of available charts, the same way typing works.
ADDITIONAL INFORMATION