Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3008 from hatched/update-eslint-4
Browse files Browse the repository at this point in the history
Update eslint to v4

- In eslint v4 they rewrote the `indent` rule to make it more strict and we had a _lot_ of improperly indented code.
- Indent changes were fixed with `--fix`
- `--cache` was removed from eslint command as it kept getting out of sync. It can probably be re-enabled in the future.
- I wasn't able to update eslint-react-plugin because of a bug when assigning props to another variable: `jsx-eslint/eslint-plugin-react#1257
  • Loading branch information
jujugui committed Jun 15, 2017
2 parents d700ec9 + ed2e846 commit bdc21d1
Show file tree
Hide file tree
Showing 203 changed files with 6,453 additions and 6,336 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -294,7 +294,7 @@ lint-python: $(FLAKE8)

.PHONY: lint-js
lint-js: $(NODE_MODULES)
$(NODE_MODULES)/.bin/eslint --cache --rulesdir eslint-rules/ $(GUISRC)
$(NODE_MODULES)/.bin/eslint --rulesdir eslint-rules/ $(GUISRC)

.PHONY: lint-css
lint-css: $(NODE_MODULES)
Expand Down
58 changes: 29 additions & 29 deletions jujugui/static/gui/src/app/app.js
Expand Up @@ -463,7 +463,7 @@ YUI.add('juju-gui', function(Y) {

// When the environment name becomes available, display it.
this.env.after('environmentNameChange',
this.onEnvironmentNameChange, this);
this.onEnvironmentNameChange, this);
this.env.after('defaultSeriesChange', this.onDefaultSeriesChange, this);

// Once we know about MAAS server, update the header accordingly.
Expand Down Expand Up @@ -523,20 +523,20 @@ YUI.add('juju-gui', function(Y) {
// up sometimes and this binding creates spooky interaction
// at a distance and strange failures.
this.db.machines.after(
['add', 'remove', '*:change'],
this.on_database_changed, this);
['add', 'remove', '*:change'],
this.on_database_changed, this);
this.db.services.after(
['add', 'remove', '*:change'],
this.on_database_changed, this);
['add', 'remove', '*:change'],
this.on_database_changed, this);
this.db.relations.after(
['add', 'remove', '*:change'],
this.on_database_changed, this);
['add', 'remove', '*:change'],
this.on_database_changed, this);
this.db.environment.after(
['add', 'remove', '*:change'],
this.on_database_changed, this);
['add', 'remove', '*:change'],
this.on_database_changed, this);
this.db.units.after(
['add', 'remove', '*:change'],
this.on_database_changed, this);
['add', 'remove', '*:change'],
this.on_database_changed, this);
this.db.notifications.after('add', this._renderNotifications, this);

// When someone wants a charm to be deployed they fire an event and we
Expand Down Expand Up @@ -730,16 +730,16 @@ YUI.add('juju-gui', function(Y) {
if ((
!creds.areAvailable && gisf && rootState === 'new'
) || (
this.anonymousMode && rootState !== 'login'
)) {
this.anonymousMode && rootState !== 'login'
)) {
this.anonymousMode = true;
console.log('now in anonymous mode');
this.maskVisibility(false);
return;
}
if (!creds.areAvailable ||
// When using direct deploy when a user is not logged in it will
// navigate to show the login if we do not have this state check.
// When using direct deploy when a user is not logged in it will
// navigate to show the login if we do not have this state check.
(currentState.special && currentState.special.dd)) {
this._displayLogin();
return;
Expand Down Expand Up @@ -856,7 +856,7 @@ YUI.add('juju-gui', function(Y) {
this.switchEnv(this.createSocketURL(
this.get('socketTemplate'),
this.get('modelUUID'), publicHost.value, publicHost.port), null,
null, null, true, false);
null, null, true, false);
});
},

Expand Down Expand Up @@ -885,7 +885,7 @@ YUI.add('juju-gui', function(Y) {
gisf={this.get('gisf')}
loginToAPIs={this.loginToAPIs.bind(this)}
loginToController={loginToController} />,
document.getElementById('login-container'));
document.getElementById('login-container'));
},

/**
Expand Down Expand Up @@ -951,7 +951,7 @@ YUI.add('juju-gui', function(Y) {
navigateUserAccount={navigateUserAccount}
navigateUserProfile={navigateUserProfile}
USSOLoginLink={USSOLoginLink}
/>, linkContainer);
/>, linkContainer);
},

/**
Expand Down Expand Up @@ -1222,7 +1222,7 @@ YUI.add('juju-gui', function(Y) {
gisf={gisf}
homePath={homePath}
showProfile={showProfile}
/>,
/>,
document.getElementById('header-logo'));
},

Expand Down Expand Up @@ -1308,7 +1308,7 @@ YUI.add('juju-gui', function(Y) {
createCardElement={
this.stripe && this.stripe.createCardElement.bind(this.stripe)}
createUser={
this.payment && this.payment.createUser.bind(this.payment)}
this.payment && this.payment.createUser.bind(this.payment)}
credential={env.get('credential')}
changes={currentChangeSet}
charmsGetById={db.charms.getById.bind(db.charms)}
Expand All @@ -1325,7 +1325,7 @@ YUI.add('juju-gui', function(Y) {
utils, env.genericConstraints, db.units)}
generatePath={this.state.generatePath.bind(this.state)}
getAgreementsByTerms={
this.terms.getAgreementsByTerms.bind(this.terms)}
this.terms.getAgreementsByTerms.bind(this.terms)}
isLoggedIn={isLoggedIn}
getCloudCredentials={
controllerAPI.getCloudCredentials.bind(controllerAPI)}
Expand All @@ -1334,7 +1334,7 @@ YUI.add('juju-gui', function(Y) {
getCloudProviderDetails={utils.getCloudProviderDetails.bind(utils)}
getCurrentChangeSet={ecs.getCurrentChangeSet.bind(ecs)}
getCountries={
this.payment && this.payment.getCountries.bind(this.payment)
this.payment && this.payment.getCountries.bind(this.payment)
|| null}
getDiagramURL={charmstore.getDiagramURL.bind(charmstore)}
getEntity={charmstore.getEntity.bind(charmstore)}
Expand Down Expand Up @@ -1532,7 +1532,7 @@ YUI.add('juju-gui', function(Y) {
_renderZoom: function() {
ReactDOM.render(
<window.juju.components.Zoom
topo={this.views.environment.instance.topo} />,
topo={this.views.environment.instance.topo} />,
document.getElementById('zoom-container'));
},

Expand Down Expand Up @@ -1699,10 +1699,10 @@ YUI.add('juju-gui', function(Y) {
series={utils.getSeriesList()}
upgradeServiceUsingLocalCharm={
localCharmHelpers.upgradeServiceUsingLocalCharm.bind(
this, model, db)}
this, model, db)}
uploadLocalCharm={
localCharmHelpers.uploadLocalCharm.bind(
this, model, db)}
this, model, db)}
/>
);
} else {
Expand Down Expand Up @@ -1762,7 +1762,7 @@ YUI.add('juju-gui', function(Y) {
deployTarget={this.deployTarget.bind(this, charmstore)}
series={utils.getSeriesList()}
importBundleYAML={this.bundleImporter.importBundleYAML.bind(
this.bundleImporter)}
this.bundleImporter)}
getBundleYAML={charmstore.getBundleYAML.bind(charmstore)}
getEntity={getEntity}
getFile={charmstore.getFile.bind(charmstore)}
Expand Down Expand Up @@ -1868,7 +1868,7 @@ YUI.add('juju-gui', function(Y) {
<window.juju.components.MachineView
acl={this.acl}
addGhostAndEcsUnits={utils.addGhostAndEcsUnits.bind(
this, this.db, this.env)}
this, this.db, this.env)}
autoPlaceUnits={this._autoPlaceUnits.bind(this)}
changeState={this.state.changeState.bind(this.state)}
createMachine={this._createMachine.bind(this)}
Expand Down Expand Up @@ -2110,7 +2110,7 @@ YUI.add('juju-gui', function(Y) {
next();
},

/**
/**
Ensures the controller is connected on dispatch. Does nothing if the
controller is already connecting/connected or if we're trying to disconnect.
@param {Object} state - The application state.
Expand All @@ -2120,7 +2120,7 @@ YUI.add('juju-gui', function(Y) {
if (
!this.controllerAPI.get('connecting') &&
!this.controllerAPI.get('connected')
) {
) {
this.controllerAPI.connect();
}
next();
Expand Down
Expand Up @@ -215,21 +215,21 @@ YUI.add('account-credentials', function() {
return (
<li className="user-profile__list-row twelve-col"
key={credential.id}>
<span className="six-col user-profile__list-col">
{credential.name}
</span>
<span className="four-col user-profile__list-col">
{title}
</span>
<span className="two-col last-col user-profile__list-col
<span className="six-col user-profile__list-col">
{credential.name}
</span>
<span className="four-col user-profile__list-col">
{title}
</span>
<span className="two-col last-col user-profile__list-col
no-margin-bottom">
<juju.components.GenericButton
action={
this._handleDeleteCredential.bind(this, credential.id)}
disabled={credential.cloud === LOCAL_CLOUD}
type="neutral"
title="Remove" />
</span>
<juju.components.GenericButton
action={
this._handleDeleteCredential.bind(this, credential.id)}
disabled={credential.cloud === LOCAL_CLOUD}
type="neutral"
title="Remove" />
</span>
</li>);
});
if (credentialsList.length > 0) {
Expand Down Expand Up @@ -322,14 +322,14 @@ YUI.add('account-credentials', function() {
content = (
<div>
{chooseCloud}
<juju.components.DeploymentCloud
acl={this.props.acl}
cloud={this.state.cloud}
controllerIsReady={this.props.controllerIsReady}
listClouds={this.props.listClouds}
getCloudProviderDetails={this.props.getCloudProviderDetails}
setCloud={this._setCloud} />
{addForm}
<juju.components.DeploymentCloud
acl={this.props.acl}
cloud={this.state.cloud}
controllerIsReady={this.props.controllerIsReady}
listClouds={this.props.listClouds}
getCloudProviderDetails={this.props.getCloudProviderDetails}
setCloud={this._setCloud} />
{addForm}
</div>);
}
return (
Expand Down
Expand Up @@ -238,22 +238,22 @@ describe('AccountCredentials', () => {
</li>,
<li className="user-profile__list-row twelve-col"
key="gce_spinach@external_test2">
<span className="six-col user-profile__list-col">
<span className="six-col user-profile__list-col">
test2
</span>
<span className="four-col user-profile__list-col">
</span>
<span className="four-col user-profile__list-col">
Google
</span>
<span className="two-col last-col user-profile__list-col
</span>
<span className="two-col last-col user-profile__list-col
no-margin-bottom">
<juju.components.GenericButton
action={
credentials[1].props.children[2].props.children
.props.action}
disabled={false}
type="neutral"
title="Remove" />
</span>
<juju.components.GenericButton
action={
credentials[1].props.children[2].props.children
.props.action}
disabled={false}
type="neutral"
title="Remove" />
</span>
</li>]}
</ul>
</div>);
Expand Down Expand Up @@ -511,22 +511,22 @@ describe('AccountCredentials', () => {
</li>
{[<li className="user-profile__list-row twelve-col"
key="gce_spinach@external_test2">
<span className="six-col user-profile__list-col">
<span className="six-col user-profile__list-col">
test2
</span>
<span className="four-col user-profile__list-col">
</span>
<span className="four-col user-profile__list-col">
Google
</span>
<span className="two-col last-col user-profile__list-col
</span>
<span className="two-col last-col user-profile__list-col
no-margin-bottom">
<juju.components.GenericButton
action={
credentials[0].props.children[2].props.children
.props.action}
disabled={false}
type="neutral"
title="Remove" />
</span>
<juju.components.GenericButton
action={
credentials[0].props.children[2].props.children
.props.action}
disabled={false}
type="neutral"
title="Remove" />
</span>
</li>]}
</ul>
</div>);
Expand Down Expand Up @@ -595,14 +595,14 @@ describe('AccountCredentials', () => {
<div className="twelve-col">
<div>
{null}
<juju.components.DeploymentCloud
acl={acl}
cloud={null}
controllerIsReady={controllerIsReady}
listClouds={listClouds}
getCloudProviderDetails={getCloudProviderDetails}
setCloud={instance._setCloud} />
{null}
<juju.components.DeploymentCloud
acl={acl}
cloud={null}
controllerIsReady={controllerIsReady}
listClouds={listClouds}
getCloudProviderDetails={getCloudProviderDetails}
setCloud={instance._setCloud} />
{null}
</div>
</div>
</juju.components.ExpandingRow>
Expand Down Expand Up @@ -650,7 +650,7 @@ describe('AccountCredentials', () => {
<juju.components.GenericButton
action={
output.props.children[1].props.children[1].props.children
.props.children[0].props.children.props.action}
.props.children[0].props.children.props.action}
type="inline-neutral"
title="Change cloud" />
</div>
Expand Down
Expand Up @@ -182,11 +182,11 @@ YUI.add('account-payment-charges', function() {
{(charge.price + charge.vat) / 100} {charge.currency}
</div>
<div className="two-col last-col no-margin-bottom">
<juju.components.GenericButton
action={this._togglePopup.bind(this, charge.id)}
disabled={false}
type="inline-neutral"
title="Show receipt" />
<juju.components.GenericButton
action={this._togglePopup.bind(this, charge.id)}
disabled={false}
type="inline-neutral"
title="Show receipt" />
</div>
</div>
<div className="twelve-col">
Expand Down
Expand Up @@ -39,7 +39,7 @@ describe('ReceiptPopup', function() {
getReceipt={sinon.stub()} />, true);
const output = renderer.getRenderOutput();
const expected = (
<juju.components.Spinner />);
<juju.components.Spinner />);
expect(output.props.children).toEqualJSX(expected);
});

Expand Down
Expand Up @@ -336,11 +336,11 @@ describe('AccountPaymentCharges', function() {
.props.children[5].props.children.props.action();
output = renderer.getRenderOutput();
const expected = (
<juju.components.ReceiptPopup
addNotification={addNotification}
close={instance._togglePopup}
chargeId="TEST-12344"
getReceipt={getReceipt} />);
<juju.components.ReceiptPopup
addNotification={addNotification}
close={instance._togglePopup}
chargeId="TEST-12344"
getReceipt={getReceipt} />);
expect(output.props.children.props.children[2]).toEqualJSX(expected);
});

Expand Down

0 comments on commit bdc21d1

Please sign in to comment.