1 | import React from 'react'
|
2 | import { storiesOf } from '@kadira/storybook'
|
3 |
|
4 | import BluprintConfigBuilder from '../src'
|
5 | import DeviceSelector from '../src/DeviceSelector'
|
6 | import sampleFlow from '../test/data/sample-flow.json'
|
7 | import composeFlow from '../test/data/compose-flow.json'
|
8 |
|
9 | import githubSampleFlow from '../test/data/sample-flow-github.json'
|
10 |
|
11 | import operationSchemas from '../test/data/tool-schema-registry.json'
|
12 | import deviceSchemas from '../test/data/device-schema-registry.json'
|
13 |
|
14 | function ghettoAction(label) {
|
15 | return function action(...args) {
|
16 | console.log(label, args)
|
17 | }
|
18 | }
|
19 |
|
20 | storiesOf('BluprintConfigBuilder', module)
|
21 | .add('Basic', () => (
|
22 | <BluprintConfigBuilder
|
23 | nodes={sampleFlow.nodes}
|
24 | operationSchemas={operationSchemas}
|
25 | deviceSchemas={deviceSchemas}
|
26 | onUpdate={ghettoAction('BluprintConfigBuilder:onUpdate')}
|
27 | />
|
28 | ))
|
29 |
|
30 | .add('Compose Node', () => (
|
31 | <BluprintConfigBuilder
|
32 | nodes={composeFlow.nodes}
|
33 | operationSchemas={operationSchemas}
|
34 | deviceSchemas={deviceSchemas}
|
35 | onUpdate={ghettoAction('BluprintConfigBuilder:onUpdate')}
|
36 | />
|
37 | ))
|
38 |
|
39 |
|
40 | .add('On Device Share', () => (
|
41 | <BluprintConfigBuilder
|
42 | nodes={sampleFlow.nodes}
|
43 | operationSchemas={operationSchemas}
|
44 | deviceSchemas={deviceSchemas}
|
45 | onUpdate={ghettoAction('BluprintConfigBuilder:onUpdate')}
|
46 | onShareDevice={ghettoAction('BluprintConfigBuilder:onShareDevice')}
|
47 | />
|
48 | ))
|
49 | .add('Flow with endo node', ()=> (
|
50 | <BluprintConfigBuilder
|
51 | nodes={githubSampleFlow.nodes}
|
52 | operationSchemas={operationSchemas}
|
53 | deviceSchemas={deviceSchemas}
|
54 | onUpdate={ghettoAction('BluprintConfigBuilder:onUpdate')}
|
55 | onShareDevice={ghettoAction('BluprintConfigBuilder:onShareDevice')}
|
56 | />
|
57 | ))
|