Skip to content

Commit 2a1e51f

Browse files
authored
Merge pull request #4449 from magento-obsessive-owls/MC-16113
[Owls] MC-16113
2 parents 467b4e1 + 3c9b29a commit 2a1e51f

File tree

19 files changed

+92
-25
lines changed

19 files changed

+92
-25
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public function getPrepareDataProvider() : array
117117
'type' => 'first_action',
118118
'label' => 'First Action',
119119
'url' => '/module/controller/firstAction',
120+
'__disableTmpl' => true
120121
],
121122
],
122123
[
@@ -136,6 +137,7 @@ public function getPrepareDataProvider() : array
136137
'url' => '/module/controller/secondSubAction2',
137138
],
138139
],
140+
'__disableTmpl' => true
139141
],
140142
],
141143
[
@@ -155,6 +157,7 @@ public function getPrepareDataProvider() : array
155157
'url' => '/module/controller/disable',
156158
],
157159
],
160+
'__disableTmpl' => true
158161
],
159162
],
160163
[
@@ -174,6 +177,7 @@ public function getPrepareDataProvider() : array
174177
'url' => '/module/controller/disable',
175178
],
176179
],
180+
'__disableTmpl' => true
177181
],
178182
false,
179183
false,
@@ -184,6 +188,7 @@ public function getPrepareDataProvider() : array
184188
'type' => 'delete',
185189
'label' => 'First Action',
186190
'url' => '/module/controller/delete',
191+
'__disableTmpl' => true
187192
],
188193
],
189194
[
@@ -192,6 +197,7 @@ public function getPrepareDataProvider() : array
192197
'type' => 'delete',
193198
'label' => 'First Action',
194199
'url' => '/module/controller/delete',
200+
'__disableTmpl' => true
195201
],
196202
false,
197203
false,
@@ -202,6 +208,7 @@ public function getPrepareDataProvider() : array
202208
'type' => 'delete',
203209
'label' => 'First Action',
204210
'url' => '/module/controller/attributes',
211+
'__disableTmpl' => true
205212
],
206213
],
207214
[
@@ -210,6 +217,7 @@ public function getPrepareDataProvider() : array
210217
'type' => 'delete',
211218
'label' => 'First Action',
212219
'url' => '/module/controller/attributes',
220+
'__disableTmpl' => true
213221
],
214222
false,
215223
false,

app/code/Magento/Catalog/Ui/Component/Listing/Columns/ProductActions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function prepareDataSource(array $dataSource)
6060
),
6161
'label' => __('Edit'),
6262
'hidden' => false,
63+
'__disableTmpl' => true
6364
];
6465
}
6566
}

app/code/Magento/Catalog/Ui/Component/Product/MassAction.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class MassAction extends AbstractComponent
2525
private $authorization;
2626

2727
/**
28+
* Constructor
29+
*
2830
* @param AuthorizationInterface $authorization
2931
* @param ContextInterface $context
3032
* @param UiComponentInterface[] $components
@@ -50,7 +52,7 @@ public function prepare()
5052
foreach ($this->getChildComponents() as $actionComponent) {
5153
$actionType = $actionComponent->getConfiguration()['type'];
5254
if ($this->isActionAllowed($actionType)) {
53-
$config['actions'][] = $actionComponent->getConfiguration();
55+
$config['actions'][] = array_merge($actionComponent->getConfiguration(), ['__disableTmpl' => true]);
5456
}
5557
}
5658
$origConfig = $this->getConfiguration();
@@ -67,7 +69,7 @@ public function prepare()
6769
/**
6870
* @inheritdoc
6971
*/
70-
public function getComponentName(): string
72+
public function getComponentName() : string
7173
{
7274
return static::NAME;
7375
}
@@ -78,7 +80,7 @@ public function getComponentName(): string
7880
* @param string $actionType
7981
* @return bool
8082
*/
81-
public function isActionAllowed(string $actionType): bool
83+
public function isActionAllowed(string $actionType) : bool
8284
{
8385
$isAllowed = true;
8486
switch ($actionType) {

app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/BlockActionsTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ protected function setUp()
5656
->setMethods(['escapeHtmlAttr'])
5757
->getMock();
5858

59-
$this->blockActions = $objectManager->getObject(BlockActions::class, [
60-
'context' => $context,
61-
'urlBuilder' => $this->urlBuilder
62-
]);
59+
$this->blockActions = $objectManager->getObject(
60+
BlockActions::class,
61+
[
62+
'context' => $context,
63+
'urlBuilder' => $this->urlBuilder
64+
]
65+
);
6366

6467
$objectManager->setBackwardCompatibleProperty($this->blockActions, 'escaper', $this->escaper);
6568
}
@@ -93,6 +96,7 @@ public function testPrepareDataSource()
9396
'edit' => [
9497
'href' => 'test/url/edit',
9598
'label' => __('Edit'),
99+
'__disableTmpl' => true,
96100
],
97101
'delete' => [
98102
'href' => 'test/url/delete',
@@ -102,6 +106,7 @@ public function testPrepareDataSource()
102106
'message' => __('Are you sure you want to delete a %1 record?', $title),
103107
],
104108
'post' => true,
109+
'__disableTmpl' => true,
105110
],
106111
],
107112
],

app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/PageActionsTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Magento\Cms\Ui\Component\Listing\Column\PageActions;
99
use Magento\Framework\Escaper;
1010

11+
/**
12+
* Test for Magento\Cms\Ui\Component\Listing\Column\PageActions class.
13+
*/
1114
class PageActionsTest extends \PHPUnit\Framework\TestCase
1215
{
1316
public function testPrepareItemsByPageId()
@@ -62,6 +65,7 @@ public function testPrepareItemsByPageId()
6265
'edit' => [
6366
'href' => 'test/url/edit',
6467
'label' => __('Edit'),
68+
'__disableTmpl' => true,
6569
],
6670
'delete' => [
6771
'href' => 'test/url/delete',
@@ -72,6 +76,7 @@ public function testPrepareItemsByPageId()
7276
'__disableTmpl' => true,
7377
],
7478
'post' => true,
79+
'__disableTmpl' => true,
7580
],
7681
],
7782
]
@@ -81,7 +86,6 @@ public function testPrepareItemsByPageId()
8186
->method('escapeHtml')
8287
->with($title)
8388
->willReturn($title);
84-
8589
// Configure mocks and object data
8690
$urlBuilderMock->expects($this->any())
8791
->method('getUrl')
@@ -103,7 +107,6 @@ public function testPrepareItemsByPageId()
103107
],
104108
]
105109
);
106-
107110
$model->setName($name);
108111
$items = $model->prepareDataSource($items);
109112
// Run test

app/code/Magento/Cms/Ui/Component/Listing/Column/BlockActions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function prepareDataSource(array $dataSource)
7070
]
7171
),
7272
'label' => __('Edit'),
73+
'__disableTmpl' => true,
7374
],
7475
'delete' => [
7576
'href' => $this->urlBuilder->getUrl(
@@ -84,6 +85,7 @@ public function prepareDataSource(array $dataSource)
8485
'message' => __('Are you sure you want to delete a %1 record?', $title),
8586
],
8687
'post' => true,
88+
'__disableTmpl' => true,
8789
],
8890
];
8991
}

app/code/Magento/Cms/Ui/Component/Listing/Column/PageActions.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ public function prepareDataSource(array $dataSource)
8080
if (isset($item['page_id'])) {
8181
$item[$name]['edit'] = [
8282
'href' => $this->urlBuilder->getUrl($this->editUrl, ['page_id' => $item['page_id']]),
83-
'label' => __('Edit')
83+
'label' => __('Edit'),
84+
'__disableTmpl' => true,
8485
];
8586
$title = $this->getEscaper()->escapeHtml($item['title']);
8687
$item[$name]['delete'] = [
@@ -92,6 +93,7 @@ public function prepareDataSource(array $dataSource)
9293
'__disableTmpl' => true,
9394
],
9495
'post' => true,
96+
'__disableTmpl' => true,
9597
];
9698
}
9799
if (isset($item['identifier'])) {
@@ -101,7 +103,8 @@ public function prepareDataSource(array $dataSource)
101103
isset($item['_first_store_id']) ? $item['_first_store_id'] : null,
102104
isset($item['store_code']) ? $item['store_code'] : null
103105
),
104-
'label' => __('View')
106+
'label' => __('View'),
107+
'__disableTmpl' => true,
105108
];
106109
}
107110
}

app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/ActionsTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
use Magento\Customer\Ui\Component\Listing\Column\Actions;
99

10+
/**
11+
* Class ActionsTest
12+
*/
1013
class ActionsTest extends \PHPUnit\Framework\TestCase
1114
{
1215
/** @var Actions */
@@ -64,7 +67,8 @@ public function testPrepareDataSource()
6467
'edit' => [
6568
'href' => 'http://magento.com/customer/index/edit',
6669
'label' => new \Magento\Framework\Phrase('Edit'),
67-
'hidden' => false
70+
'hidden' => false,
71+
'__disableTmpl' => true,
6872
]
6973
]
7074
],

app/code/Magento/Customer/Ui/Component/Listing/Column/Actions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function prepareDataSource(array $dataSource)
6060
),
6161
'label' => __('Edit'),
6262
'hidden' => false,
63+
'__disableTmpl' => true
6364
];
6465
}
6566
}

app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/ViewActionTest.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,28 @@ public function prepareDataSourceDataProvider()
8989
[
9090
['name' => 'itemName', 'config' => []],
9191
[['itemName' => '', 'entity_id' => 1]],
92-
[['itemName' => ['view' => ['href' => 'url', 'label' => __('View')]], 'entity_id' => 1]],
92+
[
93+
[
94+
'itemName' => [
95+
'view' => ['href' => 'url', 'label' => __('View'), '__disableTmpl' => true]
96+
],
97+
'entity_id' => 1
98+
]
99+
],
93100
'#',
94101
['entity_id' => 1]
95102
],
96103
[
97104
['name' => 'itemName', 'config' => ['viewUrlPath' => 'url_path', 'urlEntityParamName' => 'order_id']],
98105
[['itemName' => '', 'entity_id' => 2]],
99-
[['itemName' => ['view' => ['href' => 'url', 'label' => __('View')]], 'entity_id' => 2]],
106+
[
107+
[
108+
'itemName' => [
109+
'view' => ['href' => 'url', 'label' => __('View'), '__disableTmpl' => true]
110+
],
111+
'entity_id' => 2
112+
]
113+
],
100114
'url_path',
101115
['order_id' => 2]
102116
]

0 commit comments

Comments
 (0)