Skip to content
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

Jetpack Partner Portal: add the feature flag and required modules for a page to create a WP.com site #81056

Merged
merged 3 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions client/jetpack-cloud/sections/partner-portal/controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
import { ToSConsent } from 'calypso/state/partner-portal/types';
import getSites from 'calypso/state/selectors/get-sites';
import Header from './header';
import WPCOMAtomicHosting from './primary/wpcom-atomic-hosting';
import type PageJS from 'page';

export function partnerContext( context: PageJS.Context, next: () => void ): void {
Expand Down Expand Up @@ -163,6 +164,13 @@ export function landingPageContext() {
return;
}

export function wpcomAtomicHostingContext( context: PageJS.Context, next: () => void ): void {
context.header = <Header />;
context.secondary = <PartnerPortalSidebar path={ context.path } />;
context.primary = <WPCOMAtomicHosting />;
next();
}

/**
* Require the user to have a partner with at least 1 active partner key.
*
Expand Down
14 changes: 14 additions & 0 deletions client/jetpack-cloud/sections/partner-portal/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import config from '@automattic/calypso-config';
import page from 'page';
import { makeLayout, render as clientRender } from 'calypso/controller/index.web';
import * as controller from './controller';
Expand Down Expand Up @@ -148,4 +149,17 @@ export default function () {
makeLayout,
clientRender
);

// WPCOM Atomic Hosting Page
if ( config.isEnabled( 'jetpack/pro-dashboard-wpcom-atomic-hosting' ) ) {
page(
`/partner-portal/create-site`,
controller.requireAccessContext,
controller.requireTermsOfServiceConsentContext,
controller.requireSelectedPartnerKeyContext,
controller.wpcomAtomicHostingContext,
makeLayout,
clientRender
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { useTranslate } from 'i18n-calypso';
import CardHeading from 'calypso/components/card-heading';
import Layout from '../../layout';
import LayoutHeader from '../../layout/header';

export default function WPCOMAtomicHosting() {
const translate = useTranslate();
const title = translate( 'Create a new WordPress.com site' );
return (
<Layout title={ title } wide>
<LayoutHeader>
<CardHeading size={ 36 }>{ title }</CardHeading>
</LayoutHeader>
</Layout>
);
}
1 change: 1 addition & 0 deletions config/jetpack-cloud-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"jetpack/pro-dashboard-jetpack-boost": true,
"jetpack/pro-dashboard-monitor-multiple-email-recipients": true,
"jetpack/pro-dashboard-monitor-paid-tier": true,
"jetpack/pro-dashboard-wpcom-atomic-hosting": true,
yashwin marked this conversation as resolved.
Show resolved Hide resolved
"jetpack/pro-dashboard-monitor-sms-notification": true,
"jetpack/search-product": true,
"jetpack/server-credentials-advanced-flow": true,
Expand Down
1 change: 1 addition & 0 deletions config/jetpack-cloud-horizon.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"jetpack/pro-dashboard-jetpack-boost": false,
"jetpack/pro-dashboard-monitor-multiple-email-recipients": true,
"jetpack/pro-dashboard-monitor-paid-tier": true,
"jetpack/pro-dashboard-wpcom-atomic-hosting": true,
"jetpack/pro-dashboard-monitor-sms-notification": true,
"jetpack/search-product": true,
"jetpack/server-credentials-advanced-flow": true,
Expand Down
1 change: 1 addition & 0 deletions config/jetpack-cloud-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"jetpack/pro-dashboard-jetpack-boost": false,
"jetpack/pro-dashboard-monitor-multiple-email-recipients": true,
"jetpack/pro-dashboard-monitor-paid-tier": true,
"jetpack/pro-dashboard-wpcom-atomic-hosting": false,
"jetpack/pro-dashboard-monitor-sms-notification": true,
"jetpack/server-credentials-advanced-flow": true,
"jetpack/simplify-pricing-structure": false,
Expand Down
1 change: 1 addition & 0 deletions config/jetpack-cloud-stage.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"jetpack/pro-dashboard-jetpack-boost": false,
"jetpack/pro-dashboard-monitor-multiple-email-recipients": true,
"jetpack/pro-dashboard-monitor-paid-tier": true,
"jetpack/pro-dashboard-wpcom-atomic-hosting": false,
"jetpack/pro-dashboard-monitor-sms-notification": true,
"jetpack/search-product": true,
"jetpack/server-credentials-advanced-flow": true,
Expand Down