Enable 'prefer-spread' in .eslintrc
Change-Id: I5e310b4d368e6c9806baa206bfed1a379fe0a3b0
This commit is contained in:
parent
1422584312
commit
1b5f22df05
|
@ -144,7 +144,7 @@
|
|||
object-shorthand: 0
|
||||
prefer-arrow-callback: 0
|
||||
prefer-const: 0
|
||||
prefer-spread: 0
|
||||
prefer-spread: 2
|
||||
prefer-template: 0
|
||||
|
||||
# react
|
||||
|
|
|
@ -71,7 +71,7 @@ define([
|
|||
|
||||
args.unshift(this.models);
|
||||
|
||||
return _[method].apply(_, args);
|
||||
return _[method](...args);
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -676,8 +676,8 @@ define([
|
|||
}, this);
|
||||
return _.isEmpty(errors) ? null : errors;
|
||||
},
|
||||
makePath: function() {
|
||||
return _.toArray(arguments).join('.');
|
||||
makePath: function(...args) {
|
||||
return args.join('.');
|
||||
},
|
||||
getValueAttribute: function(settingName) {
|
||||
return settingName == 'metadata' ? 'enabled' : 'value';
|
||||
|
@ -1259,8 +1259,8 @@ define([
|
|||
}, this);
|
||||
return _.isEmpty(errors) ? null : errors;
|
||||
},
|
||||
makePath: function() {
|
||||
return _.toArray(arguments).join('.');
|
||||
makePath: function(...args) {
|
||||
return args.join('.');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -90,11 +90,10 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, componentMixins
|
|||
{url: 'healthcheck', tab: HealthCheckTab}
|
||||
];
|
||||
},
|
||||
fetchData: function(id, activeTab) {
|
||||
fetchData: function(id, activeTab, ...tabOptions) {
|
||||
var cluster, promise, currentClusterId;
|
||||
var nodeNetworkGroups = app.nodeNetworkGroups;
|
||||
var tab = _.find(this.getTabs(), {url: activeTab}).tab,
|
||||
tabOptions = _.toArray(arguments).slice(2);
|
||||
var tab = _.find(this.getTabs(), {url: activeTab}).tab;
|
||||
try {
|
||||
currentClusterId = app.page.props.cluster.id;
|
||||
} catch (ignore) {}
|
||||
|
@ -192,7 +191,7 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, componentMixins
|
|||
requests.push(task.destroy({silent: true}));
|
||||
}
|
||||
}, this);
|
||||
return $.when.apply($, requests);
|
||||
return $.when(...requests);
|
||||
},
|
||||
shouldDataBeFetched: function() {
|
||||
return this.props.cluster.task({group: ['deployment', 'network'], active: true});
|
||||
|
|
|
@ -171,7 +171,7 @@ function($, _, i18n, Backbone, React, models, utils, componentMixins, controls)
|
|||
if (oldTestruns.length) {
|
||||
requests.push(Backbone.sync('update', oldTestruns));
|
||||
}
|
||||
$.when.apply($, requests)
|
||||
$.when(...requests)
|
||||
.done(_.bind(function() {
|
||||
this.startPolling(true);
|
||||
}, this))
|
||||
|
|
|
@ -45,7 +45,7 @@ function($, _, i18n, Backbone, React, utils, models, ComponentMixins, controls)
|
|||
|
||||
var volumes = new models.Volumes();
|
||||
volumes.url = _.result(nodes.at(0), 'url') + '/volumes';
|
||||
return $.when.apply($, nodes.map(function(node) {
|
||||
return $.when(...nodes.map(function(node) {
|
||||
node.disks = new models.Disks();
|
||||
return node.disks.fetch({url: _.result(node, 'url') + '/disks'});
|
||||
}, this).concat(volumes.fetch()))
|
||||
|
@ -96,7 +96,7 @@ function($, _, i18n, Backbone, React, utils, models, ComponentMixins, controls)
|
|||
if (!this.isSavingPossible()) return $.Deferred().reject();
|
||||
|
||||
this.setState({actionInProgress: true});
|
||||
return $.when.apply($, this.props.nodes.map(function(node) {
|
||||
return $.when(...this.props.nodes.map(function(node) {
|
||||
node.disks.each(function(disk, index) {
|
||||
disk.set({volumes: new models.Volumes(this.props.disks.at(index).get('volumes').toJSON())});
|
||||
}, this);
|
||||
|
|
|
@ -53,7 +53,7 @@ function($, _, Backbone, React, i18n, utils, models, dispatcher, dialogs, contro
|
|||
var networkConfiguration = cluster.get('networkConfiguration'),
|
||||
networksMetadata = new models.ReleaseNetworkProperties();
|
||||
|
||||
return $.when.apply($, nodes.map(function(node) {
|
||||
return $.when(...nodes.map(function(node) {
|
||||
node.interfaces = new models.Interfaces();
|
||||
return node.interfaces.fetch({
|
||||
url: _.result(node, 'url') + '/interfaces',
|
||||
|
@ -186,7 +186,7 @@ function($, _, Backbone, React, i18n, utils, models, dispatcher, dialogs, contro
|
|||
});
|
||||
});
|
||||
this.setState({actionInProgress: true});
|
||||
return $.when.apply($, nodes.map(function(node) {
|
||||
return $.when(...nodes.map(function(node) {
|
||||
var oldNodeBonds, nodeBonds;
|
||||
// removing previously configured bonds
|
||||
oldNodeBonds = node.interfaces.filter(function(ifc) {return ifc.isBond();});
|
||||
|
@ -607,7 +607,7 @@ function($, _, Backbone, React, i18n, utils, models, dispatcher, dialogs, contro
|
|||
return result.concat(modeSet.values);
|
||||
}, [], this));
|
||||
}, this);
|
||||
return _.intersection.apply(_, availableModes);
|
||||
return _.intersection(...availableModes);
|
||||
},
|
||||
getBondPropertyValues: function(propertyName, value) {
|
||||
var bondType = this.props.bondType;
|
||||
|
|
|
@ -124,7 +124,7 @@ function($, _, i18n, React, models, utils, dispatcher, componentMixins, CreateCl
|
|||
}, this));
|
||||
requests.push(request);
|
||||
}
|
||||
return $.when.apply($, requests);
|
||||
return $.when(...requests);
|
||||
},
|
||||
render: function() {
|
||||
var cluster = this.props.cluster;
|
||||
|
|
Loading…
Reference in New Issue