-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[dashboard] fix filter_scopes when copy dashboard with duplicate_slices #9188
[dashboard] fix filter_scopes when copy dashboard with duplicate_slices #9188
Conversation
f1f2682
to
eb04f8a
Compare
Codecov Report
@@ Coverage Diff @@
## master #9188 +/- ##
==========================================
- Coverage 59.16% 59.13% -0.04%
==========================================
Files 372 372
Lines 11935 11938 +3
Branches 2927 2925 -2
==========================================
- Hits 7061 7059 -2
- Misses 4694 4699 +5
Partials 180 180
Continue to review full report at Codecov.
|
@@ -1195,6 +1195,20 @@ def copy_dash(self, dashboard_id): | |||
old_id = "{}".format(value.get("meta").get("chartId")) | |||
new_id = int(old_to_new_sliceids[old_id]) | |||
value["meta"]["chartId"] = new_id | |||
|
|||
if "filter_scopes" in data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty similar to the chunk of code here. Can we pull this out into a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a util function to clean up.
CATEGORY
Choose one
SUMMARY
When user copy dashboard with
also copy (duplicate) charts
, dashboard duplicates each slices in the old dash and use new slice_id in the new dash. We should update filter_scopes with new slice ids.TEST PLAN
CI and manual test
ADDITIONAL INFORMATION
REVIEWERS
@serenajiang @john-bodley