Skip to content

Commit 526725c

Browse files
author
Mohan Ahuja
committed
Merge branch '2.4-develop' of https://github.com/magento-commerce/magento2ce into ACP2E-711
2 parents 3638431 + 610f7f5 commit 526725c

File tree

110 files changed

+3463
-364
lines changed

Some content is hidden

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

110 files changed

+3463
-364
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="CustomerReorderSimpleProductTest" extends="CustomerOrderSimpleProductTest">
11+
<annotations>
12+
<features value="Checkout"/>
13+
<stories value="Customer Reorder simple product"/>
14+
<title value="Customer Reorder simple product"/>
15+
<description value="Customer Reorder simple product"/>
16+
<stories value="Customer Reorder simple product"/>
17+
<testCaseId value="MC-27191"/>
18+
<severity value="MAJOR"/>
19+
<group value="reorder"/>
20+
</annotations>
21+
22+
<!-- Log in as admin-->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
25+
<!-- Go to orders page and validate the order details -->
26+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="addFilterToGridAndOpenOrder">
27+
<argument name="orderId" value="{$getOrderNumber}"/>
28+
</actionGroup>
29+
30+
<!-- create an shipment for the order-->
31+
<actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="createNewShipment">
32+
<argument name="Title" value="Title"/>
33+
<argument name="Number" value="99"/>
34+
<argument name="Qty" value="1"/>
35+
<argument name="Comment" value="comments for shipment"/>
36+
</actionGroup>
37+
38+
39+
<!-- Open My Account Page from Customer dropdown -->
40+
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToMyAccountPage"/>
41+
42+
<!-- Goto Orders tab from Sidebar menu in Storefront page -->
43+
<actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToSidebarMenu">
44+
<argument name="menu" value="My Orders"/>
45+
</actionGroup>
46+
47+
<!-- Clicking View Order from My Orders Grid -->
48+
<actionGroup ref="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup" stepKey="clickViewOrder"/>
49+
50+
51+
<!-- Clicking on Reorder link from Order Details Tab -->
52+
<click selector="{{StorefrontCustomerOrderViewSection.reorder}}" stepKey="clickReorder"/>
53+
54+
<!-- Reorder Simple Product -->
55+
<actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeReorder">
56+
<argument name="shippingMethod" value="Flat Rate"/>
57+
</actionGroup>
58+
59+
</test>
60+
</tests>
Lines changed: 25 additions & 0 deletions
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+
<actionGroup name="AdminOpenAndApplyBundleItemsOptionPerPageActionGroup">
12+
<annotations>
13+
<description>Open the bundle item options drop down section and assign the user defined custom value</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="perPageInputValue" type="string" defaultValue="1"/>
17+
</arguments>
18+
19+
<click selector="{{AdminProductGridPaginationSection.perPageDropdown}}" stepKey="clickProductPerPageDropdown"/>
20+
<click selector="{{AdminProductGridPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/>
21+
<fillField selector="{{AdminProductGridPaginationSection.perPageInput}}" userInput="{{perPageInputValue}}" stepKey="fillCustomPerPage"/>
22+
<click selector="{{AdminProductGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/>
23+
<waitForPageLoad stepKey="waitForPageRefreshCustomPerPage"/>
24+
</actionGroup>
25+
</actionGroups>

app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,6 @@
111111
<element name="selectCategory" type="multiselect" selector="//div[@class='action-menu _active']//label[@class='admin__action-multiselect-label']" timeout="30"/>
112112
<element name="categoriesLabel" type="text" selector="//div[@class='action-menu _active']//button[@data-action='close-advanced-select']"/>
113113
<element name="userDefinedQuantity" type="checkbox" selector="[name='bundle_options[bundle_options][{{option}}][bundle_selections][{{product}}][selection_can_change_qty]'][type='checkbox']" parameterized="true"/>
114+
<element name="bundleItemsOptionTableRows" type="button" selector=".admin__dynamic-rows[data-index='bundle_selections'] tr.data-row" timeout="30"/>
114115
</section>
115116
</sections>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminValidateBundleProductWithBundleItemsOptionPerPageTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Bundle Product Backend : Sort Order does not work of Bundle Items in an Option"/>
14+
<title value="Admin to validate bundle product with the bundle items option dynamic rows per page"/>
15+
<description value="Admin to validate bundle product with the bundle items option dynamic rows per page"/>
16+
<severity value="AVERAGE"/>
17+
<testCaseId value="AC-2718"/>
18+
<useCaseId value="ACP2E-113"/>
19+
<group value="BundleProduct"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
23+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
24+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
25+
<magentoCron stepKey="runCronIndex" groups="index"/>
26+
</before>
27+
<after>
28+
<!--Delete custom added per page-->
29+
<actionGroup ref="AdminDataGridDeleteCustomPerPageActionGroup" stepKey="deleteCustomAddedPerPage">
30+
<argument name="perPage" value="ProductPerPage.productCount"/>
31+
</actionGroup>
32+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
33+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
34+
<!--Logout to Admin Area-->
35+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
36+
</after>
37+
38+
<!-- Open bundle product creation page. -->
39+
<actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/>
40+
<!-- Fill out main field for the bundle product -->
41+
<actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainFieldsForBundle"/>
42+
<!-- Add Bundle items option with two simple product -->
43+
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2">
44+
<argument name="x" value="0"/>
45+
<argument name="n" value="1"/>
46+
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
47+
<argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/>
48+
<argument name="optionTitle" value="Option"/>
49+
<argument name="inputType" value="select"/>
50+
</actionGroup>
51+
<!-- Validate bundle items option dynamic rows per page -->
52+
<actionGroup ref="AdminOpenAndApplyBundleItemsOptionPerPageActionGroup" stepKey="openAndApplyPerPageDropdown">
53+
<argument name="perPageInputValue" value="1"/>
54+
</actionGroup>
55+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleItemsOptionTableRows}}" stepKey="waitForRowsToBeVisible"/>
56+
<seeNumberOfElements selector="{{AdminProductFormBundleSection.bundleItemsOptionTableRows}}" userInput="1" stepKey="see4RowsOfOptions"/>
57+
</test>
58+
</tests>

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
*/
2727
class BundlePanel extends AbstractModifier
2828
{
29-
const GROUP_CONTENT = 'content';
30-
const CODE_SHIPMENT_TYPE = 'shipment_type';
31-
const CODE_BUNDLE_DATA = 'bundle-items';
32-
const CODE_AFFECT_BUNDLE_PRODUCT_SELECTIONS = 'affect_bundle_product_selections';
33-
const CODE_BUNDLE_HEADER = 'bundle_header';
34-
const CODE_BUNDLE_OPTIONS = 'bundle_options';
35-
const SORT_ORDER = 20;
29+
public const GROUP_CONTENT = 'content';
30+
public const CODE_SHIPMENT_TYPE = 'shipment_type';
31+
public const CODE_BUNDLE_DATA = 'bundle-items';
32+
public const CODE_AFFECT_BUNDLE_PRODUCT_SELECTIONS = 'affect_bundle_product_selections';
33+
public const CODE_BUNDLE_HEADER = 'bundle_header';
34+
public const CODE_BUNDLE_OPTIONS = 'bundle_options';
35+
public const SORT_ORDER = 20;
3636

3737
/**
3838
* @var UrlInterface
@@ -383,7 +383,10 @@ protected function getBundleOptions()
383383
'component' => 'Magento_Bundle/js/components/bundle-dynamic-rows-grid',
384384
'sortOrder' => 50,
385385
'additionalClasses' => 'admin__field-wide',
386-
'template' => 'ui/dynamic-rows/templates/default',
386+
'template' => 'Magento_Catalog/components/dynamic-rows-per-page',
387+
'sizesConfig' => [
388+
'enabled' => true
389+
],
387390
'provider' => 'product_form.product_form_data_source',
388391
'dataProvider' => '${ $.dataScope }' . '.bundle_button_proxy',
389392
'__disableTmpl' => ['dataProvider' => false],

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

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
define([
77
'underscore',
8-
'Magento_Ui/js/dynamic-rows/dynamic-rows-grid'
9-
], function (_, dynamicRowsGrid) {
8+
'Magento_Ui/js/dynamic-rows/dynamic-rows-grid',
9+
'uiLayout',
10+
'rjsResolver'
11+
], function (_, dynamicRowsGrid, layout, resolver) {
1012
'use strict';
1113

1214
return dynamicRowsGrid.extend({
@@ -23,10 +25,74 @@ define([
2325
},
2426
listens: {
2527
inputType: 'onInputTypeChange',
26-
isDefaultValue: 'onIsDefaultValue'
28+
isDefaultValue: 'onIsDefaultValue',
29+
pageSize: 'onPageSizeChange'
30+
},
31+
sizesConfig: {
32+
component: 'Magento_Ui/js/grid/paging/sizes',
33+
name: '${ $.name }_sizes',
34+
options: {
35+
'20': {
36+
value: 20,
37+
label: 20
38+
},
39+
'30': {
40+
value: 30,
41+
label: 30
42+
},
43+
'50': {
44+
value: 50,
45+
label: 50
46+
},
47+
'100': {
48+
value: 100,
49+
label: 100
50+
},
51+
'200': {
52+
value: 200,
53+
label: 200
54+
}
55+
},
56+
storageConfig: {
57+
provider: '${ $.storageConfig.provider }',
58+
namespace: '${ $.storageConfig.namespace }'
59+
},
60+
enabled: false
61+
},
62+
links: {
63+
options: '${ $.sizesConfig.name }:options',
64+
pageSize: '${ $.sizesConfig.name }:value'
65+
},
66+
modules: {
67+
sizes: '${ $.sizesConfig.name }'
2768
}
2869
},
2970

71+
/**
72+
* Initializes paging component.
73+
*
74+
* @returns {Paging} Chainable.
75+
*/
76+
initialize: function () {
77+
this._super()
78+
.initSizes();
79+
80+
return this;
81+
},
82+
83+
/**
84+
* Initializes sizes component.
85+
*
86+
* @returns {Paging} Chainable.
87+
*/
88+
initSizes: function () {
89+
if (this.sizesConfig.enabled) {
90+
layout([this.sizesConfig]);
91+
}
92+
93+
return this;
94+
},
95+
3096
/**
3197
* Handler for type select.
3298
*
@@ -104,6 +170,17 @@ define([
104170
}
105171

106172
this._super();
173+
},
174+
175+
/**
176+
* Handles changes of the page size.
177+
*/
178+
onPageSizeChange: function () {
179+
resolver(function () {
180+
if (this.elems().length) {
181+
this.reload();
182+
}
183+
}, this);
107184
}
108185
});
109186
});

0 commit comments

Comments
 (0)