fix linting issues

pull/30/head
unknown 2018-11-15 18:34:54 -05:00
parent 397ceff833
commit 19ec5f7dd7
4 changed files with 8 additions and 11 deletions

View File

@ -74,7 +74,7 @@ module.exports = {
async function sendUpdatesAsync (id) { async function sendUpdatesAsync (id) {
const book = await Book.find({ id }) const book = await Book.find({ id })
const targets = await TargetUri.find() const targets = await TargetUrl.find()
for (const i in targets) { for (const i in targets) {
sails.log('sending ' + book.id + ' info to ' + targets[i].url) sails.log('sending ' + book.id + ' info to ' + targets[i].url)
} }

View File

@ -6,13 +6,13 @@ import '../../styles/shared/iconbutton.scss'
function getSVG (icon) { function getSVG (icon) {
switch (icon) { switch (icon) {
case 'delete': return '<svg viewBox="0 0 24 24"><path d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z" /></svg>' case 'delete': return '<svg viewBox="0 0 24 24"><path d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z" /></svg>'
default: icon || 'missing icon prop' default: return icon || 'missing icon prop'
} }
} }
const IconButton = props => { const IconButton = props => {
return ( return (
<button className='button icon' onClick={props.onClick} dangerouslySetInnerHTML={{__html: getSVG(props.icon)}} /> <button className='button icon' onClick={props.onClick} dangerouslySetInnerHTML={{ __html: getSVG(props.icon) }} />
) )
} }

View File

@ -9,9 +9,6 @@ import { changeUrlField, setUrl, removeUrl } from '../actions/targets'
const uriRegex = /(.+:\/\/)?(.+\.)*(.+\.).{1,}(:\d+)?(.+)?/i const uriRegex = /(.+:\/\/)?(.+\.)*(.+\.).{1,}(:\d+)?(.+)?/i
class UriListItem extends React.Component { class UriListItem extends React.Component {
constructor () {
super()
}
render () { render () {
return ( return (
<li className='uri-list-item flex-container'> <li className='uri-list-item flex-container'>
@ -24,7 +21,7 @@ class UriListItem extends React.Component {
pattern={uriRegex} pattern={uriRegex}
onChange={(e) => this.props.dispatch(changeUrlField(this.props.id, e.target.value))} onChange={(e) => this.props.dispatch(changeUrlField(this.props.id, e.target.value))}
onBlur={(e) => this.props.dispatch(setUrl(this.props.id, e.target.value))} /> onBlur={(e) => this.props.dispatch(setUrl(this.props.id, e.target.value))} />
<IconButton icon='delete' onClick={() => this.props.dispatch(removeUrl(this.props.id))}/> <IconButton icon='delete' onClick={() => this.props.dispatch(removeUrl(this.props.id))} />
</li> </li>
) )
} }

View File

@ -45,10 +45,10 @@ class App extends React.Component {
getRegisteredUris () { getRegisteredUris () {
return this.state.urls.map((item, i) => { return this.state.urls.map((item, i) => {
return (<UriListItem return (<UriListItem
key={i} key={i}
dispatch={this.dispatch} dispatch={this.dispatch}
id={item.id} id={item.id}
url={item.url} />) url={item.url} />)
}) })
} }
render () { render () {