From 5e59690ca87f7fba6bf810e86365c852aa067ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Thu, 27 Apr 2017 23:11:12 +0100 Subject: [PATCH] run prettier --- cloudapi-graphql/src/credentials.js | 28 +++---------------- docker-graphql/src/config.js | 23 ++++----------- docker-graphql/src/schema/index.js | 2 +- .../src/schema/queries/containers.js | 13 +++++---- .../src/schema/types/from-pascal-case.js | 3 +- docker-graphql/src/schema/types/port.js | 1 - frontend/server/index.js | 4 ++- 7 files changed, 24 insertions(+), 50 deletions(-) diff --git a/cloudapi-graphql/src/credentials.js b/cloudapi-graphql/src/credentials.js index 9c645329..2fa99554 100644 --- a/cloudapi-graphql/src/credentials.js +++ b/cloudapi-graphql/src/credentials.js @@ -20,28 +20,8 @@ const json = (() => { })(); module.exports = { - url: ( - process.env.SDC_URL || - json.SDC_URL || - json.url || - '' - ), - account: ( - process.env.SDC_ACCOUNT || - json.SDC_ACCOUNT || - json.account || - '' - ), - user: ( - process.env.SDC_USER || - json.SDC_USER || - json.user || - '' - ), - keyId: ( - process.env.SDC_KEY_ID || - json.SDC_KEY_ID || - json.keyId || - '' - ) + url: process.env.SDC_URL || json.SDC_URL || json.url || '', + account: process.env.SDC_ACCOUNT || json.SDC_ACCOUNT || json.account || '', + user: process.env.SDC_USER || json.SDC_USER || json.user || '', + keyId: process.env.SDC_KEY_ID || json.SDC_KEY_ID || json.keyId || '' }; diff --git a/docker-graphql/src/config.js b/docker-graphql/src/config.js index ad3f810d..762a25a9 100644 --- a/docker-graphql/src/config.js +++ b/docker-graphql/src/config.js @@ -20,28 +20,17 @@ const json = (() => { })(); module.exports = { - cert: ( - process.env.DOCKER_CERT_PATH || + cert: process.env.DOCKER_CERT_PATH || json.DOCKER_CERT_PATH || json.cert || - '' - ), - host: ( - process.env.DOCKER_HOST || - json.DOCKER_HOST || - json.host || - '' - ), - tls_verify: ( - process.env.DOCKER_TLS_VERIFY || + '', + host: process.env.DOCKER_HOST || json.DOCKER_HOST || json.host || '', + tls_verify: process.env.DOCKER_TLS_VERIFY || json.DOCKER_TLS_VERIFY || json.tls_verify || - '' - ), - timeout: ( - process.env.DOCKER_CLIENT_TIMEOUT || + '', + timeout: process.env.DOCKER_CLIENT_TIMEOUT || json.DOCKER_CLIENT_TIMEOUT || json.timeout || '' - ) }; diff --git a/docker-graphql/src/schema/index.js b/docker-graphql/src/schema/index.js index 35d6cb4e..c343e41e 100644 --- a/docker-graphql/src/schema/index.js +++ b/docker-graphql/src/schema/index.js @@ -1,5 +1,5 @@ const graphql = require('graphql'); -const mutation = require('./mutations'); +// const mutation = require('./mutations'); const query = require('./queries'); const { GraphQLSchema } = graphql; diff --git a/docker-graphql/src/schema/queries/containers.js b/docker-graphql/src/schema/queries/containers.js index 5b950cf7..eec1183c 100644 --- a/docker-graphql/src/schema/queries/containers.js +++ b/docker-graphql/src/schema/queries/containers.js @@ -1,9 +1,13 @@ -const graphql = require('graphql'); const DynamicObjectType = require('../types/dynamic-object'); const ContainerType = require('../types/container'); const api = require('../../api'); -const { GraphQLInt, GraphQLList, GraphQLString, GraphQLID, GraphQLBoolean } = graphql; +const { + GraphQLInt, + GraphQLList, + GraphQLID, + GraphQLBoolean +} = require('graphql'); module.exports = { type: new GraphQLList(ContainerType), @@ -35,8 +39,7 @@ module.exports = { } }, resolve(root, args) { - const { list, inspect } = api.containers; - + const { list } = api.containers; return list(args); // // const { after, first } = args; @@ -52,4 +55,4 @@ module.exports = { // }).then(machine => [machine]) // : list(newArgs); } -}; \ No newline at end of file +}; diff --git a/docker-graphql/src/schema/types/from-pascal-case.js b/docker-graphql/src/schema/types/from-pascal-case.js index b09652d1..cfd650fa 100644 --- a/docker-graphql/src/schema/types/from-pascal-case.js +++ b/docker-graphql/src/schema/types/from-pascal-case.js @@ -1,4 +1,5 @@ const pascalCase = require('pascal-case'); const upperCase = require('upper-case'); -module.exports = (root, ctx, req, { fieldName }) => root[pascalCase(fieldName)] || root[upperCase(fieldName)]; +module.exports = (root, ctx, req, { fieldName }) => + root[pascalCase(fieldName)] || root[upperCase(fieldName)]; diff --git a/docker-graphql/src/schema/types/port.js b/docker-graphql/src/schema/types/port.js index 60e74edd..48e33242 100644 --- a/docker-graphql/src/schema/types/port.js +++ b/docker-graphql/src/schema/types/port.js @@ -1,5 +1,4 @@ const { GraphQLString, GraphQLObjectType, GraphQLInt } = require('graphql'); -const DynamicObjectType = require('./dynamic-object'); const fromPascalCase = require('./from-pascal-case'); module.exports = new GraphQLObjectType({ diff --git a/frontend/server/index.js b/frontend/server/index.js index 966246f8..b4c9adbb 100644 --- a/frontend/server/index.js +++ b/frontend/server/index.js @@ -36,7 +36,9 @@ const plugins = [ }, { register: PortalApi, - routes: { prefix: '/api' } + routes: { + prefix: '/api' + } } ];