You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "jfrag1 (via GitHub)" <gi...@apache.org> on 2023/11/15 19:15:57 UTC

[PR] fix: Make Select component fire onChange listener when a selection is pasted in [superset]

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

   <!---
   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 -->
   Currently, pasting a value into a `Select` does not trigger the `onChange` callback passed to the `Select`.  This resulted in a buggy experience when pasting values into the adhoc filter select component, as demonstrated below.  It's possible similar issues exist in other areas of the application which this change will also fix.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   ### Before:
   ![adhoc_paste_before](https://github.com/apache/superset/assets/47196419/88c1e868-4081-4bce-984d-a41ff286b374)
   
   
   ### After:
   ![adhoc_paste_after](https://github.com/apache/superset/assets/47196419/a41b64a9-7e7e-42fd-b369-c400ded986cf)
   
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] 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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix: Make Select component fire onChange listener when a selection is pasted in [superset]

Posted by "jfrag1 (via GitHub)" <gi...@apache.org>.
jfrag1 commented on PR #25993:
URL: https://github.com/apache/superset/pull/25993#issuecomment-1813251286

   Added


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix: Make Select component fire onChange listener when a selection is pasted in [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on PR #25993:
URL: https://github.com/apache/superset/pull/25993#issuecomment-1813120552

   Thanks for the fix @jfrag1. Could you also add the fix/test to the async version?


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix: Make Select component fire onChange listener when a selection is pasted in [superset]

Posted by "jfrag1 (via GitHub)" <gi...@apache.org>.
jfrag1 commented on code in PR #25993:
URL: https://github.com/apache/superset/pull/25993#discussion_r1394670362


##########
superset-frontend/src/components/Select/Select.test.tsx:
##########
@@ -985,6 +985,20 @@ test('fires onChange when clearing the selection in multiple mode', async () =>
   expect(onChange).toHaveBeenCalledTimes(1);
 });
 
+test('fires onChange when pasting a selection', async () => {

Review Comment:
   This test fails without the fix



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix: Make Select component fire onChange listener when a selection is pasted in [superset]

Posted by "Antonio-RiveroMartnez (via GitHub)" <gi...@apache.org>.
Antonio-RiveroMartnez merged PR #25993:
URL: https://github.com/apache/superset/pull/25993


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org