From cceacbebaba0bb8af83e22d0cb7f4eef1c49ffad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Wed, 6 Sep 2017 10:46:34 +0100 Subject: [PATCH] style: format --- .../src/components/service/metrics.js | 10 ++-------- .../src/components/services/list-item.js | 1 - .../src/containers/metrics/metrics-data-hoc.js | 4 ++-- .../src/containers/navigation/not-found-hoc.js | 2 +- .../src/containers/service/metrics.js | 7 ++----- .../src/containers/services/list.js | 2 +- packages/cp-gql-mock-server/src/resolvers.js | 18 +++++++++++------- 7 files changed, 19 insertions(+), 25 deletions(-) diff --git a/packages/cp-frontend/src/components/service/metrics.js b/packages/cp-frontend/src/components/service/metrics.js index e29b4100..ff9c94b4 100644 --- a/packages/cp-frontend/src/components/service/metrics.js +++ b/packages/cp-frontend/src/components/service/metrics.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; import styled from 'styled-components'; import remcalc from 'remcalc'; @@ -8,13 +8,7 @@ import { Card, CardView, CardTitle, - CardSubTitle, - CardDescription, - CardGroupView, - CardOptions, - CardHeader, - CardInfo, - Anchor + CardHeader } from 'joyent-ui-toolkit'; const MetricView = styled(CardView)` diff --git a/packages/cp-frontend/src/components/services/list-item.js b/packages/cp-frontend/src/components/services/list-item.js index 1ceefc52..cc80bda1 100644 --- a/packages/cp-frontend/src/components/services/list-item.js +++ b/packages/cp-frontend/src/components/services/list-item.js @@ -16,7 +16,6 @@ import { Card, CardView, CardTitle, - CardSubTitle, CardDescription, CardGroupView, CardOptions, diff --git a/packages/cp-frontend/src/containers/metrics/metrics-data-hoc.js b/packages/cp-frontend/src/containers/metrics/metrics-data-hoc.js index b1eaac42..b86fc2c3 100644 --- a/packages/cp-frontend/src/containers/metrics/metrics-data-hoc.js +++ b/packages/cp-frontend/src/containers/metrics/metrics-data-hoc.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { compose, graphql } from 'react-apollo'; +import { graphql } from 'react-apollo'; import find from 'lodash.find'; import uniqBy from 'lodash.uniqby'; import get from 'lodash.get'; @@ -22,7 +22,7 @@ export const withServiceMetricsPolling = ({ return class extends Component { componentDidMount() { this._poll = setInterval(() => { - const { loading, error, service, fetchMoreMetrics } = this.props; + const { loading, fetchMoreMetrics } = this.props; const previousEnd = getPreviousEnd(this.props); if (previousEnd) { diff --git a/packages/cp-frontend/src/containers/navigation/not-found-hoc.js b/packages/cp-frontend/src/containers/navigation/not-found-hoc.js index 0c12f945..00d7383f 100644 --- a/packages/cp-frontend/src/containers/navigation/not-found-hoc.js +++ b/packages/cp-frontend/src/containers/navigation/not-found-hoc.js @@ -30,7 +30,7 @@ export default paths => { } render() { - const { error, location, match } = this.props; + const { location, match } = this.props; if (location.state && location.state.notFound) { const notFound = location.state.notFound; diff --git a/packages/cp-frontend/src/containers/service/metrics.js b/packages/cp-frontend/src/containers/service/metrics.js index 03a0ad80..e30204a2 100644 --- a/packages/cp-frontend/src/containers/service/metrics.js +++ b/packages/cp-frontend/src/containers/service/metrics.js @@ -1,14 +1,11 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { compose, graphql } from 'react-apollo'; -import { connect } from 'react-redux'; +import React from 'react'; +import { compose } from 'react-apollo'; import moment from 'moment'; import ServiceMetricsQuery from '@graphql/ServiceMetrics.gql'; import { withNotFound, GqlPaths } from '@containers/navigation'; import { LayoutContainer } from '@components/layout'; import { Title } from '@components/navigation'; import { ServiceMetrics as ServiceMetricsComponent } from '@components/service'; -import { Button } from 'joyent-ui-toolkit'; import { Loader, ErrorMessage } from '@components/messaging'; import { processInstancesMetrics } from '@state/selectors'; import get from 'lodash.get'; diff --git a/packages/cp-frontend/src/containers/services/list.js b/packages/cp-frontend/src/containers/services/list.js index c72e9ccd..20ff2a45 100644 --- a/packages/cp-frontend/src/containers/services/list.js +++ b/packages/cp-frontend/src/containers/services/list.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { compose, graphql } from 'react-apollo'; +import { compose } from 'react-apollo'; import { connect } from 'react-redux'; import styled from 'styled-components'; import forceArray from 'force-array'; diff --git a/packages/cp-gql-mock-server/src/resolvers.js b/packages/cp-gql-mock-server/src/resolvers.js index 40e932f6..a7cd473e 100644 --- a/packages/cp-gql-mock-server/src/resolvers.js +++ b/packages/cp-gql-mock-server/src/resolvers.js @@ -172,11 +172,12 @@ const getMetrics = query => { return Promise.resolve(metrics); }; -const getInstanceMetrics = ({ id }) => query => getMetrics( - Object.assign({}, query, { - instanceId: id - }) -); +const getInstanceMetrics = ({ id }) => query => + getMetrics( + Object.assign({}, query, { + instanceId: id + }) + ); const updateInstance = async query => { await delay(0.5); @@ -184,7 +185,10 @@ const updateInstance = async query => { const instanceIndex = findIndex(instances, ['id', query.id]); const original = cleanQuery(instances[instanceIndex]); - instances[instanceIndex] = Object.assign(instances[instanceIndex], cleanQuery(query)); + instances[instanceIndex] = Object.assign( + instances[instanceIndex], + cleanQuery(query) + ); emit('instance-updated', diff(original, instances[instanceIndex], 'name')); @@ -454,7 +458,7 @@ const getServiceInstances = async (query, { id }) => { }; const getBranchInstances = async (query, instanceIds) => - map(instanceIds, (id) => getInstance({ id })); + map(instanceIds, id => getInstance({ id })); const getServiceBranches = async (query, { branches }) => { await delay(0.1);