Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.2-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - magento#20404: [Backport] Changes-Schedule-Update-Form-filed-misalign-2.2 (by @amol2jcommerce)
 - magento#21160: [Backport] Fixed redirection issue in Admin-> Content -> Schedule (by @mage2pratik)
 - magento#21169: [Backport] Fixes incorrect country code being used for Greek VAT numbers, should� (by @amol2jcommerce)
 - magento#21163: [Backport] Orders-and-Returns-layout-not-proper (by @amol2jcommerce)
 - magento#21161: [Backport] Extra space from left in top message section (Notification section) (by @mage2pratik)
 - magento#21140: [Backport] Fixed store switcher doesn't work multistore setup with different product urls issue (by @janakbhimani)
 - magento#21114: [Backport] Fixed issue magento#20157 On advanced search page Price field misaligned on mobile view (by @amol2jcommerce)
 - magento#20616: [Backport] Fixed admin multiselect and select ui arrow toggle issue (by @niravkrish)


Fixed GitHub Issues:
 - magento#20402: Schedule update from filed misalignment in 768 x 1147 resolution (reported by @amol2jcommerce) has been fixed in magento#20404 by @amol2jcommerce in 2.2-develop branch
   Related commits:
     1. 2eeecdb

 - magento#6960: Greek vat numbers cannot be validated (reported by @schnappenberger) has been fixed in magento#21169 by @amol2jcommerce in 2.2-develop branch
   Related commits:
     1. bfa4e1f

 - magento#20816: Orders and Returns layout not proper (reported by @yashwant2jcommerce) has been fixed in magento#21163 by @amol2jcommerce in 2.2-develop branch
   Related commits:
     1. ce53cee

 - magento#19714: Store switcher doesn't work multistore setup with different product urls (reported by @sreichel) has been fixed in magento#21140 by @janakbhimani in 2.2-develop branch
   Related commits:
     1. bd1e538
     2. a886103
     3. 78df524
     4. 7ebc03f
     5. 7e4fe31

 - magento#20157: On advanced search page Price field misaligned on mobile view (reported by @ajay2jcommerce) has been fixed in magento#21114 by @amol2jcommerce in 2.2-develop branch
   Related commits:
     1. cb67c97
     2. 665dbef
     3. 246a344
     4. 09c0f01

 - magento#20240: Admin - dropdown toggle arrow not working on closing (reported by @saphaljha) has been fixed in magento#20616 by @niravkrish in 2.2-develop branch
   Related commits:
     1. b8fa8f3
  • Loading branch information
magento-engcom-team authored Feb 13, 2019
2 parents bb620ee + 8deb8f4 commit 37ad124
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
namespace Magento\Backend\Controller\Adminhtml\System\Design;

/**
* Save design action.
*/
class Save extends \Magento\Backend\Controller\Adminhtml\System\Design
{
/**
Expand All @@ -26,6 +29,8 @@ protected function _filterPostData($data)
}

/**
* Save design action.
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
Expand Down Expand Up @@ -54,10 +59,10 @@ public function execute()
} catch (\Exception $e) {
$this->messageManager->addErrorMessage($e->getMessage());
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setDesignData($data);
return $resultRedirect->setPath('adminhtml/*/', ['id' => $design->getId()]);
return $resultRedirect->setPath('*/*/edit', ['id' => $design->getId()]);
}
}

return $resultRedirect->setPath('adminhtml/*/');
return $resultRedirect->setPath('*/*/');
}
}
29 changes: 25 additions & 4 deletions app/code/Magento/Customer/Model/Vat.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,21 @@ public function checkVatNumber($countryCode, $vatNumber, $requesterCountryCode =
return $gatewayResponse;
}

$countryCodeForVatNumber = $this->getCountryCodeForVatNumber($countryCode);
$requesterCountryCodeForVatNumber = $this->getCountryCodeForVatNumber($requesterCountryCode);

try {
$soapClient = $this->createVatNumberValidationSoapClient();

$requestParams = [];
$requestParams['countryCode'] = $countryCode;
$requestParams['countryCode'] = $countryCodeForVatNumber;
$vatNumberSanitized = $this->isCountryInEU($countryCode)
? str_replace([' ', '-', $countryCode], ['', '', ''], $vatNumber)
? str_replace([' ', '-', $countryCodeForVatNumber], ['', '', ''], $vatNumber)
: str_replace([' ', '-'], ['', ''], $vatNumber);
$requestParams['vatNumber'] = $vatNumberSanitized;
$requestParams['requesterCountryCode'] = $requesterCountryCode;
$requestParams['requesterCountryCode'] = $requesterCountryCodeForVatNumber;
$reqVatNumSanitized = $this->isCountryInEU($requesterCountryCode)
? str_replace([' ', '-', $requesterCountryCode], ['', '', ''], $requesterVatNumber)
? str_replace([' ', '-', $requesterCountryCodeForVatNumber], ['', '', ''], $requesterVatNumber)
: str_replace([' ', '-'], ['', ''], $requesterVatNumber);
$requestParams['requesterVatNumber'] = $reqVatNumSanitized;
// Send request to service
Expand Down Expand Up @@ -301,4 +304,22 @@ public function isCountryInEU($countryCode, $storeId = null)
);
return in_array($countryCode, $euCountries);
}

/**
* Returns the country code to use in the VAT number which is not always the same as the normal country code
*
* @param string $countryCode
* @return string
*/
private function getCountryCodeForVatNumber(string $countryCode): string
{
// Greece uses a different code for VAT numbers then its country code
// See: http://ec.europa.eu/taxation_customs/vies/faq.html#item_11
// And https://en.wikipedia.org/wiki/VAT_identification_number:
// "The full identifier starts with an ISO 3166-1 alpha-2 (2 letters) country code
// (except for Greece, which uses the ISO 639-1 language code EL for the Greek language,
// instead of its ISO 3166-1 alpha-2 country code GR)"

return $countryCode === 'GR' ? 'EL' : $countryCode;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
class="action-select admin__action-multiselect"
data-role="advanced-select"
data-bind="
css: {_active: multiselectFocus},
css: {_active: listVisible},
click: function(data, event) {
toggleListVisible(data, event)
}
Expand All @@ -52,7 +52,7 @@
class="action-select admin__action-multiselect"
data-role="advanced-select"
data-bind="
css: {_active: multiselectFocus},
css: {_active: listVisible},
click: function(data, event) {
toggleListVisible(data, event)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, s
UrlRewrite::STORE_ID => $oldStoreId,
]);
if ($oldRewrite) {
$targetUrl = $targetStore->getBaseUrl();
// look for url rewrite match on the target store
$currentRewrite = $this->urlFinder->findOneByData([
UrlRewrite::REQUEST_PATH => $urlPath,
UrlRewrite::TARGET_PATH => $oldRewrite->getTargetPath(),
UrlRewrite::STORE_ID => $targetStore->getId(),
]);
if (null === $currentRewrite) {
/** @var \Magento\Framework\App\Response\Http $response */
$targetUrl = $targetStore->getBaseUrl();
if ($currentRewrite) {
$targetUrl .= $currentRewrite->getRequestPath();
}
}

return $targetUrl;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

.message-system-short-wrapper {
overflow: hidden;
padding: 0 1.5rem 0 @indent__l;
padding: 0 1.5rem 0 1rem;
}

.message-system-collapsible {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
cursor: pointer;
}

&:focus {
&:active {
background-image+: url('../images/arrows-bg.svg');
background-position+: ~'calc(100% - 12px)' 13px;

Expand All @@ -107,19 +107,6 @@
}
}

// ToDo UI: add month and date styles
// .admin__control-select-month {
// width: 140px;
// }

// .admin__control-select-year {
// width: 103px;
// }

// .admin__control-cvn {
// width: 3em;
// }

option:empty {
display: none;
}
Expand Down Expand Up @@ -151,22 +138,24 @@ option:empty {
.admin__control-file-label {
&:before {
&:extend(.abs-form-control-pattern);

content:'';
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 0;

.admin__control-file:active + &,
.admin__control-file:focus + & {
/**
* @codingStandardsIgnoreStart
*/
&:extend(.abs-form-control-pattern:focus);
}

.admin__control-file[disabled] + & {
&:extend(.abs-form-control-pattern[disabled]);
}

content: '';
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 0;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@
&.admin__field {
> .admin__field-control {
&:extend(.abs-field-size-small all);
float: left;
position: relative;
display: inline-block;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,8 @@
.form.password.reset,
.form.send.confirmation,
.form.password.forget,
.form.create.account {
.form.create.account,
.form.form-orders-search {
min-width: 600px;
width: 50%;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@
// _____________________________________________

& when (@media-common = true) {

.search {
.fieldset {
.control {
.addon {
input {
flex-basis: auto;
width: 100%;
}
}
}
}
}

.block-search {
margin-bottom: 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@
.form.password.reset,
.form.send.confirmation,
.form.password.forget,
.form.create.account {
.form.create.account,
.form.form-orders-search {
min-width: 600px;
width: 50%;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public function testSwitchToExistingPage()
$storeRepository = $this->objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class);
$toStore = $storeRepository->get($toStoreCode);

$redirectUrl = $expectedUrl = "http://localhost/page-c";
$redirectUrl = "http://localhost/index.php/page-c/";
$expectedUrl = "http://localhost/index.php/page-c-on-2nd-store";

$this->assertEquals($expectedUrl, $this->storeSwitcher->switch($fromStore, $toStore, $redirectUrl));
}
Expand Down

0 comments on commit 37ad124

Please sign in to comment.