-
Notifications
You must be signed in to change notification settings - Fork 293
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
Update widget registration to declare associated modules #4849
Comments
@felixarntz is there anything you can think of more concretely that should determine when a module (other than the main module for a widget) should be associated with a widget? |
@aaemnnosttv There may be widgets that don't depend on any module, I think that would be good to point out in the ACs as well. For example the (legacy UI) URL search widget, but potentially also the AdSense CTA widget? For the latter, I'm actually wondering, what does "associated module" really mean for us? The AdSense CTA widget does not get any real data from AdSense, so the user doesn't need to have shared data access to see it. At the same time, that widget still shouldn't be shown to non-signed in users since they can't configure the module anyway. |
Yes, I think the search widget is the only one I found that would be without any module. As for the AdSense CTA widget (and your question about what the associated module really means for us), I think the association is primarily about the data source(s) used within it, but even for a widget that did not display any data, if it was somehow specific to the AdSense module, it should be associated with it.
Right, which could be handled either as conditional widget registration, logic within the widget (returning |
That makes sense. I agree we can then include a "manual" capability check in the CTA widget to return
That's a great idea. However I don't think it's necessarily a replacement for what we're doing here, it could be another future enhancement, allowing to control widget access based on capability. I think for now we can rely solely on the module approach as originally defined and check for capabilities in the few places needed manually, but it would be great to eventually have a (not dashboard sharing-related) issue to explore capability-based access. We can move this forward to IB. |
IB ✔️ |
QA Update:
|
@wpdarren it just means make sure the widgets are all showing as before and that no regressions have been introduced in changing the widget registrations. There is no intended change to what should be seen on the dashboards yet at this point. The changes here are related to dashboard sharing but not based on the feature flag. |
QA Update: ✅Verified:
|
Feature Description
In #4807 the infrastructure for widget registration and selection was extended to allow for widgets to have one or more associated modules and to select them optionally filtered by a list of modules.
This issue is about updating the widget registration for (nearly) all widgets to declare their respective modules – i.e. the modules they are for or depend on.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
modules
they depend on, passing the module slug(s)registerWidgets
function should all declare the current module as a minimum (in most cases, this will be all that's needed)DashboardTopEarningPagesWidget
– note the multiplewhenActive
use) should be registered with both/all modulesImplementation Brief
assets/js/modules/adsense/index.js
,registerWidget
calls to includemodules: [ 'adsense' ]
in their second parameter except the following widgets where additional modules should be added:adsenseTopEarningPages
:analytics
should be addedmodules
adsenseModuleTopEarningPages
:modules
should containanalytics
only (noadsense
).assets/js/modules/analytics/index.js
,registerWidget
calls to includemodules: [ 'analytics' ]
in their second parameter.assets/js/modules/idea-hub/index.js
,registerWidget
calls to includemodules: [ 'idea-hub' ]
in their second parameter.assets/js/modules/pagespeed-insights/index.js
,registerWidget
calls to includemodules: [ 'pagespeed-insights' ]
in their second parameter.assets/js/modules/search-console/index.js
,registerWidget
calls to includemodules: [ 'search-console' ]
in their second parameter except the following widgets where additional modules should be added:searchFunnel
:analytics
should be addedmodules
Test Coverage
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: