Implement Idea Hub dashboard notification informing about the module
See original GitHub issueA Site Kit dashboard notification should be displayed to inform users about the new Idea Hub module if they have access to it. See the Figma file for UI design.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- A new notification component
IdeaHubModuleNotification
should be implemented which prompts the user to activate the Idea Hub module.- The overall notice should look similar to this Figma design (no need to follow pixel-perfect/design a new component, but follow what we already have in other notifications), except for the buttons which should be left-aligned like we have in all other notifications.
- Clicking the primary button should activate the Idea Hub module and then redirect to OAuth/module setup as usual.
- Clicking the dismiss button should dismiss the notice persistently by storing the dismissal on the server-side. This should use the same implementation that #3360 has established, however it must use a different identifier (i.e. the dismissals for the notification and the widget CTA should be kept separate, even though they are for a rather similar purpose - we want to make sure people don’t “accidentally” dismiss one; they should see both).
- Notification graphic: The Idea Hub module icon.
- Notification heading: Get new ideas to write about based on what people are searching for
- Notification text: Set up Idea Hub to get topic suggestions based on unanswered searches that match your site’s topic.
- Notification button texts: Set up / Dismiss
- The above notification should be shown on the Site Kit dashboard under the following conditions:
- The
ideaHubModule
feature flag is enabled. - The Idea Hub module is not active.
- The success feedback notification about having connected Site Kit or activated a module is not there (we want to avoid showing both together - it is okay though to show this one alongside any remote
core/site/data/notifications
notifications).
- The
Implementation Brief
- Once #3360 has been merged.
- Create
assets/js/components/notifications/IdeaHubModuleNotification.js
which exports theIdeaHubModuleNotification
functional component with the following details:- Create a constant for will be the predefined ID of the notification.
- Check if the module is active by quering the modules data store via the
getModule
function, passingidea-hub
as paramter and checking theactive
property from the result. Ifactive
is nottrue
, returnnull
. - Check if the notification has been dismissed by querying the user data store via the
isItemDismissed
selector, passing the ID defined in the first bullet point. If the item has been dismissed, returnnull
. - Internally
IdeaHubModuleNotification
uses theNotification
component with the following main prop values:title
,description
,ctaLabel
,SmallImageSVG
as defined in the AC.format
should besmall
type
should bewin-success
onCTAClick
: more below.onDismiss
more below.
- Add the
handleCTAClick
function which is the value for theonCTAClick
prop. The function should redirect the user to the module setup screen. To get the module setup URL, query the module’s data store via thegetAdminReauthURL
selector. Then dispatch thenavigateTo
action of thecore/location
data store to redirect the user. An example can be found inCompleteModuleActivationCTA
. - Add the
handleOnDismiss
function which is the value for theonDismiss
prop. The function should dispatch thedismissItem
action of the user data store, passing a notification ID defined in the first bullet point as parameter.
- Using `assets/js/components/legacy-notifications/index.js,
- import the
IdeaHubModuleNotification
component and create a variable by callingcreateAddToFilter
with the component as parameter as it is done for theUserInputPromptNotification
. - The
IdeaHubModuleNotification
component must be hooked to thegooglesitekit.DashboardNotifications
filter (similar to what’s been done with theUserInputPromptNotification
) based on the following conditions:- Check if the
ideaHubModule
feature flag is enabled by using theisFeatureEnabled
function. - Check if
notification
andsetup
are null, which means there are no setup notifications being shown at the same time.
- Check if the
- import the
Test Coverage
- No new tests to be added.
Visual Regression Changes
- N/A
QA Brief
- Visit the “Modules -> Idea Hub -> Notications -> ModuleNotification -> Ready”
- The title, description, image should be as per the AC.
- Enable the
ideaHubModule
feature flag and don’t connect the module. - A notification with details as per the AC should appear on the main dashboard prompting the user to connect Idea Hub.
- If dismissed, check if the following XHR is made to
/wp-json/google-site-kit/v1/core/user/data/dismiss-item
Changelog entry
- Add Idea Hub dashboard notification to inform users about new Idea Hub module.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top Results From Across the Web
What is Idea Hub? | WordPress.org
Hi, I always see Idea Hub on the update notification messages, but I don't know what it is. There is no documentation about...
Read more >site-kit-wp/readme.txt at develop - GitHub
Add Idea Hub dashboard notification to inform users about new Idea Hub module. See [#3523](https://github.com/google/site-kit-wp/issues/3523).
Read more >Use Alerts and Case Management in Student Success Hub for ...
Explain how alerts keep stakeholders informed of students' needs. Use Student Success Hub for collaborative case management. Student support is a team sport ......
Read more >Notification Hubs - Mobile push notifications - Microsoft Azure
Learn about Azure Notification Hubs. Send push notifications to iOS, Android, Windows, or Kindle from any backend. Easier mobile app development.
Read more >STUDENT HUB ACCOUNT
If you attend an approved private high school, use your social security number to register. ... This includes a login name, password, password...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @wpdarren A follow up PR has been created: https://github.com/google/site-kit-wp/pull/3739
QA Update: ✅
Verified:
set up
button sends the user to the connect service page.Get new ideas to write about based on what people are searching for
Set up Idea Hub to get topic suggestions based on unanswered searches that match your site’s topic.
Set up
/Dismiss
Additional checks: made sure that the notice appeared correctly for our primary supported browsers, i.e. Firefox, Safari and also mobile devices on Android and iOS.