-
Notifications
You must be signed in to change notification settings - Fork 328
Closed
Labels
Module: RRMReader Revenue Manager module related issuesReader Revenue Manager module related issuesP0High priorityHigh priorityTeam MIssues for Squad 2Issues for Squad 2Type: EnhancementImprovement of an existing featureImprovement of an existing feature
Description
Feature Description
The Site Kit Settings -> Connected Services screen displays the module status if a module is connected or prompts to complete setup if the connection is incomplete.
We should add support for custom status, for example, when a module needs attention from the owner.
This is needed at the moment to support for adding a "Action needed" status for the Reader Revenue Manager module.
- Read more in the design doc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The connection status of a module that appears in Settings -> Connected Services should support any custom component.
- A Storybook story should be added to showcase this customization ability.
Implementation Brief
- In
assets/js/googlesitekit/modules/datastore/modules.js:- Add a new optional
SettingsStatusComponentproperty to module registration, following the pattern used bySettingsEditComponentandSettingsViewComponent.
- Add a new optional
- Create
assets/js/components/settings/SettingsActiveModule/ModuleStatus.js:- It should accept a
slugprop. - Extract the module status from
Header.jsand port it toModuleStatus.
- It should accept a
site-kit-wp/assets/js/components/settings/SettingsActiveModule/Header.js
Lines 137 to 157 in 7a86758
| let moduleStatus = null; | |
| if ( connected ) { | |
| moduleStatus = ( | |
| <P size={ SIZE_MEDIUM }>{ __( 'Connected', 'google-site-kit' ) }</P> | |
| ); | |
| } else { | |
| moduleStatus = ( | |
| <Button | |
| onClick={ onActionClick } | |
| disabled={ requirementsError || isNavigatingToAdminReAuthURL } | |
| inverse | |
| > | |
| { sprintf( | |
| /* translators: %s: module name. */ | |
| __( 'Complete setup for %s', 'google-site-kit' ), | |
| name | |
| ) } | |
| </Button> | |
| ); | |
| } |
site-kit-wp/assets/js/components/settings/SettingsActiveModule/Header.js
Lines 229 to 258 in 7a86758
| <div | |
| className={ classnames( | |
| 'googlesitekit-settings-module__status', | |
| { | |
| 'googlesitekit-settings-module__status--connected': | |
| connected, | |
| 'googlesitekit-settings-module__status--not-connected': | |
| ! connected, | |
| } | |
| ) } | |
| > | |
| { moduleStatus } | |
| <span | |
| className={ classnames( | |
| 'googlesitekit-settings-module__status-icon', | |
| { | |
| 'googlesitekit-settings-module__status-icon--connected': | |
| connected, | |
| 'googlesitekit-settings-module__status-icon--not-connected': | |
| ! connected, | |
| } | |
| ) } | |
| > | |
| { connected ? ( | |
| <ConnectedIcon width={ 10 } height={ 8 } /> | |
| ) : ( | |
| <WarningIcon width={ 19 } height={ 17 } /> | |
| ) } | |
| </span> | |
| </div> |
- In
assets/js/components/settings/SettingsActiveModule/Header.js:- Obtain
SettingsStatusComponentfrom the module data. - If
SettingsStatusComponentis set, render that replacingmoduleStatusand its following connection status icon. - If
SettingsStatusComponentis not set, render theModuleStatuscomponent.
- Obtain
- In
assets/js/components/settings/SettingsModules.stories.js:- In the
ConnectedServicesvariant, create a different state for any two modules:- One which is active but not connected, so that it portrays the "Complete setup for {module}" CTA.
- One with a custom
SettingsStatusComponentreplacing the module status with a custom component, such as the badge mocked up in the feature description.
- In the
Test Coverage
- In
assets/js/googlesitekit/modules/datastore/modules.test.js:- Add test coverage for
SettingsStatusComponentsimilar toSettingsEditComponent.
- Add test coverage for
- In
assets/js/components/settings/SettingsActiveModule/index.test.js:- Add a test case validating that a custom module status is displayed when
SettingsStatusComponentis used.
- Add a test case validating that a custom module status is displayed when
QA Brief
- Ensure that the module status ("Connected"/"Complete setup for {module}") appears as expected for all modules without any regressions.
- Go to the
Components/SettingsModules/ConnectedServicesStorybook story and verify that you can see one connected module (Tag Manager) with a custom status.
Changelog entry
- Add support for custom module connection status in the Settings screen.
Metadata
Metadata
Assignees
Labels
Module: RRMReader Revenue Manager module related issuesReader Revenue Manager module related issuesP0High priorityHigh priorityTeam MIssues for Squad 2Issues for Squad 2Type: EnhancementImprovement of an existing featureImprovement of an existing feature