Skip to content

Commit 1a3a405

Browse files
committed
Merge remote-tracking branch 'origin/MC-25260' into 2.4-develop-pr9
2 parents 6cb25df + 1685c21 commit 1a3a405

File tree

116 files changed

+941
-262
lines changed

Some content is hidden

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

116 files changed

+941
-262
lines changed

app/code/Magento/Backend/Block/Dashboard/Graph.php

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
*/
1515
class Graph extends \Magento\Backend\Block\Dashboard\AbstractDashboard
1616
{
17-
/**
18-
* Api URL
19-
*/
2017
const API_URL = 'https://image-charts.com/chart';
2118

2219
/**
@@ -190,8 +187,8 @@ public function getChartUrl($directUrl = true)
190187
$params = [
191188
'cht' => 'lc',
192189
'chls' => '7',
193-
'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0',
194-
'chm' => 'B,f4d4b2,0,0,0',
190+
'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0',
191+
'chm' => 'B,f4d4b2,0,0,0',
195192
'chco' => 'db4814',
196193
'chxs' => '0,0,11|1,0,11',
197194
'chma' => '15,15,15,15'
@@ -237,7 +234,7 @@ public function getChartUrl($directUrl = true)
237234
case '1y':
238235
case '2y':
239236
$d = $dateStart->format('Y-m');
240-
$dateStart->modify('+1 month');
237+
$dateStart->modify('first day of next month');
241238
break;
242239
default:
243240
$d = $dateStart->format('Y-m-d H:00');
@@ -300,20 +297,23 @@ public function getChartUrl($directUrl = true)
300297
$minvalue = min($localminvalue);
301298

302299
// default values
303-
$yLabels = [];
304300
$miny = 0;
305301
$maxy = 0;
306302
$yorigin = 0;
303+
$xAxis = 'x';
304+
$xAxisIndex = 0;
305+
$yAxisIndex = 1;
307306

308307
if ($minvalue >= 0 && $maxvalue >= 0) {
309308
if ($maxvalue > 10) {
310-
$p = pow(10, $this->_getPow((int) $maxvalue));
309+
$p = pow(10, $this->_getPow((int)$maxvalue));
311310
$maxy = ceil($maxvalue / $p) * $p;
312-
$yLabels = range($miny, $maxy, $p);
311+
$yRange = "$yAxisIndex,$miny,$maxy,$p";
313312
} else {
314313
$maxy = ceil($maxvalue + 1);
315-
$yLabels = range($miny, $maxy, 1);
314+
$yRange = "$yAxisIndex,$miny,$maxy,1";
316315
}
316+
$params['chxr'] = $yRange;
317317
$yorigin = 0;
318318
}
319319

@@ -341,22 +341,11 @@ public function getChartUrl($directUrl = true)
341341

342342
$params['chd'] .= $buffer;
343343

344-
$valueBuffer = [];
345-
346344
if (count($this->_axisLabels) > 0) {
347345
$params['chxt'] = implode(',', array_keys($this->_axisLabels));
348-
$indexid = 0;
349-
foreach ($this->_axisLabels as $idx => $labels) {
350-
if ($idx == 'x') {
351-
$this->formatAxisLabelDate((string) $idx, (string) $timezoneLocal);
352-
$tmpstring = implode('|', $this->_axisLabels[$idx]);
353-
$valueBuffer[] = $indexid . ":|" . $tmpstring;
354-
} elseif ($idx == 'y') {
355-
$valueBuffer[] = $indexid . ":|" . implode('|', $yLabels);
356-
}
357-
$indexid++;
358-
}
359-
$params['chxl'] = implode('|', $valueBuffer);
346+
$this->formatAxisLabelDate($xAxis, (string)$timezoneLocal);
347+
$customAxisLabels = $xAxisIndex . ":|" . implode('|', $this->_axisLabels[$xAxis]);
348+
$params['chxl'] = $customAxisLabels . $dataSetdelimiter;
360349
}
361350

362351
// chart size
@@ -368,7 +357,7 @@ public function getChartUrl($directUrl = true)
368357
foreach ($params as $name => $value) {
369358
$p[] = $name . '=' . urlencode($value);
370359
}
371-
return (string) self::API_URL . '?' . implode('&', $p);
360+
return (string)self::API_URL . '?' . implode('&', $p);
372361
}
373362
$gaData = urlencode(base64_encode(json_encode($params)));
374363
$gaHash = $this->_dashboardData->getChartDataHash($gaData);
@@ -392,7 +381,7 @@ private function formatAxisLabelDate($idx, $timezoneLocal)
392381
switch ($this->getDataHelper()->getParam('period')) {
393382
case '24h':
394383
$this->_axisLabels[$idx][$_index] = $this->_localeDate->formatDateTime(
395-
$period->setTime((int) $period->format('H'), 0, 0),
384+
$period->setTime((int)$period->format('H'), 0, 0),
396385
\IntlDateFormatter::NONE,
397386
\IntlDateFormatter::SHORT
398387
);

app/code/Magento/Backend/Test/Mftf/ActionGroup/LoginActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="LoginActionGroup">
1212
<annotations>
13-
<description>Login to Backend Admin using ENV Admin credentials. PLEASE NOTE: This Action Group does NOT validate that you are Logged In.</description>
13+
<description>DEPRECATED. Please use LoginAsAdmin instead.
14+
Login to Backend Admin using ENV Admin credentials. PLEASE NOTE: This Action Group does NOT validate that you are Logged In.</description>
1415
</annotations>
1516

1617
<amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}" stepKey="navigateToAdmin"/>

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,9 @@ private function getChildrenCategories(int $categoryId): array
21212121
if (in_array($category['parent_id'], $categoryIds)
21222122
&& in_array($category['parent_id'], $anchorCategory)) {
21232123
$categoryIds[] = (int)$category[$linkField];
2124-
if ($category['is_anchor'] == 1) {
2124+
// Storefront approach is to treat non-anchor children of anchor category as anchors.
2125+
// Adding their's IDs to $anchorCategory for consistency.
2126+
if ($category['is_anchor'] == 1 || in_array($category['parent_id'], $anchorCategory)) {
21252127
$anchorCategory[] = (int)$category[$linkField];
21262128
}
21272129
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCategoryPageOpenProductsInCategorySectionActionGroup">
12+
<annotations>
13+
<description>Open 'Products in Category' section on category edit page in Admin.</description>
14+
</annotations>
15+
16+
<conditionalClick selector="{{AdminCategoryProductsSection.sectionHeader}}" dependentSelector="{{AdminCategoryProductsSection.sectionBody}}" visible="false" stepKey="openSectionIfHidden" />
17+
<scrollTo selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="scrollToSection" />
18+
<waitForPageLoad stepKey="waitSectionFullyLoaded"/>
19+
</actionGroup>
20+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductFormAdvancedPricingAddTierPriceActionGroup">
12+
<annotations>
13+
<description>Add new tier price on Advanced Pricing dialog on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="website" type="string" defaultValue="All Websites [USD]"/>
17+
<argument name="customerGroup" type="string" defaultValue="ALL GROUPS"/>
18+
<argument name="quantity" type="string" defaultValue="1"/>
19+
<argument name="priceType" type="string" defaultValue="Fixed"/>
20+
<argument name="amount" type="string" defaultValue="10"/>
21+
</arguments>
22+
23+
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForGroupPriceAddButtonAppears"/>
24+
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="clickCustomerGroupPriceAddButton"/>
25+
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceWebsite}}" stepKey="waitForPriceWebsiteInputAppears"/>
26+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceWebsite}}" userInput="{{website}}" stepKey="selectWebsite"/>
27+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceCustomerGroup}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup"/>
28+
<fillField selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceQty}}" userInput="{{quantity}}" stepKey="fillQuantity"/>
29+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceType}}" userInput="{{priceType}}" stepKey="selectPriceType"/>
30+
<executeJS function="return '{{priceType}}' == 'Discount' ? &quot;{{AdminProductFormAdvancedPricingSection.lastTierPriceDiscountAmount}}&quot; : &quot;{{AdminProductFormAdvancedPricingSection.lastTierPriceFixedAmount}}&quot;" stepKey="priceAmountSelector"/>
31+
<waitForElementVisible selector="{$priceAmountSelector}" stepKey="waitPriceAmountFieldAppers"/>
32+
<fillField selector="{$priceAmountSelector}" userInput="{{amount}}" stepKey="fillPriceAmount"/>
33+
</actionGroup>
34+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductFormCloseAdvancedPricingDialogActionGroup">
12+
<annotations>
13+
<description>Close Advanced Pricing dialog from product form.</description>
14+
</annotations>
15+
16+
<scrollToTopOfPage stepKey="scrollToTopOfThePage"/>
17+
<click selector="{{AdminProductFormAdvancedPricingSection.advancedPricingCloseButton}}" stepKey="clickCloseButton"/>
18+
</actionGroup>
19+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductFormDoneAdvancedPricingDialogActionGroup">
12+
<annotations>
13+
<description>Done Advanced Pricing dialog from product form.</description>
14+
</annotations>
15+
16+
<scrollToTopOfPage stepKey="scrollToTopOfThePage"/>
17+
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductFormOpenAdvancedPricingDialogActionGroup">
12+
<annotations>
13+
<description>Open Advanced Pricing dialog from product form.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/>
17+
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.modalTitle}}" stepKey="waitForModalTitleAppears"/>
18+
<see selector="{{AdminProductFormAdvancedPricingSection.modalTitle}}" userInput="Advanced Pricing" stepKey="checkModalTitle"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSaveCategoryFormActionGroup">
12+
<annotations>
13+
<description>Save category edit form in Admin and check success message.</description>
14+
</annotations>
15+
16+
<seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/>
17+
<click selector="{{AdminMainActionsSection.save}}" stepKey="saveCategory"/>
18+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/>
19+
<see userInput="You saved the category." selector="{{AdminMessagesSection.success}}" stepKey="assertSuccessMessage"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminProductFormAdvancedPricingCheckTierPriceActionGroup">
12+
<annotations>
13+
<description>Check AdvancedPricing tier price row.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="rowNumber" type="string" defaultValue="0"/>
17+
<argument name="website" type="string" defaultValue="All Websites [USD]"/>
18+
<argument name="customerGroup" type="string" defaultValue="ALL GROUPS"/>
19+
<argument name="quantity" type="string" defaultValue="1"/>
20+
<argument name="priceType" type="string" defaultValue="Fixed"/>
21+
<argument name="amount" type="string" defaultValue="10"/>
22+
</arguments>
23+
24+
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect(rowNumber)}}" stepKey="waitForPricesGridAppears"/>
25+
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect(rowNumber)}}" userInput="{{website}}" stepKey="seeWebsite"/>
26+
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(rowNumber)}}" userInput="{{customerGroup}}" stepKey="seeCustomerGroup"/>
27+
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput(rowNumber)}}" userInput="{{quantity}}" stepKey="seeQuantity"/>
28+
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect(rowNumber)}}" userInput="{{priceType}}" stepKey="seePriceType"/>
29+
<executeJS function="return '{{priceType}}' == 'Discount' ? &quot;{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput(rowNumber)}}&quot; : &quot;{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput(rowNumber)}}&quot;" stepKey="priceAmountSelector"/>
30+
<seeInField selector="{$priceAmountSelector}" userInput="{{amount}}" stepKey="seePriceAmount"/>
31+
</actionGroup>
32+
</actionGroups>

0 commit comments

Comments
 (0)