-
Notifications
You must be signed in to change notification settings - Fork 317
/
Copy pathMetadataViewQueryBarExamples.js
51 lines (46 loc) · 1.49 KB
/
MetadataViewQueryBarExamples.js
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
// @flow
import * as React from 'react';
import QueryBar from '../../src/features/query-bar/QueryBar';
import type { ColumnType, ConditionType } from '../../src/features/query-bar/flowTypes';
import {
columnForItemName,
columnForItemLastUpdated,
columnWithEnumType,
columnForDateType,
columnWithMultiEnumType,
columnWithNumberType,
columnWithFloatType,
columnForTemplateFieldName,
} from '../../src/features/query-bar/components/fixtures';
import type { MetadataTemplate } from '../../src/common/types/metadata';
type Props = {
activeTemplate?: MetadataTemplate,
conditions: Array<ConditionType>,
onTemplateChange?: Function,
templates?: Array<MetadataTemplate>,
visibleColumns?: Array<ColumnType>,
};
const columns = [
columnForItemName,
columnForItemLastUpdated,
columnWithEnumType,
columnForDateType,
columnWithMultiEnumType,
columnWithNumberType,
columnWithFloatType,
columnForTemplateFieldName,
];
/* eslint-disable no-console */
const MetadataViewQueryBarExamples = ({ activeTemplate, onTemplateChange, templates, visibleColumns }: Props) => (
<QueryBar
activeTemplate={activeTemplate}
columns={columns}
conditions={[]}
onColumnChange={() => {}}
onFilterChange={newConditions => console.log({ newConditions })}
onTemplateChange={onTemplateChange}
templates={templates}
visibleColumns={visibleColumns || []}
/>
);
export default MetadataViewQueryBarExamples;