Skip to content

Commit 45fa146

Browse files
[Magento Community Engineering] Community Contributions - 2.3-develop-fast-lane-prs
- merged with '2.3-develop-express-lane-prs' branch
2 parents 0548427 + 41a40e0 commit 45fa146

File tree

52 files changed

+1151
-470
lines changed

Some content is hidden

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

52 files changed

+1151
-470
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
12+
<actionGroup name="AdminAssertProductEditPageCreateAttributeSaveInAttributeSetPopUpShownActionGroup">
13+
<annotations>
14+
<description>Asserts that after click on "Save In New Attribute Set" poup shown .</description>
15+
</annotations>
16+
<see userInput="Enter Name for New Attribute Set" stepKey="seeContent"/>
17+
</actionGroup>
18+
</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+
12+
<actionGroup name="AdminClickAddAttributeOnProductEditPageActionGroup">
13+
<annotations>
14+
<description>Clicks on 'Add Attribute'. Admin Product creation/edit page .</description>
15+
</annotations>
16+
<click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/>
17+
<waitForPageLoad stepKey="waitForSidePanel"/>
18+
<see userInput="Select Attribute" stepKey="checkNewAttributePopUpAppeared"/>
19+
</actionGroup>
20+
</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+
12+
<actionGroup name="AdminClickCreateNewAttributeFromProductEditPageActionGroup">
13+
<annotations>
14+
<description>Clicks on 'Create New Attribute'. Admin Product creation/edit page .</description>
15+
</annotations>
16+
<click selector="{{AdminProductFormAttributeSection.createNewAttribute}}" stepKey="clickCreateNewAttribute"/>
17+
<waitForPageLoad stepKey="waitForSidePanel"/>
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
12+
<actionGroup name="AdminFillAttributeDataProductFormNewAttributeActionGroup">
13+
<arguments>
14+
<argument name="attributeName" type="string" defaultValue="TestAttributeName"/>
15+
<argument name="attributeType" type="string" defaultValue="Text Field"/>
16+
</arguments>
17+
<annotations>
18+
<description>Fill attribute data on 'Create New Attribute' page Admin Product creation/edit page .</description>
19+
</annotations>
20+
<fillField selector="{{AdminProductFormNewAttributeSection.attributeLabel}}" userInput="{{attributeName}}"
21+
stepKey="fillAttributeLabel"/>
22+
<selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}"
23+
stepKey="selectAttributeType"/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminCreateNewAttributeFromProductPageTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="We should validate the form when the user click Save in New Attribute Set"/>
15+
<title value="We should validate the form when the user click Save in New Attribute Set"/>
16+
<description
17+
value="Admin should be able to create product attribute and validate the form when the user click Save in New Attribute Set"/>
18+
<testCaseId value="https://github.com/magento/magento2/pull/25132"/>
19+
<severity value="CRITICAL"/>
20+
<group value="Catalog"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
</before>
25+
<after>
26+
<actionGroup ref="logout" stepKey="logout"/>
27+
</after>
28+
29+
<actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/>
30+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct">
31+
<argument name="product" value="SimpleProduct"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminClickAddAttributeOnProductEditPageActionGroup" stepKey="clickAddAttribute"/>
34+
<actionGroup ref="AdminClickCreateNewAttributeFromProductEditPageActionGroup" stepKey="clickCreateNewAttribute1" />
35+
<actionGroup ref="AdminFillAttributeDataProductFormNewAttributeActionGroup" stepKey="fillAttributeData" />
36+
37+
<click selector="{{AdminProductFormNewAttributeSection.saveInNewSet}}" stepKey="saveAttributeInSet"/>
38+
<actionGroup ref="AdminAssertProductEditPageCreateAttributeSaveInAttributeSetPopUpShownActionGroup" stepKey="assertPopUp"/>
39+
<click selector="{{ModalConfirmationSection.CancelButton}}" stepKey="cancelButton"/>
40+
41+
<actionGroup ref="AdminFillAttributeDataProductFormNewAttributeActionGroup" stepKey="emptyAttributeData" >
42+
<argument name="attributeName" value=" "/>
43+
<argument name="attributeType" value=" "/>
44+
</actionGroup>
45+
46+
<click selector="{{AdminProductFormNewAttributeSection.saveInNewSet}}" stepKey="clickSaveInSet"/>
47+
<see userInput="This is a required field." stepKey="seeThisIsRequiredField"/>
48+
<dontSee userInput="Enter Name for New Attribute Set" stepKey="dontSeePopUp" />
49+
50+
</test>
51+
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@
9797
<waitForPageLoad stepKey="waitForCategoryPageToLoad"/>
9898
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{virtualProductBigQty.name}}" stepKey="seeVirtualProductNameOnCategoryPage"/>
9999

100+
<!--Run full reindex and clear caches -->
101+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
102+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
103+
100104
<!-- Verify customer see created virtual product with tier price(from above step) on storefront page and is searchable by sku -->
101105
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefront"/>
102106
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>

app/code/Magento/Catalog/view/adminhtml/web/js/components/new-attribute-form.js

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,41 +42,47 @@ define([
4242

4343
var self = this;
4444

45-
prompt({
46-
content: this.newSetPromptMessage,
47-
actions: {
45+
this.validate();
4846

49-
/**
50-
* @param {String} val
51-
* @this {actions}
52-
*/
53-
confirm: function (val) {
54-
var rules = ['required-entry', 'validate-no-html-tags'],
55-
editForm = self,
56-
newAttributeSetName = val,
57-
i,
58-
params = {};
47+
if (!this.additionalInvalid && !this.source.get('params.invalid')) {
48+
prompt({
49+
content: this.newSetPromptMessage,
50+
actions: {
5951

60-
if (!newAttributeSetName) {
61-
return;
62-
}
63-
64-
for (i = 0; i < rules.length; i++) {
65-
if (!$.validator.methods[rules[i]](newAttributeSetName)) {
66-
alert({
67-
content: $.validator.messages[rules[i]]
68-
});
52+
/**
53+
* @param {String} val
54+
* @this {actions}
55+
*/
56+
confirm: function (val) {
57+
var rules = ['required-entry', 'validate-no-html-tags'],
58+
editForm = self,
59+
newAttributeSetName = val,
60+
i,
61+
params = {};
6962

63+
if (!newAttributeSetName) {
7064
return;
7165
}
72-
}
7366

74-
params['new_attribute_set_name'] = newAttributeSetName;
75-
editForm.setAdditionalData(params);
76-
editForm.save();
67+
for (i = 0; i < rules.length; i++) {
68+
if (!$.validator.methods[rules[i]](newAttributeSetName)) {
69+
alert({
70+
content: $.validator.messages[rules[i]]
71+
});
72+
73+
return;
74+
}
75+
}
76+
77+
params['new_attribute_set_name'] = newAttributeSetName;
78+
editForm.setAdditionalData(params);
79+
editForm.save();
80+
}
7781
}
78-
}
79-
});
82+
});
83+
} else {
84+
this.focusInvalid();
85+
}
8086
}
8187
});
8288
});

app/code/Magento/CatalogGraphQl/Model/Product/Option/DateType.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
use Magento\Catalog\Model\Product\Option\Type\Date as ProductDateOptionType;
1111
use Magento\Framework\Exception\LocalizedException;
1212
use Magento\Framework\Stdlib\DateTime;
13+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1314

1415
/**
15-
* @inheritdoc
16+
* CatalogGraphQl product option date type
17+
*
18+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1619
*/
1720
class DateType extends ProductDateOptionType
1821
{
@@ -43,6 +46,13 @@ private function formatValues($values)
4346
if (isset($values[$this->getOption()->getId()])) {
4447
$value = $values[$this->getOption()->getId()];
4548
$dateTime = \DateTime::createFromFormat(DateTime::DATETIME_PHP_FORMAT, $value);
49+
50+
if ($dateTime === false) {
51+
throw new GraphQlInputException(
52+
__('Invalid format provided. Please use \'Y-m-d H:i:s\' format.')
53+
);
54+
}
55+
4656
$values[$this->getOption()->getId()] = [
4757
'date' => $value,
4858
'year' => $dateTime->format('Y'),

app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,7 @@ protected function _parseRequiredData(array $rowData)
16951695
$this->_rowIsMain = false;
16961696
}
16971697

1698-
return [$this->_rowProductId, $this->_rowStoreId, $this->_rowType, $this->_rowIsMain];
1698+
return true;
16991699
}
17001700

17011701
/**

app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ define([
170170

171171
if (!availableRate && window.checkoutConfig.selectedShippingMethod) {
172172
availableRate = window.checkoutConfig.selectedShippingMethod;
173-
selectShippingMethodAction(window.checkoutConfig.selectedShippingMethod);
174-
175-
return;
176173
}
177174

178175
//Unset selected shipping method if not available

0 commit comments

Comments
 (0)