Skip to content

Commit

Permalink
Add 'a4a-product-page-redesign' feature flag and use it to load produ…
Browse files Browse the repository at this point in the history
…cts overview v2 page.
  • Loading branch information
jkguidaven committed Jan 13, 2025
1 parent 1dc90b4 commit 3d707e3
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
20 changes: 13 additions & 7 deletions client/a8c-for-agencies/sections/marketplace/controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { getValidHostingSection } from './lib/hosting';
import { getValidBrand } from './lib/product-brand';
import DownloadProducts from './primary/download-products';
import ProductsOverview from './products-overview';
import ProductsOverviewV2 from './products-overview-v2';

export const marketplaceContext: Callback = () => {
page.redirect( A4A_MARKETPLACE_HOSTING_LINK );
Expand All @@ -29,16 +30,21 @@ export const marketplaceProductsContext: Callback = ( context, next ) => {

context.secondary = <MarketplaceSidebar path={ context.path } />;
const purchaseType = purchase_type === 'referral' ? 'referral' : undefined;

context.primary = (
<>
<PageViewTracker title="Marketplace > Products" path={ context.path } />
<ProductsOverview
siteId={ site_id }
suggestedProduct={ product_slug }
defaultMarketplaceType={ purchaseType }
productBrand={ getValidBrand( productBrand ) }
searchQuery={ search_query }
/>
{ isEnabled( 'a4a-product-page-redesign' ) ? (
<ProductsOverviewV2 />
) : (
<ProductsOverview
siteId={ site_id }
suggestedProduct={ product_slug }
defaultMarketplaceType={ purchaseType }
productBrand={ getValidBrand( productBrand ) }
searchQuery={ search_query }
/>
) }
</>
);
next();
Expand Down
6 changes: 5 additions & 1 deletion client/a8c-for-agencies/sections/marketplace/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isEnabled } from '@automattic/calypso-config';
import page from '@automattic/calypso-router';
import {
A4A_MARKETPLACE_ASSIGN_LICENSE_LINK,
Expand All @@ -20,8 +21,11 @@ import {

export default function () {
page( A4A_MARKETPLACE_LINK, requireAccessContext, marketplaceContext, makeLayout, clientRender );

page(
`${ A4A_MARKETPLACE_PRODUCTS_LINK }/:brand?`,
isEnabled( 'a4a-product-page-redesign' )
? A4A_MARKETPLACE_PRODUCTS_LINK
: `${ A4A_MARKETPLACE_PRODUCTS_LINK }/:brand?`,
requireAccessContext,
marketplaceProductsContext,
makeLayout,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function ProductsOverviewV2() {
return <div>Products Overview V2</div>;
}
1 change: 1 addition & 0 deletions config/a8c-for-agencies-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"a4a/site-migration": true,
"a4a-automated-referrals": true,
"a4a-partner-directory": false,
"a4a-product-page-redesign": true,
"a4a-hosting-page-redesign-v3": true,
"a4a-dev-sites": true,
"a4a-migrations-page-v2": true,
Expand Down
1 change: 1 addition & 0 deletions config/a8c-for-agencies-horizon.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"a4a/site-migration": true,
"a4a-automated-referrals": true,
"a4a-partner-directory": false,
"a4a-product-page-redesign": false,
"a4a-hosting-page-redesign-v3": true,
"a4a-dev-sites": true,
"a4a-migrations-page-v2": true,
Expand Down
1 change: 1 addition & 0 deletions config/a8c-for-agencies-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"oauth": true,
"a4a-automated-referrals": true,
"a4a-partner-directory": false,
"a4a-product-page-redesign": false,
"a4a-hosting-page-redesign-v3": true,
"a4a-dev-sites": true,
"a4a-migrations-page-v2": true,
Expand Down
1 change: 1 addition & 0 deletions config/a8c-for-agencies-stage.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"a4a/site-migration": false,
"a4a-automated-referrals": true,
"a4a-partner-directory": false,
"a4a-product-page-redesign": false,
"a4a-hosting-page-redesign-v3": true,
"a4a-dev-sites": true,
"a4a-migrations-page-v2": true,
Expand Down

0 comments on commit 3d707e3

Please sign in to comment.