Skip to content

Commit

Permalink
Merge pull request #577 from mesosphere/refactor/clean-up-code
Browse files Browse the repository at this point in the history
Refactor - clean up code
  • Loading branch information
philipnrmn committed Jan 22, 2016
2 parents 4527b66 + 7122e42 commit dba4406
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 35 deletions.
10 changes: 6 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,28 @@
],

"rules": {
"no-unused-vars": [1],
"no-console": [1],
"eqeqeq": [2, "smart"],
"quotes": [2, "double"],
"indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": 1}],
"camelcase": [2, {"properties": "always"}],
"strict": [2, "never"], // <-- fix
"block-spacing": [1, "always"],
"block-spacing": [2, "always"],
"no-mixed-spaces-and-tabs": [2],
"no-trailing-spaces": [2, { "skipBlankLines": false }],
"no-underscore-dangle": 1,
"no-underscore-dangle": 2,
"no-multiple-empty-lines": [2, {"max": 1}],
"no-empty": [2],
"one-var": [1, "never"],
"one-var": [2, "never"],
"object-curly-spacing": [2, "never"],
"space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, {
"anonymous": "always", "named": "never"
}],
"spaced-comment": [2, "always", { "exceptions": ["*"]}],
"semi": [1, "always"],
"semi": [2, "always"],
"max-len": [2, 80, 4],
"valid-jsdoc": [2, {
"requireReturn": false,
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/AlertDialogComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var AlertDialogComponent = React.createClass({
return {
onAccept: Util.noop,
onDismiss: Util.noop
}
};
},

componentDidMount: function () {
Expand Down
5 changes: 0 additions & 5 deletions src/js/components/AppListItemLabelsComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import PopoverComponent from "./PopoverComponent";
import OnClickOutsideMixin from "react-onclickoutside";
import Util from "../helpers/Util";

// Keep track of post-render initial margin value, on a per-reactid basis
var _initialTopMargins = [];
// Keep track of reversed dropdown state without modifying the DOM
var _reversedDropdowns = [];

var AppListItemLabelsComponent = React.createClass({
displayName: "AppListItemLabelsComponent",

Expand Down
1 change: 0 additions & 1 deletion src/js/components/AppPageComponent.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react/addons";

import AppsActions from "../actions/AppsActions";
import AppsEvents from "../events/AppsEvents";
import AppsStore from "../stores/AppsStore";
import BreadcrumbComponent from "../components/BreadcrumbComponent";
Expand Down
3 changes: 1 addition & 2 deletions src/js/components/CenteredInlineDialogComponent.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import classNames from "classnames";
import React from "react/addons";
import {Link} from "react-router";

import Util from "../helpers/Util"
import Util from "../helpers/Util";

var CenteredInlineDialogComponent = React.createClass({
displayName: "CenteredInlineDialogComponent",
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/ConfirmDialoglComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var ConfirmDialogComponent = React.createClass({
return {
onAccept: Util.noop,
onDismiss: Util.noop
}
};
},

componentDidMount: function () {
Expand Down
6 changes: 0 additions & 6 deletions src/js/components/DeploymentsListComponent.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import classNames from "classnames";
import lazy from "lazy.js";
import {Link} from "react-router";
import React from "react/addons";

import Messages from "../constants/Messages";
Expand Down Expand Up @@ -119,11 +118,6 @@ var DeploymentListComponent = React.createClass({
state.deployments.length === 0 &&
state.fetchState !== States.STATE_UNAUTHORIZED &&
state.fetchState !== States.STATE_FORBIDDEN;
var pageHasGenericError = state.fetchState === States.STATE_ERROR;
var pageHasUnauthorizedError =
state.fetchState === States.STATE_UNAUTHORIZED;
var pageHasForbiddenError = state.fetchState === States.STATE_FORBIDDEN;
var pageHasErrorMessage = state.errorMessage !== "";

if (pageIsLoading) {
let message = "Please wait while deployments are being retrieved";
Expand Down
10 changes: 5 additions & 5 deletions src/js/components/Marathon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@ var Marathon = React.createClass({
},

startPolling: function () {
if (this._interval == null) {
if (this.interval == null) {
this.poll();
this._interval = setInterval(this.poll, config.updateInterval);
this.interval = setInterval(this.poll, config.updateInterval);
}
},

stopPolling: function () {
if (this._interval != null) {
clearInterval(this._interval);
this._interval = null;
if (this.interval != null) {
clearInterval(this.interval);
this.interval = null;
}
},

Expand Down
3 changes: 1 addition & 2 deletions src/js/components/PromptDialogComponent.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react/addons";
import classNames from "classnames";

import DialogSeverity from "../constants/DialogSeverity";
import Util from "../helpers/Util";
import ModalComponent from "../components/ModalComponent";

Expand All @@ -24,7 +23,7 @@ var PromptDialogComponent = React.createClass({
return {
onAccept: Util.noop,
onDismiss: Util.noop
}
};
},

componentDidMount: function () {
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/TaskDetailComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ var TaskDetailComponent = React.createClass({

var ipAddressFields = this.getIpAddresses();
if (ipAddressFields != null && ipAddressFields.length > 0) {
ipAddressFields.unshift(<dt key="ip-addresses">IP Addresses</dt>)
ipAddressFields.unshift(<dt key="ip-addresses">IP Addresses</dt>);
}

return (
Expand Down
1 change: 0 additions & 1 deletion src/js/components/TaskFileDownloadComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import classNames from "classnames";
import MesosActions from "../actions/MesosActions";
import MesosEvents from "../events/MesosEvents";
import MesosStore from "../stores/MesosStore";
import PopoverComponent from "../components/PopoverComponent";
import TooltipComponent from "../components/TooltipComponent";

var TaskFileDownloadComponent = React.createClass({
Expand Down
1 change: 0 additions & 1 deletion src/js/stores/DialogStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Util from "../helpers/Util";

import AppDispatcher from "../AppDispatcher";
import DialogEvents from "../events/DialogEvents";
import DialogTypes from "../constants/DialogTypes";

var dialogs = [];

Expand Down
10 changes: 5 additions & 5 deletions src/js/stores/MesosStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function getNodeURLFromState(nodeId, state) {
}

if (environment === DCOS_ENVIRONMENT) {
return `/slave/${nodeId}`
return `/slave/${nodeId}`;
}

let agent = state.slaves.find((slave) => {
Expand Down Expand Up @@ -126,9 +126,9 @@ function getExecutorDirectoryFromState(frameworkId, taskId, state) {
let framework = null;

if (state.frameworks != null) {
framework = state.frameworks.find(matchFramework)
framework = state.frameworks.find(matchFramework);
} else if (state.completed_frameworks != null) {
framework = state.completed_frameworks.find(matchFramework)
framework = state.completed_frameworks.find(matchFramework);
}

if (framework == null) {
Expand All @@ -142,9 +142,9 @@ function getExecutorDirectoryFromState(frameworkId, taskId, state) {
let executor = null;

if (framework.executors != null) {
executor = framework.executors.find(matchExecutor)
executor = framework.executors.find(matchExecutor);
} else if (framework.completed_executors != null) {
executor = framework.completed_executors.find(matchExecutor)
executor = framework.completed_executors.find(matchExecutor);
}

if (executor == null) {
Expand Down

0 comments on commit dba4406

Please sign in to comment.