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

fix(sqllab): per-tab hide left bar #13288

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Conversation

betodealmeida
Copy link
Member

SUMMARY

Currently the state of whether we should show the left bar in SQL Lab is global, not per tab. Since this is configured separately in each tab menu, it makes sense to track the state individually.

This PR moves the state of the left bar to the query editor, using the redux store to toggle its display. If the SQLLAB_BACKEND_PERSISTENCE is enabled the visibility is stored on the backend as well.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TEST PLAN

  1. SQLLAB_BACKEND_PERSISTENCE set to off.
  2. Created a few tabs, changed their visibility, verified that visibility is defined per tabs and persists on page refresh.
  3. Turn SQLLAB_BACKEND_PERSISTENCE on, reload SQL Lab, verified that tabs' state was migrated to the backend.
  4. Toggle visibility, verified state is persisted in the backend and loaded correctly on page refresh and tab switch.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

Comment on lines +713 to +715
const leftBarStateClass = this.props.hideLeftBar
? 'schemaPane-exit-done'
: 'schemaPane-enter-done';
Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like there's a bug in the library: reactjs/react-transition-group#643

Without this, if this.props.hideLeftBar was initially set to true the bar wouldn't hide on page load.

@betodealmeida betodealmeida added the risk:db-migration PRs that require a DB migration label Feb 22, 2021
@betodealmeida betodealmeida changed the title fix (sqllab): per-tab hide left bar fix(sqllab): per-tab hide left bar Feb 22, 2021
@codecov-io
Copy link

codecov-io commented Feb 22, 2021

Codecov Report

Merging #13288 (525f394) into master (e8d5035) will increase coverage by 10.45%.
The diff coverage is 72.72%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #13288       +/-   ##
===========================================
+ Coverage   69.48%   79.93%   +10.45%     
===========================================
  Files        1050      298      -752     
  Lines       49755    24285    -25470     
  Branches     5322        0     -5322     
===========================================
- Hits        34571    19413    -15158     
+ Misses      15059     4872    -10187     
+ Partials      125        0      -125     
Flag Coverage Δ
cypress ?
javascript ?
python 79.93% <72.72%> (+12.56%) ⬆️

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

Impacted Files Coverage Δ
superset/app.py 81.36% <ø> (ø)
superset/views/sql_lab.py 60.68% <ø> (ø)
superset/viz.py 56.32% <0.00%> (-0.16%) ⬇️
superset/db_engine_specs/base.py 79.95% <100.00%> (-6.15%) ⬇️
superset/db_engine_specs/hive.py 90.76% <100.00%> (ø)
superset/db_engine_specs/presto.py 82.47% <100.00%> (-5.41%) ⬇️
superset/models/core.py 85.01% <100.00%> (-3.88%) ⬇️
superset/models/sql_lab.py 91.21% <100.00%> (+0.05%) ⬆️
superset/views/core.py 71.80% <100.00%> (-3.58%) ⬇️
superset/sql_validators/postgres.py 50.00% <0.00%> (-50.00%) ⬇️
... and 753 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 a646914...525f394. Read the comment docs.

@hughhhh hughhhh self-requested a review February 22, 2021 22:04
@betodealmeida betodealmeida merged commit 8d48d2e into apache:master Mar 5, 2021
@ktmud
Copy link
Member

ktmud commented Mar 5, 2021

@betodealmeida @hughhhh There seems to be a merge conflict in db-migration: https://github.com/apache/superset/runs/2042369464

allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
* fix (sqllab): per-tab hide left bar

* Load state when switching tabs
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 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 risk:db-migration PRs that require a DB migration size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants