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: dataset api endpoint for charts and dashboards count #10235

Conversation

lilykuang
Copy link
Member

SUMMARY

  • create new GET endpoint for charts and dashboards count associated to a dataset
  • when users try to delete a dataset, warning modal will show so that they know if a dataset is currently tied to charts and dashboards

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

  • add new endpoint to dataset warning modal

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

@lilykuang lilykuang force-pushed the lily/dataset-charts-dashboards-count-endpoint branch 2 times, most recently from 315a54f to 988a1b0 Compare July 3, 2020 05:50
@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2020

Codecov Report

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

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #10235       +/-   ##
===========================================
- Coverage   70.31%   53.38%   -16.93%     
===========================================
  Files         594      343      -251     
  Lines       31608    11419    -20189     
  Branches     3221     2848      -373     
===========================================
- Hits        22225     6096    -16129     
+ Misses       9275     5143     -4132     
- Partials      108      180       +72     
Flag Coverage Δ
#cypress 53.38% <ø> (ø)
#javascript ?
#python ?
Impacted Files Coverage Δ
...uperset-frontend/src/dashboard/util/dnd-reorder.js 0.00% <0.00%> (-100.00%) ⬇️
...rset-frontend/src/dashboard/util/getEmptyLayout.js 0.00% <0.00%> (-100.00%) ⬇️
.../src/dashboard/util/getFilterScopeFromNodesTree.js 0.00% <0.00%> (-93.48%) ⬇️
.../src/dashboard/components/FilterIndicatorGroup.jsx 11.76% <0.00%> (-88.24%) ⬇️
...c/explore/components/controls/withVerification.jsx 9.09% <0.00%> (-87.88%) ⬇️
...uperset-frontend/src/utils/getClientErrorObject.ts 0.00% <0.00%> (-87.10%) ⬇️
...src/dashboard/components/gridComponents/Header.jsx 10.52% <0.00%> (-86.85%) ⬇️
...rc/dashboard/components/gridComponents/Divider.jsx 13.33% <0.00%> (-86.67%) ⬇️
...c/dashboard/components/gridComponents/Markdown.jsx 6.59% <0.00%> (-82.42%) ⬇️
superset-frontend/src/components/Link.tsx 7.69% <0.00%> (-79.81%) ⬇️
... and 398 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 fdd28c1...988a1b0. Read the comment docs.

@mistercrunch
Copy link
Member

It could be good to be able to show a list of related objects instead of counts as users may want to go and alter those objects to point them to a new place.

The UI can still just show the counts, but the endpoint would be more useful that way.

Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

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

looking good, but I think that the OpenAPI spec is no correct, check it on \swaggerview\v1

content:
application/json:
schema:
type: object
Copy link
Member

Choose a reason for hiding this comment

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

schema:
  type: object
  properties:
    dashboard_count:
      type: integer
    chart_count:
      type: integer

@lilykuang lilykuang force-pushed the lily/dataset-charts-dashboards-count-endpoint branch 3 times, most recently from 00fb48f to 371e153 Compare July 4, 2020 20:28
@lilykuang lilykuang force-pushed the lily/dataset-charts-dashboards-count-endpoint branch from 371e153 to 37d3306 Compare July 6, 2020 21:38
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jul 6, 2020
@lilykuang lilykuang force-pushed the lily/dataset-charts-dashboards-count-endpoint branch 3 times, most recently from 1a633d3 to 6cbbda5 Compare July 6, 2020 22:57
@lilykuang lilykuang force-pushed the lily/dataset-charts-dashboards-count-endpoint branch from 6cbbda5 to c7d96d5 Compare July 6, 2020 23:07
@lilykuang lilykuang requested a review from dpgaspar July 6, 2020 23:14
@lilykuang lilykuang marked this pull request as ready for review July 6, 2020 23:14
Copy link
Member

@nytai nytai left a comment

Choose a reason for hiding this comment

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

lgtm!

@willbarrett willbarrett merged commit b9e0678 into apache:master Jul 6, 2020
@willbarrett willbarrett deleted the lily/dataset-charts-dashboards-count-endpoint branch July 6, 2020 23:26
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
)

* create GET endpoint for charts and dashboards count associated to a dataset

* add test for chart and dashboard count dataset
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.37.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 🚢 0.37.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants