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

fix: Add database search in available charts on dashboard. #19244

Merged

Conversation

codemaster08240328
Copy link
Contributor

SUMMARY

On dashboard, when we try to add a new chart, we can see only 200 charts in chart list section. Because we are fetching charts by limitation of amount of 200.

And filtering chart, sort by option only works in frontend, not against database. So we can't see old charts if we have more than 200 charts in database.

Solution.

Need to make filter/sort by option work against database.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

  1. Go to one dashboard page.
  2. Click edit
  3. Go go charts tab in crud pane.
  4. Try to filter chart or sort chart.

Result: You should be able to see that it hits the endpoint, reloads charts data again.

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

@rusackas rusackas marked this pull request as draft March 17, 2022 22:29
@rusackas rusackas changed the title draft: Add database search in available charts on dashboard. fix: Add database search in available charts on dashboard. Mar 17, 2022
@rusackas rusackas marked this pull request as ready for review April 6, 2022 20:36
@rusackas rusackas marked this pull request as draft April 6, 2022 20:37
function fetchSlices(
userId,
excludeFilterBox,
dispatch,
Copy link
Contributor

Choose a reason for hiding this comment

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

you could transform this to an action creator function (like the ones below) to avoid passing this param around

dispatch,
filter_value,
sortColumn = 'changed_on_delta_humanized',
slices = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

do you need the current slices? aren't we fetching here and need to replace the existing ones?

@rusackas rusackas requested review from suddjian and geido April 20, 2022 21:09
@rusackas rusackas marked this pull request as ready for review May 4, 2022 20:49
@codecov
Copy link

codecov bot commented May 12, 2022

Codecov Report

Merging #19244 (1bd4105) into master (6f0d53e) will increase coverage by 0.03%.
The diff coverage is 54.54%.

@@            Coverage Diff             @@
##           master   #19244      +/-   ##
==========================================
+ Coverage   66.65%   66.69%   +0.03%     
==========================================
  Files        1729     1749      +20     
  Lines       64910    65321     +411     
  Branches     6842     6935      +93     
==========================================
+ Hits        43268    43568     +300     
- Misses      19893    19998     +105     
- Partials     1749     1755       +6     
Flag Coverage Δ
javascript 51.83% <54.54%> (+0.25%) ⬆️

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

Impacted Files Coverage Δ
...t-frontend/src/dashboard/containers/SliceAdder.jsx 100.00% <ø> (+100.00%) ⬆️
...t-frontend/src/dashboard/components/SliceAdder.jsx 72.00% <33.33%> (+5.82%) ⬆️
...et-frontend/src/dashboard/actions/sliceEntities.js 74.28% <62.50%> (+58.90%) ⬆️
...oard/components/gridComponents/new/NewMarkdown.jsx 0.00% <0.00%> (-100.00%) ⬇️
...s/plugin-chart-echarts/src/BoxPlot/controlPanel.ts 16.66% <0.00%> (-83.34%) ⬇️
...gins/legacy-plugin-chart-chord/src/controlPanel.ts 25.00% <0.00%> (-75.00%) ⬇️
...gins/legacy-plugin-chart-rose/src/controlPanel.tsx 50.00% <0.00%> (-50.00%) ⬇️
...ins/legacy-plugin-chart-sankey/src/controlPanel.ts 50.00% <0.00%> (-50.00%) ⬇️
...s/legacy-plugin-chart-calendar/src/controlPanel.ts 50.00% <0.00%> (-50.00%) ⬇️
.../legacy-preset-chart-nvd3/src/Line/controlPanel.ts 50.00% <0.00%> (-50.00%) ⬇️
... and 208 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 6f0d53e...1bd4105. Read the comment docs.

@rusackas rusackas added the need:qa-review Requires QA review label Jun 8, 2022
@yousoph
Copy link
Member

yousoph commented Jun 8, 2022

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2022

@yousoph Ephemeral environment spinning up at http://35.86.145.242:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@yousoph
Copy link
Member

yousoph commented Jun 25, 2022

Open issue to address: Recently created charts don't appear in charts section in dashboard edit mode if user sorts by recent

@yousoph
Copy link
Member

yousoph commented Jun 27, 2022

/testenv up

@github-actions
Copy link
Contributor

@yousoph Ephemeral environment spinning up at http://54.184.5.242:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@yousoph
Copy link
Member

yousoph commented Jun 29, 2022

/testenv up

@github-actions
Copy link
Contributor

@yousoph Ephemeral environment spinning up at http://52.35.138.69:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@yousoph
Copy link
Member

yousoph commented Jul 1, 2022

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2022

@yousoph Ephemeral environment spinning up at http://34.215.177.50:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

export function getDatasourceParameter(datasourceId, datasourceType) {
return `${datasourceId}__${datasourceType}`;
export function fetchSlices(
userId,

Choose a reason for hiding this comment

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

Could we send these as an Option object? So we don't have to worry about the order we send it and we avoid sending undefined when calling it? So we just send what options we need and we destructure here to get them?

userId,
excludeFilterBox,
dispatch,
undefined,

Choose a reason for hiding this comment

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

If passed as an Option object there's no need to worry about order or sending undefined.

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... we can address any touchups from comments in followup PRs.

@rusackas rusackas merged commit 9622520 into apache:master Jul 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2022

Ephemeral environment shutdown and build artifacts deleted.

akshatsri pushed a commit to charan1314/superset that referenced this pull request Jul 19, 2022
)

* add database search

* resolve lint issue

* add test for sliceEntities actions

* fix lint issue

* add licence into test

* fix pipeline broken

* fix sort by recent

* resolve comment
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.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 need:qa-review Requires QA review Preset-Patch size/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants