Enforce semicolon insertion

Change-Id: Ic249f647fb6daa8740d57be805dc87438495e3ee
This commit is contained in:
Vitaly Kramskikh 2015-11-21 22:34:56 +07:00
parent 98ea103106
commit 0b5f934119
22 changed files with 44 additions and 36 deletions

View File

@ -119,7 +119,7 @@
quote-props: [2, as-needed]
quotes: [2, single, avoid-escape]
semi-spacing: [2, {before: false, after: true}]
semi: [0, always]
semi: [2, always]
space-after-keywords: [2, always]
space-before-blocks: [2, always]
space-before-function-paren: [2, never]

View File

@ -131,7 +131,7 @@ define(
<button
className='btn btn-link'
disabled={this.props.disabled}
onClick={_.bind(function() {this.props.onAdd(this.props.model)}, this)}
onClick={_.bind(function() {this.props.onAdd(this.props.model);}, this)}
>
<i className='glyphicon glyphicon-plus-sign' />
</button>
@ -139,7 +139,7 @@ define(
<button
className='btn btn-link'
disabled={this.props.disabled}
onClick={_.bind(function() {this.props.onRemove(this.props.model)}, this)}
onClick={_.bind(function() {this.props.onRemove(this.props.model);}, this)}
>
<i className='glyphicon glyphicon-minus-sign' />
</button>
@ -255,7 +255,7 @@ define(
&nbsp;
({node.get('mac')})
</li>
)
);
})
}
</ul>

View File

@ -75,9 +75,10 @@ define([
}
return matchFound;
}
)},
false
);
);
},
false
);
})
.then(function(result) {
if (!result) {

View File

@ -100,7 +100,8 @@ define([
function(name) {
return (name === clusterName) || matchFound;
}
)}, false);
);
}, false);
});
},
addNodesToCluster: function(nodesAmount, nodesRoles, nodeStatus, nodeNameFilter) {

View File

@ -38,7 +38,7 @@ define([
.then(function(currentIfcName) {
return _.trim(currentIfcName) == ifcName ? ifcElement : result;
});
})
});
}, null);
});
},
@ -83,7 +83,7 @@ define([
.getVisibleText()
.then(function(currentNetworkName) {
return currentNetworkName == networkName ? networkElement : result;
})
});
}, null);
})
.then(function(networkElement) {
@ -126,7 +126,7 @@ define([
var self = this;
return this.remote
.then(function() {
return self.findInterfaceElement(bondName)
return self.findInterfaceElement(bondName);
})
.then(function(bondElement) {
ifcsNames.push(bondName);

View File

@ -59,8 +59,8 @@ define([
.clickByCssSelector('.user-popover button.btn-logout')
.findByCssSelector('.login-btn')
.then(
function() {return true},
function() {return true}
function() {return true;},
function() {return true;}
);
}
};

View File

@ -30,11 +30,11 @@ define(['../../helpers'], function() {
.clickByCssSelector('.welcome-button-box button')
.waitForDeletedByCssSelector('.welcome-button-box button', 2000)
.then(
function() {return true},
function() {return !strictCheck}
function() {return true;},
function() {return !strictCheck;}
);
},
function() {return !strictCheck}
function() {return !strictCheck;}
);
}
};

View File

@ -58,7 +58,7 @@ define([
},
'No deployment button when there are no nodes added': function() {
return this.remote
.assertElementNotExists(dashboardPage.deployButtonSelector, 'No deployment should be possible without nodes added')
.assertElementNotExists(dashboardPage.deployButtonSelector, 'No deployment should be possible without nodes added');
},
'Discard changes': function() {
return this.remote

View File

@ -138,7 +138,7 @@ define([
})
.clickByCssSelector(networksPage.applyButtonSelector)
.assertElementsAppear('input:not(:disabled)', 2000, 'Inputs are not disabled')
.assertElementNotExists('.alert-error', 'Correct settings were saved successfully')
.assertElementNotExists('.alert-error', 'Correct settings were saved successfully');
},
'Testing cluster networks: save settings with group: network': function() {
return this.remote

View File

@ -132,6 +132,6 @@ define([
.assertElementDisabled('.btn-bond', 'Making sure bond button is disabled')
.assertElementContainsText('.alert.alert-warning', ' network interface is already bonded with other network inteface.', 'Warning message should appear when intended to bond bonds');
}
}
};
});
});

View File

@ -34,7 +34,7 @@ define([
return this.remote
.then(function() {
return common.getIn();
})
});
},
'Notification Page': function() {
return this.remote

View File

@ -70,7 +70,7 @@ define([
'All steps are available if no changes to restrictions are made')
.clickByCssSelector('input[type=checkbox]')
.assertElementExists('.wizard-step.available', 1,
'Only one step is available after changing hypervisor')
'Only one step is available after changing hypervisor');
}
};
});

View File

@ -64,7 +64,7 @@ define(function() {
},
saveMethod = sinon.spy(input, 'saveFile');
window.FileReader = function() {return readerObject};
window.FileReader = function() {return readerObject;};
sinon.stub(input, 'getInputDOMNode').returns({
value: '/dummy/path/to/somefile.ext',

View File

@ -49,8 +49,12 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, componentMixins
}),
componentMixins.dispatcherMixin('networkConfigurationUpdated', 'removeFinishedNetworkTasks'),
componentMixins.dispatcherMixin('deploymentTasksUpdated', 'removeFinishedDeploymentTasks'),
componentMixins.dispatcherMixin('deploymentTaskStarted', function() {this.refreshCluster().always(_.bind(this.startPolling, this))}),
componentMixins.dispatcherMixin('deploymentTaskFinished', function() {this.refreshCluster().always(_.bind(dispatcher.trigger, dispatcher, 'updateNotifications'))})
componentMixins.dispatcherMixin('deploymentTaskStarted', function() {
this.refreshCluster().always(this.startPolling);
}),
componentMixins.dispatcherMixin('deploymentTaskFinished', function() {
this.refreshCluster().always(() => dispatcher.trigger('updateNotifications'));
})
],
statics: {
navbarActiveElement: 'clusters',

View File

@ -101,7 +101,7 @@ function($, _, i18n, Backbone, React, models, utils, componentMixins, controls)
return {
actionInProgress: false,
credentialsVisible: null,
credentials: _.transform(this.props.cluster.get('settings').get('access'), function(result, value, key) {result[key] = value.value})
credentials: _.transform(this.props.cluster.get('settings').get('access'), function(result, value, key) {result[key] = value.value;})
};
},
isLocked: function() {

View File

@ -1060,7 +1060,7 @@ function($, _, i18n, Backbone, React, models, dispatcher, utils, dialogs, compon
isInvalid = networksErrors;
} else {
isInvalid = networksErrors &&
!!networksErrors[nodeNetworkGroups.findWhere({name: groupName}).id]
!!networksErrors[nodeNetworkGroups.findWhere({name: groupName}).id];
}
//FIXME(morale): this is a hack until default node network group
//name is capitalized on backend

View File

@ -238,8 +238,8 @@ function($, _, i18n, Backbone, React, utils, models, ComponentMixins, controls)
volumesInfo = this.props.volumesInfo,
diskMetaData = this.props.diskMetaData,
requiredDiskSize = _.sum(disk.get('volumes').map(function(volume) {
return volume.getMinimalSize(this.props.volumes.findWhere({name: volume.get('name')}).get('min_size'))
}, this)),
return volume.getMinimalSize(this.props.volumes.findWhere({name: volume.get('name')}).get('min_size'));
}, this)),
diskError = disk.get('size') < requiredDiskSize,
sortOrder = ['name', 'model', 'size'],
ns = 'cluster_page.nodes_tab.configure_disks.';

View File

@ -115,7 +115,7 @@ function($, _, Backbone, React, i18n, utils, models, dispatcher, dialogs, contro
if (ifc.isBond()) return null;
return firstNodeInterfaces.indexOf(
firstNodeInterfaces.findWhere({name: ifc.get('name')})
)
);
})
});
},

View File

@ -106,7 +106,7 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, controls, dialo
return {
sorters: [],
filters: []
}
};
},
getInitialState: function() {
var cluster = this.props.cluster,

View File

@ -39,7 +39,7 @@ function($, _, React, i18n, utils) {
},
setModeState: function(mode, state) {
mode.state = state;
_.each(mode.sub, function(mode) {this.setModeState(mode, state)}, this);
_.each(mode.sub, function(mode) {this.setModeState(mode, state);}, this);
},
checkModes: function(mode, sub) {
var changedState = sub.reduce(

View File

@ -628,7 +628,7 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, controls, compo
meta = node.get('meta');
if (!meta) return <controls.ProgressBar />;
var groupOrder = ['system', 'cpu', 'memory', 'disks', 'interfaces'],
groups = _.sortBy(_.keys(meta), function(group) {return _.indexOf(groupOrder, group)}),
groups = _.sortBy(_.keys(meta), (group) => _.indexOf(groupOrder, group)),
sortOrder = {
disks: ['name', 'model', 'size'],
interfaces: ['name', 'mac', 'state', 'ip', 'netmask', 'current_speed', 'max_speed', 'driver', 'bus_info']

View File

@ -72,7 +72,7 @@ function($, _, i18n, React, Backbone, utils, models, componentMixins, dialogs, c
_.map(warnings, function(warning) {
return (
<div key={warning}>{i18n(warning, this.props.wizard.translationParams)}</div>
)
);
}, this)
}
</div>
@ -170,7 +170,9 @@ function($, _, i18n, React, Backbone, utils, models, componentMixins, dialogs, c
if (!release.get('is_deployable')) {
return null;
}
return <option key={release.id} value={release.id}>{release.get('name')}</option>
return (
<option key={release.id} value={release.id}>{release.get('name')}</option>
);
})
}
</controls.Input>
@ -420,7 +422,7 @@ function($, _, i18n, React, Backbone, utils, models, componentMixins, dialogs, c
this.setState(newState);
},
getEnabledPanes: function() {
return _.filter(this.state.panes, function(pane) {return !pane.hidden});
return _.reject(this.state.panes, 'hidden');
},
getActivePane: function() {
var panes = this.getEnabledPanes();
@ -507,7 +509,7 @@ function($, _, i18n, React, Backbone, utils, models, componentMixins, dialogs, c
response: response,
title: i18n('dialog.create_cluster_wizard.create_cluster_error.title')
});
}, this))
}, this));
}, this))
.fail(_.bind(function(response) {
this.stopHandlingKeys = false;