-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from moxious/v0.7.1
V0.7.1
- Loading branch information
Showing
12 changed files
with
182 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import React, { Component } from 'react'; | ||
import fields from '../data/fields'; | ||
import Spinner from '../Spinner'; | ||
import ReactTable from 'react-table'; | ||
import 'react-table/react-table.css'; | ||
|
||
class CypherSurface extends Component { | ||
state = { | ||
surface: null, | ||
displayColumns: [ | ||
{ | ||
Header: 'Type', | ||
accessor: 'type', | ||
filterMethod: (filter, row) => { | ||
if (filter.value === "all") { | ||
return true; | ||
} | ||
|
||
return row[filter.id] === filter.value; | ||
}, | ||
Filter: ({ filter, onChange }) => | ||
<select | ||
onChange={event => onChange(event.target.value)} | ||
style={{ width: "100%" }} | ||
value={filter ? filter.value : "all"} | ||
> | ||
<option value="all">All</option> | ||
<option value="function">Functions</option> | ||
<option value="procedure">Procedures</option> | ||
</select>, | ||
}, | ||
{ | ||
Header: 'Name', | ||
accessor: 'name', | ||
style: { whiteSpace: 'unset', textAlign: 'left' } | ||
}, | ||
{ | ||
Header: 'Signature', | ||
accessor: 'signature', | ||
style: { whiteSpace: 'unset', textAlign: 'left' } | ||
}, | ||
{ | ||
Header: 'Description', | ||
accessor: 'description', | ||
style: { whiteSpace: 'unset', textAlign: 'left' } | ||
}, | ||
{ | ||
Header: 'Roles', | ||
accessor: 'roles', | ||
Cell: fields.jsonField, | ||
style: { whiteSpace: 'unset', textAlign: 'left' }, | ||
show: false, | ||
}, | ||
], | ||
}; | ||
|
||
constructor(props, context) { | ||
super(props, context); | ||
this.driver = props.driver || context.driver; | ||
} | ||
|
||
componentWillMount() { | ||
return this.props.node.getCypherSurface() | ||
.then(surface => { | ||
this.setState({ surface }); | ||
}) | ||
.catch(err => { | ||
console.error('Failed to get surface', err); | ||
}); | ||
} | ||
|
||
render() { | ||
if (!this.state.surface) { | ||
return ( | ||
<div className='CypherSurface'> | ||
<Spinner/> | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<div className='CypherSurface'> | ||
<h3>Installed Functions & Procedures</h3> | ||
|
||
<ReactTable | ||
// By default, filter only catches data if the value STARTS WITH | ||
// the entered string. This makes it less picky. | ||
defaultFilterMethod={(filter, row, column) => { | ||
const id = filter.pivotId || filter.id | ||
return row[id] !== undefined ? String(row[id]).indexOf(filter.value) > -1 : true | ||
}} | ||
data={this.state.surface} | ||
sortable={true} | ||
filterable={true} | ||
defaultPageSize={10} | ||
showPagination={true} | ||
columns={this.state.displayColumns} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default CypherSurface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { Component } from 'react'; | ||
import CypherSurface from './CypherSurface'; | ||
import uuid from 'uuid'; | ||
|
||
export default class PluginPane extends Component { | ||
state = { | ||
key: uuid.v4(), | ||
}; | ||
|
||
render() { | ||
return ( | ||
<div className='PluginPane'> | ||
<CypherSurface | ||
key={this.state.key} node={this.props.node} driver={this.props.driver} | ||
/> | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters