Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
11020c2
Add price calculation improvement for product option value price
VitaliyBoyko May 15, 2018
81f2600
Handle empty or incorrect lines in a language CSV
VitaliyBoyko May 17, 2018
e9b144f
Naming collision in Javascript ui registry (backend) to 2.2
VitaliyBoyko May 17, 2018
e8fc7b4
Update 1.csv
May 19, 2018
db762d3
Variant product image in sidebar wishlist block
kp-drc May 24, 2018
488c8a9
Update Wishlist.php
kishanpatadia May 24, 2018
5111760
Fix Magento_ImportExport not supporting unicode characters in column …
tdgroot May 14, 2018
5e6abd5
#12601 - A space between the category page and the main footer when a…
sanjay-wagento Jan 3, 2018
2fcaf53
#14063 - Wrong invoice prefix in multistore setup due to default stor…
sanjay-wagento May 19, 2018
1839f97
ISSUE-14747 Newsletter subscription confirmation message does not dis…
KaushikChavda May 16, 2018
b82653b
ENGCOM-2031: [Backport] #14063 - Wrong invoice prefix in multistore s…
magento-engcom-team Jun 18, 2018
39f6740
Navigation dropdown caret icon.
tejashkumbhare Jun 13, 2018
b9d75e7
Correct sentence in comment section in class file.
sanganinamrata Jun 16, 2018
bc8c661
ENGCOM-2037: Navigation dropdown caret icon. #16226
magento-engcom-team Jun 19, 2018
957cb34
ENGCOM-2031: [Backport] #14063 - Wrong invoice prefix in multistore s…
IvanPletnyov Jun 19, 2018
e799678
ENGCOM-2044: [Backport] Add price calculation improvement for product…
magento-engcom-team Jun 19, 2018
11040a3
ENGCOM-2046: [Backport] ISSUE-14747 Newsletter subscription confirmat…
magento-engcom-team Jun 19, 2018
d56dcc2
ENGCOM-2048: [Backport] Feature space between category page #15727
magento-engcom-team Jun 19, 2018
77370eb
ENGCOM-2049: [Backport] Fix Magento_ImportExport not supporting unico…
magento-engcom-team Jun 19, 2018
98e11b5
ENGCOM-2050: [Backport] Variant product image in sidebar wishlist blo…
magento-engcom-team Jun 19, 2018
b8dba9b
ENGCOM-2052: [Backport] Naming collision in Javascript ui registry (b…
magento-engcom-team Jun 19, 2018
bcdf4db
ENGCOM-2053: [Backport] Handle empty or incorrect lines in a language…
magento-engcom-team Jun 19, 2018
a041916
MAGETWO-90840: Can't save customer address on adminhtml when country …
OlgaVasyltsun Jun 19, 2018
c7b70a4
ENGCOM-2053: [Backport] Handle empty or incorrect lines in a language…
Jun 19, 2018
112cfc9
ENGCOM-2046: [Backport] ISSUE-14747 Newsletter subscription confirmat…
Jun 19, 2018
5ff7741
ENGCOM-2044: [Backport] Add price calculation improvement for product…
Jun 19, 2018
723f663
ENGCOM-2031: [Backport] #14063 - Wrong invoice prefix in multistore s…
Jun 19, 2018
16fbce4
ENGCOM-2052: [Backport] Naming collision in Javascript ui registry (b…
Jun 20, 2018
af70abd
ENGCOM-2050: [Backport] Variant product image in sidebar wishlist blo…
Jun 20, 2018
a2ec203
ENGCOM-2049: [Backport] Fix Magento_ImportExport not supporting unico…
Jun 20, 2018
12a35f6
Merge remote-tracking branch 'origin/MAGETWO-90840' into 2.1-develop-…
DianaRusin Jun 20, 2018
a6b0d37
Fixed static test failures
Jun 20, 2018
c9e5239
Fix duplicate element id issue.
chirag-wagento Jun 20, 2018
67a9e13
Refactor validate code in Tax module
gelanivishal Jun 20, 2018
c2b8a5b
ENGCOM-2061: magento/magento2#15255 unlock customer after password re…
magento-engcom-team Jun 20, 2018
bedf5c1
:arrows_clockwise: [EngCom] Public Pull Requests - 2.1-develop
Jun 20, 2018
c708638
Removed commented line
gelanivishal Jun 20, 2018
75fab2e
ENGCOM-2068: Refactor validate code in Tax module #16270
magento-engcom-team Jun 20, 2018
429e243
Merge remote-tracking branch 'origin/2.1-develop' into 2.1-develop-pr55
zakdma Jun 20, 2018
9799883
Merge remote-tracking branch 'origin/2.1-develop' into MAGETWO-90840
zakdma Jun 20, 2018
2b27c95
MAGETWO-90840: Can't save customer address on adminhtml when country …
zakdma Jun 20, 2018
6000fd6
Merge remote-tracking branch 'origin/MAGETWO-90840' into 2.1-develop-…
zakdma Jun 20, 2018
382465a
ENGCOM-2037: Navigation dropdown caret icon. #16226
VladimirZaets Jun 20, 2018
5064cb8
fixed Submitting search form (mini) with enter key fires event handle
gelanivishal Jun 21, 2018
c601b84
Fixes overlapping issue on category page.
chirag-wagento Jun 21, 2018
42389e0
ENGCOM-2079: Submitting search form (mini) with enter key fires event…
magento-engcom-team Jun 21, 2018
5341adf
ENGCOM-2080: [Backport] Fix duplicate element id issue. #16264
magento-engcom-team Jun 21, 2018
96af9cf
Improve trim email address in customer account login page
dankhrapiyush Jun 21, 2018
5e58bac
Trim email address in customer account create page
dankhrapiyush Jun 21, 2018
4ec83ec
Trim email address in customer authentication popup
dankhrapiyush Jun 21, 2018
d3c6e06
Merge pull request #2736 from magento-tsg/2.1-develop-pr55
Jun 21, 2018
f6b5b01
ENGCOM-2083: Removed duplicate line and added comment on variable #16294
magento-engcom-team Jun 21, 2018
86fddd8
ENGCOM-2084: [Backport] Solve overlapping Issue on category page. #1…
magento-engcom-team Jun 21, 2018
f21146e
ENGCOM-2083: Removed duplicate line and added comment on variable #16294
Jun 21, 2018
d61e00d
ENGCOM-2061: magento/magento2#15255 unlock customer after password re…
Jun 21, 2018
78d58f2
ENGCOM-2048: [Backport] Feature space between category page #15727
Jun 21, 2018
cbbe04f
DEVOPS-2632: Sample Data Builds Migrated from Bamboo
slavvka Jun 21, 2018
597dbbe
:arrows_clockwise: [EngCom] Public Pull Requests - 2.1-develop
Jun 21, 2018
715907d
ENGCOM-2096: [Backport-2.1] Trim email address in customer account cr…
magento-engcom-team Jun 22, 2018
a2ce02e
ENGCOM-2100: [Backport] Correct sentence in comment section in class …
magento-engcom-team Jun 22, 2018
85eae4f
Fixed typo error
gelanivishal Jun 19, 2018
9fc1c6b
ENGCOM-2102: [Backport] Fixed typo error #16325
magento-engcom-team Jun 22, 2018
f9c255f
ENGCOM-2102: [Backport] Fixed typo error #16325
Jun 22, 2018
5b91c72
ENGCOM-2096: [Backport-2.1] Trim email address in customer account cr…
Jun 22, 2018
047d330
ENGCOM-2080: [Backport] Fix duplicate element id issue. #16264
Jun 22, 2018
c54fc09
ENGCOM-2068: Refactor validate code in Tax module #16270
Jun 22, 2018
b358efa
DEVOPS-2632: Sample Data Builds Migrated from Bamboo
slavvka Jun 22, 2018
e78fa39
Merge remote-tracking branch 'mainline/2.1-develop' into DEVOPS-2632-2.1
slavvka Jun 22, 2018
1440b23
Fixed static test failures
Jun 22, 2018
f664fd2
ENGCOM-2100: [Backport] Correct sentence in comment section in class …
Jun 22, 2018
a394b33
ENGCOM-2079: Submitting search form (mini) with enter key fires event…
Jun 22, 2018
59129f5
Merge pull request #2746 from magento-borg/DEVOPS-2632-2.1
slavvka Jun 22, 2018
e0c96d6
Fixed static test failures
Jun 22, 2018
3b22433
[EngCom] Public Pull Requests - 2.1-develop
magento-engcom-team Jun 22, 2018
7516446
:arrows_clockwise: [EngCom] Public Pull Requests - 2.1-develop
Jun 23, 2018
d909643
ENGCOM-2084: [Backport] Solve overlapping Issue on category page. #1…
Jun 23, 2018
c20946e
:arrows_clockwise: [EngCom] Public Pull Requests - 2.1-develop
Jun 24, 2018
cfeba9c
during product import, use correct error message for duplicate error key
denteblu Jun 10, 2018
4e23358
Updated according to coding style requirements
ishakhsuvarov Jun 11, 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
3 changes: 2 additions & 1 deletion app/code/Magento/Catalog/Model/Product/Option/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace Magento\Catalog\Model\Product\Option;

use Magento\Catalog\Pricing\Price\BasePrice;
use Magento\Framework\Model\AbstractModel;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\Option;
Expand Down Expand Up @@ -225,7 +226,7 @@ public function saveValues()
public function getPrice($flag = false)
{
if ($flag && $this->getPriceType() == self::TYPE_PERCENT) {
$basePrice = $this->getOption()->getProduct()->getFinalPrice();
$basePrice = $this->getOption()->getProduct()->getPriceInfo()->getPrice(BasePrice::PRICE_CODE)->getValue();
$price = $basePrice * ($this->_getData(self::KEY_PRICE) / 100);
return $price;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,30 @@ private function getMockedOption()
private function getMockedProduct()
{
$mockBuilder = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
->setMethods(['getFinalPrice', '__wakeup'])
->setMethods(['getPriceInfo', '__wakeup'])
->disableOriginalConstructor();
$mock = $mockBuilder->getMock();

$mock->expects($this->any())
->method('getFinalPrice')
->will($this->returnValue(10));
$priceInfoMock = $this->getMockForAbstractClass(
\Magento\Framework\Pricing\PriceInfoInterface::class,
[],
'',
false,
false,
true,
['getPrice']
);

$priceMock = $this->getMockForAbstractClass(\Magento\Framework\Pricing\Price\PriceInterface::class);

$priceInfoMock->expects($this->any())->method('getPrice')->willReturn($priceMock);

$mock->expects($this->any())->method('getPriceInfo')->willReturn($priceInfoMock);

$priceMock->expects($this->any())->method('getValue')->willReturn(10);

return $mock;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,12 @@ protected function checkUrlKeyDuplicates()
);
foreach ($urlKeyDuplicates as $entityData) {
$rowNum = $this->rowNumbers[$entityData['store_id']][$entityData['request_path']];
$this->addRowError(ValidatorInterface::ERROR_DUPLICATE_URL_KEY, $rowNum);
$message = sprintf(
$this->retrieveMessageTemplate(ValidatorInterface::ERROR_DUPLICATE_URL_KEY),
$entityData['request_path'],
$entityData['sku']
);
$this->addRowError(ValidatorInterface::ERROR_DUPLICATE_URL_KEY, $rowNum, 'url_key', $message);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,12 @@ define([
var element;

_.each(this.disabledAttributes, function (attribute) {
registry.get('index = ' + attribute).disabled(false);
registry.get('code = ' + attribute, 'index = ' + attribute).disabled(false);
});
this.disabledAttributes = [];

_.each(attributes, function (attribute) {
element = registry.get('index = ' + attribute.code);
element = registry.get('code = ' + attribute.code, 'index = ' + attribute.code);
if (!_.isUndefined(element)) {
element.disabled(true);
this.disabledAttributes.push(attribute.code);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Api\SortOrder;
use Magento\Framework\Exception\InputException;
use Magento\Framework\App\ObjectManager;
use Magento\Store\Model\ScopeInterface;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Expand Down Expand Up @@ -61,6 +63,16 @@ class AddressRepository implements \Magento\Customer\Api\AddressRepositoryInterf
*/
protected $extensionAttributesJoinProcessor;

/**
* @var \Magento\Directory\Model\AllowedCountries
*/
private $allowedCountriesReader;

/**
* @var \Magento\Customer\Model\Config\Share
*/
private $shareConfig;

/**
* @param \Magento\Customer\Model\AddressFactory $addressFactory
* @param \Magento\Customer\Model\AddressRegistry $addressRegistry
Expand All @@ -70,6 +82,10 @@ class AddressRepository implements \Magento\Customer\Api\AddressRepositoryInterf
* @param \Magento\Customer\Api\Data\AddressSearchResultsInterfaceFactory $addressSearchResultsFactory
* @param \Magento\Customer\Model\ResourceModel\Address\CollectionFactory $addressCollectionFactory
* @param \Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface $extensionAttributesJoinProcessor
* @param \Magento\Directory\Model\AllowedCountries|null $allowedCountriesReader
* @param \Magento\Customer\Model\Config\Share|null $shareConfig
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
\Magento\Customer\Model\AddressFactory $addressFactory,
Expand All @@ -79,7 +95,9 @@ public function __construct(
\Magento\Directory\Helper\Data $directoryData,
\Magento\Customer\Api\Data\AddressSearchResultsInterfaceFactory $addressSearchResultsFactory,
\Magento\Customer\Model\ResourceModel\Address\CollectionFactory $addressCollectionFactory,
\Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface $extensionAttributesJoinProcessor
\Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface $extensionAttributesJoinProcessor,
\Magento\Directory\Model\AllowedCountries $allowedCountriesReader = null,
\Magento\Customer\Model\Config\Share $shareConfig = null
) {
$this->addressFactory = $addressFactory;
$this->addressRegistry = $addressRegistry;
Expand All @@ -89,6 +107,10 @@ public function __construct(
$this->addressSearchResultsFactory = $addressSearchResultsFactory;
$this->addressCollectionFactory = $addressCollectionFactory;
$this->extensionAttributesJoinProcessor = $extensionAttributesJoinProcessor;
$this->allowedCountriesReader = $allowedCountriesReader
?: ObjectManager::getInstance()->get(\Magento\Directory\Model\AllowedCountries::class);
$this->shareConfig = $shareConfig
?: ObjectManager::getInstance()->get(\Magento\Customer\Model\Config\Share::class);
}

/**
Expand Down Expand Up @@ -290,7 +312,7 @@ private function _validate(CustomerAddressModel $customerAddressModel)
$exception->addError(__('%fieldName is a required field.', ['fieldName' => 'countryId']));
} else {
//Checking if such country exists.
if (!in_array($countryId, $this->directoryData->getCountryCollection()->getAllIds(), true)) {
if (!in_array($countryId, $this->getWebsiteAllowedCountries($customerAddressModel), true)) {
$exception->addError(
__(
'Invalid value of "%value" provided for the %fieldName field.',
Expand Down Expand Up @@ -334,4 +356,23 @@ private function _validate(CustomerAddressModel $customerAddressModel)

return $exception;
}

/**
* Return allowed counties per website.
*
* @param \Magento\Customer\Model\Address $customerAddressModel
* @return array
*/
private function getWebsiteAllowedCountries(\Magento\Customer\Model\Address $customerAddressModel)
{
$websiteId = null;

if (!$this->shareConfig->isGlobalScope()) {
$websiteId = $customerAddressModel->getCustomer()
? $customerAddressModel->getCustomer()->getWebsiteId()
: null;
}

return $this->allowedCountriesReader->getAllowedCountries(ScopeInterface::SCOPE_WEBSITE, $websiteId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
namespace Magento\Customer\Test\Unit\Model\ResourceModel;

use Magento\Customer\Api\Data\AddressInterface as AddressData;
use Magento\Directory\Model\ResourceModel\Country\Collection as Countries;
use Magento\Framework\Exception\InputException;
use Magento\Store\Model\ScopeInterface;

/**
* Unit test for Magento\Customer\Model\ResourceModel\AddressRepository
Expand Down Expand Up @@ -71,6 +71,16 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase
*/
protected $repository;

/**
* @var \Magento\Directory\Model\AllowedCountries|\PHPUnit_Framework_MockObject_MockObject
*/
private $allowedCountriesReaderMock;

/**
* @var \Magento\Customer\Model\Config\Share|\PHPUnit_Framework_MockObject_MockObject
*/
private $shareConfigMock;

protected function setUp()
{
$this->addressFactory = $this->getMock(
Expand Down Expand Up @@ -137,6 +147,26 @@ protected function setUp()
false
);

$this->allowedCountriesReaderMock = $this->getMock(
\Magento\Directory\Model\AllowedCountries::class,
['getAllowedCountries'],
[],
'',
false
);
$this->shareConfigMock = $this->getMock(
\Magento\Customer\Model\Config\Share::class,
['isGlobalScope'],
[],
'',
false
);
$this->shareConfigMock->method('isGlobalScope')->willReturn(false);
$this->allowedCountriesReaderMock
->method('getAllowedCountries')
->with(ScopeInterface::SCOPE_WEBSITE, null)
->willReturn(['1', '2']);

$this->repository = new \Magento\Customer\Model\ResourceModel\AddressRepository(
$this->addressFactory,
$this->addressRegistry,
Expand All @@ -145,7 +175,9 @@ protected function setUp()
$this->directoryData,
$this->addressSearchResultsFactory,
$this->addressCollectionFactory,
$this->extensionAttributesJoinProcessor
$this->extensionAttributesJoinProcessor,
$this->allowedCountriesReaderMock,
$this->shareConfigMock
);
}

Expand Down Expand Up @@ -315,15 +347,6 @@ public function testSaveWithInvalidRegion()
->method('getRegion')
->willReturn('');

/** @var \PHPUnit_Framework_MockObject_MockObject $countryCollection */
$countryCollection = $this->getMockBuilder(Countries::class)
->disableOriginalConstructor()
->getMock();
$countryCollection->expects($this->once())->method('getAllIds')->willReturn(['1', '2']);
$this->directoryData->expects($this->once())
->method('getCountryCollection')
->willReturn($countryCollection);

$this->repository->save($customerAddress);
}

Expand Down Expand Up @@ -408,15 +431,6 @@ public function testSaveWithInvalidRegionId()
->method('getRegion')
->willReturn('');

/** @var \PHPUnit_Framework_MockObject_MockObject $countryCollection */
$countryCollection = $this->getMockBuilder(Countries::class)
->disableOriginalConstructor()
->getMock();
$countryCollection->expects($this->once())->method('getAllIds')->willReturn(['1', '2']);
$this->directoryData->expects($this->once())
->method('getCountryCollection')
->willReturn($countryCollection);

$this->repository->save($customerAddress);
}

Expand Down Expand Up @@ -714,15 +728,6 @@ private function prepareAddressData($countryId, $regionId)
$countryModel->expects($this->any())->method('getRegionCollection')->willReturn($regionCollection);
$regionCollection->expects($this->any())->method('getAllIds')->willReturn(['3', '4']);

/** @var \PHPUnit_Framework_MockObject_MockObject $countryCollection */
$countryCollection = $this->getMockBuilder(Countries::class)
->disableOriginalConstructor()
->getMock();
$countryCollection->expects($this->once())->method('getAllIds')->willReturn(['1', '2']);
$this->directoryData->expects($this->once())
->method('getCountryCollection')
->willReturn($countryCollection);

return $customerAddress;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="field email required">
<label class="label" for="email"><span><?php echo $block->escapeHtml(__('Email')) ?></span></label>
<div class="control">
<input name="login[username]" value="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($block->getUsername()) ?>" <?php if ($block->isAutocompleteDisabled()) :?> autocomplete="off"<?php endif; ?> id="email" type="email" class="input-text" title="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Email')) ?>" data-validate="{required:true, 'validate-email':true}">
<input name="login[username]" value="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($block->getUsername()) ?>" <?php if ($block->isAutocompleteDisabled()) :?> autocomplete="off"<?php endif; ?> id="email" type="email" class="input-text" title="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Email')) ?>" data-mage-init='{"mage/trim-input":{}}' data-validate="{required:true, 'validate-email':true}">
</div>
</div>
<div class="field password required">
Expand All @@ -51,12 +51,3 @@
</div>
</div>

<script type="text/x-magento-init">
{
".field.email": {
"Magento_Customer/js/trim-username": {
"formSelector": "form.form-login"
}
}
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<div class="field required">
<label for="email_address" class="label"><span><?php echo $block->escapeHtml(__('Email')) ?></span></label>
<div class="control">
<input type="email" name="email" autocomplete="email" id="email_address" value="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($block->getFormData()->getEmail()) ?>" title="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Email')) ?>" class="input-text" data-validate="{required:true, 'validate-email':true}">
<input type="email" name="email" autocomplete="email" id="email_address" value="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($block->getFormData()->getEmail()) ?>" title="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Email')) ?>" class="input-text" data-mage-init='{"mage/trim-input":{}}' data-validate="{required:true, 'validate-email':true}">
</div>
</div>
<div class="field password required" data-mage-init='{"passwordStrengthIndicator": {}}'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ define(

/** Show login popup window */
showModal: function () {
$(this.modalWindow).modal('openModal');
$(this.modalWindow).modal('openModal').trigger('contentUpdated');
}
}
}
Expand Down
65 changes: 0 additions & 65 deletions app/code/Magento/Customer/view/frontend/web/js/trim-username.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
id="email"
type="email"
class="input-text"
data-mage-init='{"mage/trim-input":{}}'
data-bind="attr: {autocomplete: autocomplete}"
data-validate="{required:true, 'validate-email':true}">
</div>
Expand Down
Loading