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

perf(native-filters): Load native filters after charts #14443

Merged
merged 21 commits into from May 4, 2021

Conversation

simcha90
Copy link
Contributor

@simcha90 simcha90 commented May 2, 2021

SUMMARY

Show filter bar after all charts loaded

Dependent on: #14408

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2021-05-04.at.9.17.02.mov

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

@villebro
Copy link
Member

villebro commented May 3, 2021

Reviewing/testing #14408 first, but one problem with this approach is that it will cause two renders of charts - first with the full width of the dashboard without the filter tab, and next with the filter tab. To address this I would recommend making the filter tab visible initially, but potentially introduce the loading spinner instead of the tab contents to highlight that filters are still pending.

@villebro villebro changed the title WIP: feat(native-filters): Load native filters after charts WIP: perf(native-filters): Load native filters after charts May 3, 2021
� Conflicts:
�	superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
�	superset-frontend/src/dashboard/components/nativeFilters/FilterBar/state.ts
�	superset-frontend/src/dashboard/components/nativeFilters/FilterBar/utils.ts
�	superset-frontend/src/dashboard/types.ts
�	superset-frontend/src/dataMask/reducer.ts
@pull-request-size pull-request-size bot added size/S and removed size/L labels May 3, 2021
@junlincc junlincc requested a review from villebro May 3, 2021 20:11
@pull-request-size pull-request-size bot added size/M and removed size/S labels May 4, 2021
@simcha90 simcha90 changed the title WIP: perf(native-filters): Load native filters after charts perf(native-filters): Load native filters after charts May 4, 2021
@codecov
Copy link

codecov bot commented May 4, 2021

Codecov Report

Merging #14443 (3596366) into master (2f9efb2) will increase coverage by 0.13%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14443      +/-   ##
==========================================
+ Coverage   76.95%   77.09%   +0.13%     
==========================================
  Files         955      957       +2     
  Lines       48091    48141      +50     
  Branches     6036     6056      +20     
==========================================
+ Hits        37008    37112     +104     
+ Misses      10884    10828      -56     
- Partials      199      201       +2     
Flag Coverage Δ
javascript 71.91% <88.88%> (+0.30%) ⬆️

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

Impacted Files Coverage Δ
superset-frontend/src/chart/Chart.jsx 50.00% <ø> (ø)
...d/components/DashboardBuilder/DashboardBuilder.tsx 86.95% <ø> (ø)
...hboard/components/nativeFilters/FilterBar/state.ts 88.63% <86.36%> (-2.67%) ⬇️
...board/components/nativeFilters/FilterBar/index.tsx 92.94% <100.00%> (+1.58%) ⬆️
.../FilterBar/CascadeFilters/CascadePopover/index.tsx 63.38% <0.00%> (-1.41%) ⬇️
...et-frontend/src/views/CRUD/data/database/styles.ts
...end/src/views/CRUD/data/database/DatabaseModal.tsx
.../CRUD/data/database/DatabaseModal/ExtraOptions.tsx 93.33% <0.00%> (ø)
...c/views/CRUD/data/database/DatabaseModal/styles.ts 96.00% <0.00%> (ø)
...c/views/CRUD/data/database/DatabaseModal/index.tsx 59.64% <0.00%> (ø)
... and 7 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 2f9efb2...3596366. 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.

One small comment, other than that LGTM and was verified to work well in all following cases:

  • regular examples dashboard
  • dashboard with no charts on first page
  • Global Async Query framework (websocket)

Comment on lines +246 to +248
{!isInitialized ? (
<Loading />
) : isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS_SET) ? (
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 this causes an unnecessary visual artefact - I think it's ok to keep this as-is, i.e. showing the filters in spinning state until they've fully resolved.

Copy link
Contributor Author

@simcha90 simcha90 May 4, 2021

Choose a reason for hiding this comment

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

but this is the point not to render them in order they will not start to do requests to the server :)

Copy link
Member

Choose a reason for hiding this comment

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

Haha, makes sense 🤦

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.

LGTM

@villebro villebro merged commit 582900c into apache:master May 4, 2021
amitmiran137 pushed a commit that referenced this pull request May 4, 2021
* fix:fix get permission function

* refactor: filter default value

* refactor: update default value loading

* refactor: apply defaultValues

* lint: fix lint

* lint: fix lint

* test: fix test

* refactor: use extraFormData for reload charts

* feat: load native filters after after charts

* feat: load filters after charts

* fix: revert changes

* test: fix timers

* test: fix tests

(cherry picked from commit 582900c)
hughhhh pushed a commit that referenced this pull request May 4, 2021
* fix:fix get permission function

* refactor: filter default value

* refactor: update default value loading

* refactor: apply defaultValues

* lint: fix lint

* lint: fix lint

* test: fix test

* refactor: use extraFormData for reload charts

* feat: load native filters after after charts

* feat: load filters after charts

* fix: revert changes

* test: fix timers

* test: fix tests
@junlincc junlincc added the dashboard:native-filters Related to the native filters of the Dashboard label May 12, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Sep 8, 2021
* fix:fix get permission function

* refactor: filter default value

* refactor: update default value loading

* refactor: apply defaultValues

* lint: fix lint

* lint: fix lint

* test: fix test

* refactor: use extraFormData for reload charts

* feat: load native filters after after charts

* feat: load filters after charts

* fix: revert changes

* test: fix timers

* test: fix tests

(cherry picked from commit 582900c)
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* fix:fix get permission function

* refactor: filter default value

* refactor: update default value loading

* refactor: apply defaultValues

* lint: fix lint

* lint: fix lint

* test: fix test

* refactor: use extraFormData for reload charts

* feat: load native filters after after charts

* feat: load filters after charts

* fix: revert changes

* test: fix timers

* test: fix tests
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* fix:fix get permission function

* refactor: filter default value

* refactor: update default value loading

* refactor: apply defaultValues

* lint: fix lint

* lint: fix lint

* test: fix test

* refactor: use extraFormData for reload charts

* feat: load native filters after after charts

* feat: load filters after charts

* fix: revert changes

* test: fix timers

* test: fix tests
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* fix:fix get permission function

* refactor: filter default value

* refactor: update default value loading

* refactor: apply defaultValues

* lint: fix lint

* lint: fix lint

* test: fix test

* refactor: use extraFormData for reload charts

* feat: load native filters after after charts

* feat: load filters after charts

* fix: revert changes

* test: fix timers

* test: fix tests
@mistercrunch mistercrunch added 🍒 1.2.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.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 dashboard:native-filters Related to the native filters of the Dashboard size/M v1.2 🍒 1.2.0 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants