From 64903fc01c656ed09aef9cfba4f7ef57396ef8fb Mon Sep 17 00:00:00 2001 From: Nathan Cook Date: Tue, 30 Jul 2019 11:13:07 -0700 Subject: [PATCH] Misc stlye fixes --- package.json | 11 +++++++++-- src/Action.js | 2 +- src/ActionIcon.js | 13 ++++++------- src/Menu.js | 2 +- src/config.json | 21 ++++++++++++--------- src/resolvers/Policy.js | 8 +++----- src/resolvers/Security.js | 2 +- src/start.js | 2 +- 8 files changed, 34 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 317a9cc8..2a4c8ffe 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,14 @@ "ignore": [ "registerServiceWorker.js" ], - "globals": [ "jest", "it", "expect", "describe", "beforeEach", "afterEach" ] + "globals": [ + "jest", + "it", + "expect", + "describe", + "beforeEach", + "afterEach" + ] }, "scripts": { "start": "yarn babel && cross-env FORCE_COLOR=true nf start -p 12000", @@ -178,4 +185,4 @@ } ] } -} +} \ No newline at end of file diff --git a/src/Action.js b/src/Action.js index 1d28aab2..fca6375a 100644 --- a/src/Action.js +++ b/src/Action.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import ReactDOMServer from 'react-dom/server' import Accessible from './Accessible' -import ActionIcon, {VARIANTS, VARIANT_COLORS} from './ActionIcon' +import ActionIcon, { VARIANTS, VARIANT_COLORS } from './ActionIcon' import semver from './lib/patchedSemver' import showdown from 'showdown' import Handlebars from 'handlebars/dist/handlebars.min.js' diff --git a/src/ActionIcon.js b/src/ActionIcon.js index 2740da7d..e2277360 100644 --- a/src/ActionIcon.js +++ b/src/ActionIcon.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' -const DEFAULT_SIZE = '20px'; +const DEFAULT_SIZE = '20px' const LABELS = { BLOCK: 'Highly recommended action', @@ -11,7 +11,7 @@ const LABELS = { export const VARIANT_COLORS = { PASS: '#bbd8ca', BLOCK: '#a94442', - SUGGEST: '#bfa058', + SUGGEST: '#bfa058' } export const VARIANTS = { @@ -27,8 +27,8 @@ export default class ActionIcon extends Component { const { color, variant = VARIANTS.PASS, - size = DEFAULT_SIZE, - } = props; + size = DEFAULT_SIZE + } = props const styleProps = { color: color || VARIANT_COLORS[variant], @@ -48,11 +48,10 @@ export default class ActionIcon extends Component { } render () { - const { variant = VARIANTS.PASS, - title, - } = this.props; + title + } = this.props return ( diff --git a/src/Menu.js b/src/Menu.js index 51daae61..f0b7da59 100644 --- a/src/Menu.js +++ b/src/Menu.js @@ -1,5 +1,5 @@ import { Menu, shell, clipboard } from 'electron' -import fetch from 'node-fetch'; +import fetch from 'node-fetch' import pkg from '../package.json' import config from './config.json' import AutoLauncher from './AutoLauncher' diff --git a/src/config.json b/src/config.json index 17e31a8e..3160af34 100644 --- a/src/config.json +++ b/src/config.json @@ -1,14 +1,17 @@ { "menu": { - "help": [{ - "label": "Email Support", - "link": "mailto:support@your-company.com" - }, { - "label": "Slack Support", - "link": "slack://channel?id=YOUR_CHANNEL_ID&team=YOUR_TEAM_ID" - }] + "help": [ + { + "label": "Email Support", + "link": "mailto:support@your-company.com" + }, + { + "label": "Slack Support", + "link": "slack://channel?id=YOUR_CHANNEL_ID&team=YOUR_TEAM_ID" + } + ] }, - "rescanIntervalSeconds": 604800, + "rescanIntervalSeconds": 604800, "autoLaunchPrompt": true, "allowPrerelease": false -} +} \ No newline at end of file diff --git a/src/resolvers/Policy.js b/src/resolvers/Policy.js index 0be3f9f5..04cac619 100644 --- a/src/resolvers/Policy.js +++ b/src/resolvers/Policy.js @@ -1,7 +1,5 @@ import Security from './Security' -import { PASS, FAIL, NUDGE, SUGGESTED, NEVER, - SUGGESTED_INSTALL, - SUGGESTED_UPGRADE } from '../constants' +import { PASS, FAIL, NUDGE, SUGGESTED, NEVER } from '../constants' export default { async validate (root, args, context) { @@ -22,8 +20,8 @@ export default { if (Array.isArray(passing)) { // convert verification result to PASS|FAIL response[verification] = passing.map(({ name, version, installed, state, passing }, index) => { - const policyType = requirement[index].assertion; - const failStatus = policyType === SUGGESTED ? NUDGE : FAIL; + const policyType = requirement[index].assertion + const failStatus = policyType === SUGGESTED ? NUDGE : FAIL return { name, version, diff --git a/src/resolvers/Security.js b/src/resolvers/Security.js index 88950adc..533c4bc0 100644 --- a/src/resolvers/Security.js +++ b/src/resolvers/Security.js @@ -170,7 +170,7 @@ export default { return results.map((data, idx) => { const config = args.applications[idx] const installed = Boolean(data.version) - const versionSatisfied = config.version ? semver.satisfies(semver.coerce(data.version), config.version) : true; + const versionSatisfied = config.version ? semver.satisfies(semver.coerce(data.version), config.version) : true let validInstall switch (config.assertion) { diff --git a/src/start.js b/src/start.js index 2714de38..20fe34f0 100644 --- a/src/start.js +++ b/src/start.js @@ -89,7 +89,7 @@ const focusOrCreateWindow = (mainWindow) => { initMenu(mainWindow, app, focusOrCreateWindow, updater, log) mainWindow.loadURL(BASE_URL) } - return mainWindow; + return mainWindow } async function createWindow () {