Skip to content

Commit

Permalink
Merge pull request #580 from magento-vanilla/PR
Browse files Browse the repository at this point in the history
[Vanilla] Bugfixes
  • Loading branch information
Momotenko,Natalia(nmomotenko) committed May 6, 2016
2 parents 135f967 + d4fafab commit 4d71bb4
Show file tree
Hide file tree
Showing 47 changed files with 410 additions and 282 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@
* @see \Magento\AdminNotification\Block\Window
*/
?>
<div data-mage-init='{"modalPopup": {}}' class="fade critical-notification">
<div class="popup popup-<?php /* @escapeNotVerified */ echo preg_replace('#[^a-z0-9]+#', '-', strtolower($block->getSeverityText())) ?>">
<div class="popup-inner">
<div class="popup-header">
<div class="popup-title"><?php /* @escapeNotVerified */ echo $block->getHeaderText(); ?></div>
</div>
<div class="popup-content">
<span><?php /* @escapeNotVerified */ echo $block->getSeverityText();?></span>

<p class="message-text"><?php /* @escapeNotVerified */ echo $block->getNoticeMessageText(); ?></p>

<a href="<?php /* @escapeNotVerified */ echo $block->getNoticeMessageUrl(); ?>"><?php /* @escapeNotVerified */ echo $block->getReadDetailsText(); ?></a>
</div>
<span class="action close" data-dismiss="popup" title="<?php echo $block->escapeHtml(__('Close popup'));?>"><?php /* @escapeNotVerified */ echo __('Close'); ?></span>
</div>
</div>
</div>
<ul class="message-system-list"
style="display: none;"
data-mage-init='{
"Magento_Ui/js/modal/modal": {
"autoOpen": true,
"buttons": false,
"modalClass": "modal-system-messages",
"title": "<?php /* @escapeNotVerified */ echo $block->getHeaderText(); ?>"
}
}'>
<li class="message message-warning warning">
<?php /* @escapeNotVerified */ echo $block->getNoticeMessageText(); ?><br/>
<a href="<?php /* @escapeNotVerified */ echo $block->getNoticeMessageUrl(); ?>"><?php /* @escapeNotVerified */ echo $block->getReadDetailsText(); ?></a>
</li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<table class="admin__dynamic-rows data-grid" data-role="grid">
<thead if="element.columnsHeader">
<tr>
<th if="dndConfig.enabled"
<th if="$data.dndConfig.enabled"
class="data-grid-draggable-row-cell"/>

<th repeat="foreach: labels, item: '$label'"
Expand All @@ -67,7 +67,7 @@
class="data-grid-draggable-row-cell"
template="name: dndConfig.template, data: dnd"/>

<!-- ko fastForEach: { data: $record().elems, as: 'elem'} -->
<!-- ko foreach: { data: $record().elems(), as: 'elem'} -->
<td if="elem.template"
visible="elem.visible"
disable="elem.disabled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ protected function getBundleHeader()
[
'targetName' => 'product_form.product_form.'
. self::CODE_BUNDLE_DATA . '.' . self::CODE_BUNDLE_OPTIONS,
'actionName' => 'addChild',
'actionName' => 'processingAddChild',
]
],
],
Expand All @@ -272,7 +272,6 @@ protected function getBundleOptions()
'template' => 'ui/dynamic-rows/templates/collapsible',
'label' => '',
'additionalClasses' => 'admin__field-wide',
'itemTemplate' => 'record',
'collapsibleHeader' => true,
'columnsHeader' => false,
'deleteProperty' => false,
Expand Down Expand Up @@ -324,18 +323,23 @@ protected function getBundleOptions()
'additionalClasses' => 'admin__field-wide',
'component' => 'Magento_Ui/js/dynamic-rows/dynamic-rows-grid',
'template' => 'ui/dynamic-rows/templates/default',
'renderDefaultRecord' => true,
'columnsHeader' => false,
'columnsHeaderAfterRender' => true,
'recordTemplate' => 'record',
'provider' => 'product_form.product_form_data_source',
'dataProvider' => '${ $.dataScope }' . '.bundle_button_proxy',
'identificationDRProperty' => 'product_id',
'identificationProperty' => 'product_id',
'map' => [
'id' => 'entity_id',
'product_id' => 'entity_id',
'name' => 'name',
'sku' => 'sku',
'price' => 'price',
'delete' => '',
'selection_can_change_qty' => '',
'selection_id' => '',
'selection_price_type' => '',
'selection_price_value' => '',
'selection_qty' => '',
],
'links' => [
'insertData' => '${ $.provider }:${ $.dataProvider }'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public function modifyData(array $data)
'selection_can_change_qty' => $productLink->getCanChangeQuantity(),
'selection_qty_is_integer' => (bool)$integerQty,
'position' => $productLink->getPosition(),
'delete' => '',
];
}
$data[$modelId][BundlePanel::CODE_BUNDLE_OPTIONS][BundlePanel::CODE_BUNDLE_OPTIONS][] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,11 @@ protected function _getHtmlSelect($name, $value = null)
}
$extraParams .= ' data-role="calendar-dropdown" data-calendar-role="' . $name . '"';
$extraParams .= ' data-selector="' . $select->getName() . '"';
$select->setExtraParams($extraParams);
if ($this->getOption()->getIsRequire()) {
$extraParams .= ' data-validate=\'{"datetime-validation": true}\'';
}

$select->setExtraParams($extraParams);
if ($value === null) {
$value = $this->getProduct()->getPreconfiguredValues()->getData(
'options/' . $option->getId() . '/' . $name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ protected function getHeaderContainerConfig($sortOrder)
'actions' => [
[
'targetName' => 'ns = ${ $.ns }, index = ' . static::GRID_OPTIONS_NAME,
'actionName' => 'addChild',
'actionName' => 'processingAddChild',
]
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* See COPYING.txt for license details.
*/
define([
"jquery",
"Magento_Ui/js/lib/view/utils/async",
"jquery/ui",
"mage/translate",
"prototype",
Expand Down Expand Up @@ -45,16 +45,18 @@ define([
var self = this;

this._initWindowElements();
this.dialog = jQuery('#product_composite_configure').modal({
title: jQuery.mage.__('Configure Product'),
type: 'slide',
buttons: [{
text: jQuery.mage.__('OK'),
'class': 'action-primary',
click: function () {
self.onConfirmBtn();
}
}]
jQuery.async('#product_composite_configure',function (el) {
self.dialog = jQuery(el).modal({
title: jQuery.mage.__('Configure Product'),
type: 'slide',
buttons: [{
text: jQuery.mage.__('OK'),
'class': 'action-primary',
click: function () {
self.onConfirmBtn();
}
}]
});
});
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<?php if ($_option->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_DATE_TIME
|| $_option->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_TIME): ?>
<span class="time-picker"><?php echo $block->getTimeHtml() ?></span>
<?php echo $block->getTimeHtml() ?>
<?php endif; ?>

<?php if ($_option->getIsRequire()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,40 @@
(function (factory) {
if (typeof define === 'function' && define.amd) {
define([
"jquery",
"jquery/ui",
"mage/validation/validation"
'jquery',
'jquery/ui',
'mage/validation/validation'
], factory);
} else {
factory(jQuery);
}
}(function ($) {
"use strict";
'use strict';

$.widget("mage.validation", $.mage.validation, {
$.widget('mage.validation', $.mage.validation, {
options: {
radioCheckboxClosest: 'ul, ol',
errorPlacement: function (error, element) {
var messageBox,
dataValidate;

if ($(element).hasClass('datetime-picker')) {
element = $(element).parent();

if (element.parent().find('[generated=true].mage-error').length) {
return;
}
}

if (element.attr('data-errors-message-box')) {
var messageBox = $(element.attr('data-errors-message-box'));
messageBox = $(element.attr('data-errors-message-box'));
messageBox.html(error);

return;
}
var dataValidate = element.attr('data-validate');

dataValidate = element.attr('data-validate');

if (dataValidate && dataValidate.indexOf('validate-one-checkbox-required-by-name') > 0) {
error.appendTo('#links-advice-container');
} else if (element.is(':radio, :checkbox')) {
Expand All @@ -35,6 +49,7 @@
},
highlight: function (element, errorClass) {
var dataValidate = $(element).attr('data-validate');

if (dataValidate && dataValidate.indexOf('validate-required-datetime') > 0) {
$(element).parent().find('.datetime-picker').each(function() {
$(this).removeClass(errorClass);
Expand All @@ -50,6 +65,7 @@
},
unhighlight: function (element, errorClass) {
var dataValidate = $(element).attr('data-validate');

if (dataValidate && dataValidate.indexOf('validate-required-datetime') > 0) {
$(element).parent().find('.datetime-picker').removeClass(errorClass);
} else if ($(element).is(':radio, :checkbox')) {
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Customer/Block/Widget/Dob.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public function getLabel()
public function getFieldHtml()
{
$this->dateElement->setData([
'extra_params' => $this->isRequired() ? 'data-validate="{required:true}"' : '',
'name' => $this->getHtmlId(),
'id' => $this->getHtmlId(),
'class' => $this->getHtmlClass(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@
require([
"prototype",
"Magento_Sales/order/create/form",
"Magento_Catalog/catalog/product/composite/configure"
"Magento_Catalog/catalog/product/composite/configure",
"domReady!"
], function(){

order.sidebarHide();
Event.observe(window, 'load', function() {
if (window.productConfigure) {
productConfigure.addListType('product_to_add', {
urlFetch: '<?php /* @escapeNotVerified */ echo $block->getUrl('sales/order_create/configureProductToAdd') ?>'
});
productConfigure.addListType('quote_items', {
urlFetch: '<?php /* @escapeNotVerified */ echo $block->getUrl('sales/order_create/configureQuoteItems') ?>'
});
}
});
if (window.productConfigure) {
productConfigure.addListType('product_to_add', {
urlFetch: '<?php /* @escapeNotVerified */ echo $block->getUrl('sales/order_create/configureProductToAdd') ?>'
});
productConfigure.addListType('quote_items', {
urlFetch: '<?php /* @escapeNotVerified */ echo $block->getUrl('sales/order_create/configureQuoteItems') ?>'
});
}

});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Purchase Date</item>
<item name="dateFormat" xsi:type="string">MMM dd, YYYY, H:MM:SS A</item>
</item>
</argument>
</column>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<head>
<css src="Magento_Swatches::css/swatches.css"/>
<css src="jquery/colorpicker/css/colorpicker.css"/>
<link src="jquery/colorpicker/js/colorpicker.js"/>
</head>
<body>
<referenceContainer name="main">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<head>
<css src="Magento_Swatches::css/swatches.css"/>
<css src="jquery/colorpicker/css/colorpicker.css"/>
<link src="jquery/colorpicker/js/colorpicker.js"/>
</head>
<body>
<referenceContainer name="form">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
<head>
<css src="Magento_Swatches::css/swatches.css"/>
<css src="jquery/colorpicker/css/colorpicker.css"/>
<link src="jquery/colorpicker/js/colorpicker.js"/>
</head>
</page>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ define([
'uiRegistry',
'prototype',
'Magento_Ui/js/form/element/abstract',
'jquery/colorpicker/js/colorpicker',
'jquery/ui'
], function (_, jQuery, mageTemplate, rg, prototype, Abstract) {
'use strict';
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Swatches/view/adminhtml/web/js/visual.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ define([
'jquery',
'mage/template',
'uiRegistry',
'jquery/colorpicker/js/colorpicker',
'prototype',
'jquery/ui'
], function (jQuery, mageTemplate, rg) {
Expand Down
Loading

0 comments on commit 4d71bb4

Please sign in to comment.