Skip to content

Commit f6633d3

Browse files
author
Bohdan Korablov
committed
Merge remote-tracking branch 'mainlinec/develop' into new_pr_bugs
2 parents 363fa13 + 882be01 commit f6633d3

File tree

47 files changed

+970
-524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+970
-524
lines changed

app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset.phtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (!isset($advancedLabel)) {
2222
$advancedLabel = __('Additional Settings');
2323
}
2424

25-
$cssClass = ($isField) ? 'field ' . $element->getClass() : 'fieldset admin__fieldset ' . $element->getClass();
25+
$cssClass = ($isField) ? 'field ' . $element->getClass() : 'fieldset admin__fieldset' . $element->getClass();
2626

2727
if ($isField) {
2828
$count = $element->getCountBasicChildren();
@@ -91,11 +91,11 @@ if ($isField) {
9191

9292
<?php if ($element->hasAdvanced() && !$isField): ?>
9393
<?php echo(!$element->getNoContainer() && $advancedAfter) ? '</fieldset>' : ''?>
94-
<details data-mage-init='{"details": {}}' class="details" id="details<?php /* @escapeNotVerified */ echo $id ?>">
95-
<summary class="details-summary" id="details-summary<?php /* @escapeNotVerified */ echo $id ?>">
94+
<details data-mage-init='{"details": {}}' class="details admin__collapsible-block-wrapper" id="details<?php /* @escapeNotVerified */ echo $id ?>">
95+
<summary class="details-summary admin__collapsible-title" id="details-summary<?php /* @escapeNotVerified */ echo $id ?>">
9696
<span><?php /* @escapeNotVerified */ echo $advancedLabel ?></span>
9797
</summary>
98-
<div class="details-content" id="details-content<?php /* @escapeNotVerified */ echo $id ?>">
98+
<div class="details-content admin__fieldset" id="details-content<?php /* @escapeNotVerified */ echo $id ?>">
9999
<?php echo $element->getAdvancedChildrenHtml(); ?>
100100
</div>
101101
</details>

app/code/Magento/Bundle/view/base/templates/product/price/tier_prices.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $tierPriceModel = $block->getPrice();
1616
$tierPrices = $tierPriceModel->getTierPriceList();
1717
?>
1818
<?php if (count($tierPrices)) : ?>
19-
<ul class="<?php /* @escapeNotVerified */ echo($block->hasListClass() ? $block->getListClass() : 'prices tier items'); ?>">
19+
<ul class="<?php /* @escapeNotVerified */ echo($block->hasListClass() ? $block->getListClass() : 'prices-tier items'); ?>">
2020
<?php foreach ($tierPrices as $index => $price) : ?>
2121
<li class="item">
2222
<?php /* @escapeNotVerified */ echo __(

app/code/Magento/Catalog/view/adminhtml/web/product/product.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@
325325

326326
.admin__scope-old .tiers_table .col-qty span {
327327
font-size: 1rem;
328+
white-space: nowrap;
328329
}
329330

330331
.admin__scope-old .tiers_table .col-price .input-text {

app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,14 @@ define(
8181
var countryId = $('select[name="shippingAddress[country_id]"]').val();
8282
var validationResult = postcodeValidator.validate(postcodeElement.value(), countryId);
8383

84-
postcodeElement.error(null);
84+
postcodeElement.warn(null);
8585
if (!validationResult) {
86-
var errorMessage = $t('Invalid Zip/Postal code for current country!');
86+
var warnMessage = $t('Provided Zip/Postal Code seems to be invalid.');
8787
if (postcodeValidator.validatedPostCodeExample.length) {
88-
errorMessage += $t(' Example: ') + postcodeValidator.validatedPostCodeExample.join('; ');
88+
warnMessage += $t(' Example: ') + postcodeValidator.validatedPostCodeExample.join('; ') + '. ';
8989
}
90-
postcodeElement.error(errorMessage);
90+
warnMessage += $t('If you believe it is the right one you can ignore this notice.');
91+
postcodeElement.warn(warnMessage);
9192
}
9293
return validationResult;
9394
},

app/code/Magento/TaxImportExport/view/adminhtml/templates/importExport.phtml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
<?php if (!$block->getIsReadonly()): ?>
1212
<div class="import-tax-rates">
1313
<?php if ($block->getUseContainer()): ?>
14-
<form id="import-form" action="<?php /* @escapeNotVerified */ echo $block->getUrl('tax/rate/importPost') ?>" method="post" enctype="multipart/form-data">
14+
<form id="import-form" class="admin__fieldset" action="<?php /* @escapeNotVerified */ echo $block->getUrl('tax/rate/importPost') ?>" method="post" enctype="multipart/form-data">
1515
<?php endif; ?>
1616
<?php echo $block->getBlockHtml('formkey')?>
17-
<fieldset class="fieldset">
18-
<legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Import Tax Rates') ?></span></legend>
19-
<input type="file" name="import_rates_file" class="input-file required-entry"/>
20-
<?php echo $block->getButtonHtml('Import Tax Rates', '', 'import-submit') ?>
21-
</fieldset>
17+
<div class="fieldset admin__field">
18+
<label for="import_rates_file" class="admin__field-label"><span><?php /* @escapeNotVerified */ echo __('Import Tax Rates') ?></span></label>
19+
<div class="admin__field-control">
20+
<input type="file" id="import_rates_file" name="import_rates_file" class="input-file required-entry"/>
21+
<?php echo $block->getButtonHtml('Import Tax Rates', '', 'import-submit') ?>
22+
</div>
23+
</div>
2224
<?php if ($block->getUseContainer()): ?>
2325
</form>
2426
<?php endif; ?>
@@ -44,13 +46,15 @@ require(['jquery', "mage/mage", "loadingPopup"], function(jQuery){
4446
<?php endif; ?>
4547
<div class="export-tax-rates <?php if ($block->getIsReadonly()): ?>box-left<?php else: ?>box-right<?php endif; ?>">
4648
<?php if ($block->getUseContainer()): ?>
47-
<form id="export_form" action="<?php /* @escapeNotVerified */ echo $block->getUrl('tax/rate/exportPost') ?>" method="post" enctype="multipart/form-data">
49+
<form id="export_form" class="admin__fieldset" action="<?php /* @escapeNotVerified */ echo $block->getUrl('tax/rate/exportPost') ?>" method="post" enctype="multipart/form-data">
4850
<?php endif; ?>
4951
<?php echo $block->getBlockHtml('formkey')?>
50-
<fieldset class="fieldset">
51-
<legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Export Tax Rates') ?></span></legend>
52-
<?php echo $block->getButtonHtml('Export Tax Rates', "this.form.submit()") ?>
53-
</fieldset>
52+
<div class="fieldset admin__field">
53+
<span class="admin__field-label"><span><?php /* @escapeNotVerified */ echo __('Export Tax Rates') ?></span></span>
54+
<div class="admin__field-control">
55+
<?php echo $block->getButtonHtml('Export Tax Rates', "this.form.submit()") ?>
56+
</div>
57+
</div>
5458
<?php if ($block->getUseContainer()): ?>
5559
</form>
5660
<?php endif; ?>

app/code/Magento/Ui/view/base/web/js/form/element/abstract.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ define([
2525
description: '',
2626
label: '',
2727
error: '',
28+
warn: '',
2829
notice: '',
2930
customScope: '',
3031
additionalClasses: {},
@@ -64,7 +65,7 @@ define([
6465

6566
this._super();
6667

67-
this.observe('error disabled focused preview visible value')
68+
this.observe('error disabled focused preview visible value warn')
6869
.observe({
6970
'required': !!rules['required-entry']
7071
});
@@ -126,6 +127,7 @@ define([
126127
_.extend(this.additionalClasses, {
127128
required: this.required,
128129
_error: this.error,
130+
_warn: this.warn,
129131
_disabled: this.disabled
130132
});
131133

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
/**
2+
* Copyright © 2015 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
define([
6+
'underscore',
7+
'mage/translate',
8+
'./multiselect',
9+
'uiRegistry'
10+
], function (_, $t, Column, registry) {
11+
'use strict';
12+
13+
return Column.extend({
14+
defaults: {
15+
headerTmpl: 'ui/grid/columns/onoff',
16+
bodyTmpl: 'ui/grid/cells/onoff',
17+
imports: {
18+
selectedData: '${ $.provider }:data.selectedData'
19+
},
20+
listens: {
21+
'${ $.provider }:reloaded': 'setDefaultSelections'
22+
}
23+
},
24+
25+
/**
26+
* @param {Integer} id
27+
* @returns {*}
28+
*/
29+
getLabel: function (id) {
30+
return this.selected.indexOf(id) !== -1 ? $t('On') : $t('Off');
31+
},
32+
33+
/**
34+
* Initializes components' static properties.
35+
*
36+
* @returns {Column} Chainable.
37+
*/
38+
initProperties: function () {
39+
this.actions = [{
40+
value: 'selectPage',
41+
label: $t('Select all on this page')
42+
}, {
43+
value: 'deselectPage',
44+
label: $t('Deselect all on this page')
45+
}];
46+
47+
return this._super();
48+
},
49+
50+
/**
51+
* Sets the ids for preselected elements
52+
* @returns void
53+
*/
54+
setDefaultSelections: function () {
55+
var positionCacheValid = registry.get('position_cache_valid'),
56+
key,
57+
i;
58+
59+
registry.set('position_cache_valid', true);
60+
61+
if (this.selected().length === this.selectedData.length || positionCacheValid) {
62+
return;
63+
}
64+
// Check selected data
65+
for (key in this.selectedData) {
66+
if (this.selectedData.hasOwnProperty(key) && this.selected().indexOf(key) === -1) {
67+
this.selected.push(key);
68+
}
69+
}
70+
// Uncheck unselected data
71+
for (i = 0; i < this.selected().length; i++) {
72+
key = this.selected()[i];
73+
this.selectedData.hasOwnProperty(key) || this.selected.splice(this.selected().indexOf(key), 1);
74+
}
75+
},
76+
77+
/**
78+
* Show/hide action in the massaction menu
79+
* @param {Integer} actionId
80+
* @returns {Boolean}
81+
*/
82+
isActionRelevant: function (actionId) {
83+
var relevant = true;
84+
85+
switch (actionId) {
86+
case 'selectPage':
87+
relevant = !this.isPageSelected(true);
88+
break;
89+
90+
case 'deselectPage':
91+
relevant = this.isPageSelected();
92+
break;
93+
}
94+
95+
return relevant;
96+
},
97+
98+
/**
99+
* Updates values of the 'allSelected'
100+
* and 'indetermine' properties.
101+
*
102+
* @returns {Multiselect} Chainable.
103+
*/
104+
updateState: function () {
105+
var totalRecords = this.totalRecords(),
106+
selected = this.selected().length,
107+
excluded = this.excluded().length,
108+
totalSelected = this.totalSelected(),
109+
allSelected;
110+
111+
// When filters are enabled then totalRecords is unknown
112+
if (this.getFiltering()) {
113+
if (this.getFiltering().search !== '') {
114+
totalRecords = -1;
115+
}
116+
}
117+
118+
allSelected = totalRecords && totalSelected === totalRecords;
119+
120+
if (this.excludeMode()) {
121+
if (excluded === totalRecords) {
122+
this.deselectAll();
123+
}
124+
} else if (totalRecords && selected === totalRecords) {
125+
this.selectAll();
126+
}
127+
128+
this.allSelected(allSelected);
129+
this.indetermine(totalSelected && !allSelected);
130+
131+
return this;
132+
}
133+
});
134+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!--
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
8+
<td class="data-grid-onoff-cell admin__scope-old">
9+
<div class="switcher">
10+
<input
11+
class="admin__control-onoff"
12+
type="checkbox"
13+
data-bind="checked: selected,
14+
value: row[indexField],
15+
attr: {id: 'check' + row[indexField]}">
16+
<label class="switcher-label" data-bind="attr: {for: 'check' + row[indexField]}, text: getLabel(row[indexField])"></label>
17+
</div>
18+
</td>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!--
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
8+
<th class="data-grid-multicheck-cell">
9+
<label data-bind="i18n: 'Assign'"></label>
10+
<div
11+
class="action-multicheck-wrap"
12+
style="width: 3.3rem"
13+
data-bind="css: { '_active': menuVisible, '_disabled': !totalRecords()},
14+
outerClick: hideMenu">
15+
<input
16+
id="mass-select-checkbox"
17+
class="admin__control-checkbox"
18+
type="checkbox"
19+
data-bind="checked: allSelected,
20+
event: { change: toggleSelectAll },
21+
css: { '_indeterminate': indetermine },
22+
enable: totalRecords">
23+
<label for="mass-select-checkbox" class="data-grid-onoff-label">
24+
<span data-bind="i18n: 'Select all'"></span>
25+
</label>
26+
<button
27+
class="action-multicheck-toggle"
28+
data-toggle="dropdown"
29+
data-bind="css: { '_active': menuVisible },
30+
click: toggleMenu,
31+
enable: totalRecords">
32+
<span data-bind="i18n: 'Options'"></span>
33+
</button>
34+
<ul
35+
class="action-menu"
36+
data-bind="click: hideMenu, foreach: actions">
37+
<li data-bind="click: $parent[value].bind($parent),
38+
visible: $parent.isActionRelevant(value)">
39+
<span class="action-menu-item" data-bind="text: label"></span>
40+
</li>
41+
</ul>
42+
</div>
43+
</th>

app/code/Magento/Ui/view/frontend/web/templates/form/field.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
<!-- ko if: element.error() -->
4343
<div class="mage-error" data-bind="attr: { for: element.uid }, text: element.error" generated="true"></div>
4444
<!-- /ko -->
45+
46+
<!-- ko if: element.warn() -->
47+
<div class="message warning" generated="true"><span data-bind="text: element.warn"></span></div>
48+
<!-- /ko -->
4549
</div>
4650
</div>
4751
<!-- /ko -->

0 commit comments

Comments
 (0)