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
Pass scoped Widget
component to registered widget component function
#2613
Labels
P0
High priority
QA: Eng
Requires specialized QA by an engineer
Rollover
Issues which role over to the next sprint
Type: Enhancement
Improvement of an existing feature
Milestone
Comments
felixarntz
added
P0
High priority
Type: Enhancement
Improvement of an existing feature
Next Up
labels
Jan 13, 2021
IB ✅ |
Executed, I'll wait on the merge of #2252 to finalise tests and storybooks so I don't have a moving target. |
QA ✅ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
P0
High priority
QA: Eng
Requires specialized QA by an engineer
Rollover
Issues which role over to the next sprint
Type: Enhancement
Improvement of an existing feature
Widgets that pass
wrapWidget: false
need to render the wrappingWidget
component themselves. For this purpose, we right now export theWidget
component publicly ongooglesitekit.widgets.components
.Somewhat annoying here, components that render
Widget
on its own currently are required to pass the widget's slug to the component - duplicating that from where the widget is registered, making it error-prone.We should change this so that we pass a scoped version of
Widget
to every registered component so that they don't need to import it and don't need to pass theslug
prop. This follows the pattern established in #2252 where components already get access to special widget state components via props, such asWidgetReportZero
.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
slug
prop ofWidget
should be renamed to a more explicitwidgetSlug
, matching what other publicly usableWidget*
components are doing.getWidgetComponentProps
function should be expanded to include a scoped version ofWidget
in the props object. (This will haveWidgetRenderer
pass it through to every registered widget component.)googlesitekit.widgets.components
property should be removed (i.e.Widgets.components
internally).<Widget />
manually in its component should rely on theWidget
it receives from props instead of importing it. Theslug
/widgetSlug
must no longer be passed since it's already taken care of.Implementation Brief
slug
property to bewidgetSlug
in theWidget
component. Update all occurrences of theWidget
component to use the new property.getWidgetComponentProps
function. It should have theWidget
name and scoped theWidget
component as a value (similarly to other props in the returned object).Widget
property passed to the component instead ofWidgets.components.Widget
one. Plus remove slug properties from the rendered<Widget>
components since they are not needed anymore.DashboardSummaryWidget
component in the AdSense module;DashboardTopEarningPagesWidget
component in the AdSense module;DashboardAllTrafficWidget
component in the Analytics module;DashboardPopularPagesWidget
component in the Analytics module;DashboardPageSpeedWidget
component in the Page Speed module;DashboardPopularKeywordsWidget
component in the Search Console module;components
property of theWidgets
object in theassets/js/googlesitekit/widgets/index.js
file.Test Coverage
Visual Regression Changes
QA Brief
DashboardSummaryWidget
component in the AdSense module;DashboardTopEarningPagesWidget
component in the AdSense module;DashboardAllTrafficWidget
component in the Analytics module;DashboardPopularPagesWidget
component in the Analytics module;DashboardPageSpeedWidget
component in the Page Speed module;DashboardPopularKeywordsWidget
component in the Search Console module;Changelog entry
Widget
component so that widget components can use a scoped version of it via props rather than manually importing it and re-specifying the widget slug.The text was updated successfully, but these errors were encountered: