这是indexloc提供的服务,不要输入任何密码
Skip to content

Register widget contexts and widget areas for module pages #2062

@felixarntz

Description

@felixarntz

Widget contexts and the available widget areas should be registered via the Widget API for the Site Kit modules pages (Search Console, AdSense, Analytics). Furthermore the internal widget rendering components should be put in place on those pages, to render widget areas for the respective context (above the original "widgets" not using the Widget API).

Individual feature flags should be used, which will only be active for development builds. The existing UI should remain untouched (similar to how it was with the dashboard before) - the new widgets implementation will for now show up as a "copy" of the legacy version of the UI.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The following additional default context slugs should receive constants in assets/js/googlesitekit/widgets:
    • CONTEXT_MODULE_SEARCH_CONSOLE
    • CONTEXT_MODULE_ANALYTICS
    • CONTEXT_MODULE_ADSENSE
  • The following additional widget area slugs should receive constants in assets/js/googlesitekit/widgets:
    • AREA_MODULE_SEARCH_CONSOLE_MAIN
    • AREA_MODULE_ANALYTICS_MAIN
    • AREA_MODULE_ADSENSE_MAIN
  • The registerDefaults function in assets/js/googlesitekit/widgets should be expanded to register the above widget areas in their respective above context:
    • title and subtitle should always be empty.
    • priority should always be 1.
    • style should always be WIDGET_AREA_STYLES.BOXES.

Implementation Brief

  • Add three context slugs to /assets/js/googlesitekit/widgets/default-contexts.js CONTEXT_MODULE_SEARCH_CONSOLE, CONTEXT_MODULE_ANALYTICS, and CONTEXT_MODULE_ADSENSE.
  • Add three additional widget areas in /assets/js/googlesitekit/widgets/default-areas.js: AREA_MODULE_SEARCH_CONSOLE_MAIN, AREA_MODULE_ANALYTICS_MAIN, and AREA_MODULE_ADSENSE_MAIN.
  • In /assets/js/googlesitekit/widgets/register-defaults.js registerDefaults() add the above three widget areas to their context areas ( AREA_MODULE_SEARCH_CONSOLE_MAIN / CONTEXT_MODULE_SEARCH_CONSOLE and so on ) using widgetsAPI.registerWidgetArea():
{
 title: '',
 subtitle: '',
 style: WIDGET_AREA_STYLES.BOXES,
 priority: 1,
},

QA Brief

  • There should be no visual changes, everything should work as usual.

Changelog entry

  • Add widget contexts and register widget areas for Site Kit module pages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priorityRolloverIssues which role over to the next sprintType: EnhancementImprovement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions