Skip to content

Commit

Permalink
PRESS0-2277, PRESS0-2282 - fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
aratidgr8 committed Oct 10, 2024
1 parent ed407fe commit 312527f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 18 deletions.
43 changes: 33 additions & 10 deletions inc/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use function NewfoldLabs\WP\Context\getContext;
use function NewfoldLabs\WP\Module\Features\isEnabled;
use NewfoldLabs\WP\Module\Data\SiteCapabilities;

/**
* \Bluehost\Admin
Expand Down Expand Up @@ -66,6 +67,10 @@ public static function add_to_runtime( $sdk ) {
public static function subpages() {
global $bluehost_module_container;

$capability = new SiteCapabilities();

$hasSolution = $capability->get( 'hasSolution' );

$home = array(
'bluehost#/home' => __( 'Home', 'wp-plugin-bluehost' ),
);
Expand All @@ -78,6 +83,9 @@ public static function subpages() {
$marketplace = array(
'bluehost#/marketplace' => __( 'Marketplace', 'wp-plugin-bluehost' ),
);
$mypluginsandtools = array(
'bluehost#/my_plugins_and_tools' => __( 'My Plugins & Tools', 'wp-plugin-bluehost' ),
);
// add performance if enabled
$performance = isEnabled( 'performance' )
? array(
Expand All @@ -97,16 +105,31 @@ public static function subpages() {
'bluehost#/help' => __( 'Help', 'wp-plugin-bluehost' ),
);

return array_merge(
$home,
$pagesAndPosts,
$store,
$marketplace,
$performance,
$settings,
$staging,
$help
);
if($hasSolution){
return array_merge(
$home,
$pagesAndPosts,
$store,
$marketplace,
$mypluginsandtools,
$performance,
$settings,
$staging,
$help
);
}
else{
return array_merge(
$home,
$pagesAndPosts,
$store,
$marketplace,
$performance,
$settings,
$staging,
$help
);
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/app/data/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const topRoutePaths = [
'/pages-and-posts',
'/store',
'/marketplace',
'/my_plugins_and_tools',
'/my_plugins_and_tools',
'/performance',
'/settings',
'/staging',
Expand Down Expand Up @@ -138,13 +138,13 @@ export const routes = [
subRoutes: await getMarketplaceSubnavRoutes(),
condition: true,
},
{
NewfoldRuntime.hasCapability( 'hasSolution' ) && {
name: '/my_plugins_and_tools',
title: __( 'My Plugins & Tools', 'wp-plugin-bluehost' ),
Component: Solutions,
Icon: PuzzlePieceIcon,
condition: true,
},
},
{
name: '/performance',
title: __( 'Performance', 'wp-plugin-bluehost' ),
Expand Down
7 changes: 2 additions & 5 deletions src/app/pages/solutions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime';
import { default as NewfoldEntitlements } from '@modules/wp-module-solutions/components/entitlements';

const Solutions = () => {

// constants to pass to module
const moduleConstants = {
text: {
Expand Down Expand Up @@ -38,13 +37,11 @@ const Solutions = () => {
useNavigate,
NewfoldRuntime,
};

return (
<Page>
<Container
className={
'newfold-entitlements-container nfd-overflow-clip'
}
className={ 'newfold-entitlements-container nfd-overflow-clip' }
>
<NewfoldEntitlements
methods={ moduleMethods }
Expand Down

0 comments on commit 312527f

Please sign in to comment.