diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4575b6b..ee34d08 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,6 +21,6 @@ If you're new to Git and want to learn how to fork this repo, make your own addi If you find a bug, or have a suggestion on how to improve the project, just fill out a Github issue! -If you're interested in using BrainWaves as a basis for your own work to streamline EEG experimentation or psychological data collection, we'd love to hear from you. Send an email to [dano@neurotechx.com](mailto:dano@neurotechx.com) or create an issue and we'll be in touch. +If you're interested in using BrainWaves as a basis for your own work to streamline EEG experimentation or psychological data collection, we'd love to hear from you. Send an email to [morrisondano@gmail.com](mailto:morrisondano@gmail.com) or create an issue and we'll be in touch. -All project management for BrainWaves occurs through issues on Github (via Zenhub). If you want to see what we need help with, or what is on our , check out the issues on this repository. +All project management for BrainWaves occurs through issues on Github (via Zenhub). If you want to see what we need help with, or what is on our [roadmap](ROADMAP.md), check out the issues on this repository. diff --git a/ROADMAP.md b/ROADMAP.md index 4dbd78c..6f74851 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -5,11 +5,6 @@ July/August 2020: Jiffy Lube & Pyodide Fall 2020+: LSL & Lab.js -## Jiffy Lube - -- Finishing soon -- Will provide CI and better dev experience - ## Pyodide - Successfully added pyodide via webworker @@ -34,8 +29,10 @@ Fall 2020+: LSL & Lab.js ## Lab.js - Type lab.js data (pending lab.js TypeScript library update) +- Remove jspsych and refactor lab.js usage ## Non-technical stuff + - Share on HN/reddit - Consider writing short papers for JOSS and/or Journal of Open Source Education - UCSD diff --git a/app/components/ExperimentWindow.tsx b/app/components/ExperimentWindow.tsx index 50456c7..fbedcea 100644 --- a/app/components/ExperimentWindow.tsx +++ b/app/components/ExperimentWindow.tsx @@ -68,11 +68,7 @@ export const ExperimentWindow: React.FC = ({ image.filename ), })) - .reduce((obj, item) => { - // return { ...obj, item }; ?? - obj[Object.keys(item)[0]] = Object.values(item)[0]; - return obj; - }, {}); + .reduce((obj, item) => ({ ...obj, ...item }), {}); } studyWithParams.on('end', () => { diff --git a/app/components/InputCollect.tsx b/app/components/InputCollect.tsx index 4ef7c02..38fbac9 100644 --- a/app/components/InputCollect.tsx +++ b/app/components/InputCollect.tsx @@ -24,9 +24,6 @@ interface State { } export default class InputCollect extends Component { - // handleClose: () => void; - // handleExit: () => void; - // handleEnterSubmit: (Object) => void; constructor(props: Props) { super(props); this.state = { @@ -133,7 +130,3 @@ export default class InputCollect extends Component { ); } } - -function sanitizeTextInput(text: string) { - return text.replace(/[|&;$%@"<>()+,./]/g, ''); -} diff --git a/app/components/InputModal.tsx b/app/components/InputModal.tsx index 94f31e2..575b0b0 100644 --- a/app/components/InputModal.tsx +++ b/app/components/InputModal.tsx @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { Input, Modal, Button } from 'semantic-ui-react'; import { debounce } from 'lodash'; +import { sanitizeTextInput } from '../utils/ui'; import styles from './styles/common.css'; interface Props { @@ -16,10 +17,6 @@ interface State { } export default class InputModal extends Component { - static sanitizeTextInput(text: string) { - return text.replace(/[|&;$%@"<>()+,./]/g, ''); - } - constructor(props: Props) { super(props); this.state = { @@ -38,7 +35,7 @@ export default class InputModal extends Component { handleClose() { if (this.state.enteredText.length >= 1) { - this.props.onClose(InputModal.sanitizeTextInput(this.state.enteredText)); + this.props.onClose(sanitizeTextInput(this.state.enteredText)); } else { this.setState({ isError: true }); } diff --git a/app/components/PreviewExperimentComponent.tsx b/app/components/PreviewExperimentComponent.tsx index 6c5937c..bd8d8ce 100644 --- a/app/components/PreviewExperimentComponent.tsx +++ b/app/components/PreviewExperimentComponent.tsx @@ -4,7 +4,7 @@ import { ExperimentWindow } from './ExperimentWindow'; import styles from './styles/collect.css'; import { getImages } from '../utils/filesystem/storage'; -import { Trial, ExperimentParameters } from '../constants/interfaces'; +import { ExperimentParameters } from '../constants/interfaces'; import { EXPERIMENTS } from '../constants/constants'; interface Props { diff --git a/app/main.dev.ts b/app/main.dev.ts index 39f4b52..53a35c6 100644 --- a/app/main.dev.ts +++ b/app/main.dev.ts @@ -101,7 +101,6 @@ const createWindow = async () => { mainWindow.show(); mainWindow.focus(); } - mainWindow.webContents.openDevTools(); }); mainWindow.on('closed', () => { @@ -113,11 +112,6 @@ const createWindow = async () => { // Remove this if your app does not use auto updates // eslint-disable-next-line new AppUpdater(); - - // mainWindow.setMenu(null); - // if (process.env.NODE_ENV === 'development') { - // mainWindow.webContents.openDevTools(); - // } }; /** diff --git a/app/menu.ts b/app/menu.ts index 573e1e7..d0cb5ec 100644 --- a/app/menu.ts +++ b/app/menu.ts @@ -64,11 +64,6 @@ export default class MenuBuilder { { type: 'separator' }, { label: 'Services', submenu: [] }, { type: 'separator' }, - { - label: 'Hide ElectronReact', - accelerator: 'Command+H', - selector: 'hide:', - }, { label: 'Hide Others', accelerator: 'Command+Shift+H', @@ -85,22 +80,6 @@ export default class MenuBuilder { }, ], }; - const subMenuEdit: DarwinMenuItemConstructorOptions = { - label: 'Edit', - submenu: [ - { label: 'Undo', accelerator: 'Command+Z', selector: 'undo:' }, - { label: 'Redo', accelerator: 'Shift+Command+Z', selector: 'redo:' }, - { type: 'separator' }, - { label: 'Cut', accelerator: 'Command+X', selector: 'cut:' }, - { label: 'Copy', accelerator: 'Command+C', selector: 'copy:' }, - { label: 'Paste', accelerator: 'Command+V', selector: 'paste:' }, - { - label: 'Select All', - accelerator: 'Command+A', - selector: 'selectAll:', - }, - ], - }; const subMenuViewDev: MenuItemConstructorOptions = { label: 'View', submenu: [ @@ -155,30 +134,18 @@ export default class MenuBuilder { const subMenuHelp: MenuItemConstructorOptions = { label: 'Help', submenu: [ - { - label: 'Learn More', - click() { - shell.openExternal('https://electronjs.org'); - }, - }, { label: 'Documentation', click() { - shell.openExternal( - 'https://github.com/electron/electron/tree/master/docs#readme' - ); - }, - }, - { - label: 'Community Discussions', - click() { - shell.openExternal('https://www.electronjs.org/community'); + shell.openExternal('https://github.com/makebrainwaves/BrainWaves/'); }, }, { label: 'Search Issues', click() { - shell.openExternal('https://github.com/electron/electron/issues'); + shell.openExternal( + 'https://github.com/makebrainwaves/BrainWaves/issues' + ); }, }, ], @@ -190,27 +157,11 @@ export default class MenuBuilder { ? subMenuViewDev : subMenuViewProd; - return [subMenuAbout, subMenuEdit, subMenuView, subMenuWindow, subMenuHelp]; + return [subMenuAbout, subMenuView, subMenuWindow, subMenuHelp]; } buildDefaultTemplate() { const templateDefault = [ - { - label: '&File', - submenu: [ - { - label: '&Open', - accelerator: 'Ctrl+O', - }, - { - label: '&Close', - accelerator: 'Ctrl+W', - click: () => { - this.mainWindow.close(); - }, - }, - ], - }, { label: '&View', submenu: @@ -256,30 +207,20 @@ export default class MenuBuilder { { label: 'Help', submenu: [ - { - label: 'Learn More', - click() { - shell.openExternal('https://electronjs.org'); - }, - }, { label: 'Documentation', click() { shell.openExternal( - 'https://github.com/electron/electron/tree/master/docs#readme' + 'https://github.com/makebrainwaves/BrainWaves/' ); }, }, - { - label: 'Community Discussions', - click() { - shell.openExternal('https://www.electronjs.org/community'); - }, - }, { label: 'Search Issues', click() { - shell.openExternal('https://github.com/electron/electron/issues'); + shell.openExternal( + 'https://github.com/makebrainwaves/BrainWaves/issues' + ); }, }, ], diff --git a/app/utils/filesystem/dialog.ts b/app/utils/filesystem/dialog.ts index b87da0d..e8311d0 100644 --- a/app/utils/filesystem/dialog.ts +++ b/app/utils/filesystem/dialog.ts @@ -3,11 +3,9 @@ * These functions are all executed in the main process */ -import { remote } from 'electron'; +import { dialog } from 'electron'; import { FILE_TYPES } from '../../constants/constants'; -const { dialog } = remote; - export const loadDialog = (event, arg) => { switch (arg) { case FILE_TYPES.STIMULUS_DIR: diff --git a/app/utils/ui/index.tsx b/app/utils/ui/index.tsx new file mode 100644 index 0000000..da98a02 --- /dev/null +++ b/app/utils/ui/index.tsx @@ -0,0 +1,3 @@ +export function sanitizeTextInput(text: string) { + return text.replace(/[|&;$%@"<>()+,./]/g, ''); +} diff --git a/package.json b/package.json index 8fa8285..7ee69d8 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "BrainWaves", + "name": "brainwaves", "productName": "BrainWaves", "version": "0.14.0", "description": "EEG Experiment Desktop Application", @@ -96,8 +96,8 @@ }, "publish": { "provider": "github", - "owner": "electron-react-boilerplate", - "repo": "electron-react-boilerplate", + "owner": "makebrainwaves", + "repo": "brainwaves", "private": false } }, @@ -111,11 +111,6 @@ "url": "https://github.com/makebrainwaves" }, "contributors": [ - { - "name": "Dano Morrison", - "email": "dano@neurotechx.com", - "url": "https://github.com/makebrainwaves" - }, { "name": "Teon L Brooks", "url": "https://teonian.com" @@ -129,13 +124,14 @@ "keywords": [ "eeg", "electron", - "boilerplate", "react", "redux", - "sass", - "webpack", - "hot", - "reload" + "redux-observable", + "muse", + "emotiv", + "pyodide", + "wasm", + "lab.js" ], "homepage": "https://wp.nyu.edu/brainwaves/", "jest": {