Skip to content

Commit

Permalink
Merge pull request #151 from magento-commerce/1.1.46-release
Browse files Browse the repository at this point in the history
1.1.46 Release
  • Loading branch information
apoltoratskyi authored Feb 16, 2024
2 parents ca33ddc + c85f380 commit 1caa9b7
Show file tree
Hide file tree
Showing 14 changed files with 3,193 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/quality-patches",
"description": "Provides quality patches for AdobeCommerce & Magento OpenSource",
"type": "magento2-component",
"version": "1.1.45",
"version": "1.1.46",
"license": "proprietary",
"repositories": {
"repo": {
Expand Down
18 changes: 12 additions & 6 deletions magento_releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"magento/module-page-builder": "2.2.3-p5",
"magento/page-builder-commerce": "1.7.2-p5",
"magento/security-package": "1.1.4-p5",
"magento/security-package-b2b": "1.0.2-p5"
"magento/security-package-b2b": "1.0.2-p5",
"magento/security-package-ee": "1.0.0-p5"
},
"2.4.5-p4": {
"magento/magento2-base": "2.4.5-p4",
Expand All @@ -57,7 +58,8 @@
"magento/module-page-builder": "2.2.3-p4",
"magento/page-builder-commerce": "1.7.2-p4",
"magento/security-package": "1.1.4-p4",
"magento/security-package-b2b": "1.0.2-p4"
"magento/security-package-b2b": "1.0.2-p4",
"magento/security-package-ee": "1.0.0-p4"
},
"2.4.5-p3": {
"magento/magento2-base": "2.4.5-p3",
Expand All @@ -67,7 +69,8 @@
"magento/module-page-builder": "2.2.3-p1",
"magento/page-builder-commerce": "1.7.2-p3",
"magento/security-package": "1.1.4-p3",
"magento/security-package-b2b": "1.0.2-p3"
"magento/security-package-b2b": "1.0.2-p3",
"magento/security-package-ee": "1.0.0-p3"
},
"2.4.5-p2": {
"magento/magento2-base": "2.4.5-p2",
Expand All @@ -77,7 +80,8 @@
"magento/module-page-builder": "2.2.3-p1",
"magento/page-builder-commerce": "1.7.2-p2",
"magento/security-package": "1.1.4-p2",
"magento/security-package-b2b": "1.0.2-p2"
"magento/security-package-b2b": "1.0.2-p2",
"magento/security-package-ee": "1.0.0-p2"
},
"2.4.5-p1": {
"magento/magento2-base": "2.4.5-p1",
Expand All @@ -87,7 +91,8 @@
"magento/module-page-builder": "2.2.3-p1",
"magento/page-builder-commerce": "1.7.2-p1",
"magento/security-package": "1.1.4-p1",
"magento/security-package-b2b": "1.0.2-p1"
"magento/security-package-b2b": "1.0.2-p1",
"magento/security-package-ee": "1.0.0-p1"
},
"2.4.5": {
"magento/magento2-base": "2.4.5",
Expand All @@ -97,7 +102,8 @@
"magento/module-page-builder": "2.2.3",
"magento/page-builder-commerce": "1.7.2",
"magento/security-package": "1.1.4",
"magento/security-package-b2b": "1.0.2"
"magento/security-package-b2b": "1.0.2",
"magento/security-package-ee": "1.0.0"
},
"2.4.4-p6": {
"magento/magento2-base": "2.4.4-p6",
Expand Down
2 changes: 1 addition & 1 deletion patches-info.json

Large diffs are not rendered by default.

300 changes: 300 additions & 0 deletions patches/commerce/ACSD-54656_1.0.0-p1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
diff --git a/vendor/magento/module-re-captcha-gift-card/view/frontend/layout/checkout_cart_index.xml b/vendor/magento/module-re-captcha-gift-card/view/frontend/layout/checkout_cart_index.xml
index 8a7e43ed..822f51a0 100644
--- a/vendor/magento/module-re-captcha-gift-card/view/frontend/layout/checkout_cart_index.xml
+++ b/vendor/magento/module-re-captcha-gift-card/view/frontend/layout/checkout_cart_index.xml
@@ -19,7 +19,7 @@
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="recaptcha" xsi:type="array">
- <item name="component" xsi:type="string">Magento_ReCaptchaFrontendUi/js/reCaptcha</item>
+ <item name="component" xsi:type="string">Magento_ReCaptchaGiftCard/js/checkoutReCaptcha</item>
</item>
</item>
</argument>
diff --git a/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/action/get-gift-card-information-mixin.js b/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/action/get-gift-card-information-mixin.js
index 2eda05a0..c16606ad 100644
--- a/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/action/get-gift-card-information-mixin.js
+++ b/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/action/get-gift-card-information-mixin.js
@@ -3,7 +3,10 @@
* See COPYING.txt for license details.
*/

+ /* eslint-disable max-nested-callbacks */
+
define([
+ 'jquery',
'ko',
'mage/storage',
'Magento_Customer/js/model/customer',
@@ -15,6 +18,7 @@ define([
'mage/utils/wrapper',
'Magento_ReCaptchaWebapiUi/js/webapiReCaptchaRegistry'
], function (
+ $,
ko,
storage,
customer,
@@ -35,43 +39,57 @@ define([
* @param {Object} giftCardCode - giftCardCode model.
*/
check: function (originFn, giftCardCode) {
- var self = this,
+ var recaptchaDeferred,
+ self = this,
serviceUrl, headers = {};

+ if (!customer.isLoggedIn()) {
+ serviceUrl = urlBuilder.createUrl('/carts/guest-carts/:cartId/checkGiftCard/:giftCardCode', {
+ cartId: quote.getQuoteId(),
+ giftCardCode: giftCardCode
+ });
+ } else {
+ serviceUrl = urlBuilder.createUrl('/carts/mine/checkGiftCard/:giftCardCode', {
+ giftCardCode: giftCardCode
+ });
+ }
+ messageList.clear();
+
this.isLoading(true);

if (recaptchaRegistry.triggers.hasOwnProperty('recaptcha-checkout-gift-apply')) {
+ //ReCaptcha is present for checkout
+ recaptchaDeferred = $.Deferred();
recaptchaRegistry.addListener('recaptcha-checkout-gift-apply', function (token) {
headers = {
'X-ReCaptcha': token
};
- });

- if (!customer.isLoggedIn()) {
- serviceUrl = urlBuilder.createUrl('/carts/guest-carts/:cartId/checkGiftCard/:giftCardCode', {
- cartId: quote.getQuoteId(),
- giftCardCode: giftCardCode
- });
- } else {
- serviceUrl = urlBuilder.createUrl('/carts/mine/checkGiftCard/:giftCardCode', {
- giftCardCode: giftCardCode
+ storage.get(
+ serviceUrl, true, 'application/json', headers
+ ).done(function (response) {
+ giftCardAccount.isChecked(true);
+ giftCardAccount.code(giftCardCode);
+ giftCardAccount.amount(response);
+ giftCardAccount.isValid(true);
+ }).fail(function (response) {
+ giftCardAccount.isValid(false);
+ errorProcessor.process(response, messageList);
+ }).always(function () {
+ self.isLoading(false);
});
+ });
+ //Trigger ReCaptcha validation
+ recaptchaRegistry.triggers['recaptcha-checkout-gift-apply']();
+ if (
+ !recaptchaRegistry._isInvisibleType.hasOwnProperty('recaptcha-checkout-gift-apply') ||
+ recaptchaRegistry._isInvisibleType['recaptcha-checkout-gift-apply'] === false
+ ) {
+ //remove listener so that get gift action is only triggered by the 'Gift Apply' button
+ recaptchaRegistry.removeListener('recaptcha-checkout-gift-apply');
}
- messageList.clear();

- return storage.get(
- serviceUrl, true, 'application/json', headers
- ).done(function (response) {
- giftCardAccount.isChecked(true);
- giftCardAccount.code(giftCardCode);
- giftCardAccount.amount(response);
- giftCardAccount.isValid(true);
- }).fail(function (response) {
- giftCardAccount.isValid(false);
- errorProcessor.process(response, messageList);
- }).always(function () {
- self.isLoading(false);
- });
+ return recaptchaDeferred;
}

return originFn(giftCardCode);
diff --git a/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/action/set-gift-card-information-mixin.js b/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/action/set-gift-card-information-mixin.js
index e8fd257e..25561f8e 100644
--- a/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/action/set-gift-card-information-mixin.js
+++ b/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/action/set-gift-card-information-mixin.js
@@ -3,6 +3,8 @@
* See COPYING.txt for license details.
*/

+ /* eslint-disable max-nested-callbacks */
+
define([
'jquery',
'mage/storage',
@@ -34,7 +36,8 @@ define([

return function (setGiftCardAction) {
return wrapper.wrap(setGiftCardAction, function (originalAction, giftCardCode) {
- var serviceUrl,
+ var recaptchaDeferred,
+ serviceUrl,
payload,
headers = {},
message = $.mage.__('Gift Card %1 was added.').replace('%1', giftCardCode);
@@ -63,34 +66,46 @@ define([
}

if (recaptchaRegistry.triggers.hasOwnProperty('recaptcha-checkout-gift-apply')) {
+ //ReCaptcha is present for checkout
+ recaptchaDeferred = $.Deferred();
recaptchaRegistry.addListener('recaptcha-checkout-gift-apply', function (token) {
headers['X-ReCaptcha'] = token;
- });
+ storage.post(
+ serviceUrl, JSON.stringify(payload), true, 'application/json', headers
+ ).done(function (response) {
+ /**
+ * Callback for getPaymentInformationAction.
+ */
+ var onGetPaymentInformationAction = function () {
+ totals.isLoading(false);
+ },
+ deferred = $.Deferred();

- return storage.post(
- serviceUrl, JSON.stringify(payload), true, 'application/json', headers
- ).done(function (response) {
- /**
- * Callback for getPaymentInformationAction.
- */
- var onGetPaymentInformationAction = function () {
+ if (response) {
+ totals.isLoading(true);
+ $.when(getPaymentInformationAction(deferred)).done(onGetPaymentInformationAction);
+ messageList.addSuccessMessage({
+ 'message': message
+ });
+ }
+ }).fail(function (response) {
totals.isLoading(false);
- },
- deferred = $.Deferred();
-
- if (response) {
- totals.isLoading(true);
- $.when(getPaymentInformationAction(deferred)).done(onGetPaymentInformationAction);
- messageList.addSuccessMessage({
- 'message': message
- });
- }
- }).fail(function (response) {
- totals.isLoading(false);
- errorProcessor.process(response, messageList);
- }).always(function () {
- fullScreenLoader.stopLoader();
+ errorProcessor.process(response, messageList);
+ }).always(function () {
+ fullScreenLoader.stopLoader();
+ });
});
+ //Trigger ReCaptcha validation
+ recaptchaRegistry.triggers['recaptcha-checkout-gift-apply']();
+ if (
+ !recaptchaRegistry._isInvisibleType.hasOwnProperty('recaptcha-checkout-gift-apply') ||
+ recaptchaRegistry._isInvisibleType['recaptcha-checkout-gift-apply'] === false
+ ) {
+ //remove listener so that gift-apply action is only triggered by the 'Gift Apply' button
+ recaptchaRegistry.removeListener('recaptcha-checkout-gift-apply');
+ }
+
+ return recaptchaDeferred;
}

//No ReCaptcha, just sending the request
diff --git a/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/checkoutReCaptcha.js b/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/checkoutReCaptcha.js
new file mode 100644
index 00000000..8896649a
--- /dev/null
+++ b/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/checkoutReCaptcha.js
@@ -0,0 +1,58 @@
+/************************************************************************
+ *
+ * ADOBE CONFIDENTIAL
+ * ___________________
+ *
+ * Copyright 2023 Adobe
+ * All Rights Reserved.
+ *
+ * NOTICE: All information contained herein is, and remains
+ * the property of Adobe and its suppliers, if any. The intellectual
+ * and technical concepts contained herein are proprietary to Adobe
+ * and its suppliers and are protected by all applicable intellectual
+ * property laws, including trade secret and copyright laws.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * from Adobe.
+ * ************************************************************************
+ */
+
+define(
+ [
+ 'Magento_ReCaptchaFrontendUi/js/reCaptcha'
+ ],
+ function (Component) {
+ 'use strict';
+
+ return Component.extend({
+ /**
+ * Auto-trigger validation so that ReCaptcha is ready for Quick Checkout
+ *
+ * @param {Object} parentForm
+ * @param {String} widgetId
+ */
+ initParentForm: function (parentForm, widgetId) {
+ window.grecaptcha.execute(widgetId);
+ parentForm.find('.action.check').click(function (event) {
+ if (this.getIsInvisibleRecaptcha()) {
+ window.grecaptcha.execute(widgetId);
+ event.preventDefault(event);
+ event.stopImmediatePropagation();
+ }
+ }.bind(this));
+ },
+
+ /**
+ * Recording the token
+ *
+ * @param {String} token
+ */
+ reCaptchaCallback: function (token) {
+ if (this.getIsInvisibleRecaptcha() && this.tokenField) {
+ this.tokenField.value = token;
+ }
+ }
+ });
+ }
+);
+
diff --git a/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/gift-card-recaptcha.js b/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/gift-card-recaptcha.js
index 7587c258..53bd4834 100644
--- a/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/gift-card-recaptcha.js
+++ b/vendor/magento/module-re-captcha-gift-card/view/frontend/web/js/gift-card-recaptcha.js
@@ -2,7 +2,8 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-/* global grecaptcha */
+
+/* eslint-disable no-unused-vars */
define(
[
'Magento_ReCaptchaWebapiUi/js/webapiReCaptcha',
@@ -41,10 +42,6 @@ define(
captchaId = this.getReCaptchaId();

this._super();
- if (self.getIsInvisibleRecaptcha()) {
- grecaptcha.execute(widgetId);
- self.validateReCaptcha(true);
- }
if (GiftCode() != null) {
if (isApplied) {
self.validateReCaptcha(true);
Loading

0 comments on commit 1caa9b7

Please sign in to comment.