Skip to content

Commit

Permalink
Merge pull request #781 from PrestaShopCorp/feat/perf-improvment
Browse files Browse the repository at this point in the history
Perf improvement
  • Loading branch information
intraordinaire authored Nov 12, 2024
2 parents eda986e + 52c741f commit a7c1204
Show file tree
Hide file tree
Showing 9 changed files with 252 additions and 266 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_mbo</name>
<displayName><![CDATA[PrestaShop Marketplace in your Back Office]]></displayName>
<version><![CDATA[4.12.0]]></version>
<version><![CDATA[4.13.0]]></version>
<description><![CDATA[Discover the best PrestaShop modules to optimize your online store.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
Expand Down
6 changes: 3 additions & 3 deletions ps_mbo.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
use PrestaShop\Module\Mbo\Addons\Subscriber\ModuleManagementEventSubscriber;
use PrestaShop\Module\Mbo\Api\Security\AdminAuthenticationProvider;
use PrestaShop\Module\Mbo\Helpers\Config;
use PrestaShop\Module\Mbo\Helpers\ErrorHelper;
use PrestaShop\PrestaShop\Adapter\SymfonyContainer;
use PrestaShopBundle\Event\ModuleManagementEvent;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Dotenv\Dotenv;
use PrestaShop\Module\Mbo\Helpers\ErrorHelper;

class ps_mbo extends Module
{
Expand All @@ -49,7 +49,7 @@ class ps_mbo extends Module
/**
* @var string
*/
public const VERSION = '4.12.0';
public const VERSION = '4.13.0';

public const CONTROLLERS_WITH_CONNECTION_TOOLBAR = [
'AdminModulesManage',
Expand Down Expand Up @@ -94,7 +94,7 @@ class ps_mbo extends Module
public function __construct()
{
$this->name = 'ps_mbo';
$this->version = '4.12.0';
$this->version = '4.13.0';
$this->author = 'PrestaShop';
$this->tab = 'administration';
$this->module_key = '6cad5414354fbef755c7df4ef1ab74eb';
Expand Down
17 changes: 1 addition & 16 deletions src/Controller/Admin/ModuleCatalogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,6 @@ class ModuleCatalogController extends ModuleAbstractController
*/
public function indexAction(): Response
{
$moduleUri = __PS_BASE_URI__ . 'modules/ps_mbo/';

$extraParams = [
'cdc_error_templating_url' => $moduleUri . 'views/js/cdc-error-templating.js',
'cdc_error_templating_css' => $moduleUri . 'views/css/cdc-error-templating.css',
];

$cdcJsFile = getenv('MBO_CDC_URL');
if (false === $cdcJsFile || !is_string($cdcJsFile) || empty($cdcJsFile)) {
$extraParams['cdc_script_not_found'] = true;
$extraParams['cdc_error_url'] = $moduleUri . 'views/js/cdc-error.js';
} else {
$extraParams['cdc_url'] = $cdcJsFile;
}

/*********************
* PrestaShop Account *
* *******************/
Expand Down Expand Up @@ -116,7 +101,7 @@ public function indexAction(): Response
'You do not have permission to add this.',
'Admin.Notifications.Error'
),
] + $extraParams
]
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Traits/Hooks/UseActionAdminControllerSetMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ private function loadCdcMedia(): void
}
if (
!Tab::mayDisplayRecommendedModules($controllerName) &&
!in_array($controllerName, self::CONTROLLERS_WITH_CDC_SCRIPT)
!in_array($controllerName, self::CONTROLLERS_WITH_CDC_SCRIPT) &&
$controllerName !== 'AdminPsMboModule'
) {
return;
}
Expand Down
228 changes: 0 additions & 228 deletions src/Traits/Hooks/UseActionDispatcherBefore.php

This file was deleted.

Loading

0 comments on commit a7c1204

Please sign in to comment.