Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
chore(release): release 0.5.2
Browse files Browse the repository at this point in the history
merge pull request #398
  • Loading branch information
b5 authored Oct 10, 2018
2 parents a7d2059 + 54afd73 commit 0c788e9
Show file tree
Hide file tree
Showing 21 changed files with 89 additions and 118 deletions.
9 changes: 8 additions & 1 deletion app/backend.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* globals __BUILD__ */
import { app } from 'electron'
// import {chunksToLinesAsync, chomp} from '@rauschma/stringio'
import { app, dialog } from 'electron'
import { spawn } from 'child_process'
import { EventEmitter } from 'events'
import path from 'path'
Expand Down Expand Up @@ -151,9 +152,15 @@ export default class Backend extends EventEmitter {
}

this.backend.on('close', (code) => {
if (process.env.NODE_ENV !== 'development') {
dialog.showErrorBox("Qri Backend Closed", "For some unexpected reason the Qri backend process has closed. Things aren't going to work well. Mind restarting?")
}
this.log('closed backend process')
})
this.backend.on('error', (err) => {
if (process.env.NODE_ENV !== 'development') {
dialog.showErrorBox("Qri Backend Error", err)
}
this.log(`backend error: ${err}`)
})
}
Expand Down
30 changes: 2 additions & 28 deletions app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import touchbar from './touchbar'

const isDevelopment = (process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD !== 'false')

let mainWindow = null
// let mainWindow = null
let backend = null

if (process.env.NODE_ENV === 'production') {
Expand Down Expand Up @@ -97,7 +97,6 @@ app.on('quit', () => {
})

function createMainWindow () {
console.log('booting app...')
let mainWindow = new BrowserWindow({
show: false,
width: 1500,
Expand Down Expand Up @@ -140,31 +139,6 @@ function createMainWindow () {
})
}

const menuBuilder = new MenuBuilder(mainWindow)
const menuBuilder = new MenuBuilder(mainWindow, createMainWindow)
menuBuilder.buildMenu()

// mainWindow.webContents.session.on('will-download', (event, item, webContents) => {
// console.log(event)
// // Set the save path, making Electron not to prompt a save dialog.
// item.setSavePath('/tmp/save.pdf')

// item.on('updated', (event, state) => {
// if (state === 'interrupted') {
// console.log('Download is interrupted but can be resumed')
// } else if (state === 'progressing') {
// if (item.isPaused()) {
// console.log('Download is paused')
// } else {
// console.log(`Received bytes: ${item.getReceivedBytes()}`)
// }
// }
// })
// item.once('done', (event, state) => {
// if (state === 'completed') {
// console.log('Download successfully')
// } else {
// console.log(`Download failed: ${state}`)
// }
// })
// })
}
39 changes: 18 additions & 21 deletions app/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { app, Menu, shell, BrowserWindow } from 'electron';
export default class MenuBuilder {
mainWindow: BrowserWindow;

constructor(mainWindow: BrowserWindow) {
constructor(mainWindow: BrowserWindow, createWindow) {
this.mainWindow = mainWindow;
this.createWindow = createWindow;
}

buildMenu() {
Expand Down Expand Up @@ -44,19 +45,23 @@ export default class MenuBuilder {

buildDarwinTemplate() {
const subMenuAbout = {
label: 'qri',
label: 'Qri',
submenu: [
{ label: 'About qri', selector: 'orderFrontStandardAboutPanel:' },
// { type: 'separator' },
// { label: 'Services', submenu: [] },
{ label: 'About Qri', selector: 'orderFrontStandardAboutPanel:' },
{ type: 'separator' },
{ label: 'Hide qri', accelerator: 'Command+H', selector: 'hide:' },
{ label: 'Hide Qri', accelerator: 'Command+H', selector: 'hide:' },
{ label: 'Hide Others', accelerator: 'Command+Shift+H', selector: 'hideOtherApplications:' },
{ label: 'Show All', selector: 'unhideAllApplications:' },
{ type: 'separator' },
{ label: 'Quit', accelerator: 'Command+Q', click: () => { app.quit(); } }
]
};
const subMenuFile = {
label: 'File',
submenu: [
{ label: 'New Window', accelerator: 'Command+N', click: () => { this.createWindow() }}
]
}
const subMenuEdit = {
label: 'Edit',
submenu: [
Expand All @@ -69,21 +74,14 @@ export default class MenuBuilder {
{ label: 'Select All', accelerator: 'Command+A', selector: 'selectAll:' }
]
};
const subMenuViewDev = {
const subMenuView = {
label: 'View',
submenu: [
{ label: 'Reload', accelerator: 'Command+R', click: () => { this.mainWindow.webContents.reload(); } },
{ label: 'Toggle Full Screen', accelerator: 'Ctrl+Command+F', click: () => { this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen()); } },
{ label: 'Toggle Developer Tools', accelerator: 'Command+Shift+C', click: () => { this.mainWindow.toggleDevTools(); } }
]
};
const subMenuViewProd = {
label: 'View',
submenu: [
{ label: 'Toggle Full Screen', accelerator: 'Ctrl+Command+F', click: () => { this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen()); } },
{ label: 'Toggle Developer Tools', accelerator: 'Command+Shift+C', click: () => { this.mainWindow.openDevTools(); } }
]
};
const subMenuWindow = {
label: 'Window',
submenu: [
Expand All @@ -96,18 +94,17 @@ export default class MenuBuilder {
const subMenuHelp = {
label: 'Help',
submenu: [
{ label: 'Learn More', click() { shell.openExternal('http://qri.io'); } },
{ label: 'Documentation', click() { shell.openExternal('https://github.com/qri-io/frontend/blob/master/readme.md'); } },
// { label: 'Community Discussions', click() { shell.openExternal('https://discuss.atom.io/c/electron'); } },
{ label: 'Search Issues', click() { shell.openExternal('https://github.com/qri-io/frontend/issues'); } }
{ label: 'Qri Site', click() { shell.openExternal('http://qri.io'); } },
{ label: 'Discord Chat', click() { shell.openExternal('https://discord.gg/etap8Gb'); } },
{ label: 'Docs', click() { shell.openExternal('https://qri.io/docs'); } },
{ label: 'App Github', click() { shell.openExternal('https://github.com/qri-io/frontend/blob/master/readme.md'); } },
{ label: 'App Github Issues', click() { shell.openExternal('https://github.com/qri-io/frontend/issues'); } }
]
};

const subMenuView = process.env.NODE_ENV === 'development'
? subMenuViewDev : subMenuViewProd;

return [
subMenuAbout,
subMenuFile,
subMenuEdit,
subMenuView,
subMenuWindow,
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "qri-webapp",
"productName": "qri",
"version": "0.5.1",
"version": "0.5.2",
"description": "qri (\"query\") frontend application",
"main": "./main.prod.js",
"author": {
Expand Down
5 changes: 3 additions & 2 deletions lib/actions/dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export function downloadDataset (datasetRef) {
}

// prepFiles turns strings into File objects for submission via a form/multipart API request
function prepFiles (dataset = {}, transformScript = '', vizScript = '', bodyData) {
function prepFiles (dataset = {}, transformScript = '', vizScript = '', bodyData = '') {
let viz, transform, body

let file = new File([JSON.stringify(dataset)], 'dataset.json', {
Expand All @@ -264,7 +264,8 @@ function prepFiles (dataset = {}, transformScript = '', vizScript = '', bodyData
})
}

if (bodyData) {
if (bodyData && bodyData.length) {
console.log(bodyData, bodyData.length)
body = new File([bodyData], 'body', {
type: 'text/plain'
})
Expand Down
6 changes: 4 additions & 2 deletions lib/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ export default class App extends Base {
this.props.layoutResize(window.innerWidth, window.innerHeight)
}, 250)

window.onbeforeunload = () => {
window.onbeforeunload = (e) => {
if (this.props.editorDirty) {
if (!confirm('the editor has unsaved changes. are you *sure* want to close this window?')) {
if (!confirm('the editor has unsaved changes. are you sure want to close this window?')) {
e.preventDefault()
e.returnValue = ''
return false
}
}
Expand Down
11 changes: 11 additions & 0 deletions lib/components/ExternalLink.electron.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'
import { shell } from 'electron'

export default class ExternalLink extends React.Component {
render () {
return (<a href={this.props.href} onClick={(e) => {
e.preventDefault()
shell.openExternal(this.props.href)
}} {...this.props}>{this.props.children}</a>)
}
}
7 changes: 7 additions & 0 deletions lib/components/ExternalLink.web.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'

export default class ExternalLink extends React.Component {
render () {
return <a {...this.props} target='_blank'>{this.props.children}</a>
}
}
5 changes: 3 additions & 2 deletions lib/components/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { defaultPalette } from '../propTypes/palette'

import SearchBar from './form/SearchBar'
import Base from './Base'
import ExternalLink from './ExternalLink.APP_TARGET'

export default class TopBar extends Base {
constructor (props) {
Expand Down Expand Up @@ -88,8 +89,8 @@ export default class TopBar extends Base {
<SearchBar onKeyUp={this.handleSearch} searchString={searchString} onChange={this.handleChange} />
<div className={css('flexSpace')} />
<div className={css('help')}>
<a href='https://discord.gg/etap8Gb' className={css('nav_button')} target='_blank'>chat</a>
<a href='https://qri.io/docs' className={css('nav_button')} target='_blank'>help</a>
<ExternalLink href='https://discord.gg/etap8Gb' className={css('nav_button')} target='_blank'>chat</ExternalLink>
<ExternalLink href='https://qri.io/docs' className={css('nav_button')} target='_blank'>help</ExternalLink>
</div>
</div>
</div>
Expand Down
7 changes: 4 additions & 3 deletions lib/components/dataset/Overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Button from '../chrome/Button'

import { defaultPalette } from '../../propTypes/palette'
import Schema from '../schema/schema.js'
import ExternalLink from '../ExternalLink.APP_TARGET'

export default class Overview extends Base {
constructor (props) {
Expand Down Expand Up @@ -143,9 +144,9 @@ export default class Overview extends Base {
<h3 className={css('name')}>{ (meta && meta.title) || name}</h3>
{/* <div className={css('open')}> open data</div> */}
</div>
{meta && meta.keywords ? <TagList tags={meta.keywords} /> : undefined}
{meta && meta.description ? <p>{meta.description}</p> : undefined}
{meta && meta.downloadPath ? <a>{meta.downloadPath}</a> : undefined}
{meta && meta.keywords && <TagList tags={meta.keywords} />}
{meta && meta.description && <p>{meta.description}</p>}
{meta && meta.downloadPath && <ExternalLink href={meta.downloadPath}>{meta.downloadPath}</ExternalLink>}
</div>
)
}
Expand Down
32 changes: 3 additions & 29 deletions lib/components/editor/EditBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,20 @@ export default class EditBody extends Base {
}

onAddBody () {
// TODO - check structure & produce proper data format
this.props.onChangeBody([['', ''], ['', '']])
}

onRemoveBody () {
this.props.onChangeBody(undefined)
this.props.onChangeBody('')
}

onMonacoChange (body) {
this.props.onChangeBody(body)
}

onAfterCreateRow (start, rows, source) {
// const { body } = this.props
// const newBody = body.slice(0, start).concat([], body.slice(start, body.length - 1))
// console.log(newBody)
// this.props.onChangeBody(newBody)
this.props.onChangeBody(cloneDeep(this.body))
}
onAfterRemoveRow (changes, source) {
this.props.onChangeBody(cloneDeep(this.body))
Expand All @@ -73,31 +71,7 @@ export default class EditBody extends Base {
if (source === 'loadData' || !changes) {
return
}

this.props.onChangeBody(cloneDeep(this.body))

// const { body } = this.props

// const newBody = body.concat([])
// changes.forEach((a) => {
// if (!a) {
// return
// }

// const [row, column,, newValue] = a
// if (!newBody[row]) {
// return
// }

// newBody[row] = newBody[row].map((item, i) => {
// if (i === column) {
// return newValue
// }
// return item
// })
// })

// this.props.onChangeBody(newBody)
}

renderEditor () {
Expand Down
3 changes: 3 additions & 0 deletions lib/components/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ export default class Editor extends Base {
} else {
body = JSON.stringify(body)
}
if (body === '""') {
body = ''
}

this.setState({ datasetError: '', datasetMessage: '', results: undefined, loading: true })

Expand Down
25 changes: 0 additions & 25 deletions lib/scss/_site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,31 +124,6 @@ b {
font-size: 16px;
}

// these overrides cause scrolling of the data body page to get messed up
// if we need to add them it won't be the worst, but until I hear that we
// need these overrides back, I'm going to keep them commented out.

// ::-webkit-scrollbar {
// width: 8px;
// background-color: transparent;
// }
// ::-webkit-scrollbar-corner {
// background-color: transparent;
// }
// ::-webkit-scrollbar-thumb {
// width: 8px;
// border-radius: 4px;
// background-color: rgba(0,0,0,0.4);
// box-shadow: 0 0 0 12px rgba(49, 49, 49,0.2) inset;
// }
// ::-webkit-scrollbar-thumb:hover,
// ::-webkit-scrollbar-thumb:focus {
// box-shadow: 0 0 0 12px rgba(89, 89, 89, 0.5) inset;
// }
// ::-webkit-scrollbar-thumb:active {
// box-shadow: 0 0 0 12px rgba(169, 169, 169, 0.5) inset;
// }

// dataset nav links
.navLink {
font-size: $nav-font-size;
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/reflect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// data structures

export function isEmpty (v) {
if (!v) { return true }
if (v === undefined) { return true }

switch (v.constructor) {
case Object:
return isEmptyObj(v)
case Array:
return v.length === 0
}
return !!v
return !v
}

export function isEmptyObj (obj = {}) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "qri",
"private": true,
"productName": "qri",
"version": "0.5.1",
"version": "0.5.2",
"description": "qri (\"query\") frontend application",
"keywords": [],
"homepage": "https://qri.io",
Expand Down
Binary file modified resources/qri
Binary file not shown.
2 changes: 1 addition & 1 deletion version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '0.5.1'
export default '0.5.2'
Loading

0 comments on commit 0c788e9

Please sign in to comment.