@@ -59,8 +59,9 @@ function SchemaItem({ item, expanded, onToggle, onSelect, ...props }) {
59
59
mouseEnterDelay = { 0 }
60
60
mouseLeaveDelay = { 0 }
61
61
placement = "topRight"
62
- arrowPointAtCenter >
63
- < PlainButton className = "copy-to-editor" onClick = { e => handleSelect ( e , item . name ) } >
62
+ arrowPointAtCenter
63
+ >
64
+ < PlainButton className = "copy-to-editor" onClick = { ( e ) => handleSelect ( e , item . name ) } >
64
65
< i className = "fa fa-angle-double-right" aria-hidden = "true" />
65
66
</ PlainButton >
66
67
</ Tooltip >
@@ -70,16 +71,22 @@ function SchemaItem({ item, expanded, onToggle, onSelect, ...props }) {
70
71
{ item . loading ? (
71
72
< div className = "table-open" > Loading...</ div >
72
73
) : (
73
- map ( item . columns , column => {
74
+ map ( item . columns , ( column ) => {
74
75
const columnName = get ( column , "name" ) ;
75
76
const columnType = get ( column , "type" ) ;
77
+ const columnDescription = get ( column , "description" ) ;
76
78
return (
77
79
< Tooltip
78
- title = "Insert column name into query text"
80
+ title = { "Insert column name into query text" + ( columnDescription ? "\n" + columnDescription : "" ) }
79
81
mouseEnterDelay = { 0 }
80
82
mouseLeaveDelay = { 0 }
81
- placement = "rightTop" >
82
- < PlainButton key = { columnName } className = "table-open-item" onClick = { e => handleSelect ( e , columnName ) } >
83
+ placement = "rightTop"
84
+ >
85
+ < PlainButton
86
+ key = { columnName }
87
+ className = "table-open-item"
88
+ onClick = { ( e ) => handleSelect ( e , columnName ) }
89
+ >
83
90
< div >
84
91
{ columnName } { columnType && < span className = "column-type" > { columnType } </ span > }
85
92
</ div >
@@ -168,7 +175,7 @@ export function SchemaList({ loading, schema, expandedFlags, onTableExpand, onIt
168
175
}
169
176
170
177
export function applyFilterOnSchema ( schema , filterString ) {
171
- const filters = filter ( filterString . toLowerCase ( ) . split ( / \s + / ) , s => s . length > 0 ) ;
178
+ const filters = filter ( filterString . toLowerCase ( ) . split ( / \s + / ) , ( s ) => s . length > 0 ) ;
172
179
173
180
// Empty string: return original schema
174
181
if ( filters . length === 0 ) {
@@ -181,21 +188,21 @@ export function applyFilterOnSchema(schema, filterString) {
181
188
const columnFilter = filters [ 0 ] ;
182
189
return filter (
183
190
schema ,
184
- item =>
191
+ ( item ) =>
185
192
includes ( item . name . toLowerCase ( ) , nameFilter ) ||
186
- some ( item . columns , column => includes ( get ( column , "name" ) . toLowerCase ( ) , columnFilter ) )
193
+ some ( item . columns , ( column ) => includes ( get ( column , "name" ) . toLowerCase ( ) , columnFilter ) )
187
194
) ;
188
195
}
189
196
190
197
// Two (or more) words: first matches table, seconds matches column
191
198
const nameFilter = filters [ 0 ] ;
192
199
const columnFilter = filters [ 1 ] ;
193
200
return filter (
194
- map ( schema , item => {
201
+ map ( schema , ( item ) => {
195
202
if ( includes ( item . name . toLowerCase ( ) , nameFilter ) ) {
196
203
item = {
197
204
...item ,
198
- columns : filter ( item . columns , column => includes ( get ( column , "name" ) . toLowerCase ( ) , columnFilter ) ) ,
205
+ columns : filter ( item . columns , ( column ) => includes ( get ( column , "name" ) . toLowerCase ( ) , columnFilter ) ) ,
199
206
} ;
200
207
return item . columns . length > 0 ? item : null ;
201
208
}
@@ -243,7 +250,7 @@ export default function SchemaBrowser({
243
250
placeholder = "Search schema..."
244
251
aria-label = "Search schema"
245
252
disabled = { schema . length === 0 }
246
- onChange = { event => handleFilterChange ( event . target . value ) }
253
+ onChange = { ( event ) => handleFilterChange ( event . target . value ) }
247
254
/>
248
255
249
256
< Tooltip title = "Refresh Schema" >
0 commit comments