Newer
Older
piotr.kupczyk@id.ethz.ch
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import _ from 'lodash'
import React from 'react'
import autoBind from 'auto-bind'
import { withStyles } from '@material-ui/core/styles'
import Grid from '@src/js/components/common/grid/Grid.jsx'
import QueryLink from '@src/js/components/common/link/QueryLink.jsx'
import UserLink from '@src/js/components/common/link/UserLink.jsx'
import logger from '@src/js/common/logger.js'
const styles = () => ({})
class QueriesGrid extends React.PureComponent {
constructor(props) {
super(props)
autoBind(this)
}
render() {
logger.log(logger.DEBUG, 'QueriesGrid.render')
const {
id,
rows,
selectedRowId,
onSelectedRowChange,
controllerRef
} = this.props
return (
<Grid
id={id}
controllerRef={controllerRef}
header='Queries'
columns={[
{
name: 'name',
label: 'Name',
sort: 'asc',
getValue: ({ row }) => row.name.value,
renderValue: ({ value }) => {
return <QueryLink queryName={value} />
}
},
{
name: 'description',
label: 'Description',
getValue: ({ row }) => row.description.value
},
{
name: 'database',
label: 'Database',
getValue: ({ row }) => row.database.value
},
{
name: 'queryType',
label: 'Query Type',
getValue: ({ row }) => row.queryType.value
},
{
name: 'entityTypeCodePattern',
label: 'Entity Type Pattern',
getValue: ({ row }) => row.entityTypeCodePattern.value
},
{
name: 'publicFlag',
label: 'Public',
getValue: ({ row }) => row.publicFlag.value
},
{
name: 'registrator',
label: 'Registrator',
getValue: ({ row }) => row.registrator.value,
renderValue: ({ value }) => {
return <UserLink userId={value} />
}
}
]}
rows={rows}
selectedRowId={selectedRowId}
onSelectedRowChange={onSelectedRowChange}
/>
)
}
}
export default _.flow(withStyles(styles))(QueriesGrid)