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: update slug name #17961

Merged
merged 2 commits into from
Jan 7, 2022
Merged

fix: update slug name #17961

merged 2 commits into from
Jan 7, 2022

Conversation

pkdotson
Copy link
Member

@pkdotson pkdotson commented Jan 7, 2022

SUMMARY

This Pr fixes an issue where if you update the slug name of dashboard in the properties modal it would not reflect the change on save. This occured because the react-router is out of sync with the window state.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

before
https://user-images.githubusercontent.com/17326228/148497218-8177ef09-3412-4f90-aaa3-d5e6ce58802d.mov

after

Screen.Recording.2022-01-06.at.9.38.21.PM.mov

TESTING INSTRUCTIONS

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

@codecov
Copy link

codecov bot commented Jan 7, 2022

Codecov Report

Merging #17961 (7c88839) into master (f75908b) will increase coverage by 0.00%.
The diff coverage is 95.83%.

❗ Current head 7c88839 differs from pull request most recent head 7f5af3e. Consider uploading reports for the commit 7f5af3e to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master   #17961   +/-   ##
=======================================
  Coverage   67.07%   67.07%           
=======================================
  Files        1609     1609           
  Lines       64905    64906    +1     
  Branches     6868     6868           
=======================================
+ Hits        43537    43538    +1     
  Misses      19502    19502           
  Partials     1866     1866           
Flag Coverage Δ
javascript 53.77% <95.83%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
.../plugins/legacy-preset-chart-nvd3/src/Bar/index.js 66.66% <ø> (ø)
...gins/legacy-preset-chart-nvd3/src/DistBar/index.js 66.66% <ø> (ø)
...ins/legacy-preset-chart-nvd3/src/DualLine/index.js 66.66% <ø> (ø)
superset-frontend/src/common/components/index.tsx 100.00% <ø> (ø)
...rontend/src/dashboard/containers/DashboardPage.tsx 25.24% <ø> (ø)
...nd/src/explore/components/ExploreViewContainer.jsx 2.32% <ø> (ø)
...mponents/controls/MetricControl/MetricsControl.jsx 35.16% <ø> (ø)
...et-frontend/src/hooks/apiResources/apiResources.ts 85.71% <ø> (ø)
superset-frontend/src/hooks/apiResources/charts.ts 57.14% <ø> (ø)
...rset-frontend/src/hooks/apiResources/dashboards.ts 40.00% <ø> (ø)
... and 48 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 f75908b...7f5af3e. Read the comment docs.

@@ -216,6 +216,9 @@ const FilterBar: React.FC<FiltersBarProps> = ({
}
newParams.set(URL_PARAMS.nativeFiltersKey.name, dataMaskKey);

// pathname could be updated somewhere else through windows.history
// keep react router history in sync with window history
history.location.pathname = window.location.pathname;
Copy link
Member

Choose a reason for hiding this comment

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

Won't this problem happen elsewhere too? Is there a global solution for it?

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

Approving it to get the quick fix, but we need to investigate for a global solution.

…rBar/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
@pkdotson pkdotson merged commit 765c72a into apache:master Jan 7, 2022
rosemarie-chiu pushed a commit to preset-io/superset that referenced this pull request Jan 10, 2022
* fix: fix update slug name

* Update superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
(cherry picked from commit 765c72a)
@rosemarie-chiu
Copy link
Contributor

🏷 2022.1

eschutho pushed a commit that referenced this pull request Jan 27, 2022
* fix: fix update slug name

* Update superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
shcoderAlex pushed a commit to casual-precision/superset that referenced this pull request Feb 7, 2022
* fix: fix update slug name

* Update superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
bwang221 pushed a commit to casual-precision/superset that referenced this pull request Feb 10, 2022
* fix: fix update slug name

* Update superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
@mistercrunch mistercrunch added 🍒 1.4.1 🍒 1.4.2 🏷️ 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 preset:2022.1 preset-io size/XS v1.4.1 🍒 1.4.1 🍒 1.4.2 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants