Skip to content

Commit 836f5e6

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.1-develop
Accepted Public Pull Requests: - #17160: [Backport] Improve "Invalid country code" error message on tax import (by @gelanivishal) - #17159: [Backport] Add Confirm Modal Width (by @gelanivishal) - #17090: [Backport] Inconsistent Redirect in Admin Notification Controller (by @mageprince) - #16992: [Backport] Refactor JavsScript for UrlRewrite module edit page. (by @chirag-wagento) Fixed GitHub Issues: - #15356: Refactore javascript for module URL rewrite (reported by @vgelani) has been fixed in #16992 by @chirag-wagento in 2.1-develop branch Related commits: 1. 846347d
2 parents 9317c4f + d1ad184 commit 836f5e6

File tree

7 files changed

+37
-15
lines changed

7 files changed

+37
-15
lines changed

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemove.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ public function execute()
3939
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
4040
}
4141
}
42-
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*')));
42+
$this->_redirect('adminhtml/*/');
4343
}
4444
}

app/code/Magento/TaxImportExport/Model/Rate/CsvImportHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ protected function _importRate(array $rateData, array $regionsCache, array $stor
234234
$countryCode = $rateData[1];
235235
$country = $this->_countryFactory->create()->loadByCode($countryCode, 'iso2_code');
236236
if (!$country->getId()) {
237-
throw new \Magento\Framework\Exception\LocalizedException(__('One of the countries has invalid code.'));
237+
throw new \Magento\Framework\Exception\LocalizedException(__('Country code is invalid: %1', $countryCode));
238238
}
239239
$regionsCache = $this->_addCountryRegionsToCache($countryCode, $regionsCache);
240240

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Rate,Rate
1212
"Invalid file upload attempt","Invalid file upload attempt"
1313
"Invalid file upload attempt.","Invalid file upload attempt."
1414
"Invalid file format.","Invalid file format."
15-
"One of the countries has invalid code.","One of the countries has invalid code."
15+
"Country code is invalid: %1","Country code is invalid: %1"
1616
"Import Tax Rates","Import Tax Rates"
1717
"Export Tax Rates","Export Tax Rates"
1818
CSV,CSV

app/code/Magento/UrlRewrite/view/adminhtml/templates/edit.phtml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@
1313
<?php echo $block->getChildHtml() ?>
1414

1515
<?php if ($block->getChildBlock('form')): ?>
16-
<script>
17-
require([
18-
'jquery',
19-
'mage/backend/form',
20-
'mage/backend/validation'
21-
], function($){
22-
23-
$('#edit_form').form()
24-
.validation({validationUrl: '<?php /* @escapeNotVerified */ echo $block->getValidationUrl() ?>'});
25-
26-
});
16+
<script type="text/x-magento-init">
17+
{
18+
"#edit_form": {
19+
"Magento_UrlRewrite/js/url-rewrite-validation" : {
20+
"url": "<?= $block->escapeUrl($block->getValidationUrl()) ?>"
21+
}
22+
}
23+
}
2724
</script>
2825
<?php endif; ?>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'mage/backend/form',
9+
'mage/backend/validation'
10+
], function ($) {
11+
'use strict';
12+
13+
return function (data, element) {
14+
15+
$(element).form().validation({
16+
validationUrl: data.url
17+
});
18+
};
19+
});

dev/tests/integration/testsuite/Magento/TaxImportExport/Model/Rate/CsvImportHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testImportFromCsvFileWithCorrectData()
5757
/**
5858
* @magentoDbIsolation enabled
5959
* @expectedException \Magento\Framework\Exception\LocalizedException
60-
* @expectedExceptionMessage One of the countries has invalid code.
60+
* @expectedExceptionMessage Country code is invalid: ZZ
6161
*/
6262
public function testImportFromCsvFileThrowsExceptionWhenCountryCodeIsInvalid()
6363
{

lib/web/css/source/components/_modals.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@
9696
left: 0;
9797
overflow-y: auto;
9898

99+
&.confirm {
100+
.modal-inner-wrap {
101+
.lib-css(width, @modal-popup-confirm__width);
102+
}
103+
}
104+
99105
&._show {
100106
.modal-inner-wrap {
101107
-webkit-transform: translateY(0);

0 commit comments

Comments
 (0)