Skip to content

Commit 55519da

Browse files
Merge pull request #4893 from magento-engcom/2.3-develop-fast-lane-prs
[Magento Community Engineering] Community Contributions - 2.3-develop latest changes
2 parents 0dcb19e + e1c26f0 commit 55519da

File tree

65 files changed

+1033
-623
lines changed

Some content is hidden

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

65 files changed

+1033
-623
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Please see LICENSE_EE.txt for the full text of the MEE License or visit https://
6464

6565
## Community Engineering Slack
6666

67-
To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us a request at [engcom@adobe.com](mailto:engcom@adobe.com) or [self signup](https://tinyurl.com/engcom-slack).
67+
To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us a request at [engcom@adobe.com](mailto:engcom@adobe.com) or [self signup](https://opensource.magento.com/slack).
6868

6969

7070
We have channels for each project. These channels are recommended for new members:

app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,11 @@
33
* See COPYING.txt for license details.
44
*/
55

6-
(function (factory) {
7-
if (typeof define === 'function' && define.amd) {
8-
define([
9-
'jquery',
10-
'mage/backend/validation',
11-
'prototype'
12-
], factory);
13-
} else {
14-
factory(jQuery);
15-
}
16-
}(function (jQuery) {
17-
6+
define([
7+
'jquery',
8+
'mage/backend/validation',
9+
'prototype'
10+
], function (jQuery) {
1811
window.directPost = Class.create();
1912
directPost.prototype = {
2013
initialize: function (methodCode, iframeId, controller, orderSaveUrl, cgiUrl, nativeAction) {
@@ -349,4 +342,4 @@
349342
}
350343
}
351344
};
352-
}));
345+
});

app/code/Magento/Backend/view/adminhtml/web/js/translate.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@
44
*/
55

66
/* eslint-disable strict */
7-
(function (factory) {
8-
if (typeof define === 'function' && define.amd) {
9-
define([
10-
'jquery',
11-
'mage/mage'
12-
], factory);
13-
} else {
14-
factory(jQuery);
15-
}
16-
}(function ($) {
7+
define([
8+
'jquery',
9+
'mage/mage'
10+
], function ($) {
1711
$.extend(true, $, {
1812
mage: {
1913
translate: (function () {
@@ -51,4 +45,4 @@
5145
$.mage.__ = $.proxy($.mage.translate.translate, $.mage.translate);
5246

5347
return $.mage.__;
54-
}));
48+
});

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,8 @@ public function addAttributeToFilter($attribute, $condition = null, $joinType =
15951595
} else {
15961596
return parent::addAttributeToFilter($attribute, $condition, $joinType);
15971597
}
1598+
1599+
return $this;
15981600
}
15991601

16001602
/**

app/code/Magento/Catalog/view/frontend/web/js/gallery.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,10 @@
33
* See COPYING.txt for license details.
44
*/
55

6-
(function (factory) {
7-
'use strict';
8-
9-
if (typeof define === 'function' && define.amd) {
10-
define([
11-
'jquery',
12-
'jquery-ui-modules/widget'
13-
], factory);
14-
} else {
15-
factory(jQuery);
16-
}
17-
}(function ($) {
6+
define([
7+
'jquery',
8+
'jquery-ui-modules/widget'
9+
], function ($) {
1810
'use strict';
1911

2012
$.widget('mage.gallery', {
@@ -49,4 +41,4 @@
4941
});
5042

5143
return $.mage.gallery;
52-
}));
44+
});

app/code/Magento/Catalog/view/frontend/web/product/view/validation.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,11 @@
33
* See COPYING.txt for license details.
44
*/
55

6-
(function (factory) {
7-
'use strict';
8-
9-
if (typeof define === 'function' && define.amd) {
10-
define([
11-
'jquery',
12-
'jquery-ui-modules/widget',
13-
'mage/validation/validation'
14-
], factory);
15-
} else {
16-
factory(jQuery);
17-
}
18-
}(function ($) {
6+
define([
7+
'jquery',
8+
'jquery-ui-modules/widget',
9+
'mage/validation/validation'
10+
], function ($) {
1911
'use strict';
2012

2113
$.widget('mage.validation', $.mage.validation, {
@@ -97,4 +89,4 @@
9789
});
9890

9991
return $.mage.validation;
100-
}));
92+
});

app/code/Magento/Customer/Block/Widget/Dob.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ public function getHtmlExtraParams()
267267
$validators['validate-date'] = [
268268
'dateFormat' => $this->getDateFormat()
269269
];
270+
$validators['validate-dob'] = true;
271+
270272
return 'data-validate="' . $this->_escaper->escapeHtml(json_encode($validators)) . '"';
271273
}
272274

app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,25 @@
77
namespace Magento\Customer\Model\ResourceModel;
88

99
use Magento\Customer\Api\CustomerMetadataInterface;
10+
use Magento\Customer\Api\CustomerRepositoryInterface;
1011
use Magento\Customer\Api\Data\CustomerInterface;
1112
use Magento\Customer\Api\Data\CustomerSearchResultsInterfaceFactory;
12-
use Magento\Framework\Api\ExtensibleDataObjectConverter;
13-
use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface;
13+
use Magento\Customer\Model\Customer as CustomerModel;
14+
use Magento\Customer\Model\Customer\NotificationStorage;
1415
use Magento\Customer\Model\CustomerFactory;
1516
use Magento\Customer\Model\CustomerRegistry;
1617
use Magento\Customer\Model\Data\CustomerSecureFactory;
17-
use Magento\Customer\Model\Customer\NotificationStorage;
1818
use Magento\Customer\Model\Delegation\Data\NewOperation;
19-
use Magento\Customer\Api\CustomerRepositoryInterface;
19+
use Magento\Customer\Model\Delegation\Storage as DelegatedStorage;
2020
use Magento\Framework\Api\DataObjectHelper;
21+
use Magento\Framework\Api\ExtensibleDataObjectConverter;
22+
use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface;
2123
use Magento\Framework\Api\ImageProcessorInterface;
24+
use Magento\Framework\Api\Search\FilterGroup;
2225
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface;
2326
use Magento\Framework\Api\SearchCriteriaInterface;
24-
use Magento\Framework\Api\Search\FilterGroup;
25-
use Magento\Framework\Event\ManagerInterface;
26-
use Magento\Customer\Model\Delegation\Storage as DelegatedStorage;
2727
use Magento\Framework\App\ObjectManager;
28+
use Magento\Framework\Event\ManagerInterface;
2829
use Magento\Store\Model\StoreManagerInterface;
2930

3031
/**
@@ -203,7 +204,7 @@ public function save(CustomerInterface $customer, $passwordHash = null)
203204
$customer->setAddresses([]);
204205
$customerData = $this->extensibleDataObjectConverter->toNestedArray($customer, [], CustomerInterface::class);
205206
$customer->setAddresses($origAddresses);
206-
/** @var Customer $customerModel */
207+
/** @var CustomerModel $customerModel */
207208
$customerModel = $this->customerFactory->create(['data' => $customerData]);
208209
//Model's actual ID field maybe different than "id" so "id" field from $customerData may be ignored.
209210
$customerModel->setId($customer->getId());

app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
use Magento\Customer\Api\CustomerMetadataInterface;
1010
use Magento\Customer\Api\Data\AttributeMetadataInterface;
1111
use Magento\Customer\Api\Data\ValidationRuleInterface;
12+
use Magento\Customer\Block\Widget\Dob;
1213
use Magento\Customer\Helper\Address;
1314
use Magento\Framework\App\CacheInterface;
1415
use Magento\Framework\Cache\FrontendInterface;
1516
use Magento\Framework\Data\Form\FilterFactory;
1617
use Magento\Framework\Escaper;
1718
use Magento\Framework\Exception\NoSuchEntityException;
18-
use Magento\Customer\Block\Widget\Dob;
1919
use Magento\Framework\Locale\Resolver;
2020
use Magento\Framework\Locale\ResolverInterface;
2121
use Magento\Framework\Stdlib\DateTime\Timezone;
@@ -536,16 +536,16 @@ public function testGetHtmlExtraParamsWithoutRequiredOption()
536536
{
537537
$this->escaper->expects($this->any())
538538
->method('escapeHtml')
539-
->with('{"validate-date":{"dateFormat":"M\/d\/Y"}}')
540-
->will($this->returnValue('{"validate-date":{"dateFormat":"M\/d\/Y"}}'));
539+
->with('{"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}')
540+
->will($this->returnValue('{"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}'));
541541

542542
$this->attribute->expects($this->once())
543543
->method("isRequired")
544544
->willReturn(false);
545545

546546
$this->assertEquals(
547547
$this->_block->getHtmlExtraParams(),
548-
'data-validate="{"validate-date":{"dateFormat":"M\/d\/Y"}}"'
548+
'data-validate="{"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}"'
549549
);
550550
}
551551

@@ -559,13 +559,17 @@ public function testGetHtmlExtraParamsWithRequiredOption()
559559
->willReturn(true);
560560
$this->escaper->expects($this->any())
561561
->method('escapeHtml')
562-
->with('{"required":true,"validate-date":{"dateFormat":"M\/d\/Y"}}')
563-
->will($this->returnValue('{"required":true,"validate-date":{"dateFormat":"M\/d\/Y"}}'));
562+
->with('{"required":true,"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}')
563+
->will(
564+
$this->returnValue(
565+
'{"required":true,"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}'
566+
)
567+
);
564568

565569
$this->context->expects($this->any())->method('getEscaper')->will($this->returnValue($this->escaper));
566570

567571
$this->assertEquals(
568-
'data-validate="{"required":true,"validate-date":{"dateFormat":"M\/d\/Y"}}"',
572+
'data-validate="{"required":true,"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}"',
569573
$this->_block->getHtmlExtraParams()
570574
);
571575
}

app/code/Magento/Customer/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,3 +539,4 @@ Addresses,Addresses
539539
"Prefix","Prefix"
540540
"Middle Name/Initial","Middle Name/Initial"
541541
"Suffix","Suffix"
542+
"The Date of Birth should not be greater than today.","The Date of Birth should not be greater than today."

0 commit comments

Comments
 (0)