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(welcome): add SQL snippets to saved queries card #11678

Merged
merged 12 commits into from
Nov 30, 2020

Conversation

pkdotson
Copy link
Member

@pkdotson pkdotson commented Nov 12, 2020

SUMMARY

This Pr update the savedqueries card to the new proposed layout on welcome page. Also, updated media queries to keep text from expanding the cards to weird widths.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
Screen Shot 2020-11-12 at 1 55 56 PM

After:
Screen Shot 2020-11-16 at 12 00 18 PM

TEST PLAN

ADDITIONAL INFORMATION

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

@pkdotson pkdotson closed this Nov 12, 2020
@pkdotson pkdotson reopened this Nov 12, 2020
@pkdotson pkdotson marked this pull request as draft November 12, 2020 22:04
@nytai
Copy link
Member

nytai commented Nov 12, 2020

FYI, I discovered #11679 while testing this. You'll want to handle the null case in this PR too

@nytai
Copy link
Member

nytai commented Nov 12, 2020

Screen Shot 2020-11-12 at 12 36 28 PM

Also, it looks card size changes based on the content. I'm not sure whether this is desirable or not. I just worked on query history page added a truncation function you might be interested in

https://github.com/apache/incubator-superset/blob/432e5ab4607fe4743562101336c63dcfd18b0867/superset-frontend/src/views/CRUD/data/query/QueryList.tsx#L52

@pkdotson pkdotson force-pushed the phillip/saved-queries-card-fix branch from 4fb8811 to 9c67b4f Compare November 13, 2020 17:19
@codecov-io
Copy link

codecov-io commented Nov 13, 2020

Codecov Report

Merging #11678 (483821f) into master (84c8a62) will decrease coverage by 0.32%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11678      +/-   ##
==========================================
- Coverage   63.54%   63.22%   -0.33%     
==========================================
  Files         915      916       +1     
  Lines       44358    44476     +118     
  Branches     4221     4228       +7     
==========================================
- Hits        28189    28120      -69     
- Misses      15990    16177     +187     
  Partials      179      179              
Flag Coverage Δ
javascript 62.94% <77.77%> (-0.02%) ⬇️
python 63.38% <ø> (-0.51%) ⬇️

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

Impacted Files Coverage Δ
...set-frontend/src/components/ListViewCard/index.tsx 94.54% <ø> (ø)
superset-frontend/src/views/CRUD/utils.tsx 48.88% <60.00%> (+0.10%) ⬆️
...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx 62.88% <80.00%> (+3.58%) ⬆️
...t-frontend/src/views/CRUD/data/query/QueryList.tsx 72.72% <100.00%> (+0.34%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-85.72%) ⬇️
superset/db_engine_specs/hive.py 54.08% <0.00%> (-29.97%) ⬇️
superset/db_engine_specs/presto.py 69.76% <0.00%> (-12.53%) ⬇️
superset-frontend/src/utils/hostNamesConfig.js 33.33% <0.00%> (-4.17%) ⬇️
superset-frontend/src/featureFlags.ts 86.36% <0.00%> (-3.64%) ⬇️
superset/examples/world_bank.py 97.10% <0.00%> (-2.90%) ⬇️
... and 34 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 84c8a62...483821f. Read the comment docs.

@pkdotson pkdotson force-pushed the phillip/saved-queries-card-fix branch from e4abfde to 52c093b Compare November 16, 2020 19:40
@pkdotson pkdotson marked this pull request as ready for review November 16, 2020 20:00
@junlincc junlincc added rush! Requires immediate attention and removed rush! Requires immediate attention labels Nov 16, 2020
@junlincc
Copy link
Member

adding tooltip for long title display on hover. don't merge yet @rusackas

@junlincc
Copy link
Member

junlincc commented Nov 18, 2020

Screen Shot 2020-11-17 at 10 04 09 PM

just checked out this branch

  1. can we get rid of the default Note in the query card?
  2. what is "3"? it's not part of the query
  3. add tooltip to show entire title

@pkdotson pkdotson force-pushed the phillip/saved-queries-card-fix branch from 2d5c4df to f717b71 Compare November 24, 2020 00:09
@junlincc
Copy link
Member

junlincc commented Nov 24, 2020

Screen Shot 2020-11-23 at 7 55 44 PM

Screen Shot 2020-11-23 at 7 56 32 PM

LGTM, @rusackas let's merge! tooltip will come from a separate PR

@junlincc junlincc requested review from junlincc and removed request for nytai November 24, 2020 03:57
@ktmud ktmud changed the title chore: update savedqueries card to new layout feat(welcome): add SQL snippets to saved queries card Nov 24, 2020
const QueryContainer = styled.div`
pre {
height: ${({ theme }) => theme.gridUnit * 40}px;
border: none !important;
Copy link
Member

Choose a reason for hiding this comment

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

Ping me when you have a chance, we can pair up and see if there's a better selector to remove the need for !important here.

@pkdotson pkdotson requested a review from ktmud November 25, 2020 01:35
@pkdotson pkdotson force-pushed the phillip/saved-queries-card-fix branch from 301975c to d611270 Compare November 25, 2020 15:41
.ant-card-cover {
border-bottom: 1px solid ${({ theme }) => theme.colors.grayscale.light2};
& > div {
height: 171px;
Copy link
Member

Choose a reason for hiding this comment

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

This can be an experiment for another PR, but if this card is basically a text box, we may be able to base its height on the number of lines set elsewhere in the JS. That is, if line-height is pulled from the Theme variables, the height could be numLines * lineHeight. Anyway, something to fiddle with to make this a little more dynamic.

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.

Lookin' good to me, just one little nit to fix (I made a code suggestion)

Co-authored-by: Evan Rusackas <evan@preset.io>
@rusackas rusackas merged commit 0e9898c into apache:master Nov 30, 2020
@rusackas rusackas deleted the phillip/saved-queries-card-fix branch November 30, 2020 19:53
@junlincc
Copy link
Member

#11659

@junlincc junlincc added the rush! Requires immediate attention label Nov 30, 2020
@junlincc junlincc removed the rush! Requires immediate attention label Mar 18, 2021
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.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 size/L 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants