-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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(dashboard): Fix missing metadata on draggable dashboard edit chart cards #20684
fix(dashboard): Fix missing metadata on draggable dashboard edit chart cards #20684
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20684 +/- ##
=======================================
Coverage 66.30% 66.30%
=======================================
Files 1756 1756
Lines 66734 66734
Branches 7049 7049
=======================================
Hits 44248 44248
Misses 20689 20689
Partials 1797 1797
Flags with carried forward coverage won't be shown. Click here to find out more.
|
a19d3a0
to
ba87693
Compare
/testenv up |
@jinghua-qa Ephemeral environment spinning up at http://35.166.98.73:8080. Credentials are |
@michael-s-molina Looks like that PR transitioned from another endpoint that had a similar restriction – do you know if there's any spec for what the permissions are supposed to be around adding charts to a dashboard? My thought would be that if you have view permissions on a chart, you should be able to add it to a dashboard that you have edit permissions for, but that's just off the top of my head, I don't have a great understanding of the permissions model. |
QA team found an issue that when user add a chart (not owner) to the dashboard and then delete, user will automatically become owner of the chart. This issue has been filed in ticket and will be fixed in another pr. Other than that, LGTM~ |
ba87693
to
20d10d5
Compare
Ephemeral environment shutdown and build artifacts deleted. |
Linking for future documentation: #21720 |
@codyml in reference to your comment,
I thought there was merit in sharing some user feedback—for context at Airbnb where we have a significant number of charts, i.e., in excess of 100k—I received:
Based on this feedback I was wondering whether:
Thoughts? |
@john-bodley Thanks for the follow-up! Those points make a lot of sense to me and it sounds like there's definitely room for improvement. From what I remember, no one at Preset was clamoring for being able to add charts that you don't own to a dashboard via dashboard edit (cc @lauderbaugh in case I'm wrong). I think I chose this approach just because it seemed like the easiest way to resolve the missing metadata bug caused by the list trying to display charts that you don't own that were already added to the dashboard. I like the idea of a toggle – that sounds like a best of both worlds solution. A bandaid solution could also be to revert this change and solve the missing metadata issue by just not trying to show charts added to the dashboard that you don't own in the list at all. The downside of that would be that if you remove a chart you don't own from a dashboard there would be no way to get it back. But, that was already sort of a problem before this PR: if you removed a chart you didn't own and then saved the dashboard, you wouldn't be able to add it back from the dashboard edit list. Is changing this behavior something that you'd like to work on? Happy to discuss these or any other ideas further or do any PR reviews as helpful – let me know! |
SUMMARY
Currently, when editing a dashboard, any charts that are already in the dashboard when the Edit button is clicked but are not owned by the current user appear in the sidebar of draggable charts missing metadata. This is due to a two-step process for downloading charts:
sliceEntities.slices
object when the dashboard is loaded, but are missing the metadata necessary to correctly render as draggable cards.sliceEntities.slices
store object. Because some charts added to the dashboard might not be owned by the current user, thesliceEntities.slices
entries for those charts are not updated with the necessary metadata.This PR removes the filter from the 2nd request that limits it to charts owned by the current user, so all charts are now correctly downloaded and merged into the store object.
Note: I'm opening this PR under the assumption that this filter was present for no good reason. If there's a reason that you should only be able to add charts that you own to a dashboard, let me know and I'll find another solution.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
After:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION