Skip to content

Commit 4419df7

Browse files
committed
Merge branch '2.4-develop' into T4-PR-07-02-2024
2 parents 8e49540 + 93d50f8 commit 4419df7

File tree

35 files changed

+1245
-258
lines changed

35 files changed

+1245
-258
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/************************************************************************
4+
*
5+
* Copyright 2024 Adobe
6+
* All Rights Reserved.
7+
*
8+
* ************************************************************************
9+
*/
10+
-->
11+
12+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
13+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
14+
<test name="AdminOrderCreateAfterHtmlMinificationTest">
15+
<annotations>
16+
<features value="Backend"/>
17+
<stories value="Admin Panel with HTML minification"/>
18+
<title value="Admin panel should allow order creation with HTML minification enabled"/>
19+
<description value="Admin panel should allow order creation with HTML minification enabled"/>
20+
<testCaseId value="AC-12329"/>
21+
<useCaseId value="ACP2E-3169"/>
22+
<severity value="MAJOR"/>
23+
<group value="backend"/>
24+
<group value="cloud"/>
25+
</annotations>
26+
<before>
27+
<magentoCLI command="config:set {{MinifyHtmlFilesEnableConfigData.path}} {{MinifyHtmlFilesEnableConfigData.value}}" stepKey="enableHtmlMinification"/>
28+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
29+
<argument name="tags" value="config"/>
30+
</actionGroup>
31+
<magentoCLI command="setup:static-content:deploy -f" stepKey="deployStaticContent"/>
32+
<createData entity="Simple_US_Customer_CA" stepKey="createSimpleCustomer"/>
33+
<createData entity="ApiProductWithDescription" stepKey="createSimpleProduct"/>
34+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
35+
</before>
36+
<after>
37+
<magentoCLI command="config:set {{MinifyHtmlFilesDisableConfigData.path}} {{MinifyHtmlFilesDisableConfigData.value}}" stepKey="disableHtmlMinification"/>
38+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
39+
<argument name="tags" value="config"/>
40+
</actionGroup>
41+
<magentoCLI command="setup:static-content:deploy -f" stepKey="deployStaticContent"/>
42+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
43+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
44+
<deleteData createDataKey="createSimpleCustomer" stepKey="deleteSimpleCustomer"/>
45+
</after>
46+
<waitForPageLoad stepKey="waitForPageLoadOnDashboard"/>
47+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeDashboardTitle">
48+
<argument name="value" value="Dashboard"/>
49+
</actionGroup>
50+
<actionGroup ref="CreateOrderActionGroup" stepKey="createOrder">
51+
<argument name="product" value="$$createSimpleProduct$$"/>
52+
<argument name="customer" value="$$createSimpleCustomer$$"/>
53+
</actionGroup>
54+
</test>
55+
</tests>

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-dynamic-rows-grid.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,13 @@ define([
141141
* @returns {Object} Chainable.
142142
*/
143143
initElements: function (data) {
144-
var newData = this.getNewData(data),
145-
recordIndex;
144+
var newData = this.getNewData(data);
146145

147146
this.parsePagesData(data);
148147

149148
if (newData.length) {
150149
if (this.insertData().length) {
151-
recordIndex = data.length - newData.length - 1;
152-
153-
_.each(newData, function (newRecord) {
154-
this.processingAddChild(newRecord, ++recordIndex, newRecord[this.identificationProperty]);
155-
}, this);
150+
this.parseProcessingAddChild(data, newData);
156151
}
157152
}
158153

@@ -181,6 +176,23 @@ define([
181176
this.reload();
182177
}
183178
}, this);
179+
},
180+
181+
/**
182+
* Parse and processing the add child method to update the latest records if the record index is not a number.
183+
*
184+
* @param {Array} data
185+
* @param {Array} newData
186+
*/
187+
parseProcessingAddChild: function (data, newData) {
188+
let recordIndex;
189+
190+
recordIndex = data.length - newData.length - 1;
191+
if (!isNaN(recordIndex)) {
192+
_.each(newData, function (newRecord) {
193+
this.processingAddChild(newRecord, ++recordIndex, newRecord[this.identificationProperty]);
194+
}, this);
195+
}
184196
}
185197
});
186198
});

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-dynamic-rows.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ define([
7474
let bundleSelections = registry.get(this.name + '.' + index + '.' + this.bundleSelectionsName);
7575

7676
bundleSelections.destroyChildren();
77+
bundleSelections._elems.clear();
7778
},
7879

7980
/**

app/code/Magento/Catalog/Model/Product/Gallery/ReadHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function execute($entity, $arguments = [])
6464

6565
$this->addMediaDataToProduct(
6666
$entity,
67-
$this->sortMediaEntriesByPosition($mediaEntries)
67+
$mediaEntries
6868
);
6969

7070
return $entity;
@@ -80,6 +80,7 @@ public function execute($entity, $arguments = [])
8080
*/
8181
public function addMediaDataToProduct(Product $product, array $mediaEntries)
8282
{
83+
$mediaEntries = $this->sortMediaEntriesByPosition($mediaEntries);
8384
$product->setData(
8485
$this->getAttribute()->getAttributeCode(),
8586
[
@@ -111,6 +112,7 @@ public function getAttribute()
111112
* @param string[] $image
112113
* @return string
113114
* @deprecated 101.0.1
115+
* @see \Magento\Catalog\Model\Product\Gallery\ReadHandler::addMediaDataToProduct
114116
* @since 101.0.0
115117
*/
116118
protected function findDefaultValue($key, &$image)

app/code/Magento/Catalog/Test/Mftf/Data/ConfigData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@
2525
<data key="path">catalog/review/allow_guest</data>
2626
<data key="value">0</data>
2727
</entity>
28+
<entity name="EnableJavascriptCalendar">
29+
<data key="path">catalog/custom_options/use_calendar</data>
30+
<data key="value">1</data>
31+
</entity>
32+
<entity name="DisableJavascriptCalendar">
33+
<data key="path">catalog/custom_options/use_calendar</data>
34+
<data key="value">0</data>
35+
</entity>
2836
</entities>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="productCustomizableDatepickerOption1">
12+
<data key="title" unique="suffix">option1</data>
13+
<data key="is_required">1</data>
14+
<data key="type">Date</data>
15+
<data key="option_0_price">100</data>
16+
<data key="option_0_price_type">Fixed</data>
17+
<data key="option_0_sku" unique="suffix">sku1_</data>
18+
</entity>
19+
<entity name="productCustomizableDatepickerOption2">
20+
<data key="title" unique="suffix">option2</data>
21+
<data key="is_required">1</data>
22+
<data key="type">Date</data>
23+
<data key="option_0_price">200</data>
24+
<data key="option_0_price_type">Fixed</data>
25+
<data key="option_0_sku" unique="suffix">sku2_</data>
26+
</entity>
27+
<entity name="productCustomizableDatepicker">
28+
<data key="name">customizable datepicker product</data>
29+
<data key="sku">customizable_datepicker_product</data>
30+
<data key="price">100</data>
31+
<data key="weight">1</data>
32+
<data key="quantity">100</data>
33+
</entity>
34+
</entities>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<element name="customMultiSelect" type="select" selector="[name='product[multi_en]']"/>
3030

3131
<element name="optionTypeDropDown" type="select" selector="//table[@data-index='options']//tr[{{index}}]//div[@data-index='type']//div[contains(@class, 'action-select-wrap')]" parameterized="true" timeout="30"/>
32-
<element name="optionTypeItem" type="select" selector="//table[@data-index='options']//tr[{{index}}]//div[@data-index='type']//*[contains(@class, 'action-menu-item')]//*[contains(., '{{optionValue}}')]" parameterized="true" timeout="30"/>
32+
<element name="optionTypeItem" type="select" selector="//table[@data-index='options']//tr[{{index}}]//div[@data-index='type']//*[contains(@class, 'action-menu-item')]//label[contains(text(), '{{optionValue}}')]" parameterized="true" timeout="30"/>
3333
<element name="checkSelect" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//span[text()='Option Type']/parent::label/parent::div/parent::div//div[@data-role='selected-option']" parameterized="true"/>
3434
<element name="checkOptionType" type="select" selector="//span[text()='{{optionTitle}}']/parent::div/parent::div/parent::div//parent::label/parent::div/parent::div//li[@class='admin__action-multiselect-menu-inner-item']//label[text()='{{optionType}}']" parameterized="true"/>
3535
<element name="checkDropDown" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//parent::label/parent::div/parent::div//li[@class='admin__action-multiselect-menu-inner-item']//label[text()='Drop-down']" parameterized="true"/>

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
/* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Date */
88
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
9+
/** @var \Magento\Framework\Escaper $escaper */
910
?>
1011

1112
<?php $_option = $block->getOption(); ?>
1213
<?php $_optionId = (int)$_option->getId(); ?>
1314
<?php $optionId = /* @noEscape */ $_optionId ?>
1415
<div class="admin__field field<?= $_option->getIsRequire() ? ' required' : '' ?>">
1516
<label class="label admin__field-label">
16-
<?= $block->escapeHtml($_option->getTitle()) ?>
17+
<?= $escaper->escapeHtml($_option->getTitle()) ?>
1718
<?= /* @noEscape */ $block->getFormattedPrice() ?>
1819
</label>
1920
<div class="admin__field-control control">
@@ -56,7 +57,6 @@ script;
5657
"mage/backend/validation"
5758
], function(jQuery){
5859
59-
//<![CDATA[
6060
script;
6161
if ($_option->getIsRequire()):
6262
$scriptString .= <<<script
@@ -88,7 +88,6 @@ script;
8888
script;
8989
endif;
9090
$scriptString .= <<<script
91-
//]]>
9291
9392
});
9493
script;

app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1616
use Magento\Catalog\Model\Layer\Resolver;
1717
use Magento\CatalogGraphQl\DataProvider\Product\SearchCriteriaBuilder;
18+
use Magento\Framework\GraphQl\Query\Uid;
19+
use Magento\Framework\App\ObjectManager;
1820

1921
/**
2022
* Products field resolver, used for GraphQL request processing.
@@ -31,17 +33,23 @@ class Products implements ResolverInterface
3133
*/
3234
private $searchApiCriteriaBuilder;
3335

36+
/** @var Uid */
37+
private $uidEncoder;
38+
3439
/**
3540
* @param ProductQueryInterface $searchQuery
3641
* @param SearchCriteriaBuilder|null $searchApiCriteriaBuilder
42+
* @param Uid|null $uidEncoder
3743
*/
3844
public function __construct(
3945
ProductQueryInterface $searchQuery,
40-
SearchCriteriaBuilder $searchApiCriteriaBuilder = null
46+
SearchCriteriaBuilder $searchApiCriteriaBuilder = null,
47+
Uid $uidEncoder = null
4148
) {
4249
$this->searchQuery = $searchQuery;
4350
$this->searchApiCriteriaBuilder = $searchApiCriteriaBuilder ??
44-
\Magento\Framework\App\ObjectManager::getInstance()->get(SearchCriteriaBuilder::class);
51+
ObjectManager::getInstance()->get(SearchCriteriaBuilder::class);
52+
$this->uidEncoder = $uidEncoder ?: ObjectManager::getInstance()->get(Uid::class);
4553
}
4654

4755
/**
@@ -80,6 +88,10 @@ public function resolve(
8088
'layer_type' => isset($args['search']) ? Resolver::CATALOG_LAYER_SEARCH : Resolver::CATALOG_LAYER_CATEGORY,
8189
];
8290

91+
if (isset($args['filter']['category_uid'])) {
92+
$args['filter']['category_id'] = $this->getFilterCategoryIdFromCategoryUid($args['filter']['category_uid']);
93+
}
94+
8395
if (isset($args['filter']['category_id'])) {
8496
$data['categories'] = $args['filter']['category_id']['eq'] ?? $args['filter']['category_id']['in'];
8597
$data['categories'] = is_array($data['categories']) ? $data['categories'] : [$data['categories']];
@@ -88,6 +100,26 @@ public function resolve(
88100
return $data;
89101
}
90102

103+
/**
104+
* Get filter category_id by category_uid
105+
*
106+
* @param array $filterCategoryUid
107+
* @return array|null
108+
*/
109+
private function getFilterCategoryIdFromCategoryUid(array $filterCategoryUid): ?array
110+
{
111+
$filterCategoryId = null;
112+
if (isset($filterCategoryUid['eq'])) {
113+
$filterCategoryId['eq'] = $this->uidEncoder
114+
->decode((string)$filterCategoryUid['eq']);
115+
} elseif (!empty($filterCategoryUid['in'])) {
116+
foreach ($filterCategoryUid['in'] as $uid) {
117+
$filterCategoryId['in'][] = $this->uidEncoder->decode((string) $uid);
118+
}
119+
}
120+
return $filterCategoryId;
121+
}
122+
91123
/**
92124
* Validate input arguments
93125
*

app/code/Magento/CatalogWidget/Block/Product/ProductsList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ public function getAddToCartPostParams(Product $product)
310310
'action' => $url,
311311
'data' => [
312312
'product' => $product->getEntityId(),
313+
'options' => $this->optionsData->getOptionsData($product),
313314
ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlEncoder->encode($url),
314315
]
315316
];

0 commit comments

Comments
 (0)