From f51354150fca9218599f1d642298cff9e71b4ef2 Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Wed, 1 Apr 2015 18:15:49 +0300 Subject: [PATCH 01/17] MAGETWO-35321: Unexpected response for API "/V1/customers/password" service --- .../Customer/Model/AccountManagement.php | 2 + .../Test/Unit/Model/AccountManagementTest.php | 261 ++++++++++++++++-- 2 files changed, 247 insertions(+), 16 deletions(-) diff --git a/app/code/Magento/Customer/Model/AccountManagement.php b/app/code/Magento/Customer/Model/AccountManagement.php index 4d0ca1e9efbed..8b6677aec5a4e 100644 --- a/app/code/Magento/Customer/Model/AccountManagement.php +++ b/app/code/Magento/Customer/Model/AccountManagement.php @@ -420,10 +420,12 @@ public function initiatePasswordReset($email, $template, $websiteId = null) ) ); } + return true; } catch (MailException $e) { // If we are not able to send a reset password email, this should be ignored $this->logger->critical($e); } + return false; } /** diff --git a/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php b/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php index 9c7c2f1dde355..cff52aad64591 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php @@ -94,6 +94,16 @@ class AccountManagementTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Api\ExtensibleDataObjectConverter|\PHPUnit_Framework_MockObject_MockObject */ protected $extensibleDataObjectConverter; + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Store\Model\Store + */ + protected $store; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Customer\Model\Data\CustomerSecure + */ + protected $customerSecure; + /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ @@ -101,6 +111,9 @@ protected function setUp() { $this->customerFactory = $this->getMock('Magento\Customer\Model\CustomerFactory', [], [], '', false); $this->manager = $this->getMock('Magento\Framework\Event\ManagerInterface'); + $this->store = $this->getMockBuilder('Magento\Store\Model\Store') + ->disableOriginalConstructor() + ->getMock(); $this->storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); $this->random = $this->getMock('Magento\Framework\Math\Random'); $this->validator = $this->getMock('Magento\Customer\Model\Metadata\Validator', [], [], '', false); @@ -148,6 +161,10 @@ protected function setUp() false ); + $this->customerSecure = $this->getMockBuilder('Magento\Customer\Model\Data\CustomerSecure') + ->disableOriginalConstructor() + ->getMock(); + $this->objectManagerHelper = new ObjectManagerHelper($this); $this->accountManagement = $this->objectManagerHelper->getObject( 'Magento\Customer\Model\AccountManagement', @@ -208,16 +225,12 @@ public function testSendPasswordReminderEmail() ->method('getEmail') ->willReturn($customerEmail); - $store = $this->getMockBuilder('Magento\Store\Model\Store') - ->disableOriginalConstructor() - ->getMock(); - $this->storeManager->expects($this->any()) ->method('getStore') ->with($customerStoreId) - ->willReturn($store); + ->willReturn($this->store); - $store->expects($this->any()) + $this->store->expects($this->any()) ->method('isFrontUrlSecure') ->willReturn($isFrontendSecure); @@ -232,15 +245,10 @@ public function testSendPasswordReminderEmail() ] )->willReturn($resetUrl); - $customerSecure = $this->getMockBuilder('\Magento\Customer\Model\Data\CustomerSecure') - ->disableOriginalConstructor() - ->setMethods(['addData', 'setData', 'setResetPasswordUrl']) - ->getMock(); - $this->customerRegistry->expects($this->once()) ->method('retrieveSecureData') ->with($customerId) - ->willReturn($customerSecure); + ->willReturn($this->customerSecure); $this->dataObjectProcessor->expects($this->once()) ->method('buildOutputDataArray') @@ -252,15 +260,15 @@ public function testSendPasswordReminderEmail() ->with($customer) ->willReturn($customerName); - $customerSecure->expects($this->once()) + $this->customerSecure->expects($this->once()) ->method('addData') ->with($customerData) ->willReturnSelf(); - $customerSecure->expects($this->once()) + $this->customerSecure->expects($this->once()) ->method('setData') ->with('name', $customerName) ->willReturnSelf(); - $customerSecure->expects($this->once()) + $this->customerSecure->expects($this->any()) ->method('setResetPasswordUrl') ->with($resetUrl); @@ -286,7 +294,7 @@ public function testSendPasswordReminderEmail() ->willReturnSelf(); $this->transportBuilder->expects($this->once()) ->method('setTemplateVars') - ->with(['customer' => $customerSecure, 'store' => $store]) + ->with(['customer' => $this->customerSecure, 'store' => $this->store]) ->willReturnSelf(); $this->transportBuilder->expects($this->once()) ->method('setFrom') @@ -308,4 +316,225 @@ public function testSendPasswordReminderEmail() $this->accountManagement->sendPasswordReminderEmail($customer, $passwordToken) ); } + + /** + * @param string $email + * @param string $templateIdentifier + * @param string $sender + * @param int $storeId + * @param int $customerId + * @param string $hash + */ + protected function prepareInitiatePasswordReset($email, $templateIdentifier, $sender, $storeId, $customerId, $hash) + { + $websiteId = 1; + + $dateTime = date(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT); + + $customerData = ['key' => 'value']; + $customerName = 'Customer Name'; + + $this->store->expects($this->once()) + ->method('getWebsiteId') + ->willReturn($websiteId); + $this->store->expects($this->any()) + ->method('getId') + ->willReturn($storeId); + + $this->storeManager->expects($this->any()) + ->method('getStore') + ->willReturn($this->store); + + $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + ->getMock(); + $customer->expects($this->any()) + ->method('getEmail') + ->willReturn($email); + $customer->expects($this->any()) + ->method('getId') + ->willReturn($customerId); + $customer->expects($this->any()) + ->method('getStoreId') + ->willReturn($storeId); + + $this->customerRepository->expects($this->once()) + ->method('get') + ->with($email, $websiteId) + ->willReturn($customer); + $this->customerRepository->expects($this->once()) + ->method('save') + ->with($customer) + ->willReturnSelf(); + + $this->random->expects($this->once()) + ->method('getUniqueHash') + ->willReturn($hash); + + $this->customerViewHelper->expects($this->any()) + ->method('getCustomerName') + ->with($customer) + ->willReturn($customerName); + + $this->customerSecure->expects($this->any()) + ->method('setRpToken') + ->with($hash) + ->willReturnSelf(); + $this->customerSecure->expects($this->any()) + ->method('setRpTokenCreatedAt') + ->with($dateTime) + ->willReturnSelf(); + $this->customerSecure->expects($this->any()) + ->method('addData') + ->with($customerData) + ->willReturnSelf(); + $this->customerSecure->expects($this->any()) + ->method('setData') + ->with('name', $customerName) + ->willReturnSelf(); + + $this->customerRegistry->expects($this->any()) + ->method('retrieveSecureData') + ->with($customerId) + ->willReturn($this->customerSecure); + + $this->dataObjectProcessor->expects($this->any()) + ->method('buildOutputDataArray') + ->with($customer, '\Magento\Customer\Api\Data\CustomerInterface') + ->willReturn($customerData); + + $transport = $this->getMockBuilder('Magento\Framework\Mail\TransportInterface') + ->getMock(); + + $this->transportBuilder->expects($this->any()) + ->method('setTemplateIdentifier') + ->with($templateIdentifier) + ->willReturnSelf(); + $this->transportBuilder->expects($this->any()) + ->method('setTemplateOptions') + ->with(['area' => Area::AREA_FRONTEND, 'store' => $storeId]) + ->willReturnSelf(); + $this->transportBuilder->expects($this->any()) + ->method('setTemplateVars') + ->with(['customer' => $this->customerSecure, 'store' => $this->store]) + ->willReturnSelf(); + $this->transportBuilder->expects($this->any()) + ->method('setFrom') + ->with($sender) + ->willReturnSelf(); + $this->transportBuilder->expects($this->any()) + ->method('addTo') + ->with($email, $customerName) + ->willReturnSelf(); + $this->transportBuilder->expects($this->any()) + ->method('getTransport') + ->willReturn($transport); + + $transport->expects($this->any()) + ->method('sendMessage'); + } + + public function testInitiatePasswordResetEmailReminder() + { + $customerId = 1; + + $email = 'test@example.com'; + $template = AccountManagement::EMAIL_REMINDER; + $templateIdentifier = 'Template Identifier'; + $sender = 'Sender'; + + $storeId = 1; + $isFrontendSecure = true; + + $resetUrl = 'reset url'; + + mt_srand(mt_rand() + (100000000 * microtime()) % PHP_INT_MAX); + $hash = md5(uniqid(microtime() . mt_rand(0, mt_getrandmax()), true)); + + $this->store->expects($this->once()) + ->method('isFrontUrlSecure') + ->willReturn($isFrontendSecure); + + $this->url->expects($this->once()) + ->method('setScope') + ->with($storeId) + ->willReturnSelf(); + $this->url->expects($this->once()) + ->method('getUrl') + ->with( + 'customer/account/createPassword', + [ + '_query' => ['id' => $customerId, 'token' => $hash], + '_store' => $storeId, + '_secure' => $isFrontendSecure, + ] + ) + ->willReturn($resetUrl); + + $this->scopeConfig->expects($this->at(0)) + ->method('getValue') + ->with(AccountManagement::XML_PATH_REMIND_EMAIL_TEMPLATE, ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($templateIdentifier); + $this->scopeConfig->expects($this->at(1)) + ->method('getValue') + ->with(AccountManagement::XML_PATH_FORGOT_EMAIL_IDENTITY, ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($sender); + + $this->customerSecure->expects($this->any()) + ->method('setResetPasswordUrl') + ->with($resetUrl) + ->willReturnSelf(); + + $this->prepareInitiatePasswordReset($email, $templateIdentifier, $sender, $storeId, $customerId, $hash); + + $this->assertTrue($this->accountManagement->initiatePasswordReset($email, $template)); + } + + public function testInitiatePasswordResetEmailReset() + { + $storeId = 1; + $customerId = 1; + + $email = 'test@example.com'; + $template = AccountManagement::EMAIL_RESET; + $templateIdentifier = 'Template Identifier'; + $sender = 'Sender'; + + mt_srand(mt_rand() + (100000000 * microtime()) % PHP_INT_MAX); + $hash = md5(uniqid(microtime() . mt_rand(0, mt_getrandmax()), true)); + + $this->scopeConfig->expects($this->at(0)) + ->method('getValue') + ->with(AccountManagement::XML_PATH_FORGOT_EMAIL_TEMPLATE, ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($templateIdentifier); + $this->scopeConfig->expects($this->at(1)) + ->method('getValue') + ->with(AccountManagement::XML_PATH_FORGOT_EMAIL_IDENTITY, ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($sender); + + $this->prepareInitiatePasswordReset($email, $templateIdentifier, $sender, $storeId, $customerId, $hash); + + $this->assertTrue($this->accountManagement->initiatePasswordReset($email, $template)); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Invalid value of "" provided for the email type field + */ + public function testInitiatePasswordResetNoTemplate() + { + $storeId = 1; + $customerId = 1; + + $email = 'test@example.com'; + $template = null; + $templateIdentifier = 'Template Identifier'; + $sender = 'Sender'; + + mt_srand(mt_rand() + (100000000 * microtime()) % PHP_INT_MAX); + $hash = md5(uniqid(microtime() . mt_rand(0, mt_getrandmax()), true)); + + $this->prepareInitiatePasswordReset($email, $templateIdentifier, $sender, $storeId, $customerId, $hash); + + $this->accountManagement->initiatePasswordReset($email, $template); + } } From 2b10f3733ef7eb889c3fd5524fd7a2e32a12c8fc Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Wed, 1 Apr 2015 19:40:04 +0300 Subject: [PATCH 02/17] MAGETWO-35321: Unexpected response for API "/V1/customers/password" service --- .../Test/Unit/Model/AccountManagementTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php b/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php index cff52aad64591..f9bcde90bd9ca 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php @@ -402,6 +402,18 @@ protected function prepareInitiatePasswordReset($email, $templateIdentifier, $se ->with($customer, '\Magento\Customer\Api\Data\CustomerInterface') ->willReturn($customerData); + $this->prepareEmailSend($email, $templateIdentifier, $sender, $storeId, $customerName); + } + + /** + * @param $email + * @param $templateIdentifier + * @param $sender + * @param $storeId + * @param $customerName + */ + protected function prepareEmailSend($email, $templateIdentifier, $sender, $storeId, $customerName) + { $transport = $this->getMockBuilder('Magento\Framework\Mail\TransportInterface') ->getMock(); From 08a75f8986fbd08c3c91afcbc0498a27d025af68 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi Date: Thu, 2 Apr 2015 17:01:01 +0300 Subject: [PATCH 03/17] =?UTF-8?q?MAGETWO-35025:=20Can=E2=80=99t=20include?= =?UTF-8?q?=20a=20third-party=20link=20to=20frontend=20=20section=20?= =?UTF-8?q?via=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Framework/View/Layout/etc/head.xsd | 2 + .../View/Page/Config/Generator/Head.php | 3 +- .../View/Page/Config/Reader/Head.php | 19 +++++ .../Unit/Page/Config/Generator/HeadTest.php | 12 ++- .../Test/Unit/Page/Config/Reader/HeadTest.php | 77 +++++++++++++++++++ .../Unit/Page/Config/_files/template_head.xml | 1 + 6 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Reader/HeadTest.php diff --git a/lib/internal/Magento/Framework/View/Layout/etc/head.xsd b/lib/internal/Magento/Framework/View/Layout/etc/head.xsd index a9d5c3de75de8..5cf230fd0c751 100644 --- a/lib/internal/Magento/Framework/View/Layout/etc/head.xsd +++ b/lib/internal/Magento/Framework/View/Layout/etc/head.xsd @@ -18,6 +18,7 @@ + @@ -35,6 +36,7 @@ + diff --git a/lib/internal/Magento/Framework/View/Page/Config/Generator/Head.php b/lib/internal/Magento/Framework/View/Page/Config/Generator/Head.php index 8d7862fa94da0..153141cbbe2e2 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Generator/Head.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Generator/Head.php @@ -49,6 +49,7 @@ class Head implements Layout\GeneratorInterface protected $serviceAssetProperties = [ 'src', 'src_type', + 'content_type', ]; /** @@ -108,7 +109,7 @@ protected function processAssets(Structure $pageStructure) if (isset($data['src_type']) && in_array($data['src_type'], $this->remoteAssetTypes)) { $this->pageConfig->addRemotePageAsset( $name, - self::VIRTUAL_CONTENT_TYPE_LINK, + isset($data['content_type']) ? $data['content_type'] : self::VIRTUAL_CONTENT_TYPE_LINK, $this->getAssetProperties($data) ); } else { diff --git a/lib/internal/Magento/Framework/View/Page/Config/Reader/Head.php b/lib/internal/Magento/Framework/View/Page/Config/Reader/Head.php index cdb7cecdb382b..253e89389564f 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Reader/Head.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Reader/Head.php @@ -41,6 +41,24 @@ public function getSupportedNodes() return [self::TYPE_HEAD]; } + /** + * Add asset content type to node by name + * + * @param Layout\Element $node + * @return void + */ + protected function addContentTypeByNodeName(Layout\Element $node) + { + switch ($node->getName()) { + case self::HEAD_CSS: + $node->addAttribute('content_type', 'css'); + break; + case self::HEAD_SCRIPT: + $node->addAttribute('content_type', 'js'); + break; + } + } + /** * {@inheritdoc} * @@ -59,6 +77,7 @@ public function interpret( case self::HEAD_CSS: case self::HEAD_SCRIPT: case self::HEAD_LINK: + $this->addContentTypeByNodeName($node); $pageConfigStructure->addAssets($node->getAttribute('src'), $this->getAttributes($node)); break; diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Generator/HeadTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Generator/HeadTest.php index 5cc6076950b66..6efe3ebaace42 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Generator/HeadTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Generator/HeadTest.php @@ -70,12 +70,16 @@ public function testProcess() $structureMock->expects($this->once())->method('processRemoveElementAttributes'); $assets = [ - 'remoteName' => ['src' => 'file-url', 'src_type' => 'url', 'media' => "all"], - 'name' => ['src' => 'file-path', 'ie_condition' => 'lt IE 7', 'media' => "print"], + 'remoteCss' => ['src' => 'file-url', 'src_type' => 'url', 'media' => "all", 'content_type' => 'css'], + 'remoteLink' => ['src' => 'file-url', 'src_type' => 'url', 'media' => "all"], + 'name' => ['src' => 'file-path', 'ie_condition' => 'lt IE 7', 'media' => "print", 'content_type' => 'css'], ]; - $this->pageConfigMock->expects($this->once()) + $this->pageConfigMock->expects($this->at(0)) + ->method('addRemotePageAsset') + ->with('remoteCss', 'css', ['attributes' => ['media' => 'all']]); + $this->pageConfigMock->expects($this->at(1)) ->method('addRemotePageAsset') - ->with('remoteName', Head::VIRTUAL_CONTENT_TYPE_LINK, ['attributes' => ['media' => 'all']]); + ->with('remoteLink', Head::VIRTUAL_CONTENT_TYPE_LINK, ['attributes' => ['media' => 'all']]); $this->pageConfigMock->expects($this->once()) ->method('addPageAsset') ->with('name', ['attributes' => ['media' => 'print'], 'ie_condition' => 'lt IE 7']); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Reader/HeadTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Reader/HeadTest.php new file mode 100644 index 0000000000000..fc0df0799f544 --- /dev/null +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Reader/HeadTest.php @@ -0,0 +1,77 @@ +model = new Head(); + } + + public function testInterpret() + { + $readerContextMock = $this->getMockBuilder('Magento\Framework\View\Layout\Reader\Context') + ->disableOriginalConstructor() + ->getMock(); + $structureMock = $this->getMockBuilder('Magento\Framework\View\Page\Config\Structure') + ->disableOriginalConstructor() + ->getMock(); + $readerContextMock->expects($this->once()) + ->method('getPageConfigStructure') + ->willReturn($structureMock); + + $xml = file_get_contents(__DIR__ . '/../_files/template_head.xml'); + $element = new Element($xml); + + $structureMock->expects($this->at(0)) + ->method('setTitle') + ->with('Test title') + ->willReturnSelf(); + + $structureMock->expects($this->at(1)) + ->method('setMetaData') + ->with('meta_name', 'meta_content') + ->willReturnSelf(); + + $structureMock->expects($this->at(2)) + ->method('addAssets') + ->with('path/file.css', ['src' => 'path/file.css', 'media' => 'all', 'content_type' => 'css']) + ->willReturnSelf(); + + $structureMock->expects($this->at(3)) + ->method('addAssets') + ->with('path/file.js', ['src' => 'path/file.js', 'defer' => 'defer', 'content_type' => 'js']) + ->willReturnSelf(); + + $structureMock->expects($this->at(4)) + ->method('addAssets') + ->with('http://url.com', ['src' => 'http://url.com', 'src_type' => 'url']) + ->willReturnSelf(); + + $structureMock->expects($this->at(5)) + ->method('removeAssets') + ->with('path/remove/file.css') + ->willReturnSelf(); + + $structureMock->expects($this->at(6)) + ->method('setElementAttribute') + ->with(Config::ELEMENT_TYPE_HEAD, 'head_attribute_name', 'head_attribute_value') + ->willReturnSelf(); + + $this->assertEquals($this->model, $this->model->interpret($readerContextMock, $element->children()[0])); + } +} diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_head.xml b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_head.xml index 1e9db0ed75e38..15873b46e98e0 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_head.xml +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_head.xml @@ -11,6 +11,7 @@ \ No newline at end of file From 417b95e8d24b430193a986a53cc96827e5abcd7d Mon Sep 17 00:00:00 2001 From: Maxim Medinskiy Date: Fri, 10 Apr 2015 17:06:03 +0300 Subject: [PATCH 17/17] MAGETWO-36010: Checkout doesn't work with JS bundling enabled in production mode --- lib/web/jquery/jquery.validate.js | 32 ++++++++++++++-------------- lib/web/mage/translate-inline-vde.js | 3 ++- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/web/jquery/jquery.validate.js b/lib/web/jquery/jquery.validate.js index 85d0621b02244..a7f85a23137a4 100644 --- a/lib/web/jquery/jquery.validate.js +++ b/lib/web/jquery/jquery.validate.js @@ -288,22 +288,22 @@ }, messages: { - required: $.mage.__("This field is required."), - remote: $.mage.__("Please fix this field."), - email: $.mage.__("Please enter a valid email address."), - url: $.mage.__("Please enter a valid URL."), - date: $.mage.__("Please enter a valid date."), - dateISO: $.mage.__("Please enter a valid date (ISO)."), - number: $.mage.__("Please enter a valid number."), - digits: $.mage.__("Please enter only digits."), - creditcard: $.mage.__("Please enter a valid credit card number."), - equalTo: $.mage.__("Please enter the same value again."), - maxlength: $.validator.format($.mage.__("Please enter no more than {0} characters.")), - minlength: $.validator.format($.mage.__("Please enter at least {0} characters.")), - rangelength: $.validator.format($.mage.__("Please enter a value between {0} and {1} characters long.")), - range: $.validator.format($.mage.__("Please enter a value between {0} and {1}.")), - max: $.validator.format($.mage.__("Please enter a value less than or equal to {0}.")), - min: $.validator.format($.mage.__("Please enter a value greater than or equal to {0}.")) + required: "This field is required.", + remote: "Please fix this field.", + email: "Please enter a valid email address.", + url: "Please enter a valid URL.", + date: "Please enter a valid date.", + dateISO: "Please enter a valid date (ISO).", + number: "Please enter a valid number.", + digits: "Please enter only digits.", + creditcard: "Please enter a valid credit card number.", + equalTo: "Please enter the same value again.", + maxlength: $.validator.format("Please enter no more than {0} characters."), + minlength: $.validator.format("Please enter at least {0} characters."), + rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), + range: $.validator.format("Please enter a value between {0} and {1}."), + max: $.validator.format("Please enter a value less than or equal to {0}."), + min: $.validator.format("Please enter a value greater than or equal to {0}.") }, autoCreateRanges: false, diff --git a/lib/web/mage/translate-inline-vde.js b/lib/web/mage/translate-inline-vde.js index 0e70103b8f06f..1e997b9492083 100644 --- a/lib/web/mage/translate-inline-vde.js +++ b/lib/web/mage/translate-inline-vde.js @@ -11,7 +11,8 @@ "jquery", "mage/template", "jquery/ui", - "mage/translate-inline" + "mage/translate-inline", + "mage/translate" ], factory); } else { factory(root.jQuery, root.mageTemplate);