Skip to content

Commit 6ee4085

Browse files
[EngCom] Public Pull Requests - 2.3-develop
- merged latest code from mainline branch
2 parents 3f80e53 + 9216724 commit 6ee4085

File tree

67 files changed

+1923
-500
lines changed

Some content is hidden

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

67 files changed

+1923
-500
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="SetAdminAccountActionGroup">
12+
<arguments>
13+
<argument name="InterfaceLocaleByValue" type="string"/>
14+
</arguments>
15+
<!-- Navigate to admin System Account Page-->
16+
<amOnPage url="{{AdminSystemAccountPage.url}}" stepKey="openAdminSystemAccountPage" />
17+
<waitForPageLoad stepKey="loadAdminSystemAccountPage"/>
18+
<!-- Change Admin locale to Français (France) / French (France) -->
19+
<selectOption userInput="{{InterfaceLocaleByValue}}" selector="{{AdminSystemAccountSection.interfaceLocale}}" stepKey="setInterfaceLocate"/>
20+
<fillField selector="{{AdminSystemAccountSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
21+
<click selector="{{AdminCustomerMainActionsSection.saveButton}}" stepKey="clickSave"/>
22+
<waitForElement selector="{{AdminCustomerMessagesSection.successMessage}}" stepKey="waitSuccessMessage"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminSystemAccountPage" url="admin/system_account/index/" area="admin" module="Magento_Backend">
12+
<section name="AdminSystemAccountSection"/>
13+
</page>
14+
</pages>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminSystemAccountSection">
12+
<element name="interfaceLocale" type="text" selector="#interface_locale"/>
13+
<element name="currentPassword" type="text" selector="#current_password"/>
14+
</section>
15+
</sections>

app/code/Magento/Backend/Test/Mftf/Section/LocaleOptionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="LocaleOptionsSection">
1212
<element name="sectionHeader" type="text" selector="#general_locale-head"/>
1313
<element name="timezone" type="select" selector="#general_locale_timezone"/>
14+
<element name="useDefault" type="checkbox" selector="#general_locale_timezone_inherit"/>
1415
</section>
1516
</sections>

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@
131131

132132
<!--Check all products and Cart Subtotal -->
133133
<actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssert" after="waitForDetailsOpen">
134-
<argument name="subtotal" value="BundleProductsSummary.subtotal"/>
135-
<argument name="shipping" value="BundleProductsSummary.shipping"/>
136-
<argument name="shippingMethod" value="BundleProductsSummary.shippingMethod"/>
137-
<argument name="total" value="BundleProductsSummary.total"/>
134+
<argument name="subtotal" value="1,968.00"/>
135+
<argument name="shipping" value="5.00"/>
136+
<argument name="shippingMethod" value="Flat Rate - Fixed"/>
137+
<argument name="total" value="1,973.00"/>
138138
</actionGroup>
139139
</test>
140140
</tests>

app/code/Magento/Bundle/Test/Unit/Pricing/Price/SpecialPriceTest.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Bundle\Test\Unit\Pricing\Price;
77

88
use \Magento\Bundle\Pricing\Price\SpecialPrice;
9+
use Magento\Store\Api\Data\WebsiteInterface;
910

1011
class SpecialPriceTest extends \PHPUnit\Framework\TestCase
1112
{
@@ -77,12 +78,6 @@ public function testGetValue($regularPrice, $specialPrice, $isScopeDateInInterva
7778
->method('getSpecialPrice')
7879
->will($this->returnValue($specialPrice));
7980

80-
$store = $this->getMockBuilder(\Magento\Store\Model\Store::class)
81-
->disableOriginalConstructor()
82-
->getMock();
83-
$this->saleable->expects($this->once())
84-
->method('getStore')
85-
->will($this->returnValue($store));
8681
$this->saleable->expects($this->once())
8782
->method('getSpecialFromDate')
8883
->will($this->returnValue($specialFromDate));
@@ -92,7 +87,7 @@ public function testGetValue($regularPrice, $specialPrice, $isScopeDateInInterva
9287

9388
$this->localeDate->expects($this->once())
9489
->method('isScopeDateInInterval')
95-
->with($store, $specialFromDate, $specialToDate)
90+
->with(WebsiteInterface::ADMIN_CODE, $specialFromDate, $specialToDate)
9691
->will($this->returnValue($isScopeDateInInterval));
9792

9893
$this->priceCurrencyMock->expects($this->never())

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Framework\UrlInterface;
1515
use Magento\Ui\Component\Container;
1616
use Magento\Ui\Component\Form;
17+
use Magento\Ui\Component\Form\Fieldset;
1718
use Magento\Ui\Component\Modal;
1819

1920
/**
@@ -69,13 +70,26 @@ public function __construct(
6970
}
7071

7172
/**
72-
* {@inheritdoc}
73+
* @inheritdoc
74+
*
7375
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
7476
*/
7577
public function modifyMeta(array $meta)
7678
{
7779
$meta = $this->removeFixedTierPrice($meta);
78-
$path = $this->arrayManager->findPath(static::CODE_BUNDLE_DATA, $meta, null, 'children');
80+
81+
$groupCode = static::CODE_BUNDLE_DATA;
82+
$path = $this->arrayManager->findPath($groupCode, $meta, null, 'children');
83+
if (empty($path)) {
84+
$meta[$groupCode]['children'] = [];
85+
$meta[$groupCode]['arguments']['data']['config'] = [
86+
'componentType' => Fieldset::NAME,
87+
'label' => __('Bundle Items'),
88+
'collapsible' => true
89+
];
90+
91+
$path = $this->arrayManager->findPath($groupCode, $meta, null, 'children');
92+
}
7993

8094
$meta = $this->arrayManager->merge(
8195
$path,
@@ -220,7 +234,7 @@ private function removeFixedTierPrice(array $meta)
220234
}
221235

222236
/**
223-
* {@inheritdoc}
237+
* @inheritdoc
224238
*/
225239
public function modifyData(array $data)
226240
{

app/code/Magento/Bundle/view/frontend/templates/sales/order/items/renderer.phtml

Lines changed: 81 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -7,129 +7,150 @@
77
// @codingStandardsIgnoreFile
88

99
/** @var $block \Magento\Bundle\Block\Sales\Order\Items\Renderer */
10+
$parentItem = $block->getItem();
11+
$items = array_merge([$parentItem], $parentItem->getChildrenItems());
12+
$index = 0;
13+
$prevOptionId = '';
1014
?>
11-
<?php $parentItem = $block->getItem() ?>
12-
<?php $items = array_merge([$parentItem], $parentItem->getChildrenItems()); ?>
13-
<?php $_index = 0 ?>
1415

15-
<?php $_prevOptionId = '' ?>
16+
<?php foreach ($items as $item): ?>
1617

17-
<?php foreach ($items as $_item): ?>
18-
19-
<?php if ($block->getItemOptions() || $parentItem->getDescription() || $this->helper('Magento\GiftMessage\Helper\Message')->isMessagesAllowed('order_item', $parentItem) && $parentItem->getGiftMessageId()): ?>
20-
<?php $_showlastRow = true ?>
18+
<?php if ($block->getItemOptions()
19+
|| $parentItem->getDescription()
20+
|| $this->helper('Magento\GiftMessage\Helper\Message')->isMessagesAllowed('order_item', $parentItem)
21+
&& $parentItem->getGiftMessageId()): ?>
22+
<?php $showLastRow = true; ?>
2123
<?php else: ?>
22-
<?php $_showlastRow = false ?>
24+
<?php $showLastRow = false; ?>
2325
<?php endif; ?>
2426

25-
<?php if ($_item->getParentItem()): ?>
26-
<?php $attributes = $block->getSelectionAttributes($_item) ?>
27-
<?php if ($_prevOptionId != $attributes['option_id']): ?>
27+
<?php if ($item->getParentItem()): ?>
28+
<?php $attributes = $block->getSelectionAttributes($item) ?>
29+
<?php if ($prevOptionId != $attributes['option_id']): ?>
2830
<tr class="options-label">
29-
<td class="col label" colspan="5"><?= /* @escapeNotVerified */ $attributes['option_label'] ?></td>
31+
<td class="col label" colspan="5"><?= $block->escapeHtml($attributes['option_label']); ?></td>
3032
</tr>
31-
<?php $_prevOptionId = $attributes['option_id'] ?>
33+
<?php $prevOptionId = $attributes['option_id'] ?>
3234
<?php endif; ?>
3335
<?php endif; ?>
34-
<tr id="order-item-row-<?= /* @escapeNotVerified */ $_item->getId() ?>" class="<?php if ($_item->getParentItem()): ?>item-options-container<?php else: ?>item-parent<?php endif; ?>"<?php if ($_item->getParentItem()): ?> data-th="<?= /* @escapeNotVerified */ $attributes['option_label'] ?>"<?php endif; ?>>
35-
<?php if (!$_item->getParentItem()): ?>
36-
<td class="col name" data-th="<?= $block->escapeHtml(__('Product Name')) ?>">
37-
<strong class="product name product-item-name"><?= $block->escapeHtml($_item->getName()) ?></strong>
36+
<tr id="order-item-row-<?= /* @noEscape */ $item->getId() ?>"
37+
class="<?php if ($item->getParentItem()): ?>
38+
item-options-container
39+
<?php else: ?>
40+
item-parent
41+
<?php endif; ?>"
42+
<?php if ($item->getParentItem()): ?>
43+
data-th="<?= $block->escapeHtml($attributes['option_label']); ?>"
44+
<?php endif; ?>>
45+
<?php if (!$item->getParentItem()): ?>
46+
<td class="col name" data-th="<?= $block->escapeHtml(__('Product Name')); ?>">
47+
<strong class="product name product-item-name"><?= $block->escapeHtml($item->getName()); ?></strong>
3848
</td>
3949
<?php else: ?>
40-
<td class="col value" data-th="<?= $block->escapeHtml(__('Product Name')) ?>"><?= $block->getValueHtml($_item) ?></td>
50+
<td class="col value" data-th="<?= $block->escapeHtml(__('Product Name')); ?>">
51+
<?= $block->getValueHtml($item); ?>
52+
</td>
4153
<?php endif; ?>
42-
<td class="col sku" data-th="<?= $block->escapeHtml(__('SKU')) ?>"><?= /* @escapeNotVerified */ $block->prepareSku($_item->getSku()) ?></td>
43-
<td class="col price" data-th="<?= $block->escapeHtml(__('Price')) ?>">
44-
<?php if (!$_item->getParentItem()): ?>
45-
<?= $block->getItemPriceHtml() ?>
54+
<td class="col sku" data-th="<?= $block->escapeHtml(__('SKU')); ?>">
55+
<?= /* @noEscape */ $block->prepareSku($item->getSku()); ?>
56+
</td>
57+
<td class="col price" data-th="<?= $block->escapeHtml(__('Price')); ?>">
58+
<?php if (!$item->getParentItem()): ?>
59+
<?= /* @noEscape */ $block->getItemPriceHtml(); ?>
4660
<?php else: ?>
4761
&nbsp;
4862
<?php endif; ?>
4963
</td>
50-
<td class="col qty" data-th="<?= $block->escapeHtml(__('Quantity')) ?>">
64+
<td class="col qty" data-th="<?= $block->escapeHtml(__('Quantity')); ?>">
5165
<?php if (
52-
($_item->getParentItem() && $block->isChildCalculated()) ||
53-
(!$_item->getParentItem() && !$block->isChildCalculated()) || ($_item->getQtyShipped() > 0 && $_item->getParentItem() && $block->isShipmentSeparately())):?>
66+
($item->getParentItem() && $block->isChildCalculated()) ||
67+
(!$item->getParentItem() && !$block->isChildCalculated()) ||
68+
($item->getQtyShipped() > 0 && $item->getParentItem() && $block->isShipmentSeparately())): ?>
5469
<ul class="items-qty">
5570
<?php endif; ?>
56-
<?php if (($_item->getParentItem() && $block->isChildCalculated()) ||
57-
(!$_item->getParentItem() && !$block->isChildCalculated())): ?>
58-
<?php if ($_item->getQtyOrdered() > 0): ?>
71+
<?php if (($item->getParentItem() && $block->isChildCalculated()) ||
72+
(!$item->getParentItem() && !$block->isChildCalculated())): ?>
73+
<?php if ($item->getQtyOrdered() > 0): ?>
5974
<li class="item">
60-
<span class="title"><?= /* @escapeNotVerified */ __('Ordered') ?></span>
61-
<span class="content"><?= /* @escapeNotVerified */ $_item->getQtyOrdered()*1 ?></span>
75+
<span class="title"><?= $block->escapeHtml(__('Ordered')); ?></span>
76+
<span class="content"><?= /* @noEscape */ $item->getQtyOrdered() * 1; ?></span>
6277
</li>
6378
<?php endif; ?>
64-
<?php if ($_item->getQtyShipped() > 0 && !$block->isShipmentSeparately()): ?>
79+
<?php if ($item->getQtyShipped() > 0 && !$block->isShipmentSeparately()): ?>
6580
<li class="item">
66-
<span class="title"><?= /* @escapeNotVerified */ __('Shipped') ?></span>
67-
<span class="content"><?= /* @escapeNotVerified */ $_item->getQtyShipped()*1 ?></span>
81+
<span class="title"><?= $block->escapeHtml(__('Shipped')); ?></span>
82+
<span class="content"><?= /* @noEscape */ $item->getQtyShipped() * 1; ?></span>
6883
</li>
6984
<?php endif; ?>
70-
<?php if ($_item->getQtyCanceled() > 0): ?>
85+
<?php if ($item->getQtyCanceled() > 0): ?>
7186
<li class="item">
72-
<span class="title"><?= /* @escapeNotVerified */ __('Canceled') ?></span>
73-
<span class="content"><?= /* @escapeNotVerified */ $_item->getQtyCanceled()*1 ?></span>
87+
<span class="title"><?= $block->escapeHtml(__('Canceled')); ?></span>
88+
<span class="content"><?= /* @noEscape */ $item->getQtyCanceled() * 1; ?></span>
7489
</li>
7590
<?php endif; ?>
76-
<?php if ($_item->getQtyRefunded() > 0): ?>
91+
<?php if ($item->getQtyRefunded() > 0): ?>
7792
<li class="item">
78-
<span class="title"><?= /* @escapeNotVerified */ __('Refunded') ?></span>
79-
<span class="content"><?= /* @escapeNotVerified */ $_item->getQtyRefunded()*1 ?></span>
93+
<span class="title"><?= $block->escapeHtml(__('Refunded')); ?></span>
94+
<span class="content"><?= /* @noEscape */ $item->getQtyRefunded() * 1; ?></span>
8095
</li>
8196
<?php endif; ?>
82-
<?php elseif ($_item->getQtyShipped() > 0 && $_item->getParentItem() && $block->isShipmentSeparately()): ?>
97+
<?php elseif ($item->getQtyShipped() > 0 && $item->getParentItem() && $block->isShipmentSeparately()): ?>
8398
<li class="item">
84-
<span class="title"><?= /* @escapeNotVerified */ __('Shipped') ?></span>
85-
<span class="content"><?= /* @escapeNotVerified */ $_item->getQtyShipped()*1 ?></span>
99+
<span class="title"><?= $block->escapeHtml(__('Shipped')); ?></span>
100+
<span class="content"><?= /* @noEscape */ $item->getQtyShipped() * 1; ?></span>
86101
</li>
87102
<?php else: ?>
88-
&nbsp;
103+
<span class="content"><?= /* @noEscape */ $parentItem->getQtyOrdered() * 1; ?></span>
89104
<?php endif; ?>
90105
<?php if (
91-
($_item->getParentItem() && $block->isChildCalculated()) ||
92-
(!$_item->getParentItem() && !$block->isChildCalculated()) || ($_item->getQtyShipped() > 0 && $_item->getParentItem() && $block->isShipmentSeparately())):?>
106+
($item->getParentItem() && $block->isChildCalculated()) ||
107+
(!$item->getParentItem() && !$block->isChildCalculated()) ||
108+
($item->getQtyShipped() > 0 && $item->getParentItem() && $block->isShipmentSeparately())):?>
93109
</ul>
94110
<?php endif; ?>
95111
</td>
96112
<td class="col subtotal" data-th="<?= $block->escapeHtml(__('Subtotal')) ?>">
97-
<?php if (!$_item->getParentItem()): ?>
98-
<?= $block->getItemRowTotalHtml() ?>
113+
<?php if (!$item->getParentItem()): ?>
114+
<?= /* @noEscape */ $block->getItemRowTotalHtml(); ?>
99115
<?php else: ?>
100116
&nbsp;
101117
<?php endif; ?>
102118
</td>
103119
</tr>
104120
<?php endforeach; ?>
105121

106-
<?php if ($_showlastRow && (($_options = $block->getItemOptions()) || $block->escapeHtml($_item->getDescription()))): ?>
122+
<?php if ($showLastRow && (($options = $block->getItemOptions()) || $block->escapeHtml($item->getDescription()))): ?>
107123
<tr>
108124
<td class="col options" colspan="5">
109-
<?php if ($_options = $block->getItemOptions()): ?>
125+
<?php if ($options = $block->getItemOptions()): ?>
110126
<dl class="item-options">
111-
<?php foreach ($_options as $_option) : ?>
112-
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
127+
<?php foreach ($options as $option) : ?>
128+
<dt><?= $block->escapeHtml($option['label']) ?></dt>
113129
<?php if (!$block->getPrintStatus()): ?>
114-
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
115-
<dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip wrapper"<?php endif; ?>>
116-
<?= /* @escapeNotVerified */ $_formatedOptionValue['value'] ?>
117-
<?php if (isset($_formatedOptionValue['full_view'])): ?>
130+
<?php $formattedOptionValue = $block->getFormatedOptionValue($option) ?>
131+
<dd<?php if (isset($formattedOptionValue['full_view'])): ?>
132+
class="tooltip wrapper"
133+
<?php endif; ?>>
134+
<?= /* @noEscape */ $formattedOptionValue['value'] ?>
135+
<?php if (isset($formattedOptionValue['full_view'])): ?>
118136
<div class="tooltip content">
119137
<dl class="item options">
120-
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
121-
<dd><?= /* @escapeNotVerified */ $_formatedOptionValue['full_view'] ?></dd>
138+
<dt><?= $block->escapeHtml($option['label']); ?></dt>
139+
<dd><?= /* @noEscape */ $formattedOptionValue['full_view']; ?></dd>
122140
</dl>
123141
</div>
124142
<?php endif; ?>
125143
</dd>
126144
<?php else: ?>
127-
<dd><?= $block->escapeHtml((isset($_option['print_value']) ? $_option['print_value'] : $_option['value'])) ?></dd>
145+
<dd><?= $block->escapeHtml((isset($option['print_value']) ?
146+
$option['print_value'] :
147+
$option['value'])); ?>
148+
</dd>
128149
<?php endif; ?>
129150
<?php endforeach; ?>
130151
</dl>
131152
<?php endif; ?>
132-
<?= $block->escapeHtml($_item->getDescription()) ?>
153+
<?= $block->escapeHtml($item->getDescription()); ?>
133154
</td>
134155
</tr>
135156
<?php endif; ?>

0 commit comments

Comments
 (0)