Skip to content

Commit 8e16abc

Browse files
authored
Merge pull request #4320 from magento-tsg-csl3/2.3-develop-pr24
[TSG-CSL3] For 2.3 (pr24)
2 parents 163302f + 9283ef0 commit 8e16abc

File tree

23 files changed

+343
-22
lines changed

23 files changed

+343
-22
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,4 +485,8 @@
485485
<click selector="{{AdminAddUpSellProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
486486
<waitForPageLoad stepKey="waitForPageToLoad1"/>
487487
</actionGroup>
488+
<actionGroup name="AdminSetProductDisabled">
489+
<conditionalClick selector="{{AdminProductFormSection.enableProductLabel}}" dependentSelector="{{AdminProductFormSection.productStatusValue('1')}}" visible="true" stepKey="disableProduct"/>
490+
<seeElement selector="{{AdminProductFormSection.productStatusValue('2')}}" stepKey="assertThatProductSetToDisabled"/>
491+
</actionGroup>
488492
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<element name="enableProductAttributeLabel" type="text" selector="//span[text()='Enable Product']/parent::label"/>
2222
<element name="enableProductAttributeLabelWrapper" type="text" selector="//span[text()='Enable Product']/parent::label/parent::div"/>
2323
<element name="productStatus" type="checkbox" selector="input[name='product[status]']"/>
24+
<element name="productStatusValue" type="checkbox" selector="input[name='product[status]'][value='{{value}}']" timeout="30" parameterized="true"/>
2425
<element name="productStatusDisabled" type="checkbox" selector="input[name='product[status]'][disabled]"/>
2526
<element name="enableProductLabel" type="checkbox" selector="input[name='product[status]']+label"/>
2627
<element name="productStatusUseDefault" type="checkbox" selector="input[name='use_default[status]']"/>

app/code/Magento/Checkout/Block/Cart/Totals.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Framework\View\Element\BlockInterface;
1010
use Magento\Checkout\Block\Checkout\LayoutProcessorInterface;
11+
use Magento\Sales\Model\ConfigInterface;
1112

1213
/**
1314
* Totals cart block.
@@ -45,7 +46,7 @@ class Totals extends \Magento\Checkout\Block\Cart\AbstractCart
4546
* @param \Magento\Framework\View\Element\Template\Context $context
4647
* @param \Magento\Customer\Model\Session $customerSession
4748
* @param \Magento\Checkout\Model\Session $checkoutSession
48-
* @param \Magento\Sales\Model\Config $salesConfig
49+
* @param ConfigInterface $salesConfig
4950
* @param array $layoutProcessors
5051
* @param array $data
5152
* @codeCoverageIgnore
@@ -54,7 +55,7 @@ public function __construct(
5455
\Magento\Framework\View\Element\Template\Context $context,
5556
\Magento\Customer\Model\Session $customerSession,
5657
\Magento\Checkout\Model\Session $checkoutSession,
57-
\Magento\Sales\Model\Config $salesConfig,
58+
ConfigInterface $salesConfig,
5859
array $layoutProcessors = [],
5960
array $data = []
6061
) {

app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithWebsiteAndStoreViewActionGroup.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,13 @@
4646
<actionGroup name="AdminCreateCustomerWithWebSiteAndGroup">
4747
<arguments>
4848
<argument name="customerData" defaultValue="Simple_US_Customer"/>
49-
<argument name="website" type="string" defaultValue="customWebsite"/>
50-
<argument name="storeView" type="string" defaultValue="customStore"/>
49+
<argument name="website" type="string" defaultValue="{{_defaultWebsite.name}}"/>
50+
<argument name="storeView" type="string" defaultValue="{{_defaultStore.name}}"/>
5151
</arguments>
5252
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/>
5353
<click stepKey="addNewCustomer" selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}"/>
5454
<selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/>
55-
<click selector="{{AdminCustomerAccountInformationSection.group}}" stepKey="ClickToExpandGroup"/>
56-
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption('Default (General)')}}" stepKey="waitForCustomerGroupExpand"/>
57-
<click selector="{{AdminCustomerAccountInformationSection.groupValue('Default (General)')}}" after="waitForCustomerGroupExpand" stepKey="ClickToSelectGroup"/>
55+
<selectOption selector="{{AdminCustomerAccountInformationSection.group}}" userInput="{{customerData.group}}" stepKey="selectCustomerGroup"/>
5856
<fillField stepKey="FillFirstName" selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customerData.firstname}}"/>
5957
<fillField stepKey="FillLastName" selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customerData.lastname}}"/>
6058
<fillField stepKey="FillEmail" selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customerData.email}}"/>

app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<data key="password">pwdTest123!</data>
4545
<data key="store_id">0</data>
4646
<data key="website_id">0</data>
47+
<data key="group">General</data>
4748
<requiredEntity type="address">US_Address_TX</requiredEntity>
4849
</entity>
4950
<entity name="SimpleUsCustomerWithNewCustomerGroup" type="customer">
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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="AdminVerifyCustomerAddressStateContainValuesOnceTest">
12+
<annotations>
13+
<features value="Customer"/>
14+
<stories value="Update Customer Address"/>
15+
<title value="State/Province dropdown contain values once"/>
16+
<description value="When editing a customer in the backend from the Magento Admin Panel the State/Province should only be listed once"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MAGETWO-99461"/>
19+
<useCaseId value="MAGETWO-99302"/>
20+
<group value="customer"/>
21+
</annotations>
22+
<before>
23+
<createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="firstCustomer"/>
24+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="firstCustomer" stepKey="deleteFirstCustomer"/>
28+
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteSecondCustomer">
29+
<argument name="customerEmail" value="Simple_US_Customer.email"/>
30+
</actionGroup>
31+
<actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="clearFilters"/>
32+
<actionGroup ref="logout" stepKey="logout"/>
33+
</after>
34+
35+
<!-- Go to Customers > All Customers.-->
36+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/>
37+
38+
<!--Select created customer, Click Edit mode-->
39+
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPageWithAddresses">
40+
<argument name="customer" value="$$firstCustomer$$"/>
41+
</actionGroup>
42+
43+
<!--Select Addresses tab-->
44+
<click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTabOfFirstCustomer"/>
45+
<waitForPageLoad stepKey="waitForAddressesOfFirstCustomer"/>
46+
47+
<!--Click on Edit link for Default Billing Address-->
48+
<click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditDefaultBillingAddress"/>
49+
<waitForPageLoad stepKey="waitForCustomerAddressAddUpdateFormLoad"/>
50+
51+
<!--Check that State/Province drop down contain all values once-->
52+
<seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesSection.regionId(US_Address_NY.state)}}" stepKey="seeOnlyOneRegionInSelectStateForFirstCustomer"/>
53+
54+
<!--Go to Customers > All customers, Click Add new Customers, fill all necessary fields, Save-->
55+
<actionGroup ref="AdminCreateCustomerWithWebSiteAndGroup" stepKey="createSimpleUSCustomerWithoutAddress"/>
56+
57+
<!--Select new created customer, Click Edit mode-->
58+
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPageWithoutAddresses">
59+
<argument name="customer" value="Simple_US_Customer"/>
60+
</actionGroup>
61+
62+
<!--Select Addresses tab, Click on create new addresses btn-->
63+
<click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTabOfSecondCustomer"/>
64+
<waitForPageLoad stepKey="waitForAddressesOfSecondCustomer"/>
65+
<click selector="{{AdminCustomerAddressesSection.addNewAddress}}" stepKey="clickAddNewAddressButton"/>
66+
<waitForPageLoad stepKey="waitForAddUpdateCustomerAddressForm"/>
67+
68+
<!--Select Country = United States and check that State/Province drop down contain all values once-->
69+
<click selector="{{AdminCustomerAddressesSection.country}}" stepKey="clickCountryToOpenListOfCountries"/>
70+
<click selector="{{AdminCustomerAddressesSection.countryId(US_Address_NY.country_id)}}" stepKey="fillCountry"/>
71+
<seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesSection.regionId(US_Address_NY.state)}}" stepKey="seeOnlyOneRegionInSelectStateForSecondCustomer"/>
72+
</test>
73+
</tests>

app/code/Magento/Customer/view/adminhtml/ui_component/customer_address_form.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@
215215
<target>${ $.provider }:${ $.parentScope }.country_id</target>
216216
</filterBy>
217217
<customEntry>region</customEntry>
218-
<options class="Magento\Directory\Model\ResourceModel\Region\Collection"/>
219218
</settings>
220219
</select>
221220
</formElements>

app/code/Magento/Deploy/Package/Processor/PostProcessor/CssUrls.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function process(Package $package, array $options)
6969
/** @var PackageFile $file */
7070
foreach (array_keys($package->getMap()) as $fileId) {
7171
$filePath = str_replace(\Magento\Framework\View\Asset\Repository::FILE_ID_SEPARATOR, '/', $fileId);
72+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
7273
if (strtolower(pathinfo($fileId, PATHINFO_EXTENSION)) == 'css') {
7374
$urlMap = $this->parseCss(
7475
$urlMap,
@@ -100,6 +101,7 @@ private function parseCss(array $urlMap, $cssFilePath, $packagePath, $cssContent
100101
{
101102
$cssFilePath = $this->minification->addMinifiedSign($cssFilePath);
102103

104+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
103105
$cssFileBasePath = pathinfo($cssFilePath, PATHINFO_DIRNAME);
104106
$urls = $this->getCssUrls($cssContent);
105107
foreach ($urls as $url) {
@@ -124,8 +126,21 @@ private function parseCss(array $urlMap, $cssFilePath, $packagePath, $cssContent
124126
. str_repeat('../', count(explode('/', $cssFileBasePath)))
125127
. $this->minification->addMinifiedSign($matchedFile->getDeployedFilePath())
126128
];
129+
} else {
130+
$filePathInBase = $package->getArea() .
131+
'/' . Package::BASE_THEME .
132+
'/' . $package->getLocale() .
133+
'/' . $lookupFileId;
134+
if ($this->staticDir->isReadable($this->minification->addMinifiedSign($filePathInBase))) {
135+
$urlMap[$url][] = [
136+
'filePath' => $this->minification->addMinifiedSign($packagePath . '/' . $cssFilePath),
137+
'replace' => str_repeat('../', count(explode('/', $cssFileBasePath)) + 4)
138+
. $this->minification->addMinifiedSign($filePathInBase),
139+
];
140+
}
127141
}
128142
}
143+
129144
return $urlMap;
130145
}
131146

app/code/Magento/Sales/Block/Adminhtml/Order/View.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*/
88
namespace Magento\Sales\Block\Adminhtml\Order;
99

10+
use Magento\Sales\Model\ConfigInterface;
11+
1012
/**
1113
* Adminhtml sales order view
1214
* @api
@@ -46,14 +48,14 @@ class View extends \Magento\Backend\Block\Widget\Form\Container
4648
/**
4749
* @param \Magento\Backend\Block\Widget\Context $context
4850
* @param \Magento\Framework\Registry $registry
49-
* @param \Magento\Sales\Model\Config $salesConfig
51+
* @param ConfigInterface $salesConfig
5052
* @param \Magento\Sales\Helper\Reorder $reorderHelper
5153
* @param array $data
5254
*/
5355
public function __construct(
5456
\Magento\Backend\Block\Widget\Context $context,
5557
\Magento\Framework\Registry $registry,
56-
\Magento\Sales\Model\Config $salesConfig,
58+
ConfigInterface $salesConfig,
5759
\Magento\Sales\Helper\Reorder $reorderHelper,
5860
array $data = []
5961
) {
@@ -466,6 +468,8 @@ public function getReviewPaymentUrl($action)
466468
}
467469

468470
/**
471+
* Get edit message
472+
*
469473
* @param \Magento\Sales\Model\Order $order
470474
* @return \Magento\Framework\Phrase
471475
*/
@@ -486,6 +490,8 @@ protected function getEditMessage($order)
486490
}
487491

488492
/**
493+
* Get non editable types
494+
*
489495
* @param \Magento\Sales\Model\Order $order
490496
* @return array
491497
*/

app/code/Magento/Sales/Model/Order/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ protected function maskStatusForArea($area, $code)
181181
/**
182182
* State label getter
183183
*
184-
* @param string $state
184+
* @param string $state
185185
* @return \Magento\Framework\Phrase|string
186186
*/
187187
public function getStateLabel($state)
@@ -213,7 +213,7 @@ public function getStates()
213213
{
214214
$states = [];
215215
foreach ($this->_getCollection() as $item) {
216-
if ($item->getState()) {
216+
if ($item->getState() && $item->getIsDefault()) {
217217
$states[$item->getState()] = __($item->getData('label'));
218218
}
219219
}

app/code/Magento/Sales/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
<preference for="Magento\Sales\Api\RefundOrderInterface" type="Magento\Sales\Model\RefundOrder"/>
117117
<preference for="Magento\Sales\Api\RefundInvoiceInterface" type="Magento\Sales\Model\RefundInvoice"/>
118118
<preference for="Magento\Sales\Model\ResourceModel\Provider\NotSyncedDataProviderInterface" type="Magento\Sales\Model\ResourceModel\Provider\NotSyncedDataProvider" />
119+
<preference for="Magento\Sales\Model\ConfigInterface" type="Magento\Sales\Model\Config" />
119120
<type name="Magento\Sales\Model\ResourceModel\Provider\NotSyncedDataProvider">
120121
<arguments>
121122
<argument name="providers" xsi:type="array">

app/code/Magento/Tax/Block/Checkout/Discount.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Tax\Block\Checkout;
77

8+
use Magento\Sales\Model\ConfigInterface;
9+
810
/**
911
* Subtotal Total Row Renderer
1012
*/
@@ -19,7 +21,7 @@ class Discount extends \Magento\Checkout\Block\Total\DefaultTotal
1921
* @param \Magento\Framework\View\Element\Template\Context $context
2022
* @param \Magento\Customer\Model\Session $customerSession
2123
* @param \Magento\Checkout\Model\Session $checkoutSession
22-
* @param \Magento\Sales\Model\Config $salesConfig
24+
* @param ConfigInterface $salesConfig
2325
* @param \Magento\Tax\Model\Config $taxConfig
2426
* @param array $layoutProcessors
2527
* @param array $data
@@ -28,7 +30,7 @@ public function __construct(
2830
\Magento\Framework\View\Element\Template\Context $context,
2931
\Magento\Customer\Model\Session $customerSession,
3032
\Magento\Checkout\Model\Session $checkoutSession,
31-
\Magento\Sales\Model\Config $salesConfig,
33+
ConfigInterface $salesConfig,
3234
\Magento\Tax\Model\Config $taxConfig,
3335
array $layoutProcessors = [],
3436
array $data = []
@@ -39,6 +41,8 @@ public function __construct(
3941
}
4042

4143
/**
44+
* Get display including and excluding tax config
45+
*
4246
* @return bool
4347
*/
4448
public function displayBoth()

app/code/Magento/Tax/Block/Checkout/Grandtotal.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Tax\Block\Checkout;
77

8+
use Magento\Sales\Model\ConfigInterface;
9+
810
/**
911
* Subtotal Total Row Renderer
1012
*/
@@ -26,7 +28,7 @@ class Grandtotal extends \Magento\Checkout\Block\Total\DefaultTotal
2628
* @param \Magento\Framework\View\Element\Template\Context $context
2729
* @param \Magento\Customer\Model\Session $customerSession
2830
* @param \Magento\Checkout\Model\Session $checkoutSession
29-
* @param \Magento\Sales\Model\Config $salesConfig
31+
* @param ConfigInterface $salesConfig
3032
* @param \Magento\Tax\Model\Config $taxConfig
3133
* @param array $layoutProcessors
3234
* @param array $data
@@ -35,7 +37,7 @@ public function __construct(
3537
\Magento\Framework\View\Element\Template\Context $context,
3638
\Magento\Customer\Model\Session $customerSession,
3739
\Magento\Checkout\Model\Session $checkoutSession,
38-
\Magento\Sales\Model\Config $salesConfig,
40+
ConfigInterface $salesConfig,
3941
\Magento\Tax\Model\Config $taxConfig,
4042
array $layoutProcessors = [],
4143
array $data = []

app/code/Magento/Tax/Block/Checkout/Shipping.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Tax\Block\Checkout;
77

8+
use Magento\Sales\Model\ConfigInterface;
9+
810
/**
911
* Subtotal Total Row Renderer
1012
*/
@@ -26,7 +28,7 @@ class Shipping extends \Magento\Checkout\Block\Total\DefaultTotal
2628
* @param \Magento\Framework\View\Element\Template\Context $context
2729
* @param \Magento\Customer\Model\Session $customerSession
2830
* @param \Magento\Checkout\Model\Session $checkoutSession
29-
* @param \Magento\Sales\Model\Config $salesConfig
31+
* @param ConfigInterface $salesConfig
3032
* @param \Magento\Tax\Model\Config $taxConfig
3133
* @param array $layoutProcessors
3234
* @param array $data
@@ -35,7 +37,7 @@ public function __construct(
3537
\Magento\Framework\View\Element\Template\Context $context,
3638
\Magento\Customer\Model\Session $customerSession,
3739
\Magento\Checkout\Model\Session $checkoutSession,
38-
\Magento\Sales\Model\Config $salesConfig,
40+
ConfigInterface $salesConfig,
3941
\Magento\Tax\Model\Config $taxConfig,
4042
array $layoutProcessors = [],
4143
array $data = []

app/code/Magento/Tax/Block/Checkout/Subtotal.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Tax\Block\Checkout;
77

8+
use Magento\Sales\Model\ConfigInterface;
9+
810
/**
911
* Subtotal Total Row Renderer
1012
*/
@@ -26,7 +28,7 @@ class Subtotal extends \Magento\Checkout\Block\Total\DefaultTotal
2628
* @param \Magento\Framework\View\Element\Template\Context $context
2729
* @param \Magento\Customer\Model\Session $customerSession
2830
* @param \Magento\Checkout\Model\Session $checkoutSession
29-
* @param \Magento\Sales\Model\Config $salesConfig
31+
* @param ConfigInterface $salesConfig
3032
* @param \Magento\Tax\Model\Config $taxConfig
3133
* @param array $layoutProcessors
3234
* @param array $data
@@ -35,7 +37,7 @@ public function __construct(
3537
\Magento\Framework\View\Element\Template\Context $context,
3638
\Magento\Customer\Model\Session $customerSession,
3739
\Magento\Checkout\Model\Session $checkoutSession,
38-
\Magento\Sales\Model\Config $salesConfig,
40+
ConfigInterface $salesConfig,
3941
\Magento\Tax\Model\Config $taxConfig,
4042
array $layoutProcessors = [],
4143
array $data = []
@@ -46,6 +48,8 @@ public function __construct(
4648
}
4749

4850
/**
51+
* Get display including and excluding tax config
52+
*
4953
* @return bool
5054
*/
5155
public function displayBoth()

0 commit comments

Comments
 (0)