-
Notifications
You must be signed in to change notification settings - Fork 375
Implement the RRM express setup dashboard entry point. #13107
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
Open
JakePT
wants to merge
25
commits into
develop
Choose a base branch
from
enhancement/12947-rrm-express-setup-entry
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
cf6e831
Implement the RRM express setup dashboard entry point.
JakePT 271c3a7
Fix failing Banner tests.
JakePT 51a0db5
Improve CTA button loading behaviour.
JakePT ebbfd2b
Merge branch 'develop' into enhancement/12947-rrm-express-setup-entry.
nfmohit a8dde5a
Enhance module activation by adding support for `redirectQueryArgs`.
nfmohit 81f1ff3
Apply suggestion from @nfmohit
JakePT 3cde5cd
Merge branch 'develop' into enhancement/12947-rrm-express-setup-entry.
JakePT 00ace2a
Address code review feedback.
JakePT d933ca9
Convert stories to TypeScript.
JakePT 6773ada
Update assets/js/components/PoweredBy.tsx
JakePT 1acab6f
Update assets/js/components/PoweredBy.stories.js
JakePT 8d507c1
Update assets/js/components/PoweredBy.tsx
JakePT ab3d122
Update assets/js/googlesitekit/widgets/register-defaults.js
JakePT 1735f51
Add PoweredByModule component, move setup CTA styles.
JakePT a3c980d
Improve typing of stories.
JakePT e61bc71
Correct component name.
JakePT af5343b
Type fixes.
JakePT 8a6a78e
Merge branch 'develop' into enhancement/12947-rrm-express-setup-entry.
nfmohit f87e5fb
Address CR feedback.
nfmohit 34dd345
Update assets/js/modules/reader-revenue-manager/widgets/index.ts
JakePT 265b099
Update assets/js/modules/reader-revenue-manager/components/dashboard/…
JakePT 8efcb4d
Consistent dismissing vars.
JakePT 99120e7
Update component names and structure.
JakePT 56ff75f
Move component to directory.
JakePT a67fc15
Update VRT references.
JakePT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
nfmohit marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /** | ||
| * "Powered By Module" Component Stories. | ||
| * | ||
| * Site Kit by Google, Copyright 2026 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| /** | ||
| * External dependencies | ||
| */ | ||
| import { ReactElement } from 'react'; | ||
|
|
||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| import { WPDataRegistry } from '@wordpress/data/build-types/registry'; | ||
|
|
||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import PoweredByModule, { | ||
| PoweredByModuleProps, | ||
| } from '@/js/components/PoweredByModule'; | ||
| import { MODULE_SLUG_READER_REVENUE_MANAGER } from '@/js/modules/reader-revenue-manager/constants'; | ||
| import { Story } from '@/js/types/Story'; | ||
| import { provideModuleRegistrations, provideModules } from '@tests/js/utils'; | ||
| import WithRegistrySetup from '@tests/js/WithRegistrySetup'; | ||
|
|
||
| function Template( args: PoweredByModuleProps ) { | ||
| return <PoweredByModule { ...args } />; | ||
| } | ||
|
|
||
| export const ReaderRevenueManager = Template.bind( | ||
| {} | ||
| ) as Story< PoweredByModuleProps >; | ||
| ReaderRevenueManager.storyName = 'Reader Revenue Manager'; | ||
| ReaderRevenueManager.args = { | ||
| slug: MODULE_SLUG_READER_REVENUE_MANAGER, | ||
| }; | ||
|
|
||
| export default { | ||
| title: 'Components/PoweredByModule', | ||
| component: PoweredByModule, | ||
| decorators: [ | ||
| ( StoryComponent: () => ReactElement ) => { | ||
| function setupRegistry( registry: WPDataRegistry ) { | ||
| provideModules( registry ); | ||
| provideModuleRegistrations( registry ); | ||
| } | ||
|
|
||
| return ( | ||
| <WithRegistrySetup func={ setupRegistry }> | ||
| <StoryComponent /> | ||
| </WithRegistrySetup> | ||
| ); | ||
| }, | ||
| ], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| /** | ||
| * PoweredByModule component. | ||
| * | ||
| * Site Kit by Google, Copyright 2026 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| /** | ||
| * External dependencies | ||
| */ | ||
| import classnames from 'classnames'; | ||
|
|
||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| import { __, sprintf } from '@wordpress/i18n'; | ||
|
|
||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { Select, useSelect } from 'googlesitekit-data'; | ||
| import Typography from '@/js/components/Typography'; | ||
| import { SIZE_SMALL, TYPE_BODY } from '@/js/components/Typography/constants'; | ||
| import { CORE_MODULES } from '@/js/googlesitekit/modules/datastore/constants'; | ||
|
|
||
| export interface PoweredByModuleProps { | ||
| slug: string; | ||
| } | ||
|
|
||
| export default function PoweredByModule( { slug }: PoweredByModuleProps ) { | ||
| const { Icon, name } = useSelect( | ||
| ( select: Select ) => select( CORE_MODULES ).getModule( slug ), | ||
| [ slug ] | ||
| ); | ||
|
|
||
| const text = sprintf( | ||
| // translators: %s: Module name. | ||
| __( 'Powered by %s', 'google-site-kit' ), | ||
| name | ||
| ); | ||
|
|
||
| const className = classnames( | ||
| 'googlesitekit-powered-by-module', | ||
| `googlesitekit-powered-by-module--${ slug }` | ||
| ); | ||
|
|
||
| return ( | ||
| <div className={ className }> | ||
| <Icon | ||
| aria-hidden="true" | ||
| className="googlesitekit-powered-by-module__icon" | ||
| /> | ||
| <Typography | ||
| as="div" | ||
| className="googlesitekit-powered-by-module__text" | ||
| size={ SIZE_SMALL } | ||
| type={ TYPE_BODY } | ||
| > | ||
| { text } | ||
| </Typography> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.