Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/2.3-develop' into 485-testReSetS…
Browse files Browse the repository at this point in the history
…hippingMethod

# Conflicts:
#	dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php
#	dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php
  • Loading branch information
naydav committed Mar 29, 2019
2 parents 5d9a64e + 70bf7c6 commit 4837778
Show file tree
Hide file tree
Showing 341 changed files with 10,081 additions and 2,787 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ atlassian*
/pub/media/import/*
!/pub/media/import/.htaccess
/pub/media/logo/*
/pub/media/custom_options/*
!/pub/media/custom_options/.htaccess
/pub/media/theme/*
/pub/media/theme_customization/*
!/pub/media/theme_customization/.htaccess
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<h2>Welcome</h2>
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.

## Magento system requirements
[Magento system requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html).
## Magento System Requirements
[Magento System Requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html).

## Install Magento

* [Installation guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html).
* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html).

<h2>Contributing to the Magento 2 code base</h2>
<h2>Contributing to the Magento 2 Code Base</h2>
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.

To learn about how to make a contribution, click [here][1].
Expand All @@ -39,11 +39,11 @@ Magento is thankful for any contribution that can improve our code base, documen
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
</a>

### Labels applied by the Magento team
### Labels Applied by the Magento Team
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
Please review the [Code Contributions guide](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels) for detailed information on labels used in Magento 2 repositories.

## Reporting security issues
## Reporting Security Issues

To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account [there](https://bugcrowd.com/magento) to submit and follow-up your issue. Learn more about reporting security issues [here](https://magento.com/security/reporting-magento-security-issue).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Magento\Framework\MessageQueue\MessageLockException;
use Magento\Framework\MessageQueue\ConnectionLostException;
use Magento\Framework\Exception\NotFoundException;
use Magento\Framework\MessageQueue\CallbackInvoker;
use Magento\Framework\MessageQueue\CallbackInvokerInterface;
use Magento\Framework\MessageQueue\ConsumerConfigurationInterface;
use Magento\Framework\MessageQueue\EnvelopeInterface;
use Magento\Framework\MessageQueue\QueueInterface;
Expand All @@ -30,7 +30,7 @@
class MassConsumer implements ConsumerInterface
{
/**
* @var \Magento\Framework\MessageQueue\CallbackInvoker
* @var CallbackInvokerInterface
*/
private $invoker;

Expand Down Expand Up @@ -67,7 +67,7 @@ class MassConsumer implements ConsumerInterface
/**
* Initialize dependencies.
*
* @param CallbackInvoker $invoker
* @param CallbackInvokerInterface $invoker
* @param ResourceConnection $resource
* @param MessageController $messageController
* @param ConsumerConfigurationInterface $configuration
Expand All @@ -76,7 +76,7 @@ class MassConsumer implements ConsumerInterface
* @param Registry $registry
*/
public function __construct(
CallbackInvoker $invoker,
CallbackInvokerInterface $invoker,
ResourceConnection $resource,
MessageController $messageController,
ConsumerConfigurationInterface $configuration,
Expand Down
17 changes: 15 additions & 2 deletions app/code/Magento/AsynchronousOperations/Model/MassSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Psr\Log\LoggerInterface;
use Magento\AsynchronousOperations\Model\ResourceModel\Operation\OperationRepository;
use Magento\Authorization\Model\UserContextInterface;
use Magento\Framework\Encryption\Encryptor;

/**
* Class MassSchedule used for adding multiple entities as Operations to Bulk Management with the status tracking
Expand Down Expand Up @@ -63,6 +64,11 @@ class MassSchedule
*/
private $userContext;

/**
* @var Encryptor
*/
private $encryptor;

/**
* Initialize dependencies.
*
Expand All @@ -73,6 +79,7 @@ class MassSchedule
* @param LoggerInterface $logger
* @param OperationRepository $operationRepository
* @param UserContextInterface $userContext
* @param Encryptor|null $encryptor
*/
public function __construct(
IdentityGeneratorInterface $identityService,
Expand All @@ -81,7 +88,8 @@ public function __construct(
BulkManagementInterface $bulkManagement,
LoggerInterface $logger,
OperationRepository $operationRepository,
UserContextInterface $userContext = null
UserContextInterface $userContext = null,
Encryptor $encryptor = null
) {
$this->identityService = $identityService;
$this->itemStatusInterfaceFactory = $itemStatusInterfaceFactory;
Expand All @@ -90,6 +98,7 @@ public function __construct(
$this->logger = $logger;
$this->operationRepository = $operationRepository;
$this->userContext = $userContext ?: ObjectManager::getInstance()->get(UserContextInterface::class);
$this->encryptor = $encryptor ?: ObjectManager::getInstance()->get(Encryptor::class);
}

/**
Expand Down Expand Up @@ -130,9 +139,13 @@ public function publishMass($topicName, array $entitiesArray, $groupId = null, $
$requestItem = $this->itemStatusInterfaceFactory->create();

try {
$operations[] = $this->operationRepository->createByTopic($topicName, $entityParams, $groupId);
$operation = $this->operationRepository->createByTopic($topicName, $entityParams, $groupId);
$operations[] = $operation;
$requestItem->setId($key);
$requestItem->setStatus(ItemStatusInterface::STATUS_ACCEPTED);
$requestItem->setDataHash(
$this->encryptor->hash($operation->getSerializedData(), Encryptor::HASH_VERSION_SHA256)
);
$requestItems[] = $requestItem;
} catch (\Exception $exception) {
$this->logger->error($exception);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Authorizenet/Model/Directpost/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function setDataFromOrder(
/**
* Set sign hash into the request object.
*
* All needed fields should be placed in the object fist.
* All needed fields should be placed in the object first.
*
* @return $this
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,25 +282,23 @@ public function getGridIdsJson()
if (!$this->getUseSelectAll()) {
return '';
}
/** @var \Magento\Framework\Data\Collection $allIdsCollection */
$allIdsCollection = clone $this->getParentBlock()->getCollection();

if ($this->getMassactionIdField()) {
$massActionIdField = $this->getMassactionIdField();
/** @var \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection $collection */
$collection = clone $this->getParentBlock()->getCollection();

if ($collection instanceof AbstractDb) {
$idsSelect = clone $collection->getSelect();
$idsSelect->reset(\Magento\Framework\DB\Select::ORDER);
$idsSelect->reset(\Magento\Framework\DB\Select::LIMIT_COUNT);
$idsSelect->reset(\Magento\Framework\DB\Select::LIMIT_OFFSET);
$idsSelect->reset(\Magento\Framework\DB\Select::COLUMNS);
$idsSelect->columns($this->getMassactionIdField(), 'main_table');
$idList = $collection->getConnection()->fetchCol($idsSelect);
} else {
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
$idList = $collection->setPageSize(0)->getColumnValues($this->getMassactionIdField());
}

if ($allIdsCollection instanceof AbstractDb) {
$allIdsCollection->getSelect()->limit();
$allIdsCollection->clear();
}

$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);
if (!empty($gridIds)) {
return join(",", $gridIds);
}
return '';
return implode(',', $idList);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,62 +269,6 @@ public function testGetGridIdsJsonWithoutUseSelectAll()
$this->assertEmpty($this->_block->getGridIdsJson());
}

/**
* @param array $items
* @param string $result
*
* @dataProvider dataProviderGetGridIdsJsonWithUseSelectAll
*/
public function testGetGridIdsJsonWithUseSelectAll(array $items, $result)
{
$this->_block->setUseSelectAll(true);

if ($this->_block->getMassactionIdField()) {
$massActionIdField = $this->_block->getMassactionIdField();
} else {
$massActionIdField = $this->_block->getParentBlock()->getMassactionIdField();
}

$collectionMock = $this->getMockBuilder(\Magento\Framework\Data\Collection::class)
->disableOriginalConstructor()
->getMock();

$this->_gridMock->expects($this->once())
->method('getCollection')
->willReturn($collectionMock);
$collectionMock->expects($this->once())
->method('setPageSize')
->with(0)
->willReturnSelf();
$collectionMock->expects($this->once())
->method('getColumnValues')
->with($massActionIdField)
->willReturn($items);

$this->assertEquals($result, $this->_block->getGridIdsJson());
}

/**
* @return array
*/
public function dataProviderGetGridIdsJsonWithUseSelectAll()
{
return [
[
[],
'',
],
[
[1],
'1',
],
[
[1, 2, 3],
'1,2,3',
],
];
}

/**
* @param string $itemId
* @param array|\Magento\Framework\DataObject $item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

?>
<?php if ($block->getChildHtml()):?>
<div data-mage-init='{"floatingHeader": {}}' class="page-actions" <?= /* @escapeNotVerified */ $block->getUiId('content-header') ?>>
<div data-mage-init='{"floatingHeader": {}}' class="page-actions floating-header" <?= /* @escapeNotVerified */ $block->getUiId('content-header') ?>>
<?= $block->getChildHtml() ?>
</div>
<?php endif; ?>
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<click selector="{{AdminGridActionSection.submitButton}}" stepKey="clickSubmit"/>
<waitForPageLoad stepKey="waitForConfirmWindowToAppear"/>
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to delete the selected backup(s)?" stepKey="seeConfirmationModal"/>
<waitForPageLoad stepKey="waitForSubmitAction"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkConfirmDelete"/>
<dontSee selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="dontSeeBackupInGrid"/>
</actionGroup>

</actionGroups>
9 changes: 9 additions & 0 deletions app/code/Magento/Bundle/view/base/web/js/price-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,17 @@ define([
function applyTierPrice(oneItemPrice, qty, optionConfig) {
var tiers = optionConfig.tierPrice,
magicKey = _.keys(oneItemPrice)[0],
tiersFirstKey = _.keys(optionConfig)[0],
lowest = false;

if (!tiers) {//tiers is undefined when options has only one option
tiers = optionConfig[tiersFirstKey].tierPrice;
}

tiers.sort(function (a, b) {//sorting based on "price_qty"
return a['price_qty'] - b['price_qty'];
});

_.each(tiers, function (tier, index) {
if (tier['price_qty'] > qty) {
return;
Expand Down
Loading

0 comments on commit 4837778

Please sign in to comment.