Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sql lab): Save Dataset Modal Autocomplete should display list when overwritting #20512

Merged
merged 9 commits into from
Jul 1, 2022

Conversation

Antonio-RiveroMartnez
Copy link
Member

@Antonio-RiveroMartnez Antonio-RiveroMartnez commented Jun 27, 2022

SUMMARY

  • Use our Select component as substitute of the Autocomplete one so options are loaded without the user having to trigger a search and also we are more consistent with the rest of the app
  • Changing datasetId to lowercase so when custom props get into the DOM we don't get warning related to invalid formatting
  • We extracted the dropdown out of the radio because it causes invalid click handling when an option is selected
  • Add getPopupContainer as prop for Select component

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
error

After:
test

TESTING INSTRUCTIONS

  1. In SQL Editor, enter valid query
  2. Result tab should show
  3. Click on Explore in Result tab
  4. Select overwrite existing and save & explore
  5. User should be able to see a list of virtual datasets to choose from to overwrite without typing

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

Copy link
Member

@stephenLYZ stephenLYZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Left some comments

@@ -139,7 +143,7 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
const handleOverwriteDataset = async () => {
await updateDataset(
query.dbId,
datasetToOverwrite.datasetId,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lower camel case naming makes sense, curious about the reason for the change here is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This custom prop gets into the DOM so react throws a warning for invalid format. That's why it was changed to all lowercase.

* Customize who the container node is.
* Parent node by default.
*/
getPopupContainer?: (triggerNode?: any) => any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the return should be HTMLElement

Copy link
Member Author

@Antonio-RiveroMartnez Antonio-RiveroMartnez Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I had it like that, but SelectFilterPlugin is also customizing such prop and I didn't want to impact other non-related component.

@codecov
Copy link

codecov bot commented Jun 29, 2022

Codecov Report

Merging #20512 (c0c78a5) into master (7f70de3) will increase coverage by 0.00%.
The diff coverage is 26.66%.

@@           Coverage Diff           @@
##           master   #20512   +/-   ##
=======================================
  Coverage   66.79%   66.79%           
=======================================
  Files        1754     1754           
  Lines       65561    65557    -4     
  Branches     6933     6933           
=======================================
- Hits        43793    43791    -2     
+ Misses      20014    20011    -3     
- Partials     1754     1755    +1     
Flag Coverage Δ
javascript 51.82% <26.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...c/filters/components/Select/SelectFilterPlugin.tsx 62.82% <0.00%> (-1.29%) ⬇️
...d/src/SqlLab/components/SaveDatasetModal/index.tsx 34.61% <25.00%> (+0.46%) ⬆️
superset-frontend/src/components/Select/Select.tsx 87.44% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f70de3...c0c78a5. Read the comment docs.

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rusackas
Copy link
Member

Just needs a rebase, and I'll happily merge :)

@jinghua-qa
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2022

@jinghua-qa Ephemeral environment spinning up at http://54.212.127.246:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

- Use our Select component as substitute of the Autocomplete one so options are loaded initially without the user having to trigger a search and we are mosre consistent with the rest of the app
- Changing datasetId to lowercase so when custom props get into the DOM we don't get warning related to invalid formatting
- We extracted the dropdown out of the radio because it causes invalid click handling when an option is selected
- Updated tests
- Update missing test for DatasourceControl
- Remove conditional from load options function since only guest users dont have userId, and if that is the case they wont reach this part of the application
- Remove unused comment
- Add getPopupContainer as prop for Select component
- Add tests for our new getPopupContainer prop in Select component. So if passed it gets called.
- use lowercased property when calling post form data
- Update tests so there is no need to define a null returning func
- Including getPopupContainer from PickedSelectProps instead
- Updating definition in SelectFilterPlugin
@rusackas rusackas merged commit 8a57a71 into apache:master Jul 1, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2022

Ephemeral environment shutdown and build artifacts deleted.

@michael-s-molina michael-s-molina changed the title fix(sql lab): Save Dataset Modal Autocomplete should display list when overwritting feat(sql lab): Save Dataset Modal Autocomplete should display list when overwritting Jul 6, 2022
@Antonio-RiveroMartnez Antonio-RiveroMartnez deleted the FIX-50967 branch July 8, 2022 12:19
jinghua-qa added a commit to preset-io/superset that referenced this pull request Jul 8, 2022
akshatsri pushed a commit to charan1314/superset that referenced this pull request Jul 19, 2022
…n overwritting (apache#20512)

* Save Dataset Modal:

- Use our Select component as substitute of the Autocomplete one so options are loaded initially without the user having to trigger a search and we are mosre consistent with the rest of the app
- Changing datasetId to lowercase so when custom props get into the DOM we don't get warning related to invalid formatting
- We extracted the dropdown out of the radio because it causes invalid click handling when an option is selected
- Updated tests

* Save Dataset Modal:

- Update missing test for DatasourceControl

* Save Dataset Modal:

- Remove conditional from load options function since only guest users dont have userId, and if that is the case they wont reach this part of the application

* Save Dataset Modal:

- Remove unused comment

* Save Dataset Modal:

- Add getPopupContainer as prop for Select component

* Save Dataset Modal:

- Add tests for our new getPopupContainer prop in Select component. So if passed it gets called.

* Save Dataset Modal:

- use lowercased property when calling post form data

* Save Dataset Modal:

- Update tests so there is no need to define a null returning func

* Save Dataset Modal:

- Including getPopupContainer from PickedSelectProps instead
- Updating definition in SelectFilterPlugin
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants