Skip to content

Commit 7ed3d1d

Browse files
committed
MAGETWO-91934: Unlock Locales Editing when SCD on Demand Mode is Enabled
- changes after review
1 parent a9ba5b8 commit 7ed3d1d

File tree

2 files changed

+8
-49
lines changed

2 files changed

+8
-49
lines changed

app/code/Magento/Config/Model/Config/Structure/ElementVisibility/ConcealInProductionWithoutScdOnDemand.php

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,69 +9,30 @@
99

1010
use Magento\Config\Model\Config\Structure\ElementVisibilityInterface;
1111
use Magento\Framework\App\DeploymentConfig;
12-
use Magento\Framework\App\State;
1312
use Magento\Framework\Config\ConfigOptionsListConstants as Constants;
1413

1514
/**
1615
* Defines status of visibility of form elements on Stores > Settings > Configuration page
17-
* when Constants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION is enabled.
16+
* when Constants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION is enabled
17+
* otherwise rule from Magento\Config\Model\Config\Structure\ElementVisibility\ConcealInProduction is used
18+
* @see \Magento\Config\Model\Config\Structure\ElementVisibility\ConcealInProduction
19+
*
1820
* @api
1921
*/
2022
class ConcealInProductionWithoutScdOnDemand implements ElementVisibilityInterface
2123
{
2224
/**
23-
* The list of form element paths with concrete visibility status.
24-
*
25-
* E.g.
26-
*
27-
* ```php
28-
* [
29-
* 'general/locale/code' => ElementVisibilityInterface::DISABLED,
30-
* 'general/country' => ElementVisibilityInterface::HIDDEN,
31-
* ];
32-
* ```
33-
*
34-
* It means that:
35-
* - field Locale (in group Locale Options in section General) will be disabled
36-
* - group Country Options (in section General) will be hidden
37-
*
38-
* @var array
39-
*/
40-
private $configs = [];
41-
42-
/**
43-
*
44-
* The list of form element paths which ignore visibility status.
45-
*
46-
* E.g.
47-
*
48-
* ```php
49-
* [
50-
* 'general/country/default' => '',
51-
* ];
52-
* ```
53-
*
54-
* It means that:
55-
* - field 'default' in group Country Options (in section General) will be showed, even if all group(section)
56-
* will be hidden.
57-
*
58-
* @var array
59-
*/
60-
private $exemptions = [];
61-
62-
/**
63-
* @var ConcealInProduction
25+
* @var ConcealInProduction Element visibility rules in the Production mode
6426
*/
6527
private $concealInProduction;
6628

6729
/**
68-
* @var DeploymentConfig
30+
* @var DeploymentConfig The application deployment configuration
6931
*/
7032
private $deploymentConfig;
7133

7234
/**
7335
* @param ConcealInProductionFactory $concealInProductionFactory
74-
* @param State $state The object that has information about the state of the system
7536
* @param DeploymentConfig $deploymentConfig Deployment configuration reader
7637
* @param array $configs The list of form element paths with concrete visibility status.
7738
* @param array $exemptions The list of form element paths which ignore visibility status.
@@ -85,8 +46,6 @@ public function __construct(
8546
$this->concealInProduction = $concealInProductionFactory
8647
->create(['configs' => $configs, 'exemptions' => $exemptions]);
8748
$this->deploymentConfig = $deploymentConfig;
88-
$this->configs = $configs;
89-
$this->exemptions = $exemptions;
9049
}
9150

9251
/**

app/code/Magento/Config/Test/Unit/Model/Config/Structure/ElementVisibility/ConcealInProductionWithoutScdOnDemandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function testIsDisabledScdOnDemandEnabled(): void
100100
*
101101
* @dataProvider visibilityDataProvider
102102
*/
103-
public function testIsHiddenScdOnDemandDisabled($isHidden): void
103+
public function testIsHiddenScdOnDemandDisabled(bool $isHidden): void
104104
{
105105
$path = 'section1/group1/field1';
106106
$this->deploymentConfigMock->expects($this->once())
@@ -120,7 +120,7 @@ public function testIsHiddenScdOnDemandDisabled($isHidden): void
120120
*
121121
* @dataProvider visibilityDataProvider
122122
*/
123-
public function testIsDisabledScdOnDemandDisabled($isDisabled): void
123+
public function testIsDisabledScdOnDemandDisabled(bool $isDisabled): void
124124
{
125125
$path = 'section1/group1/field1';
126126
$this->deploymentConfigMock->expects($this->once())

0 commit comments

Comments
 (0)