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(explore): Implement data table empty states #18679

Merged
merged 2 commits into from Feb 14, 2022

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Feb 11, 2022

SUMMARY

This PR implements chart empty states for 3 scenarios:

  1. Not all required controls have values
  2. Query returned no results
  3. No samples were retrieved for dataset

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

image

image

image

TESTING INSTRUCTIONS

  1. Create a chart
  2. Run a query that returns 0 results (for example set time range for last 5 minutes)
  3. Remove required controls

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

CC @kasiazjc

https://app.shortcut.com/preset/story/36403/explore-empty-states

@kgabryje kgabryje changed the title Feat/data table empty state feat(explore): Implement data table empty states Feb 11, 2022
@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

Merging #18679 (5e09e0c) into master (a7d505d) will increase coverage by 0.08%.
The diff coverage is 68.42%.

❗ Current head 5e09e0c differs from pull request most recent head b0b80ab. Consider uploading reports for the commit b0b80ab to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18679      +/-   ##
==========================================
+ Coverage   66.25%   66.34%   +0.08%     
==========================================
  Files        1604     1619      +15     
  Lines       62807    62941     +134     
  Branches     6333     6343      +10     
==========================================
+ Hits        41613    41756     +143     
+ Misses      19542    19533       -9     
  Partials     1652     1652              
Flag Coverage Δ
javascript 51.32% <68.42%> (+0.11%) ⬆️

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

Impacted Files Coverage Δ
superset-frontend/src/embedded/index.tsx 0.00% <0.00%> (ø)
...nd/src/explore/components/DataTablesPane/index.tsx 73.68% <0.00%> (-1.59%) ⬇️
...rontend/src/visualizations/TimeTable/TimeTable.jsx 0.00% <0.00%> (ø)
superset/db_engine_specs/trino.py 70.79% <ø> (+0.26%) ⬆️
superset/utils/pandas_postprocessing/__init__.py 100.00% <ø> (ø)
superset/utils/pandas_postprocessing/aggregate.py 90.90% <ø> (ø)
superset/utils/pandas_postprocessing/boxplot.py 100.00% <ø> (ø)
superset/utils/pandas_postprocessing/compare.py 88.88% <ø> (ø)
...perset/utils/pandas_postprocessing/contribution.py 100.00% <ø> (ø)
superset/utils/pandas_postprocessing/cum.py 100.00% <ø> (ø)
... and 12 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 a7d505d...b0b80ab. Read the comment docs.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Two translation comments, other than that LGTM

return (
<EmptyStateMedium
image="document.svg"
title={t(`No ${type} were returned for this query`)}
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to translate this like this:

Suggested change
title={t(`No ${type} were returned for this query`)}
title={t(`No %s were returned for this query`, type)}

Copy link
Member

Choose a reason for hiding this comment

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

Actually, we probably need to translate these like this to make sure the translators have the necessary context to fully translate the type strings:

if (type === 'sample') {
  return t(`No samples were returned for this query`)
}
if (type === 'result') {
  return t(`No results were returned for this query`)
}

I think this getting this right is pretty important, as these will be very visible fixtures in the application.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

return (
<EmptyStateMedium
image="document.svg"
title={t(`Run a query to display ${type}`)}
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@kgabryje kgabryje merged commit 42d97fb into apache:master Feb 14, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.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/S 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants