-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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(sql Lab tabs): Empty SQL Lab tabs #18817
Conversation
a7bf598
to
7438bce
Compare
/testenv up |
@eschutho Ephemeral environment spinning up at http://34.211.67.82:8080. Credentials are |
const emptyTab = ( | ||
<EditableTabs.TabPane | ||
key={Math.random()} | ||
data-key={Math.random()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to have these key
and data-key
set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was worried about hardcoding a number, but I think that you are right and that this would be the ebst way forward.
closable={false} | ||
> | ||
<StyledImage> | ||
<img src={emptySqlChart} alt="No SQL tabs" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you write a small test making sure this renders when this.props.queryEditors?.length === 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do rn
Codecov Report
@@ Coverage Diff @@
## master #18817 +/- ##
==========================================
+ Coverage 66.19% 66.21% +0.02%
==========================================
Files 1633 1633
Lines 63210 63218 +8
Branches 6409 6412 +3
==========================================
+ Hits 41839 41858 +19
+ Misses 19711 19699 -12
- Partials 1660 1661 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can we update the tab height in the blank state so that it doesn't jump when you add a new tab?
- The image on the blank state looks blurry to me right now, do you mind taking a look?
Thanks for working on this @AAfghahi! I pinged @kgabryje for a review; He's done similar work by introducing a new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @AAfghahi! 3 comments:
- Can you please use 1 of the components from
src/components/EmptyState
? I thinkEmptyStateBig
will fit well here. - I'd suggest using svg instead of png. If you add the image to
/superset-frontend/src/assets/images/
, you can just pass the name of the file to the empty state component. - Please export from figma just the image, without the text.
EmptyState
acceptstitle
anddescription
props
So you can add the empty state component like this:
<EmptyStateBig
title={t('Add a new tab to create SQL query')}
image="image-name.svg"
/>
<EditableTabs.TabPane | ||
key={0} | ||
data-key={0} | ||
tab={<TabTitle>Add a New Tab</TabTitle>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tab={<TabTitle>Add a New Tab</TabTitle>} | |
tab={<TabTitle>{t('Add a New Tab')}</TabTitle>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think we should use sentence case here, like Add a new tab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this and the empty state, implemented them, just working on the last bit (making the tabs the right height).
62809d9
to
a11d409
Compare
a11d409
to
a4755d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a4755d0
to
953a53a
Compare
/testenv up FEATURE_SQLLAB_BACKEND_PERSISTENCE=True |
@AAfghahi Ephemeral environment spinning up at http://34.210.152.193:8080. Credentials are |
0b8d956
to
801e499
Compare
801e499
to
01d1199
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Ephemeral environment shutdown and build artifacts deleted. |
* Empty SQL table message on zero tabs * sql editor no editor tab bug fix * Revert Error message * empty state tab state * added a unit test * addressed reviews * kasia feedback Co-authored-by: Yahya Kayani <yahyakiani1@gmail.com> (cherry picked from commit 147dc5a)
SUMMARY
This PR finishes the work that was done in #17700 by adding a new tab if a user exits out of their current tabs.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
Screen.Recording.2022-02-18.at.3.49.05.PM.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION