Skip to content

Commit

Permalink
Misc stlye fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancharles committed Jul 30, 2019
1 parent 0287cc4 commit 64903fc
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 27 deletions.
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -178,4 +185,4 @@
}
]
}
}
}
2 changes: 1 addition & 1 deletion src/Action.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
13 changes: 6 additions & 7 deletions src/ActionIcon.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react'

const DEFAULT_SIZE = '20px';
const DEFAULT_SIZE = '20px'

const LABELS = {
BLOCK: 'Highly recommended action',
Expand All @@ -11,7 +11,7 @@ const LABELS = {
export const VARIANT_COLORS = {
PASS: '#bbd8ca',
BLOCK: '#a94442',
SUGGEST: '#bfa058',
SUGGEST: '#bfa058'
}

export const VARIANTS = {
Expand All @@ -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],
Expand All @@ -48,11 +48,10 @@ export default class ActionIcon extends Component {
}

render () {

const {
variant = VARIANTS.PASS,
title,
} = this.props;
title
} = this.props

return (
<span className='action-icon' title={title || LABELS[variant]}>
Expand Down
2 changes: 1 addition & 1 deletion src/Menu.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
21 changes: 12 additions & 9 deletions src/config.json
Original file line number Diff line number Diff line change
@@ -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
}
}
8 changes: 3 additions & 5 deletions src/resolvers/Policy.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/Security.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const focusOrCreateWindow = (mainWindow) => {
initMenu(mainWindow, app, focusOrCreateWindow, updater, log)
mainWindow.loadURL(BASE_URL)
}
return mainWindow;
return mainWindow
}

async function createWindow () {
Expand Down

0 comments on commit 64903fc

Please sign in to comment.