Skip to content

Commit 40cf1c5

Browse files
Merge branch '2.3-develop' into 2.3-develop-com-pr2
2 parents c062543 + d271281 commit 40cf1c5

File tree

111 files changed

+6885
-886
lines changed

Some content is hidden

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

111 files changed

+6885
-886
lines changed

app/code/Magento/Backend/view/adminhtml/templates/widget/grid.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ $numColumns = $block->getColumns() !== null ? count($block->getColumns()) : 0;
170170
<?php if ($block->getSortableUpdateCallback()) : ?>
171171
<?= $block->escapeJs($block->getJsObjectName()) ?>.sortableUpdateCallback = <?= /* @noEscape */ $block->getSortableUpdateCallback() ?>;
172172
<?php endif; ?>
173+
<?php if ($block->getFilterKeyPressCallback()) : ?>
174+
<?= $block->escapeJs($block->getJsObjectName()) ?>.filterKeyPressCallback = <?= /* @noEscape */ $block->getFilterKeyPressCallback() ?>;
175+
<?php endif; ?>
173176
<?= $block->escapeJs($block->getJsObjectName()) ?>.bindSortable();
174177
<?php if ($block->getRowInitCallback()) : ?>
175178
<?= $block->escapeJs($block->getJsObjectName()) ?>.initRowCallback = <?= /* @noEscape */ $block->getRowInitCallback() ?>;

app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ $numColumns = count($block->getColumns());
272272
<?php if ($block->getCheckboxCheckCallback()) : ?>
273273
<?= $block->escapeJs($block->getJsObjectName()) ?>.checkboxCheckCallback = <?= /* @noEscape */ $block->getCheckboxCheckCallback() ?>;
274274
<?php endif; ?>
275+
<?php if ($block->getFilterKeyPressCallback()) : ?>
276+
<?= $block->escapeJs($block->getJsObjectName()) ?>.filterKeyPressCallback = <?= /* @noEscape */ $block->getFilterKeyPressCallback() ?>;
277+
<?php endif; ?>
275278
<?php if ($block->getRowInitCallback()) : ?>
276279
<?= $block->escapeJs($block->getJsObjectName()) ?>.initRowCallback = <?= /* @noEscape */ $block->getRowInitCallback() ?>;
277280
<?= $block->escapeJs($block->getJsObjectName()) ?>.initGridRows();

app/code/Magento/Braintree/Gateway/Validator/ErrorCodeProvider.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Braintree\Error\Validation;
1212
use Braintree\Result\Error;
1313
use Braintree\Result\Successful;
14+
use Braintree\Transaction;
1415

1516
/**
1617
* Processes errors codes from Braintree response.
@@ -38,12 +39,14 @@ public function getErrorCodes($response): array
3839
$result[] = $error->code;
3940
}
4041

41-
if (isset($response->transaction) && $response->transaction->status === 'gateway_rejected') {
42-
$result[] = $response->transaction->gatewayRejectionReason;
43-
}
42+
if (isset($response->transaction) && $response->transaction) {
43+
if ($response->transaction->status === Transaction::GATEWAY_REJECTED) {
44+
$result[] = $response->transaction->gatewayRejectionReason;
45+
}
4446

45-
if (isset($response->transaction) && $response->transaction->status === 'processor_declined') {
46-
$result[] = $response->transaction->processorResponseCode;
47+
if ($response->transaction->status === Transaction::PROCESSOR_DECLINED) {
48+
$result[] = $response->transaction->processorResponseCode;
49+
}
4750
}
4851

4952
return $result;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Catalog\Model\Product;
9+
10+
use Magento\Framework\EntityManager\HydratorInterface;
11+
12+
/**
13+
* Class is used to extract data and populate entity with data
14+
*/
15+
class Hydrator implements HydratorInterface
16+
{
17+
/**
18+
* @inheritdoc
19+
*/
20+
public function extract($entity)
21+
{
22+
return $entity->getData();
23+
}
24+
25+
/**
26+
* @inheritdoc
27+
*/
28+
public function hydrate($entity, array $data)
29+
{
30+
$lockedAttributes = $entity->getLockedAttributes();
31+
$entity->unlockAttributes();
32+
$entity->setData(array_merge($entity->getData(), $data));
33+
foreach ($lockedAttributes as $attribute) {
34+
$entity->lockAttribute($attribute);
35+
}
36+
37+
return $entity;
38+
}
39+
}

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,18 @@
191191
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandToSeeAllCategories"/>
192192
<dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="dontSeeCategoryInTree"/>
193193
</actionGroup>
194+
<actionGroup name="AdminDeleteCategoryByName" extends="DeleteCategory">
195+
<arguments>
196+
<argument name="categoryName" type="string" defaultValue="category1"/>
197+
</arguments>
198+
<remove keyForRemoval="clickCategoryLink"/>
199+
<remove keyForRemoval="dontSeeCategoryInTree"/>
200+
<remove keyForRemoval="expandToSeeAllCategories"/>
201+
<conditionalClick selector="{{AdminCategorySidebarTreeSection.expandAll}}" dependentSelector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" visible="false" stepKey="expandCategories" after="waitForCategoryPageLoad"/>
202+
<click selector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" stepKey="clickCategory" after="expandCategories"/>
203+
<conditionalClick selector="{{AdminCategorySidebarTreeSection.expandAll}}" dependentSelector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" visible="false" stepKey="expandCategoriesToSeeAll" after="seeDeleteSuccess"/>
204+
<dontSee selector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" stepKey="dontSeeCategory" after="expandCategoriesToSeeAll"/>
205+
</actionGroup>
194206

195207
<!-- Actions to fill out a new category from the product page-->
196208
<!-- The action assumes that you are already on an admin product configuration page -->
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="CatalogPriceScopeWebsiteConfigData">
12+
<data key="path">catalog/price/scope</data>
13+
<data key="value">1</data>
14+
</entity>
15+
<entity name="CatalogPriceScopeGlobalConfigData">
16+
<data key="path">catalog/price/scope</data>
17+
<data key="value">0</data>
18+
</entity>
19+
</entities>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
<element name="lastCreatedCategory" type="block" selector=".x-tree-root-ct li li:last-child" />
2020
<element name="treeContainer" type="block" selector=".tree-holder" />
2121
<element name="expandRootCategory" type="text" selector="img.x-tree-elbow-end-plus"/>
22+
<element name="categoryByName" type="text" selector="//div[contains(@class, 'categories-side-col')]//a/span[contains(text(), '{{categoryName}}')]" parameterized="true" timeout="30"/>
2223
</section>
2324
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="AdminProductFormSection">
11+
<element name="datepickerNewAttribute" type="input" selector="[data-index='{{attrName}}'] input" timeout="30" parameterized="true"/>
1112
<element name="attributeSet" type="select" selector="div[data-index='attribute_set_id'] .admin__field-control"/>
1213
<element name="attributeSetFilter" type="input" selector="div[data-index='attribute_set_id'] .admin__field-control input" timeout="30"/>
1314
<element name="attributeSetFilterResult" type="input" selector="div[data-index='attribute_set_id'] .action-menu-item._last" timeout="30"/>

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

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

1111
use Magento\Framework\UrlInterface;
1212

13+
/**
14+
* Returns configuration for product Url Input type
15+
*/
1316
class Product implements \Magento\Ui\Model\UrlInput\ConfigInterface
1417
{
1518
/**
@@ -27,7 +30,7 @@ public function __construct(UrlInterface $urlBuilder)
2730
}
2831

2932
/**
30-
* {@inheritdoc}
33+
* @inheritdoc
3134
*/
3235
public function getConfig(): array
3336
{
@@ -46,6 +49,7 @@ public function getConfig(): array
4649
'template' => 'ui/grid/filters/elements/ui-select',
4750
'searchUrl' => $this->urlBuilder->getUrl('catalog/product/search'),
4851
'filterPlaceholder' => __('Product Name or SKU'),
52+
'filterRateLimitMethod' => 'notifyWhenChangesStop',
4953
'isDisplayEmptyPlaceholder' => true,
5054
'emptyOptionsHtml' => __('Start typing to find products'),
5155
'missingValuePlaceholder' => __('Product with ID: %s doesn\'t exist'),
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Catalog\Ui\DataProvider\Product\Modifier;
9+
10+
use Magento\Framework\Escaper;
11+
use Magento\Ui\DataProvider\Modifier\ModifierInterface;
12+
13+
/**
14+
* Modify product listing attributes
15+
*/
16+
class Attributes implements ModifierInterface
17+
{
18+
/**
19+
* @var Escaper
20+
*/
21+
private $escaper;
22+
23+
/**
24+
* @var array
25+
*/
26+
private $escapeAttributes;
27+
28+
/**
29+
* @param Escaper $escaper
30+
* @param array $escapeAttributes
31+
*/
32+
public function __construct(
33+
Escaper $escaper,
34+
array $escapeAttributes = []
35+
) {
36+
$this->escaper = $escaper;
37+
$this->escapeAttributes = $escapeAttributes;
38+
}
39+
40+
/**
41+
* @inheritdoc
42+
*/
43+
public function modifyData(array $data)
44+
{
45+
if (!empty($data) && !empty($this->escapeAttributes)) {
46+
foreach ($data['items'] as &$item) {
47+
foreach ($this->escapeAttributes as $escapeAttribute) {
48+
if (isset($item[$escapeAttribute])) {
49+
$item[$escapeAttribute] = $this->escaper->escapeHtml($item[$escapeAttribute]);
50+
}
51+
}
52+
}
53+
}
54+
return $data;
55+
}
56+
57+
/**
58+
* @inheritdoc
59+
*/
60+
public function modifyMeta(array $meta)
61+
{
62+
return $meta;
63+
}
64+
}

0 commit comments

Comments
 (0)