Skip to content

Commit

Permalink
Merge branch 'JS-323' of https://github.com/ulaharbmg/magento2ce into…
Browse files Browse the repository at this point in the history
… JS-339

Conflicts:
	app/code/Magento/Swatches/view/frontend/web/js/SwatchRenderer.js
  • Loading branch information
ValeryYafremau committed Dec 7, 2015
2 parents 81c11d3 + e0efae1 commit 76a5545
Show file tree
Hide file tree
Showing 498 changed files with 11,670 additions and 5,833 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<?php
/* @var $block \Magento\Backend\Block\Widget\Form\Renderer\Fieldset\Element */
$element = $block->getElement();
$note = $element->getNote() ? '<div class="note" id="' . $element->getId() . '-note">' . $element->getNote() . '</div>' : '';
$note = $element->getNote() ? '<div class="note admin__field-note" id="' . $element->getId() . '-note">' . $element->getNote() . '</div>' : '';
$elementBeforeLabel = $element->getExtType() == 'checkbox admin__control-checkbox' || $element->getExtType() == 'radio admin__control-radio';
$addOn = ($element->getBeforeElementHtml() || $element->getAfterElementHtml()) && !$element->getNoWrapAsAddon();
$fieldId = ($element->getHtmlContainerId()) ? ' id="' . $element->getHtmlContainerId() . '"' : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
<div class="mass-select-wrap">
<select
id="<?php echo $block->getHtmlId() ?>-mass-select"
class="action-select-multiselect"
class="action-select-multiselect _disabled"
disabled="disabled"
data-menu="grid-mass-select">
<optgroup label="<?php /* @escapeNotVerified */ echo __('Mass Actions')?>">
<option disabled selected></option>
Expand All @@ -68,10 +69,14 @@
</div>

<script>
require(['jquery'], function($){
require(['jquery', 'domReady!'], function($){
'use strict';
$('#<?php echo $block->getHtmlId() ?>-mass-select').change(function () {
$('#<?php echo $block->getHtmlId() ?>-mass-select')
.removeClass('_disabled')
.prop('disabled', false)
.change(function () {
var massAction = $('option:selected', this).val();
this.blur();
switch (massAction) {
<?php if ($block->getUseSelectAll()):?>
case 'selectAll':
Expand All @@ -88,7 +93,6 @@
return <?php /* @escapeNotVerified */ echo $block->getJsObjectName() ?>.unselectVisible();
break;
}
this.blur();
});
});
<?php if (!$block->getParentBlock()->canDisplayContainer()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,59 +21,28 @@
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
<item name="update_url" xsi:type="url" path="mui/index/render"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
<container name="listing_top">
<listingToolbar name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">ui/grid/toolbar</item>
<item name="sticky" xsi:type="boolean">true</item>
</item>
</argument>
<bookmark name="bookmarks">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="namespace" xsi:type="string">product_listing</item>
</item>
</item>
</argument>
</bookmark>
<component name="columns_controls">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
<item name="displayArea" xsi:type="string">dataGridActions</item>
<item name="columnsData" xsi:type="array">
<item name="provider" xsi:type="string">product_listing.product_listing.product_columns</item>
</item>
</item>
</argument>
</component>
<bookmark name="bookmarks"/>
<columnsControls name="columns_controls"/>
<filters name="listing_filters">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsProvider" xsi:type="string">product_listing.product_listing.product_columns</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">product_listing.product_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
</item>
</argument>
<filterSelect name="store_id">
<argument name="optionsProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">Magento\Store\Ui\Component\Listing\Column\Store\Options</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="provider" xsi:type="string">product_listing.product_listing.listing_top.listing_filters</item>
<item name="provider" xsi:type="string">${ $.parentName }</item>
<item name="dataScope" xsi:type="string">store_id</item>
<item name="caption" xsi:type="string" translate="true">All Store Views</item>
<item name="label" xsi:type="string" translate="true">Store View</item>
Expand All @@ -84,9 +53,7 @@
<massaction name="listing_massaction">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">product_listing.product_listing.product_columns.ids</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/tree-massactions</item>
<item name="indexField" xsi:type="string">entity_id</item>
</item>
</argument>
<action name="delete">
Expand Down Expand Up @@ -136,25 +103,11 @@
</argument>
</action>
</massaction>
<paging name="listing_paging">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">product_listing.product_listing.product_columns.ids</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">product_listing.product_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
</item>
</argument>
</paging>
</container>
<paging name="listing_paging"/>
</listingToolbar>
<columns name="product_columns" class="Magento\Catalog\Ui\Component\Listing\Columns">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">product_listing.product_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">product_listing.product_listing.product_columns.actions</item>
Expand All @@ -164,11 +117,6 @@
<item name="1" xsi:type="string">${ $.$data.rowIndex }</item>
</item>
</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">product_listing.product_listing.listing_top.bookmarks</item>
<item name="root" xsi:type="string">columns.${ $.index }</item>
<item name="namespace" xsi:type="string">current.${ $.storageConfig.root}</item>
</item>
</item>
</item>
</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@
</div>
</div>
</div>
<!--Fix for jumping content. Loader must be the same size as gallery.-->
<script type="text/javascript">
var config = {
"width": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_medium', 'width'); ?>,
"thumbheight": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'height')
?: $block->getImageAttribute('product_page_image_small', 'width'); ?>,
"navtype": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/navtype"); ?>",
"height": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_medium', 'height'); ?>
},
thumbBarHeight = 0,
loader = document.querySelectorAll('[data-gallery-role="gallery-placeholder"] [data-role="loader"]')[0];

if (config.navtype === 'horizontal') {
thumbBarHeight = config.thumbheight;
}

loader.style.paddingBottom = ( config.height / config.width * 100) + "%";
</script>
<script type="text/x-magento-init">
{
"[data-gallery-role=gallery-placeholder]": {
Expand Down
23 changes: 0 additions & 23 deletions app/code/Magento/CatalogImportExport/Model/Import/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,6 @@ protected function _saveProductAttributes(array $attributesData)
{
foreach ($attributesData as $tableName => $skuData) {
$tableData = [];
$where = [];
foreach ($skuData as $sku => $attributes) {
$productId = $this->skuProcessor->getNewSku($sku)['entity_id'];

Expand All @@ -1133,30 +1132,8 @@ protected function _saveProductAttributes(array $attributesData)
'value' => $storeValue,
];
}
/*
If the store based values are not provided for a particular store,
we default to the default scope values.
In this case, remove all the existing store based values stored in the table.
*/
$where[] = $this->_connection->quoteInto(
'(store_id NOT IN (?)',
array_keys($storeValues)
) . $this->_connection->quoteInto(
' AND attribute_id = ?',
$attributeId
) . $this->_connection->quoteInto(
' AND entity_id = ?)',
$productId
);
if (count($where) >= self::ATTRIBUTE_DELETE_BUNCH) {
$this->_connection->delete($tableName, implode(' OR ', $where));
$where = [];
}
}
}
if (!empty($where)) {
$this->_connection->delete($tableName, implode(' OR ', $where));
}
$this->_connection->insertOnDuplicate($tableName, $tableData, ['value']);
}
return $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,18 +504,6 @@ public function testSaveProductAttributes()
$this->_connection->expects($this->any())
->method('quoteInto')
->willReturnCallback([$this, 'returnQuoteCallback']);
$this->_connection
->expects($this->once())
->method('delete')
->with(
$this->equalTo($testTable),
$this->equalTo(
'(store_id NOT IN ('
. $storeId . ') AND attribute_id = '
. $attributeId . ' AND entity_id = '
. self::ENTITY_ID . ')'
)
);

$tableData[] = [
'entity_id' => self::ENTITY_ID,
Expand Down
4 changes: 4 additions & 0 deletions app/code/Magento/Checkout/Controller/Cart/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ class Delete extends \Magento\Checkout\Controller\Cart
*/
public function execute()
{
if (!$this->_formKeyValidator->validate($this->getRequest())) {
return $this->resultRedirectFactory->create()->setPath('*/*/');
}

$id = (int)$this->getRequest()->getParam('id');
if ($id) {
try {
Expand Down
12 changes: 12 additions & 0 deletions app/code/Magento/Checkout/Model/DefaultConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ public function getConfig()
$output['isCustomerLoginRequired'] = $this->isCustomerLoginRequired();
$output['registerUrl'] = $this->getRegisterUrl();
$output['checkoutUrl'] = $this->getCheckoutUrl();
$output['defaultSuccessPageUrl'] = $this->getDefaultSuccessPageUrl();
$output['pageNotFoundUrl'] = $this->pageNotFoundUrl();
$output['forgotPasswordUrl'] = $this->getForgotPasswordUrl();
$output['staticBaseUrl'] = $this->getStaticBaseUrl();
Expand Down Expand Up @@ -451,6 +452,17 @@ public function pageNotFoundUrl()
return $this->urlBuilder->getUrl('checkout/noroute');
}

/**
* Retrieve default success page URL
*
* @return string
* @codeCoverageIgnore
*/
public function getDefaultSuccessPageUrl()
{
return $this->urlBuilder->getUrl('checkout/onepage/success/');
}

/**
* Retrieve selected shipping method
*
Expand Down
7 changes: 0 additions & 7 deletions app/code/Magento/Checkout/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
<label>Allow Guest Checkout</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="customer_must_be_logged" translate="label" type="select" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Require Customer To Be Logged In To Checkout</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<depends>
<field id="guest_checkout">0</field>
</depends>
</field>
</group>
<group id="cart" translate="label" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Shopping Cart</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<item name="component" xsi:type="string">Magento_Checkout/js/view/authentication</item>
<item name="displayArea" xsi:type="string">authentication</item>
<item name="children" xsi:type="array">
<!--Additional authentication fields-->
<!--Additional authentication fields-->
<item name="errors" xsi:type="array">
<item name="sortOrder" xsi:type="string">0</item>
<item name="component" xsi:type="string">Magento_Checkout/js/view/authentication-messages</item>
Expand Down Expand Up @@ -167,7 +167,7 @@
<item name="children" xsi:type="array">
<!-- address-list-additional-addresses -->
</item>
</item>
</item>
<item name="before-shipping-method-form" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="displayArea" xsi:type="string">before-shipping-method-form</item>
Expand All @@ -184,7 +184,7 @@
</item>
<item name="displayArea" xsi:type="string">additional-fieldsets</item>
<item name="children" xsi:type="array">
<!-- The following items override configuration of corresponding address attributes -->
<!-- The following items override configuration of corresponding address attributes -->
<item name="region" xsi:type="array">
<!-- Make region attribute invisible on frontend. Corresponding input element is created by region_id field -->
<item name="visible" xsi:type="boolean">false</item>
Expand Down Expand Up @@ -310,6 +310,17 @@
<item name="1" xsi:type="string">checkout.steps.billing-step.payment.additional-payment-validators</item>
</item>
</item>
<item name="children" xsi:type="array">
<item name="before-place-order" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="displayArea" xsi:type="string">before-place-order</item>
<item name="dataScope" xsi:type="string">before-place-order</item>
<item name="provider" xsi:type="string">checkoutProvider</item>
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Magento_Checkout/payment/before-place-order</item>
</item>
</item>
</item>
</item>
<!-- merge your payment methods here -->
<item name="afterMethods" xsi:type="array">
Expand Down Expand Up @@ -433,4 +444,4 @@
</referenceContainer>
<referenceContainer name="page.messages" remove="true"/>
</body>
</page>
</page>
5 changes: 1 addition & 4 deletions app/code/Magento/Checkout/view/frontend/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ var config = {
checkoutData: 'Magento_Checkout/js/checkout-data',
proceedToCheckout: 'Magento_Checkout/js/proceed-to-checkout'
}
},
deps: [
"Magento_Checkout/js/checkout-loader"
]
}
};
Loading

0 comments on commit 76a5545

Please sign in to comment.