Skip to content

Commit

Permalink
MAGETWO-67341: Merge branch 'MAGETWO-67342' of github.com:magento-fol…
Browse files Browse the repository at this point in the history
…ks/magento2ce into MAGETWO-67341-PR-9062

Conflicts:
	package.json.sample
  • Loading branch information
ishakhsuvarov committed Apr 12, 2017
2 parents f3adc5d + aa1e604 commit 4826fac
Show file tree
Hide file tree
Showing 37 changed files with 142 additions and 131 deletions.
1 change: 0 additions & 1 deletion app/code/Magento/Bundle/view/base/web/js/price-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ define([

switch (optionType) {
case 'radio':

case 'select-one':

if (optionType === 'radio' && !element.is(':checked')) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/view/base/web/js/price-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ define([
* Widget creating.
*/
_create: function createPriceBox() {
this.cache = {};
var box = this.element;

this.cache = {};
this._setDefaultsFromPriceConfig();
this._setDefaultsFromDataSet();

Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/Catalog/view/base/web/js/price-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ define([

switch (optionType) {
case 'text':

case 'textarea':
changes[optionHash] = optionValue ? optionConfig.prices : {};
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define([
}
});

return !Boolean(this.validationErrors.length);
return !this.validationErrors.length;
}
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define([
}
});

return !Boolean(this.validationErrors.length);
return !this.validationErrors.length;
}
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ define([
}
});

return !Boolean(this.validationErrors.length);
return !this.validationErrors.length;
}
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ define([
}
});

return !Boolean(this.validationErrors.length);
return !this.validationErrors.length;
}
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ define([
}
});

return !Boolean(this.validationErrors.length);
return !this.validationErrors.length;
}
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ define([
* @param {jQuery} element - Comment holder
*/
(function lookup(element) {
var iframeHostName;

// prevent cross origin iframe content reading
if ($(element).prop('tagName') === 'IFRAME') {
var iframeHostName = $('<a>').prop('href', $(element).prop('src'))
iframeHostName = $('<a>').prop('href', $(element).prop('src'))
.prop('hostname');

if (window.location.hostname !== iframeHostName) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Theme/view/frontend/web/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ define([
//mainNav();

//run navigation with delays
mainNav('nav', {
window.mainNav('nav', {
'show_delay': '100',
'hide_delay': '100'
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ define([
component: node.component
});
loaded.resolve(node, constr);
}, function (err) {
}, function () {
consoleLogger.error('componentLoadingFail', {
component: node.component
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ define([
'uiElement',
'uiRegistry',
'uiLayout',
'mageUtils'
], function (Element, registry, layout, utils) {
'mageUtils',
'underscore'
], function (Element, registry, layout, utils, _) {
'use strict';

return Element.extend({
Expand Down
13 changes: 7 additions & 6 deletions app/code/Magento/Ui/view/base/web/js/grid/columns/expandable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
* See COPYING.txt for license details.
*/
define([
'./column'
], function (Column) {
'./column',
'underscore'
], function (Column, _) {
'use strict';

return Column.extend({
Expand Down Expand Up @@ -78,14 +79,14 @@ define([
flatOptions: function (options) {
var self = this;

return options.reduce(function (options, option) {
return options.reduce(function (opts, option) {
if (_.isArray(option.value)) {
options = options.concat(self.flatOptions(option.value));
opts = opts.concat(self.flatOptions(option.value));
} else {
options.push(option);
opts.push(option);
}

return options;
return opts;
}, []);
},

Expand Down
12 changes: 4 additions & 8 deletions app/code/Magento/Ui/view/base/web/js/grid/columns/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ define([
'use strict';

return Column.extend({

/*eslint-disable eqeqeq*/
/**
* Retrieves label associated with a provided value.
*
Expand Down Expand Up @@ -57,17 +55,15 @@ define([
flatOptions: function (options) {
var self = this;

return options.reduce(function (options, option) {
return options.reduce(function (opts, option) {
if (_.isArray(option.value)) {
options = options.concat(self.flatOptions(option.value));
opts = opts.concat(self.flatOptions(option.value));
} else {
options.push(option);
opts.push(option);
}

return options;
return opts;
}, []);
}

/*eslint-enable eqeqeq*/
});
});
5 changes: 4 additions & 1 deletion app/code/Magento/Ui/view/base/web/js/lib/core/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/* global WeakMap, Map*/
define([
'ko',
'underscore',
Expand Down Expand Up @@ -34,7 +36,7 @@ define([
*
* @param {Object} obj - Key in the events weakmap.
* @param {String} ns - Callback namespace.
* @param {Fucntion} callback - Event callback.
* @param {Function} callback - Event callback.
* @param {String} name - Name of the event.
*/
function addHandler(obj, ns, callback, name) {
Expand Down Expand Up @@ -96,6 +98,7 @@ define([
* Calls callback when name event is triggered.
* @param {String} events
* @param {Function} callback
* @param {Function} ns
* @return {Object} reference to this
*/
on: function (events, callback, ns) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* See COPYING.txt for license details.
*/

/* global WeakMap */
define([
'ko',
'underscore',
Expand Down Expand Up @@ -87,6 +88,7 @@ define([
* Returns node's first sibling of 'element' type within the common component scope
*
* @param {HTMLElement} node
* @param {*} data
* @returns {HTMLElement}
*/
function getElement(node, data) {
Expand All @@ -111,6 +113,8 @@ define([
* to track nodes associated with model.
*
* @param {Function} orig - Original 'applyBindings' method.
* @param {Object} ctx
* @param {HTMLElement} node - Original 'applyBindings' method.
*/
applyBindings: function (orig, ctx, node) {
var result = orig(),
Expand All @@ -136,6 +140,7 @@ define([
* to track nodes associated with model.
*
* @param {Function} orig - Original 'cleanNode' method.
* @param {HTMLElement} node - Original 'cleanNode' method.
*/
cleanNode: function (orig, node) {
var result = orig(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ define([
component: bindingContext.$data.name
});
source.nodes(rendered);
}).fail(function (err) {
}).fail(function () {
consoleLogger.error('templateLoadingFail', {
template: templateId,
component: bindingContext.$data.name
Expand Down
10 changes: 5 additions & 5 deletions app/code/Magento/Ui/view/base/web/js/lib/logger/logger-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ define([], function () {
promise.state() === 'pending' ?
this.logger[levels.failed](messages.failed, config.data) :
this.logger[levels.loaded](messages.loaded, config.data);
}.bind(this), wait)
}.bind(this), wait);
};

/**
* Method that creats object of messages
* Method that creates object of messages
* @param {String} requested - log message that showing that request for class is started
* @param {String} loaded - log message that show when requested class is loaded
* @param {String} failded - log message that show when requested class is failed
Expand All @@ -49,11 +49,11 @@ define([], function () {
requested: requested || '',
loaded: loaded || '',
failed: failded || ''
}
};
};

/**
* Method that creats object of log levels
* Method that creates object of log levels
* @param {String} requested - log message that showing that request for class is started
* @param {String} loaded - log message that show when requested class is loaded
* @param {String} failded - log message that show when requested class is failed
Expand All @@ -64,7 +64,7 @@ define([], function () {
requested: requested || 'info',
loaded: loaded || 'info',
failed: failded || 'warn'
}
};
};

return LogUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/**
* @api
*/
/* global WeakMap */
define([
'jquery',
'underscore',
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* See COPYING.txt for license details.
*/

/* global WeakMap */
define([
'es6-collections'
], function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ define([
}
});

return !Boolean(this.validationErrors.length);
return !this.validationErrors.length;
}
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ define([
}
});

if (!Boolean(this.validationErrors.length)) {
if (!this.validationErrors.length) {
if (address['country_id'] == checkoutConfig.originCountryCode) { //eslint-disable-line eqeqeq
return !utils.isEmpty(address.postcode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* See COPYING.txt for license details.
*/

/* eslint-disable max-nested-callbacks */
define([
'Magento_Ui/js/grid/columns/expandable'
], function (Expandable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ define([
it('removes previously applied filter criteria', function () {
var logger = createLogger(),
criteria = function () {
return false
return false;
};

spyOn(entryHandler, 'show');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* See COPYING.txt for license details.
*/

/* eslint-disable max-nested-callbacks */
define([
'Magento_Ui/js/timeline/timeline'
], function (Timeline) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"node": true
},
"rules": {
"consistent-return": 2,
"eqeqeq": [2, "smart"],
"guard-for-in": 2,
"lines-around-comment": [
Expand Down Expand Up @@ -74,7 +73,7 @@
"radix": 2,
"semi": [2, "always"],
"semi-spacing": 2,
"strict": 2,
"strict": ["error", "function"],
"use-isnan": 2,
"valid-typeof": 2,
"vars-on-top": 2
Expand Down
6 changes: 4 additions & 2 deletions dev/tools/grunt/tasks/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ module.exports = function (grunt) {
var currentTarget = target || 'test',
file = grunt.option('file'),
tasks = [
'continue:on',
'eslint:' + currentTarget,
'jscs:' + currentTarget
'jscs:' + currentTarget,
'continue:off',
'continue:fail-on-warning'
];

setConfig('eslint', currentTarget, cvf.getFiles(file));
setConfig('jscs', currentTarget, cvf.getFiles(file));
grunt.option('force', true);
grunt.task.run(tasks);

if (!grunt.option('file')) {
Expand Down
Loading

0 comments on commit 4826fac

Please sign in to comment.