-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.stories.js
79 lines (75 loc) · 2.6 KB
/
index.stories.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
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
import {app} from 'ut-portal/storybook';
import model from '..';
import {tree, modelTree} from './tree';
import {plantation} from './plantation';
export default {
title: 'Model'
};
const organization = [
{value: 100, label: 'Africa'},
{value: 300, label: 'Asia'},
{value: 400, label: 'Australia'},
{value: 500, label: 'Europe'},
{value: 600, label: 'North America'},
{value: 700, label: 'South America'},
{value: 101, parents: 100, label: 'Egypt'},
{value: 102, parents: 100, label: 'Kenya'},
{value: 103, parents: 100, label: 'Ghana'},
{value: 104, parents: 100, label: 'Nigeria'},
{value: 301, parents: 300, label: 'Philippines'},
{value: 302, parents: 300, label: 'India'},
{value: 501, parents: 500, label: 'Bulgaria'},
{value: 601, parents: 600, label: 'USA'},
{value: 701, parents: 700, label: 'Mexico'}
];
const page = app({
implementation: 'model',
utModel: true,
utCore: true
}, {
'customer.organization.graphFetch': () => ({
organization: organization.map(({value: id, label: title, ...org}) => ({id, title, ...org}))
}),
'model.dropdown.list': () => ({
}),
login: () => ({
result: {
'permission.get': [{
actionId: '%'
}]
}
})
}, [
function utModel() {
return {
config: () => ({
storybook: {
browser: true,
backend: {
mock: true
}
}
}),
browser: () => model.component([tree, plantation], [
() => ({ namespace: 'component/model' })
])
};
},
function utModel() {
return model.backendMock([tree], () => ({modelTree}));
}
]);
export const TreeBrowse = page('model.tree.browse');
export const TreeOpen = page('model.tree.open', 101);
export const TreeOpenThumbIndex = page('model.tree.open', 101, {layout: 'thumbIndex'});
const treeNew = 'model.tree.new';
export const TreeNew = page(treeNew);
export const TreeNewFamilyId14 = page(treeNew, {'tree.familyId': 14});
export const TreeNewConifer = page(treeNew, {type: 'conifer'});
export const TreeNewBroadleaf = page(treeNew, {type: 'broadleaf'});
export const TreeNewFlat = page(treeNew, {layout: 'flat'});
export const TreeNewNested = page(treeNew, {layout: 'nested'});
export const TreeNew3Col = page(treeNew, {layout: '3col'});
export const TreeNewThumbIndex = page(treeNew, {layout: 'thumbIndex'});
export const TreeReport = page('model.tree.report', 'list');
export const PlantationNew = page('model.plantation.new');