Skip to content

Commit dbcd4af

Browse files
merge magento/2.3-develop into magento-qwerty/MC-29561
2 parents 2f845f9 + e71e92e commit dbcd4af

File tree

143 files changed

+8552
-3502
lines changed

Some content is hidden

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

143 files changed

+8552
-3502
lines changed

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

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ public function getChartUrl($directUrl = true)
190190
$params = [
191191
'cht' => 'lc',
192192
'chls' => '7',
193-
'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0',
194-
'chm' => 'B,f4d4b2,0,0,0',
193+
'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0',
194+
'chm' => 'B,f4d4b2,0,0,0',
195195
'chco' => 'db4814',
196196
'chxs' => '0,0,11|1,0,11',
197197
'chma' => '15,15,15,15'
@@ -237,7 +237,7 @@ public function getChartUrl($directUrl = true)
237237
case '1y':
238238
case '2y':
239239
$d = $dateStart->format('Y-m');
240-
$dateStart->modify('+1 month');
240+
$dateStart->modify('first day of next month');
241241
break;
242242
default:
243243
$d = $dateStart->format('Y-m-d H:00');
@@ -300,20 +300,23 @@ public function getChartUrl($directUrl = true)
300300
$minvalue = min($localminvalue);
301301

302302
// default values
303-
$yLabels = [];
304303
$miny = 0;
305304
$maxy = 0;
306305
$yorigin = 0;
306+
$xAxis = 'x';
307+
$xAxisIndex = 0;
308+
$yAxisIndex = 1;
307309

308310
if ($minvalue >= 0 && $maxvalue >= 0) {
309311
if ($maxvalue > 10) {
310-
$p = pow(10, $this->_getPow((int) $maxvalue));
312+
$p = pow(10, $this->_getPow((int)$maxvalue));
311313
$maxy = ceil($maxvalue / $p) * $p;
312-
$yLabels = range($miny, $maxy, $p);
314+
$yRange = "$yAxisIndex,$miny,$maxy,$p";
313315
} else {
314316
$maxy = ceil($maxvalue + 1);
315-
$yLabels = range($miny, $maxy, 1);
317+
$yRange = "$yAxisIndex,$miny,$maxy,1";
316318
}
319+
$params['chxr'] = $yRange;
317320
$yorigin = 0;
318321
}
319322

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

342345
$params['chd'] .= $buffer;
343346

344-
$valueBuffer = [];
345-
346347
if (count($this->_axisLabels) > 0) {
347348
$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);
349+
$this->formatAxisLabelDate($xAxis, (string)$timezoneLocal);
350+
$customAxisLabels = $xAxisIndex . ":|" . implode('|', $this->_axisLabels[$xAxis]);
351+
$params['chxl'] = $customAxisLabels . $dataSetdelimiter;
360352
}
361353

362354
// chart size
@@ -368,7 +360,7 @@ public function getChartUrl($directUrl = true)
368360
foreach ($params as $name => $value) {
369361
$p[] = $name . '=' . urlencode($value);
370362
}
371-
return (string) self::API_URL . '?' . implode('&', $p);
363+
return (string)self::API_URL . '?' . implode('&', $p);
372364
}
373365
$gaData = urlencode(base64_encode(json_encode($params)));
374366
$gaHash = $this->_dashboardData->getChartDataHash($gaData);
@@ -392,7 +384,7 @@ private function formatAxisLabelDate($idx, $timezoneLocal)
392384
switch ($this->getDataHelper()->getParam('period')) {
393385
case '24h':
394386
$this->_axisLabels[$idx][$_index] = $this->_localeDate->formatDateTime(
395-
$period->setTime((int) $period->format('H'), 0, 0),
387+
$period->setTime((int)$period->format('H'), 0, 0),
396388
\IntlDateFormatter::NONE,
397389
\IntlDateFormatter::SHORT
398390
);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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="AdminSetStoreInformationConfigurationActionGroup">
12+
<annotations>
13+
<description>Set Store Information configurations</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="storeName" type="string" defaultValue="{{AdminGeneralSetStoreNameConfigData.value}}"/>
17+
<argument name="storeHoursOfOperation" type="string" defaultValue="{{AdminGeneralSetStoreHoursConfigData.value}}"/>
18+
<argument name="vatNumber" type="string" defaultValue="{{AdminGeneralSetVatNumberConfigData.value}}"/>
19+
<argument name="telephone" type="string" defaultValue="{{US_Address_TX.telephone}}"/>
20+
<argument name="country" type="string" defaultValue="{{US_Address_TX.country_id}}"/>
21+
<argument name="state" type="string" defaultValue="{{US_Address_TX.state}}"/>
22+
<argument name="city" type="string" defaultValue="{{US_Address_TX.city}}"/>
23+
<argument name="postcode" type="string" defaultValue="{{US_Address_TX.postcode}}"/>
24+
<argument name="street" type="string" defaultValue="{{US_Address_TX.street[0]}}"/>
25+
</arguments>
26+
<magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} '{{storeName}}'" stepKey="setStoreInformationName"/>
27+
<magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} '{{telephone}}'" stepKey="setStoreInformationPhone"/>
28+
<magentoCLI command="config:set {{AdminGeneralSetStoreHoursConfigData.path}} '{{storeHoursOfOperation}}'" stepKey="setStoreHoursInformation"/>
29+
<magentoCLI command="config:set {{AdminGeneralSetCountryConfigData.path}} '{{country}}'" stepKey="setStoreInformationCountry"/>
30+
<magentoCLI command="config:set {{AdminGeneralSetStateConfigData.path}} '{{state}}'" stepKey="setStoreInformationState"/>
31+
<magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} '{{city}}'" stepKey="setStoreInformationCity"/>
32+
<magentoCLI command="config:set {{AdminGeneralSetPostcodeConfigData.path}} '{{postcode}}'" stepKey="setStoreInformationPostcode"/>
33+
<magentoCLI command="config:set {{AdminGeneralSetStreetAddressConfigData.path}} '{{street}}'" stepKey="setStoreInformationStreetAddress"/>
34+
<magentoCLI command="config:set {{AdminGeneralSetVatNumberConfigData.path}} '{{vatNumber}}'" stepKey="setStoreInformationVatNumber"/>
35+
</actionGroup>
36+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Data/AdminGeneralStoreInfomationConfigData.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@
3030
<entity name="AdminGeneralSetStreetAddress2ConfigData">
3131
<data key="path">general/store_information/street_line2</data>
3232
</entity>
33+
<entity name="AdminGeneralSetStateConfigData">
34+
<data key="path">general/store_information/region_id</data>
35+
</entity>
36+
<entity name="AdminGeneralSetStoreHoursConfigData">
37+
<data key="path">general/store_information/hours</data>
38+
<data key="value">8AM-8PM</data>
39+
</entity>
3340
</entities>

app/code/Magento/Braintree/view/frontend/web/js/view/payment/3d-secure.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ define([
117117
options.bin = context.paymentPayload.details.bin;
118118
}
119119

120-
if (shippingAddress) {
120+
if (shippingAddress && this.isValidShippingAddress(shippingAddress)) {
121121
options.additionalInformation = {
122122
shippingGivenName: shippingAddress.firstname,
123123
shippingSurname: shippingAddress.lastname,
@@ -206,6 +206,25 @@ define([
206206
}
207207

208208
return false;
209+
},
210+
211+
/**
212+
* Validate shipping address
213+
*
214+
* @param {Object} shippingAddress
215+
* @return {Boolean}
216+
*/
217+
isValidShippingAddress: function (shippingAddress) {
218+
var isValid = false;
219+
220+
// check that required fields are not empty
221+
if (shippingAddress.firstname && shippingAddress.lastname && shippingAddress.telephone &&
222+
shippingAddress.street && shippingAddress.city && shippingAddress.regionCode &&
223+
shippingAddress.postcode && shippingAddress.countryId) {
224+
isValid = true;
225+
}
226+
227+
return isValid;
209228
}
210229
};
211230
});

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ define(
9292
})
9393
.then(function (hostedFieldsInstance) {
9494
self.hostedFieldsInstance = hostedFieldsInstance;
95-
self.isPlaceOrderActionAllowed(true);
95+
self.isPlaceOrderActionAllowed(false);
9696
self.initFormValidationEvents(hostedFieldsInstance);
9797

9898
return self.hostedFieldsInstance;

app/code/Magento/Captcha/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"magento/module-checkout": "*",
1212
"magento/module-customer": "*",
1313
"magento/module-store": "*",
14-
"zendframework/zend-captcha": "^2.7.1",
15-
"zendframework/zend-db": "^2.8.2",
16-
"zendframework/zend-session": "^2.7.3"
14+
"laminas/laminas-captcha": "^2.7.1",
15+
"laminas/laminas-db": "^2.8.2",
16+
"laminas/laminas-session": "^2.7.3"
1717
},
1818
"type": "magento2-module",
1919
"license": [

app/code/Magento/Catalog/Model/Layout/DepersonalizePlugin.php

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,55 @@
55
* Copyright © Magento, Inc. All rights reserved.
66
* See COPYING.txt for license details.
77
*/
8+
declare(strict_types=1);
9+
810
namespace Magento\Catalog\Model\Layout;
911

12+
use Magento\Catalog\Model\Session as CatalogSession;
13+
use Magento\Framework\View\LayoutInterface;
1014
use Magento\PageCache\Model\DepersonalizeChecker;
1115

1216
/**
13-
* Class DepersonalizePlugin
17+
* Depersonalize customer data.
18+
*
19+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1420
*/
1521
class DepersonalizePlugin
1622
{
1723
/**
1824
* @var DepersonalizeChecker
1925
*/
20-
protected $depersonalizeChecker;
26+
private $depersonalizeChecker;
2127

2228
/**
2329
* Catalog session
2430
*
25-
* @var \Magento\Catalog\Model\Session
31+
* @var CatalogSession
2632
*/
27-
protected $catalogSession;
33+
private $catalogSession;
2834

2935
/**
3036
* @param DepersonalizeChecker $depersonalizeChecker
31-
* @param \Magento\Catalog\Model\Session $catalogSession
37+
* @param CatalogSession $catalogSession
3238
*/
3339
public function __construct(
3440
DepersonalizeChecker $depersonalizeChecker,
35-
\Magento\Catalog\Model\Session $catalogSession
41+
CatalogSession $catalogSession
3642
) {
37-
$this->catalogSession = $catalogSession;
3843
$this->depersonalizeChecker = $depersonalizeChecker;
44+
$this->catalogSession = $catalogSession;
3945
}
4046

4147
/**
42-
* After generate Xml
48+
* Change sensitive customer data if the depersonalization is needed.
4349
*
44-
* @param \Magento\Framework\View\LayoutInterface $subject
45-
* @param \Magento\Framework\View\LayoutInterface $result
46-
* @return \Magento\Framework\View\LayoutInterface
50+
* @param LayoutInterface $subject
51+
* @return void
4752
*/
48-
public function afterGenerateXml(\Magento\Framework\View\LayoutInterface $subject, $result)
53+
public function afterGenerateElements(LayoutInterface $subject)
4954
{
5055
if ($this->depersonalizeChecker->checkIfDepersonalize($subject)) {
5156
$this->catalogSession->clearStorage();
5257
}
53-
return $result;
5458
}
5559
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
<annotations>
179179
<description>EXTENDS: saveProductForm. Removes 'waitProductSaveSuccessMessage' and 'seeSaveConfirmation'.</description>
180180
</annotations>
181-
181+
182182
<remove keyForRemoval="waitProductSaveSuccessMessage"/>
183183
<remove keyForRemoval="seeSaveConfirmation"/>
184184
</actionGroup>
@@ -352,7 +352,7 @@
352352
</arguments>
353353

354354
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/>
355-
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/>
355+
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/>
356356
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAnd10percent"/>
357357
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" stepKey="waitForSelectCustomerGroupNameAttribute2"/>
358358
<selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect('0')}}" userInput="{{website}}" stepKey="selectProductWebsiteValue"/>
@@ -625,7 +625,7 @@
625625
<argument name="urlKey" type="string"/>
626626
</arguments>
627627

628-
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
628+
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openSeoSection"/>
629629
<fillField userInput="{{urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
630630
</actionGroup>
631631

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>

0 commit comments

Comments
 (0)