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

refactor: useListViewResource hook for charts, dashboards, datasets #10680

Merged
merged 13 commits into from
Aug 26, 2020

Conversation

nytai
Copy link
Member

@nytai nytai commented Aug 26, 2020

SUMMARY

  • converts DashboardList and ChartList to a function components
  • extracts out common list view code into a useListViewResource hook

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TEST PLAN

  • CI, functionality is unchanged

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

@nytai
Copy link
Member Author

nytai commented Aug 26, 2020

oops

@nytai nytai reopened this Aug 26, 2020
@nytai nytai force-pushed the tai/listview-hooks branch 2 times, most recently from a60d947 to b189dc9 Compare August 26, 2020 19:22
@nytai nytai marked this pull request as ready for review August 26, 2020 19:55
@codecov-commenter
Copy link

Codecov Report

Merging #10680 into master will decrease coverage by 0.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10680      +/-   ##
==========================================
- Coverage   59.53%   59.39%   -0.15%     
==========================================
  Files         360      360              
  Lines       23173    23173              
==========================================
- Hits        13796    13763      -33     
- Misses       9377     9410      +33     
Flag Coverage Δ
#python 59.39% <ø> (-0.15%) ⬇️

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

Impacted Files Coverage Δ
superset/views/database/mixins.py 59.64% <0.00%> (-21.06%) ⬇️
superset/views/database/validators.py 78.94% <0.00%> (-5.27%) ⬇️
superset/views/base_api.py 94.18% <0.00%> (-4.07%) ⬇️
superset/databases/api.py 85.18% <0.00%> (-2.78%) ⬇️
superset/db_engine_specs/postgres.py 97.43% <0.00%> (-2.57%) ⬇️
superset/views/database/views.py 85.93% <0.00%> (-1.57%) ⬇️
superset/models/core.py 85.27% <0.00%> (-1.12%) ⬇️
superset/jinja_context.py 80.00% <0.00%> (-0.96%) ⬇️
superset/db_engine_specs/base.py 87.60% <0.00%> (-0.28%) ⬇️

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 bc0fc4e...260b22a. Read the comment docs.

{
accessor: 'description',
hidden: true,
disableSortBy: true,
Copy link
Member

Choose a reason for hiding this comment

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

nit unrelated to this PR, and out of scope for this change: it would be good to make this a positive setting rather than a negated setting, so rather than disableSortBy: true, it could be more readable to have the option sortingEnabled: false.

Copy link
Member Author

Choose a reason for hiding this comment

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

originally the property was called "sortable" however there were a few type errors creeped up so I opted to use react-table's included property https://react-table.tanstack.com/docs/api/useSortBy#table-options

If time permits I'll do a second pass at trying to clean up the columns config api.

Copy link
Member

Choose a reason for hiding this comment

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

Understood. Please don't burn too many cycles on it given that it maps onto a 3rd party library's naming. Just a passing thought.

superset-frontend/src/views/CRUD/hooks.ts Outdated Show resolved Hide resolved
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.

LGTM! You've done a great job with this... but man, that Favorites star does a LOT of work. In a more perfect world, the favorite status would just be part of the chart/dash array, so you don't have to do all these API calls and whatnot.

@nytai nytai merged commit 6ff96cf into apache:master Aug 26, 2020
@nytai nytai deleted the tai/listview-hooks branch August 26, 2020 22:39
@villebro villebro added the v0.38 label Sep 11, 2020
Ofeknielsen pushed a commit to ofekisr/incubator-superset that referenced this pull request Oct 5, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.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/XXL v0.38 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants