diff options
author | Pavel Paroulek <pavel.paroulek@orange.com> | 2019-04-23 15:27:28 +0200 |
---|---|---|
committer | Pavel Paroulek <pavel.paroulek@orange.com> | 2019-05-08 13:30:00 +0200 |
commit | 1722ddc1b782c79d881a11eb06df66c6e2ab6029 (patch) | |
tree | db8850cd3733b6301c90ebeef64b31b3ca8a3304 /graphgraph-fe/src/GraphInfoMenu.js | |
parent | c90203a311c4c214eb0ea74bd83461ab7ee17d94 (diff) |
Adding schema ingestor and backend
Adding backend for schema visualization, bugfixes, UI changes
Change-Id: I830c4e5566806f14ff609e8784cd1ed2f54ba4ac
Issue-ID: AAI-531
Signed-off-by: Pavel Paroulek <pavel.paroulek@orange.com>
Diffstat (limited to 'graphgraph-fe/src/GraphInfoMenu.js')
-rw-r--r-- | graphgraph-fe/src/GraphInfoMenu.js | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/graphgraph-fe/src/GraphInfoMenu.js b/graphgraph-fe/src/GraphInfoMenu.js index 52a081e..c22a504 100644 --- a/graphgraph-fe/src/GraphInfoMenu.js +++ b/graphgraph-fe/src/GraphInfoMenu.js @@ -4,9 +4,8 @@ import PathBreadCrumb from './PathBreadCrumb' import _ from 'underscore' import ReactBasicTable from 'react-basic-table' -var generatePropertyTable = function (nodeProps) { - var columns = ['Property Name', 'Value'] - var rows = _.map(nodeProps, path => { +var getRows = function (nodeProps) { + return _.map(nodeProps, path => { return ( [ <span>{path.propertyName}</span>, @@ -14,15 +13,20 @@ var generatePropertyTable = function (nodeProps) { ] ) }) - - return ( - <div className="datatable"> - <ReactBasicTable pageSize={4} rows={rows} columns={columns} /> - </div> - ) } class GraphInfoMenu extends React.Component { + constructor (props) { + super(props) + this.basicTable = React.createRef() + } + + // ReactBasicTable does not reset pagination after + // changing data, we need to do it manually + componentDidUpdate (prevProps) { + this.basicTable.current.setPage(1) + } + render () { var paths = this.props.paths var callback = this.props.pathCallback @@ -34,8 +38,8 @@ class GraphInfoMenu extends React.Component { <p className='path-heading'>Paths</p> {breadcrumbs} </div> - <div className="kv-table"> - {generatePropertyTable(this.props.nodeProperties)} + <div className="kv-table datatable"> + <ReactBasicTable ref={this.basicTable} pageSize={3} rows={getRows(this.props.nodeProperties)} columns={['Property Name', 'Value']} /> </div> </div> ) |