Skip to content

Commit 1e7687f

Browse files
Merge branch '2.4-develop' into Arrows_Delivery_07022024
2 parents fc86517 + d1f7dc9 commit 1e7687f

File tree

49 files changed

+1701
-300
lines changed

Some content is hidden

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

49 files changed

+1701
-300
lines changed
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

+19-7
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

+1
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

+3-1
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/Model/View/Asset/Placeholder.php

+65-10
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
namespace Magento\Catalog\Model\View\Asset;
88

99
use Magento\Framework\App\Config\ScopeConfigInterface;
10+
use Magento\Framework\App\Filesystem\DirectoryList;
11+
use Magento\Framework\App\ObjectManager;
12+
use Magento\Framework\Filesystem;
13+
use Magento\Framework\Filesystem\DriverPool;
1014
use Magento\Framework\View\Asset\ContextInterface;
1115
use Magento\Framework\View\Asset\File\NotFoundException;
1216
use Magento\Framework\View\Asset\LocalInterface;
1317
use Magento\Framework\View\Asset\Repository;
18+
use Magento\Catalog\Model\Product\Media\ConfigInterface;
1419

1520
/**
1621
* A locally available image placeholder file asset that can be referred with a file type
@@ -53,28 +58,49 @@ class Placeholder implements LocalInterface
5358
*/
5459
private $scopeConfig;
5560

61+
/**
62+
* @var \Magento\Framework\Filesystem\Directory\WriteInterface
63+
*/
64+
private $directoryMedia;
65+
66+
/**
67+
* @var ConfigInterface
68+
*/
69+
private $mediaConfig;
70+
5671
/**
5772
* Placeholder constructor.
5873
*
5974
* @param ContextInterface $context
6075
* @param ScopeConfigInterface $scopeConfig
6176
* @param Repository $assetRepo
6277
* @param string $type
78+
* @param Filesystem|null $filesystem
79+
* @param ConfigInterface|null $mediaConfig
80+
*
6381
*/
6482
public function __construct(
6583
ContextInterface $context,
6684
ScopeConfigInterface $scopeConfig,
6785
Repository $assetRepo,
68-
$type
86+
$type,
87+
?Filesystem $filesystem = null,
88+
?ConfigInterface $mediaConfig = null
6989
) {
7090
$this->context = $context;
7191
$this->scopeConfig = $scopeConfig;
7292
$this->assetRepo = $assetRepo;
7393
$this->type = $type;
94+
$filesystem = $filesystem ?? ObjectManager::getInstance()->get(Filesystem::class);
95+
$this->mediaConfig = $mediaConfig ?? ObjectManager::getInstance()->get(ConfigInterface::class);
96+
$this->directoryMedia = $filesystem->getDirectoryWrite(
97+
DirectoryList::MEDIA,
98+
DriverPool::FILE
99+
);
74100
}
75101

76102
/**
77-
* {@inheritdoc}
103+
* @inheritdoc
78104
*/
79105
public function getUrl()
80106
{
@@ -88,20 +114,20 @@ public function getUrl()
88114
}
89115

90116
/**
91-
* {@inheritdoc}
117+
* @inheritdoc
92118
*/
93119
public function getContentType()
94120
{
95121
return $this->contentType;
96122
}
97123

98124
/**
99-
* {@inheritdoc}
125+
* @inheritdoc
100126
*/
101127
public function getPath()
102128
{
103129
if ($this->getFilePath() !== null) {
104-
$result = $this->getContext()->getPath()
130+
$result = $this->getLocalMediaPath()
105131
. DIRECTORY_SEPARATOR . $this->getModule()
106132
. DIRECTORY_SEPARATOR . $this->getFilePath();
107133
} else {
@@ -119,7 +145,35 @@ public function getPath()
119145
}
120146

121147
/**
122-
* {@inheritdoc}
148+
* Get path for local media
149+
*
150+
* @return string
151+
*/
152+
private function getLocalMediaPath()
153+
{
154+
return $this->directoryMedia->getAbsolutePath($this->mediaConfig->getBaseMediaPath());
155+
}
156+
157+
/**
158+
* Get relative placeholder path
159+
*
160+
* @return string|null
161+
*/
162+
public function getRelativePath()
163+
{
164+
$result = null;
165+
//will use system placeholder unless another specified in the config
166+
if ($this->getFilePath() !== null) {
167+
$result = DIRECTORY_SEPARATOR . DirectoryList::MEDIA
168+
. DIRECTORY_SEPARATOR . $this->directoryMedia->getRelativePath($this->mediaConfig->getBaseMediaPath())
169+
. DIRECTORY_SEPARATOR . $this->getModule()
170+
. DIRECTORY_SEPARATOR . $this->getFilePath();
171+
}
172+
return $result;
173+
}
174+
175+
/**
176+
* @inheritdoc
123177
*/
124178
public function getSourceFile()
125179
{
@@ -137,15 +191,15 @@ public function getSourceContentType()
137191
}
138192

139193
/**
140-
* {@inheritdoc}
194+
* @inheritdoc
141195
*/
142196
public function getContent()
143197
{
144198
return null;
145199
}
146200

147201
/**
148-
* {@inheritdoc}
202+
* @inheritdoc
149203
*/
150204
public function getFilePath()
151205
{
@@ -163,7 +217,8 @@ public function getFilePath()
163217
}
164218

165219
/**
166-
* {@inheritdoc}
220+
* @inheritdoc
221+
*
167222
* @return ContextInterface
168223
*/
169224
public function getContext()
@@ -172,7 +227,7 @@ public function getContext()
172227
}
173228

174229
/**
175-
* {@inheritdoc}
230+
* @inheritdoc
176231
*/
177232
public function getModule()
178233
{

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

+8
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>
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

+1-1
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/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml

+4-8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<testCaseId value="MC-26119"/>
2020
<group value="catalog"/>
2121
<group value="indexer"/>
22+
<group value="indexers_by_schedule_mode_only"/>
2223
</annotations>
2324
<before>
2425
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
@@ -55,16 +56,11 @@
5556
<requiredEntity createDataKey="createCategoryC"/>
5657
</createData>
5758

58-
<!-- Switch indexers to "Update by Schedule" mode -->
59-
<actionGroup ref="AdminSwitchAllIndexerToActionModeActionGroup" stepKey="onUpdateBySchedule">
60-
<argument name="action" value="Update by Schedule"/>
61-
</actionGroup>
59+
<comment userInput="Adding the comment to replace 'AdminSwitchAllIndexerToActionModeActionGroup' action group for preserving Backward Compatibility" stepKey="onUpdateBySchedule"/>
6260
</before>
6361
<after>
64-
<!-- Switch indexers to "Update on Save" mode -->
65-
<actionGroup ref="AdminSwitchAllIndexerToActionModeActionGroup" stepKey="onUpdateOnSave">
66-
<argument name="action" value="Update on Save"/>
67-
</actionGroup>
62+
<comment userInput="Adding the comment to replace 'AdminSwitchAllIndexerToActionModeActionGroup' action group for preserving Backward Compatibility" stepKey="onUpdateOnSave"/>
63+
6864
<!-- Delete data -->
6965
<deleteData createDataKey="createProductA1" stepKey="deleteProductA1"/>
7066
<deleteData createDataKey="createProductB1" stepKey="deleteProductB1"/>

0 commit comments

Comments
 (0)