Skip to content

Commit adc0786

Browse files
author
Korshenko, Olexii(okorshenko)
committed
Merge pull request #55 from magento-troll/MAGETWO-44464
[Troll] UI/grid fixes
2 parents fd7abdf + 77c35b5 commit adc0786

File tree

5 files changed

+148
-91
lines changed

5 files changed

+148
-91
lines changed

app/code/Magento/Ui/view/base/web/js/grid/columns/onoff.js

+5-21
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,13 @@ define([
2828
},
2929

3030
/**
31-
* @param {Integer} id
31+
* @param {Number} id
3232
* @returns {*}
3333
*/
3434
getLabel: function (id) {
3535
return this.selected.indexOf(id) !== -1 ? $t('On') : $t('Off');
3636
},
3737

38-
/**
39-
* Initializes components' static properties.
40-
*
41-
* @returns {Column} Chainable.
42-
*/
43-
initProperties: function () {
44-
this.actions = [{
45-
value: 'selectPage',
46-
label: $t('Select all on this page')
47-
}, {
48-
value: 'deselectPage',
49-
label: $t('Deselect all on this page')
50-
}];
51-
52-
return this._super();
53-
},
54-
5538
/**
5639
* Sets the ids for preselected elements
5740
* @returns void
@@ -63,7 +46,7 @@ define([
6346

6447
registry.set('position_cache_valid', true);
6548

66-
if (this.selected().length === this.selectedData.length || positionCacheValid) {
49+
if (this.selectedData.length === 0 || positionCacheValid) {
6750
return;
6851
}
6952
// Check selected data
@@ -76,12 +59,13 @@ define([
7659
for (i = 0; i < this.selected().length; i++) {
7760
key = this.selected()[i];
7861
this.selectedData.hasOwnProperty(key) || this.selected.splice(this.selected().indexOf(key), 1);
62+
this.selectedData.hasOwnProperty(key) || i--;
7963
}
8064
},
8165

8266
/**
8367
* Show/hide action in the massaction menu
84-
* @param {Integer} actionId
68+
* @param {Number} actionId
8569
* @returns {Boolean}
8670
*/
8771
isActionRelevant: function (actionId) {
@@ -104,7 +88,7 @@ define([
10488
* Updates values of the 'allSelected'
10589
* and 'indetermine' properties.
10690
*
107-
* @returns {Multiselect} Chainable.
91+
* @returns {Object} Chainable.
10892
*/
10993
updateState: function () {
11094
var totalRecords = this.totalRecords(),

app/code/Magento/Ui/view/base/web/templates/grid/columns/onoff.html

+14-16
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,29 @@
88
<th class="data-grid-multicheck-cell">
99
<label data-bind="i18n: 'Assign'"></label>
1010
<div
11-
class="action-multicheck-wrap"
12-
style="width: 3.3rem"
13-
data-bind="css: {'_disabled': !totalRecords()}, collapsible">
11+
class="action-multicheck-wrap"
12+
data-bind="css: {'_disabled': !totalRecords()},
13+
collapsible">
1414
<input
15-
id="mass-select-checkbox"
16-
class="admin__control-checkbox"
17-
type="checkbox"
18-
data-bind="checked: allSelected(),
15+
id="mass-select-checkbox"
16+
class="admin__control-checkbox"
17+
type="checkbox"
18+
data-bind="checked: allSelected(),
1919
event: { change: toggleSelectAll },
2020
css: { '_indeterminate': indetermine },
2121
enable: totalRecords">
22-
<label for="mass-select-checkbox" class="data-grid-onoff-label">
23-
<span data-bind="i18n: 'Select all'"></span>
24-
</label>
22+
<label for="mass-select-checkbox"></label>
2523
<button
26-
class="action-multicheck-toggle"
27-
data-toggle="dropdown"
28-
data-bind="css: { '_active': $collapsible.opened },
29-
enable: totalRecords
24+
class="action-multicheck-toggle"
25+
data-toggle="dropdown"
26+
data-bind="css: { '_active': $collapsible.opened },
27+
enable: totalRecords,
3028
toggleCollapsible">
3129
<span data-bind="i18n: 'Options'"></span>
3230
</button>
3331
<ul
34-
class="action-menu"
35-
data-bind="closeCollapsible, foreach: actions">
32+
class="action-menu"
33+
data-bind="closeCollapsible, foreach: actions">
3634
<li data-bind="click: $parent[value].bind($parent),
3735
visible: $parent.isActionRelevant(value)">
3836
<span class="action-menu-item" data-bind="text: label"></span>

app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/module.less renamed to app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less

+128-53
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22
// * Copyright © 2015 Magento. All rights reserved.
33
// * See COPYING.txt for license details.
44
// */
5-
#merchandiser-app {
6-
.merchandiser-toolbar {
7-
float: right;
8-
}
5+
6+
.merchandiser-app {
7+
&:extend(.abs-clearfix all);
98

109
ul.tabs {
1110
float: right;
1211
}
1312

14-
.clearfix {
15-
clear: both;
16-
}
17-
1813
#catalog_category_merchandiser {
1914
div.grid {
2015
padding: 0;
@@ -30,6 +25,7 @@
3025
}
3126

3227
.tabs {
28+
&:extend(.abs-clearfix all);
3329
list-style: none;
3430
overflow: hidden;
3531
li {
@@ -59,7 +55,7 @@
5955
height: 340px;
6056
float: left;
6157
border: 1px solid #7d7d7d;
62-
margin:0 25px 20px 0;
58+
margin: 0 25px 20px 0;
6359
padding: 10px;
6460
background-color: #fff;
6561
}
@@ -74,11 +70,11 @@
7470
a {
7571
text-decoration: none;
7672
color: #7d7d7d;
77-
float:left;
73+
float: left;
7874
display: inline-block;
7975
}
8076
a:last-child {
81-
float:right;
77+
float: right;
8278
}
8379
}
8480
.info-block {
@@ -92,7 +88,7 @@
9288
input {
9389
width: 50px;
9490
height: 25px;
95-
float:left;
91+
float: left;
9692
margin-right: 5px;
9793
}
9894
a {
@@ -110,22 +106,17 @@
110106
}
111107
}
112108

109+
.draggable-handle {
110+
&:extend(.abs-draggable-handle all);
111+
}
112+
113113
table.data-grid {
114114
th.col-draggable-position {
115115
width: 10px;
116116
margin: 0 auto 0 auto;
117117
}
118-
td.col-draggable-position span.draggable-handle {
119-
width: 8px;
120-
height: 14px;
121-
line-height: 14px;
122-
background: url(../Magento_Backend/images/draggable-handle-vertical.png) no-repeat 0 0;
123-
cursor: ns-resize;
124-
color: #b2b0ad;
125-
display: block;
126-
}
127118
td.col-position {
128-
>* {
119+
> * {
129120
float: left;
130121
margin-right: 5px;
131122
}
@@ -198,42 +189,18 @@
198189
display: none;
199190
}
200191

201-
.smart_category_table {
202-
width: 100%;
203-
border-collapse:collapse;
204-
margin-bottom: 5px;
205-
border-spacing:0 5px;
206-
overflow: auto;
207-
display:block;
208-
}
209-
210-
.smart_category_table tr:nth-of-type(odd) {
211-
background:#eee;
212-
}
213-
214-
.smart_category_table th {
215-
background: #333;
216-
color: white;
217-
font-weight: bold;
218-
}
219-
220-
.smart_category_table td, th {
221-
padding: 6px;
222-
border: 1px solid #ccc;
223-
text-align: left;
224-
}
225192
.smart_category {
226-
display:block;
227-
clear:both;
193+
display: block;
194+
clear: both;
228195
margin-bottom: 5px;
229196
}
230197

231198
.mode_select {
232-
float:right;
199+
float: right;
233200
}
234201

235202
.add_product_sku {
236-
float:left;
203+
float: left;
237204
display: block;
238205
margin: 5px;
239206
}
@@ -242,6 +209,11 @@
242209
display: block;
243210
margin: 5px;
244211
}
212+
213+
.automatic_sorting {
214+
margin-bottom: 5px;
215+
margin-top: 5px;
216+
}
245217
}
246218

247219
#catalog_category_add_product_tabs_content {
@@ -252,8 +224,8 @@
252224
}
253225
.data-grid-search-control-wrap {
254226
.massassign_textarea, .massassign_buttons, .massassign_messages {
255-
display:block;
256-
margin:5px;
227+
display: block;
228+
margin: 5px;
257229
}
258230
}
259231
}
@@ -265,7 +237,110 @@
265237
height: 340px;
266238
float: left;
267239
border: 1px solid #7d7d7d;
268-
margin:0 15px 15px 0;
240+
margin: 0 15px 15px 0;
269241
padding: 10px;
270242
}
271243
}
244+
245+
//
246+
// Merchandiser manage rools
247+
// ---------------------------------------------
248+
249+
.manage-rules-panel {
250+
box-sizing: border-box;
251+
margin: @indent__base 0 0;
252+
.message {
253+
margin: 0 0 @indent__base;
254+
}
255+
.admin__data-grid-wrap {
256+
padding-bottom: 0;
257+
}
258+
.smart-category-table {
259+
.action-delete {
260+
.action-icon();
261+
&:before {
262+
&:extend(.abs-icon all);
263+
content: @icon-delete__content;
264+
}
265+
> span {
266+
display: none;
267+
}
268+
}
269+
}
270+
.hidden {
271+
+ .action-secondary {
272+
margin-top: @indent__base;
273+
}
274+
}
275+
}
276+
277+
//
278+
// Merchandiser toolbar
279+
// ---------------------------------------------
280+
281+
.regular-category-settings {
282+
&:extend(.abs-clearfix all);
283+
margin: 0 0 @indent__base;
284+
.actions {
285+
float: right;
286+
}
287+
}
288+
289+
.merchandiser-toolbar {
290+
float: left;
291+
width: 80%;
292+
.admin__field {
293+
display: inline-block;
294+
margin-right: @indent__s;
295+
}
296+
}
297+
298+
.merchandiser-toolbar,
299+
.manage-rules-sorting {
300+
.admin__field {
301+
> .admin__field-label {
302+
margin-right: @indent__xs;
303+
text-align: left;
304+
span {
305+
white-space: nowrap;
306+
}
307+
}
308+
}
309+
}
310+
311+
//
312+
// Match products by rule switcher
313+
// ---------------------------------------------
314+
315+
// ToDo UI: refactor when refactoring yes/no switcher
316+
.smart-category-switcher {
317+
&:extend(.abs-clearfix all);
318+
margin: 0 0 @indent__base;
319+
.actions-switch {
320+
display: inline-block;
321+
margin-left: @indent__xs;
322+
vertical-align: top;
323+
.actions-switch-label {
324+
width: 35px;
325+
}
326+
.actions-switch-checkbox {
327+
position: absolute;
328+
z-index: -1;
329+
}
330+
}
331+
}
332+
333+
//
334+
// Merchandiser tabs
335+
// ---------------------------------------------
336+
337+
// ToDo UI: refactor merchant tabs
338+
.merchandiser-tabs {
339+
&:extend(.abs-clearfix all);
340+
border-top: 1px solid @color-gray80;
341+
padding: @indent__base 0 0;
342+
.merchandiser-tab {
343+
border-top: 0 !important;
344+
clear: both;
345+
}
346+
}

app/design/adminhtml/Magento/backend/web/css/source/_actions.less

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
@import 'actions/_actions-select.less';
1313
@import 'actions/_actions-multicheck.less';
1414
@import 'actions/_actions-multiselect.less';
15+
@import 'actions/_actions-switcher.less';
1516

1617
//
1718
// Extends

lib/web/css/source/components/_modals.less

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
bottom: 0;
4545
left: 0;
4646
min-width: 0;
47-
pointer-events: none;
4847
position: fixed;
4948
right: 0;
5049
top: 0;

0 commit comments

Comments
 (0)