Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tig-mickeybeijer committed Jul 5, 2022
2 parents ce9e316 + 39e3cb8 commit de5cf7a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Block/Adminhtml/Config/Support/Tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Tab extends Template implements RendererInterface
{
const MODULE_NAME = 'TIG_Postcode';

const EXTENSION_VERSION = '1.5.0';
const EXTENSION_VERSION = '1.5.1';

// @codingStandardsIgnoreLine
protected $_template = 'TIG_Postcode::config/support/tab.phtml';
Expand Down
25 changes: 10 additions & 15 deletions Plugin/View/Page/Config/Renderer.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
namespace TIG\Postcode\Plugin\View\Page\Config;

use Magento\Framework\Module\ModuleList;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\View\Page\Config\Renderer as pageRender;
use Magento\Framework\Module\ModuleList;
use Magento\Framework\View\Page\Config;
use Magento\Framework\View\Page\Config\Renderer as pageRender;
use Magento\Store\Model\ScopeInterface;

class Renderer
{
Expand All @@ -15,9 +15,6 @@ class Renderer
/** @var ScopeConfigInterface */
private $scopeConfig;

/** @var ScopeInterface */
private $scopeStore;

/** @var ModuleList */
public $moduleList;

Expand All @@ -29,12 +26,10 @@ class Renderer
public function __construct(
Config $config,
ScopeConfigInterface $scopeConfig,
ScopeInterface $scopeStore,
ModuleList $moduleList
){
) {
$this->config = $config;
$this->scopeConfig = $scopeConfig;
$this->scopeStore = $scopeStore;
$this->moduleList = $moduleList;
}

Expand All @@ -48,8 +43,8 @@ public function __construct(
*/
public function beforeRenderAssets(
pageRender $subject,
$assetestlist = [])
{
$assetestlist = []
) {
$modules = $this->moduleList->getNames();

$checkoutModules = [
Expand All @@ -58,19 +53,19 @@ public function beforeRenderAssets(
];

foreach ($checkoutModules as $key => $value) {
if (in_array($key, $modules)){
if (in_array($key, $modules)) {
$this->config->addPageAsset($value);
}
if (in_array('TIG_Postcode',$modules)){
if (in_array('TIG_Postcode', $modules)) {
$this->config->addPageAsset('TIG_Postcode::css/postcode_main.css');
// check if NL is enabled
if ($this->scopeConfig->getValue('tig_postcode/countries/enable_nl_check',
$this->scopeStore::SCOPE_STORE)){
ScopeInterface::SCOPE_STORE)) {
$this->config->addPageAsset('TIG_Postcode::css/postcode_nl.css');
}
// check if BE is enabled
if ($this->scopeConfig->getValue('tig_postcode/countries/enable_be_check',
$this->scopeStore::SCOPE_STORE)){
ScopeInterface::SCOPE_STORE)) {
$this->config->addPageAsset('TIG_Postcode::css/postcode_be.css');
}
}
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Block/Adminhtml/Config/Support/TabTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TabTest extends TestCase
public function testGetVersionNumber()
{
$instance = $this->getInstance();
$this->assertSame('1.5.0', $instance->getVersionNumber());
$this->assertSame('1.5.1', $instance->getVersionNumber());
}

public function testGetSupportedMagentoVersions()
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"magento/module-quote": ">=101.0.5,<=101.0.11|~101.1|~101.2"
},
"type": "magento2-module",
"version": "1.5.0",
"version": "1.5.1",
"license": "CC-BY-NC-ND-3.0",
"authors": [
{
Expand Down

0 comments on commit de5cf7a

Please sign in to comment.