Skip to content

[Backport] #13899 Solve Canada Zip Code pattern #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
bf18e7a
Fix typo in database column comment
VitaliyBoyko May 17, 2018
2878195
ENGCOM-1765: [Backport] Fix typo in database column comment #15290
magento-engcom-team Jun 1, 2018
228b765
Update webapi.xml to fix typo
mhaack Jun 5, 2018
255edc3
ENGCOM-1891: [Backport] Update webapi.xml to fix typo #15866
magento-engcom-team Jun 6, 2018
6ab1020
Added language translation in template files
RahulKachhadia Jun 6, 2018
8eb1435
ENGCOM-1899: [Backport-2.1] Added language translation in template fi…
magento-engcom-team Jun 6, 2018
fc35b01
chore: remove unused less import
DanielRuf Jun 5, 2018
6c6d67f
Update Config.php
JDavidVR Mar 31, 2018
9e22c9e
ENGCOM-1902: [Backport] chore: remove unused less import #15920
magento-engcom-team Jun 7, 2018
6027744
Format code
mageprince Mar 25, 2018
6257807
precision for price overriding by js
Mar 24, 2018
0658873
Add both locale code: ms_MY and ms_Latn_MY
osrecio Mar 24, 2018
be704cf
ENGCOM-1905: [Backport] Added spanish Bolivia locale to allowedLocale…
magento-engcom-team Jun 7, 2018
1a9dd4f
ENGCOM-1906: [Backport] Format code #15925
magento-engcom-team Jun 7, 2018
ad5ae95
ENGCOM-1907: [Backport] precision for price overriding by js #15926
magento-engcom-team Jun 7, 2018
442478c
ENGCOM-1908: [Backport] [#14089] Add Malaysian Locale Code #15927
magento-engcom-team Jun 7, 2018
fdb9adb
ENGCOM-1908: [Backport] [#14089] Add Malaysian Locale Code #15927
Jun 7, 2018
3743b34
ENGCOM-1907: [Backport] precision for price overriding by js #15926
Jun 7, 2018
a96d905
ENGCOM-1906: [Backport] Format code #15925
Jun 7, 2018
85bf0f1
ENGCOM-1905: [Backport] Added spanish Bolivia locale to allowedLocale…
Jun 7, 2018
bc27c30
ENGCOM-1902: [Backport] chore: remove unused less import #15920
Jun 7, 2018
d3e961a
ENGCOM-1899: [Backport-2.1] Added language translation in template fi…
Jun 7, 2018
c2b83ef
ENGCOM-1891: [Backport] Update webapi.xml to fix typo #15866
Jun 7, 2018
18ca396
ENGCOM-1765: [Backport] Fix typo in database column comment #15290
Jun 7, 2018
4caef44
Do not display anchor if menu has no children
rogyar Jun 7, 2018
6db65b0
:arrows_clockwise: [EngCom] Public Pull Requests - 2.1-develop
Jun 7, 2018
7c6fc56
ENGCOM-1921: Do not display anchor if admin submenu has no children #…
magento-engcom-team Jun 7, 2018
63ebb61
Wrong annotation in _toOptionArray : lib\internal\Magento\Framework\D…
sanganinamrata Jun 6, 2018
3c58390
Wrong annotation in _toOptionArray : lib\internal\Magento\Framework\D…
sanganinamrata Jun 6, 2018
f3108a3
ISSUE-11477 - fixed Swagger response for searchCriteria - added zero …
May 18, 2018
063840f
No need to pass method parameter as method definition does not requir…
Jun 6, 2018
1824663
ENGCOM-1921: Do not display anchor if admin submenu has no children #…
Jun 8, 2018
08ec01b
:arrows_clockwise: [EngCom] Public Pull Requests - 2.1-develop
Jun 11, 2018
198aa06
ENGCOM-1932: [Backport]No need to pass method parameter as method def…
magento-engcom-team Jun 11, 2018
ed12778
ENGCOM-1935: [Backport] ISSUE-11477 - fixed Swagger response for sear…
magento-engcom-team Jun 11, 2018
b9d8953
ENGCOM-1937: [Backport] Wrong annotation in _toOptionArray : lib\inte…
magento-engcom-team Jun 11, 2018
0af2aa9
ENGCOM-1937: [Backport] Wrong annotation in _toOptionArray : lib\inte…
Jun 11, 2018
a7696f9
ENGCOM-1935: [Backport] ISSUE-11477 - fixed Swagger response for sear…
Jun 11, 2018
e3df7d5
ENGCOM-1932: [Backport]No need to pass method parameter as method def…
Jun 11, 2018
4d1b832
:arrows_clockwise: [EngCom] Public Pull Requests - 2.1-develop
Jun 11, 2018
bc26a3a
#13899 Solve Zipcode pattern for Canada
tadeobarranco Mar 2, 2018
8f03ac9
#13899 Improve unit test
tadeobarranco Mar 2, 2018
2587e0f
#13899 Improve unit test
tadeobarranco Mar 2, 2018
e7db130
Fixing failures in the test file
tadeobarranco Mar 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/code/Magento/Backend/Block/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,12 @@ protected function _renderItemCssClass($menuItem, $level)
protected function _renderAnchor($menuItem, $level)
{
if ($level == 1 && $menuItem->getUrl() == '#') {
$output = '<strong class="submenu-group-title" role="presentation">'
. '<span>' . $this->_getAnchorLabel($menuItem) . '</span>'
. '</strong>';
$output = '';
if ($menuItem->hasChildren()) {
$output = '<strong class="submenu-group-title" role="presentation">'
. '<span>' . $this->_getAnchorLabel($menuItem) . '</span>'
. '</strong>';
}
} else {
$output = '<a href="' . $menuItem->getUrl() . '" ' . $this->_renderItemAnchorTitle(
$menuItem
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Braintree/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,5 @@ Debug,Debug
"credit_card","Credit card"
"apple_pay_card","Apple pay card"
"android_pay_card","Android pay card"
"Accept credit/debit cards and PayPal in your Magento store.<br/>No setup or monthly fees and your customers never leave your store to complete the purchase.","Accept credit/debit cards and PayPal in your Magento store.<br/>No setup or monthly fees and your customers never leave your store to complete the purchase."
"Accept credit/debit cards and PayPal in your Magento store.<br/>No setup or monthly fees and your customers never leave your store to complete the purchase.","Accept credit/debit cards and PayPal in your Magento store.<br/>No setup or monthly fees and your customers never leave your store to complete the purchase."
"Save for later use.","Save for later use."
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $ccType = $block->getInfoData('cc_type');
name="payment[is_active_payment_token_enabler]"
class="admin__control-checkbox"/>
<label class="label" for="<?php /* @noEscape */ echo $code; ?>_vault">
<span><?php echo $block->escapeHtml('Save for later use.'); ?></span>
<span><?php echo $block->escapeHtml(__('Save for later use.')); ?></span>
</label>
</div>
<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Setup/InstallSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
null,
['unsigned' => true, 'nullable' => false, 'default' => '0'],
'Attriute Set ID'
'Attribute Set ID'
)
->addColumn(
'parent_id',
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/view/base/web/js/price-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ define([
am = Number(Math.round(Math.abs(amount - i) + 'e+' + precision) + ('e-' + precision));
r = (j ? i.substr(0, j) + groupSymbol : '') +
i.substr(j).replace(re, '$1' + groupSymbol) +
(precision ? decimalSymbol + am.toFixed(2).replace(/-/, 0).slice(2) : '');
(precision ? decimalSymbol + am.toFixed(precision).replace(/-/, 0).slice(2) : '');

return pattern.replace('%s', r).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Checkout/etc/webapi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<resource ref="anonymous" />
</resources>
</route>
<!-- Managing My shipping information -->
<!-- Managing My payment information -->
<route url="/V1/carts/mine/set-payment-information" method="POST">
<service class="Magento\Checkout\Api\PaymentInformationManagementInterface" method="savePaymentInformation"/>
<resources>
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Directory/etc/zip_codes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
<zip countryCode="CA">
<codes>
<code id="pattern_1" active="true" example="A1B 2C3">^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}\s[0-9]{1}[a-zA-z]{1}[0-9]{1}$</code>
<code id="pattern_2" active="true" example="A1B2C3">^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}[0-9]{1}$</code>
</codes>
</zip>
<zip countryCode="IC">
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Paypal/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -680,3 +680,4 @@ User,User
"payflowpro","Payflow Pro"
"Payments Pro","Payments Pro"
"Website Payments Pro","Website Payments Pro"
"Save for later use.","Save for later use."
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $ccExpMonth = $block->getInfoData('cc_exp_month');
name="payment[is_active_payment_token_enabler]"
class="admin__control-checkbox"/>
<label class="label" for="<?php /* @noEscape */ echo $code; ?>_vault">
<span><?php echo $block->escapeHtml('Save for later use.'); ?></span>
<span><?php echo $block->escapeHtml(__('Save for later use.')); ?></span>
</label>
</div>
<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Review/etc/adminhtml/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<menu>
<add id="Magento_Review::catalog_reviews_ratings_ratings" title="Rating" translate="title" module="Magento_Review" sortOrder="60" parent="Magento_Backend::stores_attributes" action="review/rating/" resource="Magento_Review::ratings"/>
<add id="Magento_Review::catalog_reviews_ratings_reviews_all" title="Reviews" translate="title" module="Magento_Review" parent="Magento_Backend::marketing_user_content" sortOrder="10" action="review/product/index" resource="Magento_Review::reviews_all"/>
<add id="Magento_Review::report_review" title="Reviews" translate="title" module="Magento_Reports" sortOrder="20" parent="Magento_Reports::report" resource="Magento_Reports::review"/>
<add id="Magento_Review::report_review" title="Reviews" translate="title" module="Magento_Reports" sortOrder="20" parent="Magento_Reports::report" resource="Magento_Reports::review"/>
<add id="Magento_Review::report_review_customer" title="By Customers" translate="title" sortOrder="10" module="Magento_Review" parent="Magento_Review::report_review" action="reports/report_review/customer" resource="Magento_Reports::review_customer"/>
<add id="Magento_Review::report_review_product" title="By Products" translate="title" sortOrder="20" module="Magento_Review" parent="Magento_Review::report_review" action="reports/report_review/product" resource="Magento_Reports::review_product"/>
</menu>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/UrlRewrite/Block/Catalog/Product/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function _prepareLayoutFeatures()
}

if ($this->_getProduct()->getId()) {
$this->_addProductLinkBlock($this->_getProduct());
$this->_addProductLinkBlock();
}

if ($this->_getCategory()->getId()) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Generator extends AbstractSchemaGenerator
const UNAUTHORIZED_DESCRIPTION = '401 Unauthorized';

/** Array signifier */
const ARRAY_SIGNIFIER = '[]';
const ARRAY_SIGNIFIER = '[0]';

/**
* Swagger factory instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,48 @@ public function testPostCodesThrowsExceptionIfCountryDoesNotExist()
$this->validator->validate('12345', 'INVALID-CODE');
}

/**
* @dataProvider getCanadaInvalidPostCodes
*/
public function testInvalidCanadaZipCode($countryId, $invalidPostCode)
{
$this->assertFalse($this->validator->validate($invalidPostCode, $countryId));
}

/**
* @dataProvider getCanadaValidPostCodes
*/
public function testValidCanadaZipCode($countryId, $validPostCode)
{
$this->assertTrue($this->validator->validate($validPostCode, $countryId));
}

/**
* @return array
*/
public function getCanadaInvalidPostCodes()
{
return [
['countryId' => 'CA', 'postcode' => '12345'],
['countryId' => 'CA', 'postcode' => 'A1B2C3D'],
['countryId' => 'CA', 'postcode' => 'A1B2C'],
['countryId' => 'CA', 'postcode' => 'A1B 2C3'],
];
}

/**
* @return array
*/
public function getCanadaValidPostCodes()
{
return [
['countryId' => 'CA', 'postcode' => 'A1B2C3'],
['countryId' => 'CA', 'postcode' => 'A1B 2C3'],
['countryId' => 'CA', 'postcode' => 'Z9Y 8X7'],
['countryId' => 'CA', 'postcode' => 'Z9Y8X7'],
];
}

/**
* @return array
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/Magento/Framework/Data/SearchResultProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ public function toArray($arrRequiredFields = [])
}

/**
* @param null $valueField
* @param null $labelField
* @param string|null $valueField
* @param string|null $labelField
* @param array $additional
* @return array
*/
Expand Down
2 changes: 2 additions & 0 deletions lib/internal/Magento/Framework/Locale/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Config implements \Magento\Framework\Locale\ConfigInterface
'mk_MK', /*Macedonian (Macedonia)*/
'mn_Cyrl_MN', /*Mongolian (Mongolia)*/
'ms_Latn_MY', /*Malaysian (Malaysia)*/
'ms_MY', /*Malaysian (Malaysia)*/
'nl_BE', /*Dutch (Belgium)*/
'nl_NL', /*Dutch (Netherlands)*/
'nb_NO', /*Norwegian BokmГ_l (Norway)*/
Expand All @@ -98,6 +99,7 @@ class Config implements \Magento\Framework\Locale\ConfigInterface
'lo_LA', /*Laotian*/
'es_VE', /*Spanish (Venezuela)*/
'en_IE', /*English (Ireland)*/
'es_BO', /*Spanish (Bolivia)*/
];

/**
Expand Down
1 change: 0 additions & 1 deletion lib/web/css/docs/source/docs.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
@import '_icons.less';
@import '_loaders.less';
@import '_messages.less';
//@import 'navigation.less';
@import '_layout.less';
@import '_pages.less';
@import '_popups.less';
Expand Down