Skip to content

Commit 4826fac

Browse files
committed
MAGETWO-67341: Merge branch 'MAGETWO-67342' of github.com:magento-folks/magento2ce into MAGETWO-67341-PR-9062
Conflicts: package.json.sample
2 parents f3adc5d + aa1e604 commit 4826fac

File tree

37 files changed

+142
-131
lines changed

37 files changed

+142
-131
lines changed

app/code/Magento/Bundle/view/base/web/js/price-bundle.js

-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ define([
239239

240240
switch (optionType) {
241241
case 'radio':
242-
243242
case 'select-one':
244243

245244
if (optionType === 'radio' && !element.is(':checked')) {

app/code/Magento/Catalog/view/base/web/js/price-box.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ define([
3838
* Widget creating.
3939
*/
4040
_create: function createPriceBox() {
41-
this.cache = {};
4241
var box = this.element;
4342

43+
this.cache = {};
4444
this._setDefaultsFromPriceConfig();
4545
this._setDefaultsFromDataSet();
4646

app/code/Magento/Catalog/view/base/web/js/price-options.js

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ define([
4343

4444
switch (optionType) {
4545
case 'text':
46-
4746
case 'textarea':
4847
changes[optionHash] = optionValue ? optionConfig.prices : {};
4948
break;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ define([
3232
}
3333
});
3434

35-
return !Boolean(this.validationErrors.length);
35+
return !this.validationErrors.length;
3636
}
3737
};
3838
});

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ define([
3232
}
3333
});
3434

35-
return !Boolean(this.validationErrors.length);
35+
return !this.validationErrors.length;
3636
}
3737
};
3838
});

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ define([
3131
}
3232
});
3333

34-
return !Boolean(this.validationErrors.length);
34+
return !this.validationErrors.length;
3535
}
3636
};
3737
});

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ define([
3131
}
3232
});
3333

34-
return !Boolean(this.validationErrors.length);
34+
return !this.validationErrors.length;
3535
}
3636
};
3737
});

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ define([
3838
}
3939
});
4040

41-
return !Boolean(this.validationErrors.length);
41+
return !this.validationErrors.length;
4242
}
4343
};
4444
});

app/code/Magento/PageCache/view/frontend/web/js/page-cache.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ define([
4141
* @param {jQuery} element - Comment holder
4242
*/
4343
(function lookup(element) {
44+
var iframeHostName;
45+
4446
// prevent cross origin iframe content reading
4547
if ($(element).prop('tagName') === 'IFRAME') {
46-
var iframeHostName = $('<a>').prop('href', $(element).prop('src'))
48+
iframeHostName = $('<a>').prop('href', $(element).prop('src'))
4749
.prop('hostname');
4850

4951
if (window.location.hostname !== iframeHostName) {

app/code/Magento/Theme/view/frontend/web/menu.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ define([
157157
//mainNav();
158158

159159
//run navigation with delays
160-
mainNav('nav', {
160+
window.mainNav('nav', {
161161
'show_delay': '100',
162162
'hide_delay': '100'
163163
});

app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ define([
118118
component: node.component
119119
});
120120
loaded.resolve(node, constr);
121-
}, function (err) {
121+
}, function () {
122122
consoleLogger.error('componentLoadingFail', {
123123
component: node.component
124124
});

app/code/Magento/Ui/view/base/web/js/form/components/button.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ define([
1010
'uiElement',
1111
'uiRegistry',
1212
'uiLayout',
13-
'mageUtils'
14-
], function (Element, registry, layout, utils) {
13+
'mageUtils',
14+
'underscore'
15+
], function (Element, registry, layout, utils, _) {
1516
'use strict';
1617

1718
return Element.extend({

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

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
* See COPYING.txt for license details.
44
*/
55
define([
6-
'./column'
7-
], function (Column) {
6+
'./column',
7+
'underscore'
8+
], function (Column, _) {
89
'use strict';
910

1011
return Column.extend({
@@ -78,14 +79,14 @@ define([
7879
flatOptions: function (options) {
7980
var self = this;
8081

81-
return options.reduce(function (options, option) {
82+
return options.reduce(function (opts, option) {
8283
if (_.isArray(option.value)) {
83-
options = options.concat(self.flatOptions(option.value));
84+
opts = opts.concat(self.flatOptions(option.value));
8485
} else {
85-
options.push(option);
86+
opts.push(option);
8687
}
8788

88-
return options;
89+
return opts;
8990
}, []);
9091
},
9192

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

+4-8
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ define([
1313
'use strict';
1414

1515
return Column.extend({
16-
17-
/*eslint-disable eqeqeq*/
1816
/**
1917
* Retrieves label associated with a provided value.
2018
*
@@ -57,17 +55,15 @@ define([
5755
flatOptions: function (options) {
5856
var self = this;
5957

60-
return options.reduce(function (options, option) {
58+
return options.reduce(function (opts, option) {
6159
if (_.isArray(option.value)) {
62-
options = options.concat(self.flatOptions(option.value));
60+
opts = opts.concat(self.flatOptions(option.value));
6361
} else {
64-
options.push(option);
62+
opts.push(option);
6563
}
6664

67-
return options;
65+
return opts;
6866
}, []);
6967
}
70-
71-
/*eslint-enable eqeqeq*/
7268
});
7369
});

app/code/Magento/Ui/view/base/web/js/lib/core/events.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright © Magento, Inc. All rights reserved.
33
* See COPYING.txt for license details.
44
*/
5+
6+
/* global WeakMap, Map*/
57
define([
68
'ko',
79
'underscore',
@@ -34,7 +36,7 @@ define([
3436
*
3537
* @param {Object} obj - Key in the events weakmap.
3638
* @param {String} ns - Callback namespace.
37-
* @param {Fucntion} callback - Event callback.
39+
* @param {Function} callback - Event callback.
3840
* @param {String} name - Name of the event.
3941
*/
4042
function addHandler(obj, ns, callback, name) {
@@ -96,6 +98,7 @@ define([
9698
* Calls callback when name event is triggered.
9799
* @param {String} events
98100
* @param {Function} callback
101+
* @param {Function} ns
99102
* @return {Object} reference to this
100103
*/
101104
on: function (events, callback, ns) {

app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/bound-nodes.js

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* See COPYING.txt for license details.
44
*/
55

6+
/* global WeakMap */
67
define([
78
'ko',
89
'underscore',
@@ -87,6 +88,7 @@ define([
8788
* Returns node's first sibling of 'element' type within the common component scope
8889
*
8990
* @param {HTMLElement} node
91+
* @param {*} data
9092
* @returns {HTMLElement}
9193
*/
9294
function getElement(node, data) {
@@ -111,6 +113,8 @@ define([
111113
* to track nodes associated with model.
112114
*
113115
* @param {Function} orig - Original 'applyBindings' method.
116+
* @param {Object} ctx
117+
* @param {HTMLElement} node - Original 'applyBindings' method.
114118
*/
115119
applyBindings: function (orig, ctx, node) {
116120
var result = orig(),
@@ -136,6 +140,7 @@ define([
136140
* to track nodes associated with model.
137141
*
138142
* @param {Function} orig - Original 'cleanNode' method.
143+
* @param {HTMLElement} node - Original 'cleanNode' method.
139144
*/
140145
cleanNode: function (orig, node) {
141146
var result = orig(),

app/code/Magento/Ui/view/base/web/js/lib/knockout/template/engine.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ define([
6666
component: bindingContext.$data.name
6767
});
6868
source.nodes(rendered);
69-
}).fail(function (err) {
69+
}).fail(function () {
7070
consoleLogger.error('templateLoadingFail', {
7171
template: templateId,
7272
component: bindingContext.$data.name

app/code/Magento/Ui/view/base/web/js/lib/logger/logger-utils.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ define([], function () {
3434
promise.state() === 'pending' ?
3535
this.logger[levels.failed](messages.failed, config.data) :
3636
this.logger[levels.loaded](messages.loaded, config.data);
37-
}.bind(this), wait)
37+
}.bind(this), wait);
3838
};
3939

4040
/**
41-
* Method that creats object of messages
41+
* Method that creates object of messages
4242
* @param {String} requested - log message that showing that request for class is started
4343
* @param {String} loaded - log message that show when requested class is loaded
4444
* @param {String} failded - log message that show when requested class is failed
@@ -49,11 +49,11 @@ define([], function () {
4949
requested: requested || '',
5050
loaded: loaded || '',
5151
failed: failded || ''
52-
}
52+
};
5353
};
5454

5555
/**
56-
* Method that creats object of log levels
56+
* Method that creates object of log levels
5757
* @param {String} requested - log message that showing that request for class is started
5858
* @param {String} loaded - log message that show when requested class is loaded
5959
* @param {String} failded - log message that show when requested class is failed
@@ -64,7 +64,7 @@ define([], function () {
6464
requested: requested || 'info',
6565
loaded: loaded || 'info',
6666
failed: failded || 'warn'
67-
}
67+
};
6868
};
6969

7070
return LogUtils;

app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/**
77
* @api
88
*/
9+
/* global WeakMap */
910
define([
1011
'jquery',
1112
'underscore',

app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* See COPYING.txt for license details.
44
*/
55

6+
/* global WeakMap */
67
define([
78
'es6-collections'
89
], function () {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ define([
3131
}
3232
});
3333

34-
return !Boolean(this.validationErrors.length);
34+
return !this.validationErrors.length;
3535
}
3636
};
3737
});

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ define([
3333
}
3434
});
3535

36-
if (!Boolean(this.validationErrors.length)) {
36+
if (!this.validationErrors.length) {
3737
if (address['country_id'] == checkoutConfig.originCountryCode) { //eslint-disable-line eqeqeq
3838
return !utils.isEmpty(address.postcode);
3939
}

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns/expandable.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* See COPYING.txt for license details.
44
*/
55

6+
/* eslint-disable max-nested-callbacks */
67
define([
78
'Magento_Ui/js/grid/columns/expandable'
89
], function (Expandable) {

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/logger/logger.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ define([
138138
it('removes previously applied filter criteria', function () {
139139
var logger = createLogger(),
140140
criteria = function () {
141-
return false
141+
return false;
142142
};
143143

144144
spyOn(entryHandler, 'show');

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/timeline/timeline.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* See COPYING.txt for license details.
44
*/
55

6+
/* eslint-disable max-nested-callbacks */
67
define([
78
'Magento_Ui/js/timeline/timeline'
89
], function (Timeline) {

dev/tests/static/testsuite/Magento/Test/Js/_files/eslint/.eslintrc-magento

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"node": true
99
},
1010
"rules": {
11-
"consistent-return": 2,
1211
"eqeqeq": [2, "smart"],
1312
"guard-for-in": 2,
1413
"lines-around-comment": [
@@ -74,7 +73,7 @@
7473
"radix": 2,
7574
"semi": [2, "always"],
7675
"semi-spacing": 2,
77-
"strict": 2,
76+
"strict": ["error", "function"],
7877
"use-isnan": 2,
7978
"valid-typeof": 2,
8079
"vars-on-top": 2

dev/tools/grunt/tasks/static.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ module.exports = function (grunt) {
2020
var currentTarget = target || 'test',
2121
file = grunt.option('file'),
2222
tasks = [
23+
'continue:on',
2324
'eslint:' + currentTarget,
24-
'jscs:' + currentTarget
25+
'jscs:' + currentTarget,
26+
'continue:off',
27+
'continue:fail-on-warning'
2528
];
2629

2730
setConfig('eslint', currentTarget, cvf.getFiles(file));
2831
setConfig('jscs', currentTarget, cvf.getFiles(file));
29-
grunt.option('force', true);
3032
grunt.task.run(tasks);
3133

3234
if (!grunt.option('file')) {

0 commit comments

Comments
 (0)