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

CC-34261 Split navigation for MP and BO. #409

Merged
Show file tree
Hide file tree
Changes from all 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
33 changes: 18 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions config/Zed/navigation-main-merchant-portal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0"?>
<config>
<merchant-portal-dashboard>
<label>Dashboard</label>
<title>Merchant Dashboard</title>
<icon>dashboard</icon>
<bundle>dashboard-merchant-portal-gui</bundle>
<controller>dashboard</controller>
<action>index</action>
</merchant-portal-dashboard>
<merchant-portal-profile>
<label>Profile</label>
<title>Profile</title>
<icon>profile</icon>
<bundle>merchant-profile-merchant-portal-gui</bundle>
<controller>profile</controller>
<action>index</action>
</merchant-portal-profile>
<product-offer-merchant-portal-gui>
<label>Offers</label>
<title>Offers</title>
<icon>offers</icon>
<bundle>product-offer-merchant-portal-gui</bundle>
<controller>product-offers</controller>
<action>index</action>
<pages>
<create-offer>
<label>Create Offer</label>
<title>Create Offer</title>
<bundle>product-offer-merchant-portal-gui</bundle>
<controller>product-list</controller>
<action>index</action>
<visible>0</visible>
</create-offer>
</pages>
</product-offer-merchant-portal-gui>
<sales-merchant-portal-gui>
<label>Orders</label>
<title>Orders</title>
<icon>orders</icon>
<bundle>sales-merchant-portal-gui</bundle>
<controller>orders</controller>
<action>index</action>
</sales-merchant-portal-gui>
<product-merchant-portal-gui>
<label>Products</label>
<title>Products</title>
<icon>products</icon>
<bundle>product-merchant-portal-gui</bundle>
<controller>products</controller>
<action>index</action>
</product-merchant-portal-gui>
<agent-dashboard-merchant-portal-gui>
<label>Merchant Users</label>
<title>Merchant Users</title>
<icon>user-group</icon>
<bundle>agent-dashboard-merchant-portal-gui</bundle>
<controller>merchant-users</controller>
<action>index</action>
</agent-dashboard-merchant-portal-gui>
<merchant-portal-payment-settings>
<label>Payment Settings</label>
<title>Payment Settings</title>
<icon>payment</icon>
<bundle>merchant-app-merchant-portal-gui</bundle>
<controller>payment-settings</controller>
<action>index</action>
<pages>
<onboarding>
<label>Onboarding</label>
<title>Onboarding</title>
<icon>payment</icon>
<bundle>merchant-app-merchant-portal-gui</bundle>
<controller>payment-settings</controller>
<action>onboarding</action>
<visible>0</visible>
</onboarding>
</pages>
</merchant-portal-payment-settings>
</config>
77 changes: 0 additions & 77 deletions config/Zed/navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -595,81 +595,4 @@
</storage-gui>
</pages>
</maintenance>
<merchant-portal-dashboard>
<label>Dashboard</label>
<title>Merchant Dashboard</title>
<icon>dashboard</icon>
<bundle>dashboard-merchant-portal-gui</bundle>
<controller>dashboard</controller>
<action>index</action>
</merchant-portal-dashboard>
<merchant-portal-profile>
<label>Profile</label>
<title>Profile</title>
<icon>profile</icon>
<bundle>merchant-profile-merchant-portal-gui</bundle>
<controller>profile</controller>
<action>index</action>
</merchant-portal-profile>
<product-offer-merchant-portal-gui>
<label>Offers</label>
<title>Offers</title>
<icon>offers</icon>
<bundle>product-offer-merchant-portal-gui</bundle>
<controller>product-offers</controller>
<action>index</action>
<pages>
<create-offer>
<label>Create Offer</label>
<title>Create Offer</title>
<bundle>product-offer-merchant-portal-gui</bundle>
<controller>product-list</controller>
<action>index</action>
<visible>0</visible>
</create-offer>
</pages>
</product-offer-merchant-portal-gui>
<sales-merchant-portal-gui>
<label>Orders</label>
<title>Orders</title>
<icon>orders</icon>
<bundle>sales-merchant-portal-gui</bundle>
<controller>orders</controller>
<action>index</action>
</sales-merchant-portal-gui>
<product-merchant-portal-gui>
<label>Products</label>
<title>Products</title>
<icon>products</icon>
<bundle>product-merchant-portal-gui</bundle>
<controller>products</controller>
<action>index</action>
</product-merchant-portal-gui>
<agent-dashboard-merchant-portal-gui>
<label>Merchant Users</label>
<title>Merchant Users</title>
<icon>user-group</icon>
<bundle>agent-dashboard-merchant-portal-gui</bundle>
<controller>merchant-users</controller>
<action>index</action>
</agent-dashboard-merchant-portal-gui>
<merchant-portal-payment-settings>
<label>Payment Settings</label>
<title>Payment Settings</title>
<icon>payment</icon>
<bundle>merchant-app-merchant-portal-gui</bundle>
<controller>payment-settings</controller>
<action>index</action>
<pages>
<onboarding>
<label>Onboarding</label>
<title>Onboarding</title>
<icon>payment</icon>
<bundle>merchant-app-merchant-portal-gui</bundle>
<controller>payment-settings</controller>
<action>onboarding</action>
<visible>0</visible>
</onboarding>
</pages>
</merchant-portal-payment-settings>
</config>
2 changes: 2 additions & 0 deletions src/Pyz/Zed/Twig/TwigDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use Spryker\Zed\GuiTable\Communication\Plugin\Twig\GuiTableConfigurationTwigPlugin;
use Spryker\Zed\Http\Communication\Plugin\Twig\HttpKernelTwigPlugin;
use Spryker\Zed\Http\Communication\Plugin\Twig\RuntimeLoaderTwigPlugin;
use Spryker\Zed\MerchantPortalApplication\Communication\Plugin\Twig\MerchantNavigationTypeTwigPlugin;
use Spryker\Zed\MerchantUser\Communication\Plugin\Twig\MerchantUserTwigPlugin;
use Spryker\Zed\Money\Communication\Plugin\Twig\MoneyTwigPlugin;
use Spryker\Zed\Scheduler\Communication\Plugin\Twig\SchedulerTwigPlugin;
Expand Down Expand Up @@ -107,6 +108,7 @@ protected function getTwigPlugins(): array
new BooleanToStringTwigPlugin(),
new GuiTableConfigurationTwigPlugin(),
new MerchantUserTwigPlugin(),
new MerchantNavigationTypeTwigPlugin(),
];
}

Expand Down
50 changes: 50 additions & 0 deletions src/Pyz/Zed/ZedNavigation/ZedNavigationConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@

class ZedNavigationConfig extends SprykerZedNavigationConfig
{
/**
* @uses \Spryker\Zed\MerchantPortalApplication\Communication\Plugin\Twig\MerchantNavigationTypeTwigPlugin::NAVIGATION_TYPE_MAIN_MERCHANT_PORTAL
*
* @var string
*/
protected const NAVIGATION_TYPE_MAIN_MERCHANT_PORTAL = 'main-merchant-portal';

/**
* @uses \Spryker\Zed\MerchantPortalApplication\Communication\Plugin\Twig\MerchantNavigationTypeTwigPlugin::NAVIGATION_TYPE_SECONDARY_MERCHANT_PORTAL
*
* @var string
*/
protected const NAVIGATION_TYPE_SECONDARY_MERCHANT_PORTAL = 'secondary-merchant-portal';

/**
* @api
*
Expand All @@ -20,4 +34,40 @@ public function getMergeStrategy(): string
{
return static::BREADCRUMB_MERGE_STRATEGY;
}

/**
* @return array<string>
*/
public function getCacheFilePaths(): array
{
$cacheFilePaths = parent::getCacheFilePaths();
$cacheFilePaths[static::NAVIGATION_TYPE_MAIN_MERCHANT_PORTAL] = $this->getCacheDirName() . 'navigation-main-merchant-portal.cache';
$cacheFilePaths[static::NAVIGATION_TYPE_SECONDARY_MERCHANT_PORTAL] = $this->getCacheDirName() . 'navigation-secondary-merchant-portal.cache';

return $cacheFilePaths;
}

/**
* @return array<string>
*/
public function getRootNavigationSchemaPaths(): array
{
$rootNavigationSchemaPaths = parent::getRootNavigationSchemaPaths();
$rootNavigationSchemaPaths[static::NAVIGATION_TYPE_MAIN_MERCHANT_PORTAL] = $this->getRootNavigationSchemasDirName() . 'navigation-main-merchant-portal.xml';
$rootNavigationSchemaPaths[static::NAVIGATION_TYPE_SECONDARY_MERCHANT_PORTAL] = $this->getRootNavigationSchemasDirName() . 'navigation-secondary-merchant-portal.xml';

return $rootNavigationSchemaPaths;
}

/**
* @return array<string>
*/
public function getNavigationSchemaFileNamePatterns(): array
{
$navigationSchemaFileNamePatterns = parent::getNavigationSchemaFileNamePatterns();
$navigationSchemaFileNamePatterns[static::NAVIGATION_TYPE_MAIN_MERCHANT_PORTAL] = 'navigation-main-merchant-portal.xml';
$navigationSchemaFileNamePatterns[static::NAVIGATION_TYPE_SECONDARY_MERCHANT_PORTAL] = 'navigation-secondary-merchant-portal.xml';

return $navigationSchemaFileNamePatterns;
}
}
Loading