Module disconnect modal wording assumes module has features
See original GitHub issueBug Description
All modules have the option to declare a list of features as user-facing short descriptions, e.g. “Intelligent, automatic ad placement” is one for AdSense. Features are not a required element of module registration though so components that use this should not assume that this list will always be present, even if all Site Kit modules provide it.
Steps to reproduce
- Activate Idea Hub
- Deactivate Idea Hub
Screenshots
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- If a module has no available features defined, the message that would otherwise appear above the list of features in the disconnect dialog should not appear.
- Note that Site Kit modules should always provide features to clarify the meaning of disconnecting said modal. This tweak is only so that eventual third-party modules are not technically required to provide such a list.
Implementation Brief
See working branch here https://github.com/google/site-kit-wp/tree/bug/3691-Module-disconnect-modal-no-features
Using assets/js/components/settings/SettingsActiveModule/ConfirmDisconnect.js
- If no features are passed as props e.g.
feature
prop isnull
/undefined
/empty array, do not pass insubtitle
string to innerDialog
component (e.g. pass in empty string ornull
)
Create a .stories.js
file for the ConfirmDisconnect
component
- Add a story where the features are populated (current behaviour)
- Add a new story where there are no new features
Test Coverage
- No changes
Visual Regression Changes
- No changes
QA Brief
Check two new stories in Storybook
-
with features https://google.github.io/site-kit-wp/storybook/develop/?path=/story/components-confirmdisconnect--confirm-disconnect-with-features This is a new story, but the functionality should be the same as before this task
-
without features https://google.github.io/site-kit-wp/storybook/develop/?path=/story/components-confirmdisconnect--confirm-disconnect-without-features This should be this task implemented
Changelog entry
- Improve module disconnect screen when a module doesn’t have listed features.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
@danielgent I agree stories would be the easiest. A more robust test would be adding tests for
SettingsActiveModule
using a custom module registered in the test (or usingprovideModuleRegistrations
with override) but I don’t think it’s necessary here.SGTM 👍
Thanks for having a look @aaemnnosttv. While I understood the ticket and the problem as well as the fact that we no longer have a scenario to cover this specific update. My testing efforts above were to ensure that with this update, we retained the functionality and content in each of our modals.
Thanks again!