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(SqlLab): Change Save Dataset Button to Split Save Query Button III #234

Conversation

lyndsiWilliams
Copy link

SUMMARY

This changes the current save query button into a split save button if the database has "Allow this database to be explored" enabled. When the user clicks the caret section of the button, they can now save the query as a dataset.

Bonus: In order to create this button, I conveniently needed to fix the styling on the "Run" query split button. The split line now goes all the way through the button and the caret is centered.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE:

saveButtonBefore
runButtonBefore

AFTER:

splitSaveButtonAfter
saveButtonAfter
runButtonAfter

TESTING INSTRUCTIONS

  • From SqlLab, open a query for a database that has "Allow this database to be explored" enabled.
    • Observe the new split save button
      • Click the "Save" section of the button to see the save query modal
      • Click the caret v section of the button, then click "Save dataset" to see the save dataset modal
      • Both of these modals should be fully functional
  • From SqlLab, open a query for a database that does NOT have "Allow this database to be explored" enabled.
    • Observe that the save button is a normal button, not split
      • Clicking this button should show the save query modal

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

hughhhh and others added 30 commits June 6, 2022 15:09
> columns are loading into page
…ype is Query [41493]

Initial commit to add ability for the a Query Preview Modal to be available when the data source type is Query and not Dataset
Converted ModalTrigger to a functional TypeScript component
> allow for all records to be displayed
> fix select with all columns queries
> filters are now working
…view-modal-for-chart-source-query

feat: Ericbriscoe/sc 41493/query preview modal for chart source query
…set, adds default metric when chart source is query
… datasource

A follow on separate effort will enable having a default Count metric when Query is the datasource type
@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2022

Codecov Report

Merging #234 (a98538a) into chart-power-query (3f6fa0a) will increase coverage by 0.03%.
The diff coverage is 84.61%.

@@                  Coverage Diff                  @@
##           chart-power-query     #234      +/-   ##
=====================================================
+ Coverage              66.35%   66.39%   +0.03%     
=====================================================
  Files                   1757     1758       +1     
  Lines                  66624    66629       +5     
  Branches                7045     7046       +1     
=====================================================
+ Hits                   44211    44238      +27     
+ Misses                 20614    20598      -16     
+ Partials                1799     1793       -6     
Flag Coverage Δ
hive 53.20% <ø> (ø)
javascript 52.00% <84.61%> (+0.07%) ⬆️
mysql 81.16% <ø> (ø)
postgres 81.23% <ø> (ø)
presto 53.07% <ø> (ø)
python 81.65% <ø> (ø)
sqlite 81.02% <ø> (ø)
unit 50.33% <ø> (ø)

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

Impacted Files Coverage Δ
...frontend/src/SqlLab/components/ResultSet/index.tsx 52.89% <ø> (ø)
...frontend/src/SqlLab/components/SqlEditor/index.jsx 51.36% <0.00%> (ø)
...d/src/SqlLab/components/TabbedSqlEditors/index.jsx 56.11% <ø> (ø)
superset-frontend/src/SqlLab/fixtures.ts 100.00% <ø> (ø)
...et-frontend/src/SqlLab/reducers/getInitialState.js 46.42% <ø> (ø)
superset-frontend/src/SqlLab/reducers/sqlLab.js 32.62% <ø> (ø)
superset-frontend/src/SqlLab/types.ts 57.14% <ø> (ø)
superset-frontend/src/SqlLab/actions/sqlLab.js 60.22% <66.66%> (ø)
...frontend/src/SqlLab/components/SaveQuery/index.tsx 75.00% <91.66%> (+17.10%) ⬆️
...c/SqlLab/components/RunQueryActionButton/index.tsx 53.12% <100.00%> (ø)
... and 7 more

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 3f6fa0a...a98538a. Read the comment docs.

@hughhhh hughhhh force-pushed the chart-power-query branch 2 times, most recently from 2a57a4f to 555d26b Compare July 15, 2022 00:55
@hughhhh hughhhh changed the base branch from chart-power-query to master July 22, 2022 17:20
@lyndsiWilliams
Copy link
Author

Continued in this PR: apache#20852

@lyndsiWilliams lyndsiWilliams deleted the lyndsi/sql-lab-new-explore-button-functionality-and-move-save-dataset-to-split-save-button branch July 28, 2022 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants