Skip to content

Commit 9864460

Browse files
merge magento/2.4.0-develop into magento-qwerty/MC-35064
2 parents 3c497e4 + 763e47b commit 9864460

File tree

13 files changed

+279
-75
lines changed

13 files changed

+279
-75
lines changed

app/code/Magento/Backend/view/adminhtml/templates/widget/tabs.phtml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<?php $_tabHref = $block->getTabUrl($_tab) == '#' ? '#' . $block->getTabId($_tab) . '_content' :
3232
$block->getTabUrl($_tab) ?>
3333

34-
<li class="admin__page-nav-item" id="<?= $block->escapeHtmlAttr($block->getTabId($_tab)) ?>"
34+
<li class="admin__page-nav-item no-display" id="<?= $block->escapeHtmlAttr($block->getTabId($_tab)) ?>"
3535
<?= /* @noEscape */ $block->getUiId('tab', 'item', $_tab->getId()) ?>>
3636
<a href="<?= $block->escapeUrl($_tabHref) ?>"
3737
id="<?= $block->escapeHtmlAttr($block->getTabId($_tab)) ?>"
@@ -72,17 +72,27 @@
7272
<?= /* @noEscape */ $block->getUiId('tab', 'content', $_tab->getId()) ?>>
7373
<?= /* @noEscape */ $block->getTabContent($_tab) ?>
7474
</div>
75-
<?php if ($block->getTabIsHidden($_tab)): ?>
76-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
77-
'display:none',
78-
'li.admin__page-nav-item#' . $block->escapeJs($block->getTabId($_tab))
79-
); ?>
80-
<?php endif; ?>
8175
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
8276
'display:none',
8377
'div#' . $block->escapeJs($block->getTabId($_tab)) . '_content'
8478
); ?>
8579
</li>
80+
<?php $scriptString = <<<script
81+
require(['jquery'], function($){
82+
'use strict';
83+
script;
84+
if ($block->getTabIsHidden($_tab)):
85+
$scriptString .= <<<script
86+
$('li.admin__page-nav-item#{$block->escapeJs($block->getTabId($_tab))}').css('display', 'none');
87+
script;
88+
endif;
89+
90+
$scriptString .= <<<script
91+
$('li.admin__page-nav-item#{$block->escapeJs($block->getTabId($_tab))}').removeClass('no-display');
92+
})
93+
script;
94+
?>
95+
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
8696
<?php endforeach; ?>
8797
</ul>
8898
</div>

app/code/Magento/Checkout/view/frontend/templates/total/default.phtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,7 @@ $checkoutHelper = $block->getData('checkoutHelper');
3939
<?php endif; ?>
4040
</td>
4141
</tr>
42-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag($block->getTotal()->getStyle(), 'tr.totals th.mark') ?>
43-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag($block->getTotal()->getStyle(), 'tr.totals td.amount') ?>
42+
<?php if ($block->getTotal()->getStyle()): ?>
43+
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag($block->getTotal()->getStyle(), 'tr.totals th.mark') ?>
44+
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag($block->getTotal()->getStyle(), 'tr.totals td.amount') ?>
45+
<?php endif; ?>

app/code/Magento/Customer/view/frontend/templates/account/authentication-popup.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
?>
1010
<div id="authenticationPopup" data-bind="scope:'authenticationPopup', style: {display: 'none'}">
1111
<?php $scriptString = 'window.authenticationPopup = ' . /* @noEscape */ $block->getSerializedConfig(); ?>
12-
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>;
12+
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>
1313
<!-- ko template: getTemplate() --><!-- /ko -->
1414
<script type="text/x-magento-init">
1515
{

app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<argument name="link" value="downloadableLink"/>
3838
<argument name="index" value="0"/>
3939
</actionGroup>
40-
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterAddingDomainToWhitelist" after="addDownloadableProductLinkAgain" />
40+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterAddingDomainToAllowlist" after="addDownloadableProductLinkAgain" />
4141
<scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="scrollToLinks"/>
4242
<click selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="selectProductLink"/>
4343
<see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$52.99" stepKey="assertProductPriceInCart"/>

app/code/Magento/GiftMessage/view/adminhtml/templates/popup.phtml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
?>
99

1010
<?php if ($block->getChildHtml()):?>
11-
<div id="gift_options_configure_new" class="gift-options-popup product-configure-popup">
11+
<div id="gift_options_configure_new" class="gift-options-popup product-configure-popup no-display">
1212
<div id="gift_options_form_contents">
1313
<div class="content">
1414
<?= $block->getChildHtml() ?>
@@ -23,11 +23,21 @@
2323
</div>
2424
</div>
2525
</div>
26-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag("display: none;", 'div#gift_options_configure_new') ?>
27-
<div id="giftoptions_tooltip_window" class="gift-options-tooltip">
28-
<div id="giftoptions_tooltip_window_content">&nbsp;</div>
29-
</div>
30-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag("display: none;", 'div#giftoptions_tooltip_window') ?>
26+
<div id="giftoptions_tooltip_window" class="gift-options-tooltip no-display">
27+
<div id="giftoptions_tooltip_window_content">&nbsp;</div>
28+
</div>
29+
<?php $scriptString = <<<script
30+
require(['jquery'], function($){
31+
'use strict';
32+
$('div#gift_options_configure_new').css('display', 'none');
33+
$('div#gift_options_configure_new').removeClass('no-display');
34+
35+
$('div#giftoptions_tooltip_window').css('display', 'none');
36+
$('div#giftoptions_tooltip_window').removeClass('no-display');
37+
});
38+
script;
39+
?>
40+
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
3141
<?php $scriptString = <<<script
3242
require([
3343
"Magento_Sales/order/create/giftmessage",

app/code/Magento/Paypal/Test/Mftf/ActionGroup/StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup">
1111
<arguments>
12-
<argument name="payerName" defaultValue="MPI" type="string"/>
1312
<argument name="credentials" defaultValue="_CREDS"/>
1413
</arguments>
1514
<!--Check in-context-->

app/code/Magento/Paypal/Test/Mftf/ActionGroup/StorefrontLoginToPayPalPaymentFromCartActionGroup.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="StorefrontLoginToPayPalPaymentFromCartAccountActionGroup" extends="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup">
11+
<arguments>
12+
<argument name="payerName" defaultValue="MPI" type="string"/>
13+
</arguments>
1114
<seeElement selector="{{PayPalCheckoutAsGuestSection.CreditDebitBtn}}" stepKey="assertCheckoutAsGuest" before="waitForLoginForm"/>
12-
<see userInput="{{payerName}}" selector="{{PayPalPaymentSection.userName}}" stepKey="seePayerName"/>
15+
<see userInput="{{payerName}}" selector="{{PayPalPaymentSection.userName}}" stepKey="seePayerName" after="assertCheckoutAsGuest"/>
1316
</actionGroup>
1417
</actionGroups>

app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInProductPageTest.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@
7979
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
8080

8181
<!--Login to Paypal in-context-->
82-
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal">
83-
<argument name="payerName" value="{{Payer.firstName}}"/>
84-
</actionGroup>
82+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal"/>
83+
8584
<!--Transfer Cart Line and Shipping Method assertion-->
8685
<actionGroup ref="PayPalAssertTransferLineAndShippingMethodNotExistActionGroup" stepKey="assertPayPalSettings"/>
8786

app/code/Magento/Sales/view/adminhtml/templates/order/create/form.phtml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,41 @@
1414
<div id="order-message">
1515
<?= $block->getChildHtml('message') ?>
1616
</div>
17-
<div id="order-customer-selector" class="fieldset-wrapper order-customer-selector">
17+
<div id="order-customer-selector" class="fieldset-wrapper order-customer-selector no-display">
1818
<?= $block->getChildHtml('customer.grid.container') ?>
1919
</div>
20-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
21-
'display:' . /* @noEscape */ $block->getCustomerSelectorDisplay(),
22-
'div#order-customer-selector'
23-
) ?>
24-
<div id="order-store-selector" class="fieldset-wrapper">
20+
<div id="order-store-selector" class="fieldset-wrapper no-display">
2521
<?= $block->getChildHtml('store') ?>
2622
</div>
27-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
28-
'display:' . /* @noEscape */ $block->getStoreSelectorDisplay(),
29-
'div#order-store-selector'
30-
) ?>
31-
<div id="order-data">
23+
<div id="order-data" class="no-display">
3224
<?= $block->getChildHtml('data') ?>
3325
</div>
34-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
35-
'display:' . /* @noEscape */ $block->getDataSelectorDisplay(),
36-
'div#order-data'
37-
) ?>
3826
</form>
27+
<?php $scriptString = <<<Script
28+
require(['jquery'], function($){
29+
'use strict';
30+
31+
Script;
32+
if ($block->getCustomerSelectorDisplay()) {
33+
$scriptString .= <<<Script
34+
$('div#order-customer-selector').css('display', '{$block->getCustomerSelectorDisplay()}');
35+
$('div#order-customer-selector').removeClass('no-display');
36+
Script;
37+
}
38+
if ($block->getStoreSelectorDisplay()) {
39+
$scriptString .= <<<Script
40+
$('div#order-store-selector').css('display', '{$block->getStoreSelectorDisplay()}');
41+
$('div#order-store-selector').removeClass('no-display');
42+
Script;
43+
}
44+
if ($block->getDataSelectorDisplay()) {
45+
$scriptString .= <<<Script
46+
$('div#order-data').css('display', '{$block->getDataSelectorDisplay()}');
47+
$('div#order-data').removeClass('no-display');
48+
Script;
49+
}
50+
$scriptString .= <<<Script
51+
});
52+
Script;
53+
?>
54+
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>

app/code/Magento/Ui/view/base/web/js/block-loader.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ define([
1515
blockContentLoadingClass = '_block-content-loading',
1616
blockLoader,
1717
blockLoaderClass,
18-
loaderImageHref;
18+
blockLoaderElement = $.Deferred(),
19+
loaderImageHref = $.Deferred();
1920

2021
templateLoader.loadTemplate(blockLoaderTemplatePath).done(function (blockLoaderTemplate) {
21-
blockLoader = template($.trim(blockLoaderTemplate), {
22-
loaderImageHref: loaderImageHref
22+
loaderImageHref.done(function (loaderHref) {
23+
blockLoader = template($.trim(blockLoaderTemplate), {
24+
loaderImageHref: loaderHref
25+
});
26+
blockLoader = $(blockLoader);
27+
blockLoaderClass = '.' + blockLoader.attr('class');
28+
blockLoaderElement.resolve();
2329
});
24-
blockLoader = $(blockLoader);
25-
blockLoaderClass = '.' + blockLoader.attr('class');
2630
});
2731

2832
/**
@@ -70,7 +74,7 @@ define([
7074
}
7175

7276
return function (loaderHref) {
73-
loaderImageHref = loaderHref;
77+
loaderImageHref.resolve(loaderHref);
7478
ko.bindingHandlers.blockLoader = {
7579
/**
7680
* Process loader for block
@@ -81,9 +85,9 @@ define([
8185
element = $(element);
8286

8387
if (ko.unwrap(displayBlockLoader())) {
84-
addBlockLoader(element);
88+
blockLoaderElement.done(addBlockLoader(element));
8589
} else {
86-
removeBlockLoader(element);
90+
blockLoaderElement.done(removeBlockLoader(element));
8791
}
8892
}
8993
};

0 commit comments

Comments
 (0)