Skip to content

Commit 095ccff

Browse files
author
Bohdan Berezhniy
committed
refactoring
1 parent b1a91cb commit 095ccff

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

Model/Config.php

+2-23
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
use Magento\Framework\App\Config\ScopeConfigInterface;
1414
use Magento\Store\Model\ScopeInterface;
15+
use Magento\Framework\View\Asset\Config as MagentoConfig;
1516

1617
class Config
1718
{
@@ -68,28 +69,6 @@ public function isEnabled(string $storeId = null): bool
6869
return (bool)$this->getConfig(self::XML_PATH_EXTENSION_ENABLED, $storeId);
6970
}
7071

71-
/**
72-
* Retrieve true if js files merged
73-
*
74-
* @param string|null $storeId
75-
* @return bool
76-
*/
77-
public function isMergeFiles(string $storeId = null): bool
78-
{
79-
return (bool)$this->getConfig(self::XML_PATH_MERGE_FILES, $storeId);
80-
}
81-
82-
/**
83-
* Retrieve true if js files minified
84-
*
85-
* @param string|null $storeId
86-
* @return bool
87-
*/
88-
public function isMinifyFiles(string $storeId = null): bool
89-
{
90-
return (bool)$this->getConfig(self::XML_PATH_MINIFY_FILES, $storeId);
91-
}
92-
9372
/**
9473
* Retrieve true if deferred is enabled
9574
*
@@ -131,7 +110,7 @@ public function getIgnoreJavaScript(string $storeId = null): string
131110
*/
132111
public function isBundlingEnabled(string $storeId = null): bool
133112
{
134-
return (bool)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_ENABLED, $storeId);
113+
return (bool)$this->getConfig(MagentoConfig::XML_PATH_JS_BUNDLING, $storeId);
135114
}
136115

137116
/**

etc/adminhtml/system.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<label>Minify JavaScript Files</label>
3737
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
3838
<backend_model>Magefan\RocketJavaScript\Model\Config\Backend\DevSettings</backend_model>
39-
<comment>Minification is not applied in developer mode.</comment>
39+
<comment>Minification is not applied in developer mode. Static content deployment is a requirement after option change</comment>
4040
</field>
4141
</group>
4242
<group id="deferred_javascript" translate="label" type="text" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="1">
@@ -67,13 +67,14 @@
6767
<label>Enabled</label>
6868
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
6969
<backend_model>Magefan\RocketJavaScript\Model\Config\Backend\DevSettings</backend_model>
70+
<comment>Static content deployment is a requirement after option change</comment>
7071
</field>
7172
<field id="enable_js_bundling_optimization" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="20" translate="label" type="select" canRestore="1">
7273
<label>Enable Bundling Optimization</label>
7374
<depends>
7475
<field id="enabled">1</field>
7576
</depends>
76-
<comment>Please note that this option only works with enabled JavaScript Bundling (Configuration > Advanced > Developer > JavaScript Settings > Enable JavaScript Bundling).</comment>
77+
<comment>Static content deployment is a requirement after option change</comment>
7778
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
7879
</field>
7980
<field id="included_in_bundling" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="30" translate="label" type="textarea" canRestore="1">

0 commit comments

Comments
 (0)