Skip to content

Commit

Permalink
v4.5.0 (#600)
Browse files Browse the repository at this point in the history
* Do not add filterCategoryRef if category is other (#593)

* [MBO-829] Redirect to Modules catalog if contextual tabClassName is not given

* Add htaccess to forbid directory listing and access to env files

* Do not add filterCategoryRef if category is other (#593)

* feat(Context): ✨ Add data in context.

Adding Module catalog URL & Theme catalog URL to be sure to have them everytime with the correct token.
Adding PHP version for future use.

* New translations ModulesMboErrors.en-US.xlf (Romanian)

* New translations ModulesMboErrors.en-US.xlf (French)

* New translations ModulesMboErrors.en-US.xlf (Spanish)

* New translations ModulesMboErrors.en-US.xlf (German)

* New translations ModulesMboErrors.en-US.xlf (Italian)

* New translations ModulesMboErrors.en-US.xlf (Dutch)

* New translations ModulesMboErrors.en-US.xlf (Polish)

* New translations ModulesMboErrors.en-US.xlf (Portuguese)

* New translations ModulesMboErrors.en-US.xlf (Russian)

* New translations ModulesMboGlobal.en-US.xlf (Romanian)

* New translations ModulesMboGlobal.en-US.xlf (French)

* New translations ModulesMboGlobal.en-US.xlf (Spanish)

* New translations ModulesMboGlobal.en-US.xlf (German)

* New translations ModulesMboGlobal.en-US.xlf (Italian)

* New translations ModulesMboGlobal.en-US.xlf (Dutch)

* New translations ModulesMboGlobal.en-US.xlf (Polish)

* New translations ModulesMboGlobal.en-US.xlf (Portuguese)

* New translations ModulesMboGlobal.en-US.xlf (Russian)

* New translations ModulesMboLinks.en-US.xlf (Romanian)

* New translations ModulesMboLinks.en-US.xlf (French)

* New translations ModulesMboLinks.en-US.xlf (Spanish)

* New translations ModulesMboLinks.en-US.xlf (German)

* New translations ModulesMboLinks.en-US.xlf (Italian)

* New translations ModulesMboLinks.en-US.xlf (Dutch)

* New translations ModulesMboLinks.en-US.xlf (Polish)

* New translations ModulesMboLinks.en-US.xlf (Portuguese)

* New translations ModulesMboLinks.en-US.xlf (Russian)

* New translations ModulesMboModulescatalog.en-US.xlf (Romanian)

* New translations ModulesMboModulescatalog.en-US.xlf (French)

* New translations ModulesMboModulescatalog.en-US.xlf (Spanish)

* New translations ModulesMboModulescatalog.en-US.xlf (German)

* New translations ModulesMboModulescatalog.en-US.xlf (Italian)

* New translations ModulesMboModulescatalog.en-US.xlf (Dutch)

* New translations ModulesMboModulescatalog.en-US.xlf (Polish)

* New translations ModulesMboModulescatalog.en-US.xlf (Portuguese)

* New translations ModulesMboModulescatalog.en-US.xlf (Russian)

* New translations ModulesMboRecommendedmodulesandservices.en-US.xlf (Romanian)

* New translations ModulesMboRecommendedmodulesandservices.en-US.xlf (French)

* New translations ModulesMboRecommendedmodulesandservices.en-US.xlf (Spanish)

* New translations ModulesMboRecommendedmodulesandservices.en-US.xlf (German)

* New translations ModulesMboRecommendedmodulesandservices.en-US.xlf (Italian)

* New translations ModulesMboRecommendedmodulesandservices.en-US.xlf (Dutch)

* New translations ModulesMboRecommendedmodulesandservices.en-US.xlf (Polish)

* New translations ModulesMboRecommendedmodulesandservices.en-US.xlf (Portuguese)

* New translations ModulesMboRecommendedmodulesandservices.en-US.xlf (Russian)

* New translations ModulesMboLinks.en-US.xlf (Romanian)

* New translations ModulesMboLinks.en-US.xlf (French)

* New translations ModulesMboLinks.en-US.xlf (Spanish)

* New translations ModulesMboLinks.en-US.xlf (German)

* New translations ModulesMboLinks.en-US.xlf (Italian)

* New translations ModulesMboLinks.en-US.xlf (Dutch)

* New translations ModulesMboLinks.en-US.xlf (Polish)

* New translations ModulesMboLinks.en-US.xlf (Portuguese)

* New translations ModulesMboLinks.en-US.xlf (Russian)

* Update config.xml (#598)

* Bump version to 4.4.4 (#599)

* feat(Version): :tag: Bump version to 4.5.0

---------

Co-authored-by: Vincent Garcia <[email protected]>
  • Loading branch information
sowbiba and intraordinaire authored Jul 12, 2023
1 parent 8a8c56d commit 8a4f03b
Show file tree
Hide file tree
Showing 51 changed files with 373 additions and 343 deletions.
13 changes: 13 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Disable index view
Options -Indexes

# Hide a specific file
<Files .env>
Order allow,deny
Deny from all
</Files>

<Files ~ "^\.env(.*)$">
Order allow,deny
Deny from all
</Files>
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.4.3]]></version>
<version><![CDATA[4.5.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
4 changes: 2 additions & 2 deletions ps_mbo.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ps_mbo extends Module
/**
* @var string
*/
public const VERSION = '4.4.3';
public const VERSION = '4.5.0';

public const CONTROLLERS_WITH_CONNECTION_TOOLBAR = [
'AdminPsMboModule',
Expand Down Expand Up @@ -104,7 +104,7 @@ class ps_mbo extends Module
public function __construct()
{
$this->name = 'ps_mbo';
$this->version = '4.4.3';
$this->version = '4.5.0';
$this->author = 'PrestaShop';
$this->tab = 'administration';
$this->module_key = '6cad5414354fbef755c7df4ef1ab74eb';
Expand Down
9 changes: 6 additions & 3 deletions src/Addons/Provider/LinksProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,12 @@ public function getCategoryLink(string $categoryName): string
{
$category = $this->getCategoryByName($categoryName);

return $this->router->generate('admin_mbo_catalog_module', [
'filterCategoryRef' => $category ? $category->refMenu : '',
]);
$routeParams = [];
if ($category && 'other' !== mb_strtolower($categoryName)) {
$routeParams['filterCategoryRef'] = $category->refMenu;
}

return $this->router->generate('admin_mbo_catalog_module', $routeParams);
}

/**
Expand Down
17 changes: 14 additions & 3 deletions src/Controller/Admin/ModuleRecommendedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;

/**
Expand All @@ -47,14 +49,23 @@ public function __construct(
}

/**
* @return JsonResponse
* @return JsonResponse|RedirectResponse
*/
public function indexAction(): JsonResponse
public function indexAction(): Response
{
$response = new JsonResponse();
try {
$tabCollection = $this->get('mbo.tab.collection.provider')->getTabCollection();
$tabClassName = $this->requestStack->getCurrentRequest()->get('tabClassName');
if (null === $tabClassName) { // In case the recommended modules page is requested without giving tab context, we redirect to Modules catalog page
$routeParams = [];
$query = \Tools::getValue('bo_query');
if (false !== $query && !empty(trim($query))) {
$routeParams['keyword'] = trim($query);
}

return $this->redirectToRoute('admin_mbo_catalog_module', $routeParams);
}
$tabCollection = $this->get('mbo.tab.collection.provider')->getTabCollection();
$tab = $tabCollection->getTab($tabClassName);
$context = $this->get('mbo.cdc.context_builder')->getRecommendedModulesContext($tab);
$context['recommendation_format'] = $this->requestStack->getCurrentRequest()->get('recommendation_format');
Expand Down
3 changes: 3 additions & 0 deletions src/Service/View/ContextBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ private function getCommonContextContent(): array
'accounts_user_id' => $this->accountsDataProvider->getAccountsUserId(),
'accounts_shop_id' => $this->accountsDataProvider->getAccountsShopId(),
'accounts_token' => $this->accountsDataProvider->getAccountsToken(),
'module_catalog_url' => $this->router->generate('admin_mbo_catalog_module'),
'theme_catalog_url' => $this->router->generate('admin_mbo_catalog_theme'),
'php_version' => phpversion(),
];
}

Expand Down
2 changes: 1 addition & 1 deletion translations/de-DE/ModulesMboErrors.de-DE.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<trans-unit id="358cc9ee3a3d23d3390e5043122d9bea" approved="yes">
<source>PrestaShop was unable to log in to Addons. Please check your credentials and your Internet connection.</source>
<target state="final">PrestaShop konnte sich nicht bei Addons anmelden. Überprüfen Sie bitte Ihre Zugangsdaten und Ihre Internetverbindung.</target>
<note>Line: 105</note>
<note>Line: 104</note>
</trans-unit>
</body>
</file>
Expand Down
6 changes: 3 additions & 3 deletions translations/de-DE/ModulesMboGlobal.de-DE.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
<trans-unit id="a477136f1721bd17d18fc591f094f155" approved="yes">
<source>Oh no.. something went wrong</source>
<target state="final">Oh nein... etwas ist schief gelaufen</target>
<note>Line: 5</note>
<note>Line: 23</note>
</trans-unit>
<trans-unit id="77df45c90eb889b2731e6900d63ed7f7" approved="yes">
<source>There has been a problem on our side. Refresh your page and if the problem persists, try again later.</source>
<target state="final">Es gab ein Problem auf unserer Seite. Aktualisieren Sie Ihre Seite und wenn das Problem weiterhin besteht, versuchen Sie es später erneut.</target>
<note>Line: 8</note>
<note>Line: 26</note>
</trans-unit>
<trans-unit id="a593c6d1e05af324063dac348353cece" approved="yes">
<source>Refresh page</source>
<target state="final">Seite aktualisieren</target>
<note>Line: 13</note>
<note>Line: 31</note>
</trans-unit>
</body>
</file>
Expand Down
16 changes: 8 additions & 8 deletions translations/de-DE/ModulesMboLinks.de-DE.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="src/Addons/Provider/LinksProvider.php" source-language="en" target-language="de" datatype="plaintext">
<body>
<trans-unit id="ab9f0d838086d8699f9bc0f6b6bf0d59" approved="yes">
<source>https://accounts.distribution.prestashop.net/en/sign-up</source>
<target state="final">https://accounts.distribution.prestashop.net/de/sign-up</target>
<note>Line: 123</note>
<trans-unit id="85cc355c70aa470ad3f43e155b7e5e4c">
<source>https://authv2.prestashop.com/register</source>
<target state="translated">https://authv2.prestashop.com/register</target>
<note>Line: 122</note>
</trans-unit>
<trans-unit id="b14fa168a9724da44a82a09d80a98a7c" approved="yes">
<source>https://auth.prestashop.com/en/password/request</source>
<target state="final">https://auth.prestashop.com/de/passwort/anforderung</target>
<note>Line: 130</note>
<trans-unit id="6ab773a0870bec71712f3fae2641db30">
<source>https://authv2.prestashop.com/password/request </source>
<target state="translated">https://authv2.prestashop.com/password/request </target>
<note>Line: 129</note>
</trans-unit>
</body>
</file>
Expand Down
14 changes: 7 additions & 7 deletions translations/de-DE/ModulesMboModulescatalog.de-DE.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<trans-unit id="fc7da9518fbe20ebcaccbf5f8fd0e7df" approved="yes">
<source>Synchronized with Addons marketplace!</source>
<target state="final">Mit dem Addons Marktplatz verbunden!</target>
<note>Line: 145</note>
<note>Line: 143</note>
</trans-unit>
<trans-unit id="2ec0d16e4ca169baedb9b2d50ec5c6d7" approved="yes">
<source>Connected</source>
<target state="final">Angemeldet</target>
<note>Line: 157</note>
<note>Line: 155</note>
</trans-unit>
<trans-unit id="8bf910bb9ffa608d4c7fd6504667d62f" approved="yes">
<source>Connected as</source>
<target state="final">Angemeldet als</target>
<note>Line: 159</note>
<note>Line: 156</note>
</trans-unit>
</body>
</file>
Expand All @@ -24,17 +24,17 @@
<trans-unit id="cff7b4047c79f112e869481322d2924e" approved="yes">
<source>Module %module% successfully upgraded.</source>
<target state="final">Modul %module% wurde erfolgreich aktualisiert.</target>
<note>Line: 172</note>
<note>Line: 171</note>
</trans-unit>
<trans-unit id="22d6960d922158c548d123998be8dd91">
<source>Upgrade of module %module% failed. %error%</source>
<target state="translated">Upgrade des Moduls %module% fehlgeschlagen. %error%</target>
<note>Line: 208</note>
<note>Line: 207</note>
</trans-unit>
<trans-unit id="f8c9c7b6af2a8d50bc948bcf966c1d4b" approved="yes">
<source>Module %module% is already up to date</source>
<target state="final">Modul %module% ist bereits auf dem neuesten Stand</target>
<note>Line: 195</note>
<note>Line: 194</note>
</trans-unit>
</body>
</file>
Expand All @@ -52,7 +52,7 @@
<trans-unit id="eb1b4bb3667dd670210c7822badc2f1d" approved="yes">
<source>Check for updates</source>
<target state="final">Auf Update prüfen</target>
<note>Line: 38</note>
<note>Line: 46</note>
</trans-unit>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,92 +15,92 @@
<trans-unit id="f4f2cea02b1a48a90ad72f87f33ed501" approved="yes">
<source>Create a discount strategy</source>
<target state="final">Rabattstrategie erstellen</target>
<note>Line: 276</note>
<note>Line: 277</note>
</trans-unit>
<trans-unit id="71de09fcc1e3ca0c0a1e8cb40eb417ab" approved="yes">
<source>Customize pages</source>
<target state="final">Seiten individuell anpassen</target>
<note>Line: 279</note>
<note>Line: 280</note>
</trans-unit>
<trans-unit id="3015e7fd48efb2220c184c49eaeae2c1" approved="yes">
<source>Improve customer experience</source>
<target state="final">Kundenerlebnis verbessern</target>
<note>Line: 284</note>
<note>Line: 285</note>
</trans-unit>
<trans-unit id="269da544fe0eefcc12bb627f24fe2e81" approved="yes">
<source>Improve customer targeting</source>
<target state="final">Kundenansprache verbessern</target>
<note>Line: 287</note>
<note>Line: 288</note>
</trans-unit>
<trans-unit id="0b63003090cd7fae050a51da250bb0dc" approved="yes">
<source>Improve data strategy</source>
<target state="final">Datenstrategie verbessern</target>
<note>Line: 290</note>
<note>Line: 291</note>
</trans-unit>
<trans-unit id="95facf46cc97015c64679a153ff5c5a7" approved="yes">
<source>Improve SEO</source>
<target state="final">SEO verbessern</target>
<note>Line: 294</note>
<note>Line: 295</note>
</trans-unit>
<trans-unit id="27cfd6d0daa021773ca71830ce5590e4" approved="yes">
<source>Improve shipping</source>
<target state="final">Versand verbessern</target>
<note>Line: 297</note>
<note>Line: 298</note>
</trans-unit>
<trans-unit id="a9a13fd9a88fbdd52a7c1e25f3d0d946" approved="yes">
<source>Improve the checkout experience</source>
<target state="final">Kundenerfahrung an der Kasse verbessern</target>
<note>Line: 300</note>
<note>Line: 301</note>
</trans-unit>
<trans-unit id="2fad6e7317d3a912a3c8a60134397d86" approved="yes">
<source>Improve visuals</source>
<target state="final">Erscheinungsbild verbessern</target>
<note>Line: 303</note>
<note>Line: 304</note>
</trans-unit>
<trans-unit id="190bd26b051d54c12b31ccfb3008c8a5" approved="yes">
<source>Make shipping easier</source>
<target state="final">Versand vereinfachen</target>
<note>Line: 306</note>
<note>Line: 307</note>
</trans-unit>
<trans-unit id="2079b04a8fa4362967a9342028381090" approved="yes">
<source>Make your deliveries easier</source>
<target state="final">Lieferungen leichter machen</target>
<note>Line: 309</note>
<note>Line: 310</note>
</trans-unit>
<trans-unit id="61bb24f36546df402ea09b43dc5c9d28" approved="yes">
<source>Optimize order management</source>
<target state="final">Auftragsverwaltung verbessern</target>
<note>Line: 312</note>
<note>Line: 313</note>
</trans-unit>
<trans-unit id="1d929590b318c7d4746d15f1fdc19c81">
<source>Optimize product catalog</source>
<target state="translated">Den Produktkatalog optimieren</target>
<note>Line: 315</note>
<note>Line: 316</note>
</trans-unit>
<trans-unit id="f28626bfbef9b3fffea9377233f2b6dd" approved="yes">
<source>Optimize product creation</source>
<target state="final">Die Produktgestaltung optimieren</target>
<note>Line: 318</note>
<note>Line: 319</note>
</trans-unit>
<trans-unit id="92efe9f2090c8ef8b4525d9c87efb992" approved="yes">
<source>Promote brands</source>
<target state="final">Marken bewerben</target>
<note>Line: 321</note>
<note>Line: 322</note>
</trans-unit>
<trans-unit id="a4098c8673dde7faab7999c2676c3522" approved="yes">
<source>Simplify accounting</source>
<target state="final">Buchhaltung vereinfachen</target>
<note>Line: 325</note>
<note>Line: 326</note>
</trans-unit>
<trans-unit id="c70ae1b7165361802d85093a3e046107" approved="yes">
<source>Simplify store management</source>
<target state="final">Ladenverwaltung verbessern</target>
<note>Line: 328</note>
<note>Line: 329</note>
</trans-unit>
<trans-unit id="e39767bb8e247250896230e1d6ee036f" approved="yes">
<source>Recommended modules</source>
<target state="final">Empfohlene Module</target>
<note>Line: 331</note>
<note>Line: 332</note>
</trans-unit>
</body>
</file>
Expand Down
2 changes: 1 addition & 1 deletion translations/es-ES/ModulesMboErrors.es-ES.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<trans-unit id="358cc9ee3a3d23d3390e5043122d9bea" approved="yes">
<source>PrestaShop was unable to log in to Addons. Please check your credentials and your Internet connection.</source>
<target state="final">PrestaShop no pudo iniciar sesión en Addons. Por favor verifica tus datos de acceso y tu conexión de Internet.</target>
<note>Line: 105</note>
<note>Line: 104</note>
</trans-unit>
</body>
</file>
Expand Down
6 changes: 3 additions & 3 deletions translations/es-ES/ModulesMboGlobal.es-ES.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
<trans-unit id="a477136f1721bd17d18fc591f094f155" approved="yes">
<source>Oh no.. something went wrong</source>
<target state="final">Oh no... algo salió mal</target>
<note>Line: 5</note>
<note>Line: 23</note>
</trans-unit>
<trans-unit id="77df45c90eb889b2731e6900d63ed7f7" approved="yes">
<source>There has been a problem on our side. Refresh your page and if the problem persists, try again later.</source>
<target state="final">Ha habido un problema por nuestro lado. Actualice su página y si el problema persiste, inténtelo de nuevo más tarde.</target>
<note>Line: 8</note>
<note>Line: 26</note>
</trans-unit>
<trans-unit id="a593c6d1e05af324063dac348353cece" approved="yes">
<source>Refresh page</source>
<target state="final">Actualizar la página</target>
<note>Line: 13</note>
<note>Line: 31</note>
</trans-unit>
</body>
</file>
Expand Down
16 changes: 8 additions & 8 deletions translations/es-ES/ModulesMboLinks.es-ES.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="src/Addons/Provider/LinksProvider.php" source-language="en" target-language="es-ES" datatype="plaintext">
<body>
<trans-unit id="ab9f0d838086d8699f9bc0f6b6bf0d59" approved="yes">
<source>https://accounts.distribution.prestashop.net/en/sign-up</source>
<target state="final">https://accounts.distribution.prestashop.net/es/sign-up</target>
<note>Line: 123</note>
<trans-unit id="85cc355c70aa470ad3f43e155b7e5e4c">
<source>https://authv2.prestashop.com/register</source>
<target state="translated">https://authv2.prestashop.com/register</target>
<note>Line: 122</note>
</trans-unit>
<trans-unit id="b14fa168a9724da44a82a09d80a98a7c" approved="yes">
<source>https://auth.prestashop.com/en/password/request</source>
<target state="final">https://auth.prestashop.com/es/contrasena/solicitud</target>
<note>Line: 130</note>
<trans-unit id="6ab773a0870bec71712f3fae2641db30">
<source>https://authv2.prestashop.com/password/request </source>
<target state="translated">https://authv2.prestashop.com/password/request </target>
<note>Line: 129</note>
</trans-unit>
</body>
</file>
Expand Down
Loading

0 comments on commit 8a4f03b

Please sign in to comment.