Skip to content

Commit cd77da6

Browse files
authored
Merge pull request #5589 from magento-borg/MC-30175-updated
[CIA] Merge CE, EE and B2B Changes to UI Components Rendering Configurations
2 parents e5ea17f + 3b082ff commit cd77da6

File tree

85 files changed

+948
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+948
-236
lines changed

app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePriceTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public function testModifyMeta()
6868
];
6969
$priceParams = [
7070
'imports' => [
71-
'disabled' => 'ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked'
71+
'disabled' => 'ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked',
72+
'__disableTmpl' => ['disabled' => false],
7273
]
7374
];
7475
$priceMeta = [

app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleWeightTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function testModifyMeta()
5858
$weightParams = [
5959
'imports' => [
6060
'disabled' => 'ns = ${ $.ns }, index = ' . BundleWeight::CODE_WEIGHT_TYPE . ':checked',
61+
'__disableTmpl' => ['disabled' => false],
6162
]
6263
];
6364
$hasWeightParams = [

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleAdvancedPricing.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(ArrayManager $arrayManager)
3434
}
3535

3636
/**
37-
* {@inheritdoc}
37+
* @inheritdoc
3838
*/
3939
public function modifyMeta(array $meta)
4040
{
@@ -63,7 +63,7 @@ public function modifyMeta(array $meta)
6363
}
6464

6565
/**
66-
* {@inheritdoc}
66+
* @inheritdoc
6767
*/
6868
public function modifyData(array $data)
6969
{
@@ -88,7 +88,8 @@ private function modifyMsrpMeta(array $meta)
8888
$meta,
8989
[
9090
'imports' => [
91-
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
91+
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked',
92+
'__disableTmpl' => ['disabled' => false],
9293
]
9394
]
9495
);
@@ -103,7 +104,8 @@ private function modifyMsrpMeta(array $meta)
103104
$meta,
104105
[
105106
'imports' => [
106-
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
107+
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked',
108+
'__disableTmpl' => ['disabled' => false],
107109
]
108110
]
109111
);

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleCustomOptions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class BundleCustomOptions extends AbstractModifier
1616
{
1717
/**
18-
* {@inheritdoc}
18+
* @inheritdoc
1919
*/
2020
public function modifyMeta(array $meta)
2121
{
@@ -55,6 +55,7 @@ public function modifyCustomOptionsButton(array $meta, $group, $container, $butt
5555
if (!empty($meta[$group]['children'][$container]['children'][$button])) {
5656
$meta[$group]['children'][$container]['children'][$button]['arguments']['data']['config']['imports'] = [
5757
'visible' => '!ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked',
58+
'__disableTmpl' => ['visible' => false],
5859
];
5960
}
6061
return $meta;
@@ -79,6 +80,7 @@ public function getErrorMessage($sortOrder)
7980
'sortOrder' => $sortOrder,
8081
'imports' => [
8182
'visible' => 'ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked',
83+
'__disableTmpl' => ['visible' => false],
8284
],
8385
],
8486
],
@@ -87,7 +89,7 @@ public function getErrorMessage($sortOrder)
8789
}
8890

8991
/**
90-
* {@inheritdoc}
92+
* @inheritdoc
9193
*/
9294
public function modifyData(array $data)
9395
{

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ protected function getBundleHeader()
319319
* Get Bundle Options structure
320320
*
321321
* @return array
322+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
322323
*/
323324
protected function getBundleOptions()
324325
{
@@ -348,7 +349,8 @@ protected function getBundleOptions()
348349
'component' => 'Magento_Ui/js/dynamic-rows/record',
349350
'positionProvider' => 'product_bundle_container.position',
350351
'imports' => [
351-
'label' => '${ $.name }' . '.product_bundle_container.option_info.title:value'
352+
'label' => '${ $.name }' . '.product_bundle_container.option_info.title:value',
353+
'__disableTmpl' => ['label' => false],
352354
],
353355
],
354356
],
@@ -381,6 +383,7 @@ protected function getBundleOptions()
381383
'template' => 'ui/dynamic-rows/templates/default',
382384
'provider' => 'product_form.product_form_data_source',
383385
'dataProvider' => '${ $.dataScope }' . '.bundle_button_proxy',
386+
'__disableTmpl' => ['dataProvider' => false],
384387
'identificationDRProperty' => 'product_id',
385388
'identificationProperty' => 'product_id',
386389
'map' => [
@@ -395,9 +398,13 @@ protected function getBundleOptions()
395398
'selection_price_value' => '',
396399
'selection_qty' => '',
397400
],
398-
'links' => ['insertData' => '${ $.provider }:${ $.dataProvider }'],
401+
'links' => [
402+
'insertData' => '${ $.provider }:${ $.dataProvider }',
403+
'__disableTmpl' => ['insertData' => false],
404+
],
399405
'imports' => [
400406
'inputType' => '${$.provider}:${$.dataScope}.type',
407+
'__disableTmpl' => ['inputType' => false],
401408
],
402409
'source' => 'product',
403410
],
@@ -619,9 +626,11 @@ protected function getBundleSelections()
619626
'is_collection' => true,
620627
'imports' => [
621628
'inputType' => '${$.parentName}:inputType',
629+
'__disableTmpl' => ['inputType' => false],
622630
],
623631
'exports' => [
624632
'isDefaultValue' => '${$.parentName}:isDefaultValue.${$.index}',
633+
'__disableTmpl' => ['isDefaultValue' => false],
625634
],
626635
],
627636
],
@@ -702,7 +711,8 @@ protected function getBundleSelections()
702711
'validate-greater-than-zero' => true
703712
],
704713
'imports' => [
705-
'isInteger' => '${ $.provider }:${ $.parentScope }.selection_qty_is_integer'
714+
'isInteger' => '${ $.provider }:${ $.parentScope }.selection_qty_is_integer',
715+
'__disableTmpl' => ['isInteger' => false],
706716
],
707717
],
708718
],
@@ -723,6 +733,7 @@ protected function getBundleSelections()
723733
'sortOrder' => 110,
724734
'imports' => [
725735
'inputType' => '${$.parentName}:inputType',
736+
'__disableTmpl' => ['inputType' => false],
726737
],
727738
],
728739
],
@@ -764,7 +775,8 @@ protected function getSelectionPriceValue()
764775
'dataScope' => 'selection_price_value',
765776
'value' => '0.00',
766777
'imports' => [
767-
'visible' => '!ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked'
778+
'visible' => '!ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked',
779+
'__disableTmpl' => ['visible' => false],
768780
],
769781
'sortOrder' => 80,
770782
],
@@ -801,7 +813,8 @@ protected function getSelectionPriceType()
801813
]
802814
],
803815
'imports' => [
804-
'visible' => '!ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked'
816+
'visible' => '!ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked',
817+
'__disableTmpl' => ['visible' => false],
805818
],
806819
'sortOrder' => 90,
807820
],

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePrice.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public function modifyMeta(array $meta)
7171
$meta,
7272
[
7373
'imports' => [
74-
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
74+
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked',
75+
'__disableTmpl' => ['disabled' => false],
7576
]
7677
]
7778
);
@@ -86,7 +87,8 @@ public function modifyMeta(array $meta)
8687
$meta,
8788
[
8889
'imports' => [
89-
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
90+
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked',
91+
'__disableTmpl' => ['disabled' => false],
9092
]
9193
]
9294
);

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleWeight.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(ArrayManager $arrayManager)
3030
}
3131

3232
/**
33-
* {@inheritdoc}
33+
* @inheritdoc
3434
*/
3535
public function modifyMeta(array $meta)
3636
{
@@ -73,15 +73,16 @@ public function modifyMeta(array $meta)
7373
[
7474
'imports' => [
7575
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_WEIGHT_TYPE . ':checked',
76+
'__disableTmpl' => ['disabled' => false],
7677
]
7778
]
7879
);
79-
80+
8081
return $meta;
8182
}
8283

8384
/**
84-
* {@inheritdoc}
85+
* @inheritdoc
8586
*/
8687
public function modifyData(array $data)
8788
{

app/code/Magento/Catalog/Model/Product/AttributeSet/Options.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,22 @@
1010
*/
1111
class Options implements \Magento\Framework\Data\OptionSourceInterface
1212
{
13+
1314
/**
1415
* @var array
1516
*/
1617
protected $options;
1718

19+
/**
20+
* @var \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory
21+
*/
22+
protected $collectionFactory;
23+
24+
/**
25+
* @var \Magento\Catalog\Model\ResourceModel\Product
26+
*/
27+
protected $product;
28+
1829
/**
1930
* @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $collectionFactory
2031
* @param \Magento\Catalog\Model\ResourceModel\Product $product
@@ -36,13 +47,6 @@ public function toOptionArray()
3647
$this->options = $this->collectionFactory->create()
3748
->setEntityTypeFilter($this->product->getTypeId())
3849
->toOptionArray();
39-
40-
array_walk(
41-
$this->options,
42-
function (&$option) {
43-
$option['__disableTmpl'] = true;
44-
}
45-
);
4650
}
4751

4852
return $this->options;

app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ public function testCreateWithNotFilterableInGridAttribute(array $filterModifier
129129
'visible' => null,
130130
'filter' => $filter,
131131
'component' => 'Magento_Ui/js/grid/columns/column',
132-
'__disableTmpl' => ['label' => true]
133132
],
134133
],
135134
'context' => $this->context,
@@ -206,7 +205,6 @@ public function testCreateDateColumn(
206205
'component' => 'Magento_Ui/js/grid/columns/date',
207206
'timezone' => $expectedTimezone,
208207
'dateFormat' => $expectedDateFormat,
209-
'__disableTmpl' => ['label' => true],
210208
'options' => [
211209
'showsTime' => $showsTime
212210
]

app/code/Magento/Catalog/Test/Unit/Ui/Component/Product/MassActionTest.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
use Magento\Framework\AuthorizationInterface;
1212
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1313
use Magento\Framework\View\Element\UiComponent\ContextInterface;
14+
use PHPUnit\Framework\MockObject\MockObject;
1415

1516
/**
16-
* MassAction test
17+
* MassAction test for Component Product
1718
*/
1819
class MassActionTest extends \PHPUnit\Framework\TestCase
1920
{
2021
/**
21-
* @var ContextInterface|\PHPUnit_Framework_MockObject_MockObject
22+
* @var ContextInterface|MockObject
2223
*/
2324
private $contextMock;
2425

@@ -28,7 +29,7 @@ class MassActionTest extends \PHPUnit\Framework\TestCase
2829
private $objectManager;
2930

3031
/**
31-
* @var AuthorizationInterface|\PHPUnit_Framework_MockObject_MockObject
32+
* @var AuthorizationInterface|MockObject
3233
*/
3334
private $authorizationMock;
3435

@@ -107,7 +108,6 @@ public function getPrepareDataProvider() : array
107108
'type' => 'first_action',
108109
'label' => 'First Action',
109110
'url' => '/module/controller/firstAction',
110-
'__disableTmpl' => true
111111
],
112112
],
113113
[
@@ -127,7 +127,6 @@ public function getPrepareDataProvider() : array
127127
'url' => '/module/controller/secondSubAction2'
128128
],
129129
],
130-
'__disableTmpl' => true
131130
],
132131
],
133132
[
@@ -147,7 +146,6 @@ public function getPrepareDataProvider() : array
147146
'url' => '/module/controller/disable'
148147
],
149148
],
150-
'__disableTmpl' => true
151149
],
152150
],
153151
[
@@ -167,7 +165,6 @@ public function getPrepareDataProvider() : array
167165
'url' => '/module/controller/disable'
168166
],
169167
],
170-
'__disableTmpl' => true
171168
],
172169
false,
173170
false
@@ -178,7 +175,6 @@ public function getPrepareDataProvider() : array
178175
'type' => 'delete',
179176
'label' => 'First Action',
180177
'url' => '/module/controller/delete',
181-
'__disableTmpl' => true
182178
],
183179
],
184180
[
@@ -187,7 +183,6 @@ public function getPrepareDataProvider() : array
187183
'type' => 'delete',
188184
'label' => 'First Action',
189185
'url' => '/module/controller/delete',
190-
'__disableTmpl' => true
191186
],
192187
false,
193188
false
@@ -198,7 +193,6 @@ public function getPrepareDataProvider() : array
198193
'type' => 'delete',
199194
'label' => 'First Action',
200195
'url' => '/module/controller/attributes',
201-
'__disableTmpl' => true
202196
],
203197
],
204198
[
@@ -207,7 +201,6 @@ public function getPrepareDataProvider() : array
207201
'type' => 'delete',
208202
'label' => 'First Action',
209203
'url' => '/module/controller/attributes',
210-
'__disableTmpl' => true
211204
],
212205
false,
213206
false

0 commit comments

Comments
 (0)