Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.2-develop' into feature-space-…
Browse files Browse the repository at this point in the history
…between-category-page
  • Loading branch information
sanjay-wagento committed Jan 7, 2018
2 parents 023fb1a + 816ec39 commit 7727086
Show file tree
Hide file tree
Showing 30 changed files with 304 additions and 80 deletions.
4 changes: 2 additions & 2 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID === 70002 || PHP_VERSION_ID === 70004 || PHP_VERSION_ID >= 70006)) {
if (PHP_SAPI == 'cli') {
echo 'Magento supports 7.0.2, 7.0.4, and 7.0.6 or later. ' .
'Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html';
'Please read http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html';
} else {
echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
<p>Magento supports PHP 7.0.2, 7.0.4, and 7.0.6 or later. Please read
<a target="_blank" href="http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html">
<a target="_blank" href="http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html">
Magento System Requirements</a>.
</div>
HTML;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ define(
*/
onError: function (response) {
braintree.showError($t('Payment ' + this.getTitle() + ' can\'t be initialized'));
this.isPlaceOrderActionAllowed(true);
throw response.message;
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ $stores = $block->getStoresSortedBySortOrder();
<input type="hidden" id="option-count-check" value="" />
</div>
<script id="row-template" type="text/x-magento-template">
<tr>
<tr <% if (data.rowClasses) { %>class="<%- data.rowClasses %>"<% } %>>
<td class="col-draggable">
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
<div data-role="draggable-handle" class="draggable-handle"
Expand Down
8 changes: 7 additions & 1 deletion app/code/Magento/Catalog/view/adminhtml/web/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ define([
totalItems: 0,
rendered: 0,
template: mageTemplate('#row-template'),
newOptionClass: 'new-option',
isReadOnly: config.isReadOnly,
add: function (data, render) {
var isNewOption = false,
Expand All @@ -32,7 +33,8 @@ define([
if (typeof data.id == 'undefined') {
data = {
'id': 'option_' + this.itemCount,
'sort_order': this.itemCount + 1
'sort_order': this.itemCount + 1,
'rowClasses': this.newOptionClass
};
isNewOption = true;
}
Expand Down Expand Up @@ -84,6 +86,10 @@ define([
this.totalItems--;
this.updateItemsCountField();
}

if (element.hasClassName(this.newOptionClass)) {
element.remove();
}
},
updateItemsCountField: function () {
$('option-count-check').value = this.totalItems > 0 ? '1' : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* See COPYING.txt for license details.
*/
-->
<a class="product-item-link"
<a if="isAllowed()"
class="product-item-link"
attr="href: $row().url"
text="label"/>
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public function getSelect(AbstractAttribute $superAttribute, int $productId, Sco
]
),
[]
)->joinInner(
['attribute_option' => $this->attributeResource->getTable('eav_attribute_option')],
'attribute_option.option_id = entity_value.value',
[]
)->order(
'attribute_option.sort_order ASC'
)->where(
'super_attribute.product_id = ?',
$productId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function setUp()
->disableOriginalConstructor()
->getMockForAbstractClass();
$this->select = $this->getMockBuilder(Select::class)
->setMethods(['from', 'joinInner', 'joinLeft', 'where', 'columns'])
->setMethods(['from', 'joinInner', 'joinLeft', 'where', 'columns', 'order'])
->disableOriginalConstructor()
->getMock();
$this->connectionMock->expects($this->atLeastOnce())
Expand Down Expand Up @@ -112,10 +112,28 @@ public function testGetSelect()
{
$this->select->expects($this->exactly(1))->method('from')->willReturnSelf();
$this->select->expects($this->exactly(1))->method('columns')->willReturnSelf();
$this->select->expects($this->exactly(5))->method('joinInner')->willReturnSelf();
$this->select->expects($this->exactly(6))->method('joinInner')->willReturnSelf();
$this->select->expects($this->exactly(3))->method('joinLeft')->willReturnSelf();
$this->select->expects($this->exactly(1))->method('order')->willReturnSelf();
$this->select->expects($this->exactly(2))->method('where')->willReturnSelf();

$this->attributeResourceMock->expects($this->exactly(9))
->method('getTable')
->will(
$this->returnValueMap(
[
['catalog_product_super_attribute', 'catalog_product_super_attribute value'],
['catalog_product_entity', 'catalog_product_entity value'],
['catalog_product_super_link', 'catalog_product_super_link value'],
['eav_attribute', 'eav_attribute value'],
['catalog_product_entity', 'catalog_product_entity value'],
['catalog_product_super_attribute_label', 'catalog_product_super_attribute_label value'],
['eav_attribute_option', 'eav_attribute_option value'],
['eav_attribute_option_value', 'eav_attribute_option_value value']
]
)
);

$this->abstractAttributeMock->expects($this->atLeastOnce())
->method('getAttributeId')
->willReturn('getAttributeId value');
Expand All @@ -138,10 +156,27 @@ public function testGetSelectWithBackendModel()
{
$this->select->expects($this->exactly(1))->method('from')->willReturnSelf();
$this->select->expects($this->exactly(0))->method('columns')->willReturnSelf();
$this->select->expects($this->exactly(5))->method('joinInner')->willReturnSelf();
$this->select->expects($this->exactly(6))->method('joinInner')->willReturnSelf();
$this->select->expects($this->exactly(1))->method('joinLeft')->willReturnSelf();
$this->select->expects($this->exactly(1))->method('order')->willReturnSelf();
$this->select->expects($this->exactly(2))->method('where')->willReturnSelf();

$this->attributeResourceMock->expects($this->exactly(7))
->method('getTable')
->will(
$this->returnValueMap(
[
['catalog_product_super_attribute', 'catalog_product_super_attribute value'],
['catalog_product_entity', 'catalog_product_entity value'],
['catalog_product_super_link', 'catalog_product_super_link value'],
['eav_attribute', 'eav_attribute value'],
['catalog_product_entity', 'catalog_product_entity value'],
['catalog_product_super_attribute_label', 'catalog_product_super_attribute_label value'],
['eav_attribute_option', 'eav_attribute_option value']
]
)
);

$this->abstractAttributeMock->expects($this->atLeastOnce())
->method('getAttributeId')
->willReturn('getAttributeId value');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,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);
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Deploy/Console/Command/SetModeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$modeController->enableProductionMode();
}
break;
case State::MODE_DEFAULT:
$modeController->enableDefaultMode();
break;
default:
throw new LocalizedException(__('Cannot switch into given mode "%1"', $toMode));
}
Expand Down
19 changes: 19 additions & 0 deletions app/code/Magento/Deploy/Model/Mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,25 @@ public function enableDeveloperMode()
$this->setStoreMode(State::MODE_DEVELOPER);
}

/**
* Enable Default mode
*
* @return void
*/
public function enableDefaultMode()
{
$this->filesystem->cleanupFilesystem(
[
DirectoryList::CACHE,
DirectoryList::GENERATED_CODE,
DirectoryList::GENERATED_METADATA,
DirectoryList::TMP_MATERIALIZATION_DIR,
DirectoryList::STATIC_VIEW,
]
);
$this->setStoreMode(State::MODE_DEFAULT);
}

/**
* Get current mode information
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ public function testSetDeveloperMode()
);
}

public function testSetDefaultMode()
{
$this->modeMock->expects($this->once())->method('enableDefaultMode');

$tester = new CommandTester($this->command);
$tester->execute(['mode' => 'default']);
$this->assertContains(
"default mode",
$tester->getDisplay()
);
}

public function testSetProductionSkipCompilation()
{
$this->modeMock->expects($this->once())->method('enableProductionModeMinimal');
Expand Down
7 changes: 6 additions & 1 deletion app/code/Magento/Paypal/Model/Express.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,14 +669,19 @@ public function getApi()
public function assignData(\Magento\Framework\DataObject $data)
{
parent::assignData($data);

$additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);

if (!is_array($additionalData)) {
return $this;
}

foreach ($additionalData as $key => $value) {
// Skip extension attributes
if ($key === \Magento\Framework\Api\ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY) {
continue;
}

$this->getInfoInstance()->setAdditionalInformation($key, $value);
}
return $this;
Expand Down
11 changes: 10 additions & 1 deletion app/code/Magento/Paypal/Test/Unit/Model/ExpressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,21 @@ public function testAssignData()
{
$transportValue = 'something';

$extensionAttribute = $this->getMockForAbstractClass(
\Magento\Quote\Api\Data\PaymentExtensionInterface::class,
[],
'',
false,
false
);

$data = new DataObject(
[
PaymentInterface::KEY_ADDITIONAL_DATA => [
Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT => $transportValue,
Express\Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID => $transportValue,
Express\Checkout::PAYMENT_INFO_TRANSPORT_TOKEN => $transportValue
Express\Checkout::PAYMENT_INFO_TRANSPORT_TOKEN => $transportValue,
\Magento\Framework\Api\ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY => $extensionAttribute
]
]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,12 @@
*/

define([
'jquery',
'Magento_Checkout/js/model/quote',
'Magento_Checkout/js/model/url-builder',
'mage/storage',
'Magento_Checkout/js/model/error-processor',
'Magento_Customer/js/model/customer',
'Magento_Checkout/js/model/full-screen-loader'
], function ($, quote, urlBuilder, storage, errorProcessor, customer, fullScreenLoader) {
'Magento_Checkout/js/action/set-payment-information'
], function (quote, setPaymentInformation) {
'use strict';

return function (messageContainer) {
var serviceUrl,
payload,
paymentData = quote.paymentMethod();

/**
* Checkout for guest and registered customer.
*/
if (!customer.isLoggedIn()) {
serviceUrl = urlBuilder.createUrl('/guest-carts/:cartId/set-payment-information', {
cartId: quote.getQuoteId()
});
payload = {
cartId: quote.getQuoteId(),
email: quote.guestEmail,
paymentMethod: paymentData
};
} else {
serviceUrl = urlBuilder.createUrl('/carts/mine/set-payment-information', {});
payload = {
cartId: quote.getQuoteId(),
paymentMethod: paymentData
};
}
fullScreenLoader.startLoader();

return storage.post(
serviceUrl, JSON.stringify(payload)
).fail(function (response) {
errorProcessor.process(response, messageContainer);
}).always(function () {
fullScreenLoader.stopLoader();
});
return setPaymentInformation(messageContainer, quote.paymentMethod());
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,7 @@ public function execute()
}
$transactionSave->save();

if (isset($shippingResponse) && $shippingResponse->hasErrors()) {
$this->messageManager->addError(
__(
'The invoice and the shipment have been created. ' .
'The shipping label cannot be created now.'
)
);
} elseif (!empty($data['do_shipment'])) {
if (!empty($data['do_shipment'])) {
$this->messageManager->addSuccess(__('You created the invoice and shipment.'));
} else {
$this->messageManager->addSuccess(__('The invoice has been created.'));
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/Sales/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ Sales,Sales
"You can't create an invoice without products.","You can't create an invoice without products."
"New Invoice","New Invoice"
"We can't save the invoice right now.","We can't save the invoice right now."
"The invoice and the shipment have been created. The shipping label cannot be created now.","The invoice and the shipment have been created. The shipping label cannot be created now."
"You created the invoice and shipment.","You created the invoice and shipment."
"The invoice has been created.","The invoice has been created."
"We can't send the invoice email right now.","We can't send the invoice email right now."
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Translation/Model/Js/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ class DataProvider implements DataProviderInterface
/**
* Basic translate renderer
*
* @var \Magento\Framework\Phrase\Renderer\Translate
* @var \Magento\Framework\Phrase\RendererInterface
*/
protected $translate;

/**
* @param \Magento\Framework\App\State $appState
* @param Config $config
* @param \Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory
* @param \Magento\Framework\Phrase\Renderer\Translate $translate
* @param \Magento\Framework\Phrase\RendererInterface $translate
* @param \Magento\Framework\Component\ComponentRegistrar $componentRegistrar
* @param \Magento\Framework\Component\DirSearch $dirSearch
* @param \Magento\Framework\View\Design\Theme\ThemePackageList $themePackageList
Expand All @@ -64,7 +64,7 @@ public function __construct(
\Magento\Framework\App\State $appState,
Config $config,
\Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory,
\Magento\Framework\Phrase\Renderer\Translate $translate,
\Magento\Framework\Phrase\RendererInterface $translate,
\Magento\Framework\Component\ComponentRegistrar $componentRegistrar,
\Magento\Framework\Component\DirSearch $dirSearch,
\Magento\Framework\View\Design\Theme\ThemePackageList $themePackageList,
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function execute()
} catch (\Exception $e) {
$this->logger->critical($e);
$result = [
'error' => _('UI component could not be rendered because of system exception'),
'error' => __('UI component could not be rendered because of system exception'),
'errorcode' => $this->escaper->escapeHtml($e->getCode())
];
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
max-height: 250px;
overflow-y: auto;
padding-top: .25em;
&::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
&::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0, 0, 0, .5);
}

li {
border: 0;
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"ext-dom": "*",
"ext-simplexml": "*",
"ext-mcrypt": "*",
"ext-bcmath": "*",
"ext-hash": "*",
"ext-curl": "*",
"ext-iconv": "*",
Expand Down
Loading

0 comments on commit 7727086

Please sign in to comment.