From dfe4944ec73cc6d7e4862d3acfd0f741594ebd13 Mon Sep 17 00:00:00 2001 From: Filip Barl Date: Tue, 17 Oct 2017 11:14:39 +0200 Subject: [PATCH] Fixed indentation. --- client/.eslintrc | 17 +++++++++++++++++ client/app/scripts/actions/app-actions.js | 1 + client/app/scripts/charts/nodes-error.js | 7 ++++--- client/app/scripts/components/cloud-link.js | 2 +- client/app/scripts/components/node-details.js | 4 ++-- client/app/scripts/selectors/zooming.js | 6 +++--- client/app/scripts/utils/web-api-utils.js | 11 ++++++----- 7 files changed, 34 insertions(+), 14 deletions(-) diff --git a/client/.eslintrc b/client/.eslintrc index c6ed99ee7..8923c8db2 100644 --- a/client/.eslintrc +++ b/client/.eslintrc @@ -36,5 +36,22 @@ "react/prefer-stateless-function": 0, "react/sort-comp": 0, "react/prop-types": 0, + + "function-paren-newline": 0, + "jsx-a11y/anchor-is-valid": 0, + "jsx-a11y/click-events-have-key-events": 0, + "jsx-a11y/label-has-for": 0, + "jsx-a11y/mouse-events-have-key-events": 0, + "jsx-a11y/no-noninteractive-element-interactions": 0, + "no-multi-spaces": 0, + "no-restricted-globals": 0, + "object-curly-newline": 0, + "padded-blocks": 0, + "prefer-destructuring": 0, + "react/default-props-match-prop-types": 0, + "react/jsx-closing-tag-location": 0, + "react/jsx-max-props-per-line": 0, + "react/jsx-wrap-multilines": 0, + "spaced-comment": 0, } } diff --git a/client/app/scripts/actions/app-actions.js b/client/app/scripts/actions/app-actions.js index a1b7ac27c..1cd740407 100644 --- a/client/app/scripts/actions/app-actions.js +++ b/client/app/scripts/actions/app-actions.js @@ -778,6 +778,7 @@ export function resetLocalViewState() { return (dispatch) => { dispatch({type: ActionTypes.RESET_LOCAL_VIEW_STATE}); storageSet('scopeViewState', ''); + // eslint-disable-next-line prefer-destructuring window.location.href = window.location.href.split('#')[0]; }; } diff --git a/client/app/scripts/charts/nodes-error.js b/client/app/scripts/charts/nodes-error.js index e6204bfb1..69b495193 100644 --- a/client/app/scripts/charts/nodes-error.js +++ b/client/app/scripts/charts/nodes-error.js @@ -1,8 +1,7 @@ import React from 'react'; import classnames from 'classnames'; -export default function NodesError({children, faIconClass, hidden, - mainClassName = 'nodes-chart-error'}) { +const NodesError = ({ children, faIconClass, hidden, mainClassName = 'nodes-chart-error'}) => { const className = classnames(mainClassName, { hide: hidden }); @@ -18,4 +17,6 @@ export default function NodesError({children, faIconClass, hidden, {children} ); -} +}; + +export default NodesError; diff --git a/client/app/scripts/components/cloud-link.js b/client/app/scripts/components/cloud-link.js index 84933e0bd..1a5b8e455 100644 --- a/client/app/scripts/components/cloud-link.js +++ b/client/app/scripts/components/cloud-link.js @@ -21,7 +21,7 @@ const CloudLink = ({ alwaysShow, ...props }) => ( - ); +); class LinkWrapper extends React.Component { constructor(props, context) { diff --git a/client/app/scripts/components/node-details.js b/client/app/scripts/components/node-details.js index e951a7bfa..1e8114126 100644 --- a/client/app/scripts/components/node-details.js +++ b/client/app/scripts/components/node-details.js @@ -87,8 +87,8 @@ class NodeDetails extends React.Component { // caused by a bug having to do with animating the details panel). const spinnerClassName = classNames('fa fa-circle-o-notch', { 'fa-spin': this.props.mounted }); const nodeColor = (node ? - getNodeColorDark(node.get('rank'), label, node.get('pseudo')) : - getNeutralColor()); + getNodeColorDark(node.get('rank'), label, node.get('pseudo')) : + getNeutralColor()); const tools = this.renderTools(); const styles = { header: { diff --git a/client/app/scripts/selectors/zooming.js b/client/app/scripts/selectors/zooming.js index 8f8922bf4..ec354bfac 100644 --- a/client/app/scripts/selectors/zooming.js +++ b/client/app/scripts/selectors/zooming.js @@ -13,14 +13,14 @@ export const activeTopologyZoomCacheKeyPathSelector = createSelector( state => JSON.stringify(activeTopologyOptionsSelector(state)), ], (isGraphViewMode, viewMode, topologyId, pinnedMetricType, topologyOptions) => ( - isGraphViewMode ? + isGraphViewMode // In graph view, selecting different options/filters produces a different layout. - ['zoomCache', viewMode, topologyId, topologyOptions] : + ? ['zoomCache', viewMode, topologyId, topologyOptions] // Otherwise we're in the resource view where the options are hidden (for now), // but pinning different metrics can result in very different layouts. // TODO: Take `topologyId` into account once the resource // view layouts start differing between the topologies. - ['zoomCache', viewMode, pinnedMetricType] + : ['zoomCache', viewMode, pinnedMetricType] ) ); diff --git a/client/app/scripts/utils/web-api-utils.js b/client/app/scripts/utils/web-api-utils.js index b406b6458..1305b5a69 100644 --- a/client/app/scripts/utils/web-api-utils.js +++ b/client/app/scripts/utils/web-api-utils.js @@ -197,11 +197,12 @@ function getNodesForTopologies(state, dispatch, topologyIds, topologyOptions = m // fetch sequentially state.get('topologyUrlsById') .filter((_, topologyId) => topologyIds.contains(topologyId)) - .reduce((sequence, topologyUrl, topologyId) => sequence.then(() => { - const optionsQuery = buildUrlQuery(topologyOptions.get(topologyId), state); - return doRequest({ url: `${getApiPath()}${topologyUrl}?${optionsQuery}` }); - }) - .then(json => dispatch(receiveNodesForTopology(json.nodes, topologyId))), + .reduce((sequence, topologyUrl, topologyId) => sequence + .then(() => { + const optionsQuery = buildUrlQuery(topologyOptions.get(topologyId), state); + return doRequest({ url: `${getApiPath()}${topologyUrl}?${optionsQuery}` }); + }) + .then(json => dispatch(receiveNodesForTopology(json.nodes, topologyId))), Promise.resolve()); }