This branch adds the feature to make Dashboards connected to specific idSites.
This is important especially if we work with plugins like Custom reports where reports are bound to specific idSites so if we add a custom report to a Dashboard it will generate errors to the users on all other sites.
I added support for All sites (0) in the db and logic but there is not yes a GUI for users to manage this (we will always set. the siteId of the site you are currently viewing when you create a new dashboard.
Note: This still needs more testing I have created the DB updates but these are not tested yet for instance.
I would really need some help testing this.
@tomper00 great. That will be very useful indeed. From a product perspective, when creating or copying a dashboard, it would be great to be able to select whether a dashboard should be available for all sites, or only the given site (later we could maybe allow to select it to share it with multiple sites). From what I see this PR would otherwise change all the dashboards to be per site? There is for some dashboards/use cases also value in having dashboards across sites.
Ok I started to change the code according to you suggestions @sgiehl, still some testing to be done locally though - Thanks for this, very appreciated!
@tsteur Yes there is a bit of thinking needed to be done around the full functionality for sure so perhaps this should be part of a bigger feature update rather than just a small improvement.
Here are some examples of things we discussed recently that would make dashboards more powerful:
@tomper00 Thanks for the additional suggestions:
Make it possible to add custom content to a dashboard (Texts and perhaps images to better describe what you see).
This should actually be something that could easily be implemented in a third party plugin. I don't think that is something we plan to integrate into core currently.
Add an admin view for all Dashboards (so that its easier to help users and see all their dashboards)
This could also be done in an custom plugin, but might be something that could be interesting for core as well.
Make it possible to have Shared dashboards with users instead of a lot of copies to make sure changes are replicated properly
Nice idea. Guess this won't be easily implemented in a custom plugin, unless we extend the Dashboard API a lot.
Btw. how shall shared dashboards behave?
If you don't want this PR to be closed automatically in 28 days then you need to assign the label 'Do not close'.
This PR was last updated more than one month ago, maybe it's time to close it. Please check if there is anything we still can do or close this PR. ping @matomo-org/core-reviewers