Skip to content

Commit 3dbbae6

Browse files
authored
Merge pull request #42 from Progi1984/migrateDataDemo
Migrate `@data/demo` from Core
2 parents b085c92 + 4b99fd7 commit 3dbbae6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2597
-5
lines changed

src/data/demo/addresses.ts

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import FakerAddress from '@data/faker/address';
2+
3+
export default {
4+
address_1: new FakerAddress({
5+
id: 1,
6+
firstName: 'Anonymous',
7+
lastName: 'Anonymous',
8+
address: 'Anonymous',
9+
postalCode: '00000',
10+
city: 'Anonymous',
11+
country: 'France',
12+
}),
13+
address_2: new FakerAddress({
14+
id: 2,
15+
name: 'Mon adresse',
16+
firstName: 'John',
17+
lastName: 'DOE',
18+
company: 'My Company',
19+
address: '16, Main street',
20+
secondAddress: '2nd floor',
21+
postalCode: '75002',
22+
city: 'Paris',
23+
country: 'France',
24+
phone: '0102030405',
25+
}),
26+
address_5: new FakerAddress({
27+
id: 5,
28+
dni: '',
29+
alias: 'My address',
30+
firstName: 'John',
31+
lastName: 'DOE',
32+
company: 'My Company',
33+
vatNumber: '',
34+
address: '16, Main street',
35+
secondAddress: '2nd floor',
36+
postalCode: '33133',
37+
city: 'Miami',
38+
state: 'Florida',
39+
country: 'United States',
40+
phone: '0102030405',
41+
other: '',
42+
}),
43+
};

src/data/demo/attributes.ts

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import AttributeData from '@data/faker/attribute';
2+
import AttributeValueData from '@data/faker/attributeValue';
3+
4+
export default {
5+
size: new AttributeData({
6+
id: 1,
7+
name: 'Size',
8+
values: [
9+
// 0 : small
10+
new AttributeValueData({
11+
id: 1,
12+
value: 'S',
13+
position: 1,
14+
}),
15+
// 1 : medium
16+
new AttributeValueData({
17+
id: 1,
18+
value: 'M',
19+
position: 1,
20+
}),
21+
// 2 : large
22+
new AttributeValueData({
23+
id: 1,
24+
value: 'L',
25+
position: 1,
26+
}),
27+
// 3 : xLarge
28+
new AttributeValueData({
29+
id: 1,
30+
value: 'XL',
31+
position: 1,
32+
}),
33+
],
34+
position: 1,
35+
}),
36+
color: new AttributeData({
37+
id: 2,
38+
name: 'Color',
39+
values: [
40+
// 0 : grey
41+
new AttributeValueData({
42+
id: 5, value: 'Grey', color: '#AAB2BD', position: 1,
43+
}),
44+
// 1 : taupe
45+
new AttributeValueData({
46+
id: 6, value: 'Taupe', color: '#CFC4A6', position: 2,
47+
}),
48+
// 2 : beige
49+
new AttributeValueData({
50+
id: 7, value: 'Beige', color: '#f5f5dc', position: 3,
51+
}),
52+
// 3 : white
53+
new AttributeValueData({
54+
id: 8, value: 'White', color: '#ffffff', position: 4,
55+
}),
56+
// 4 : offWhite
57+
new AttributeValueData({
58+
id: 9, value: 'Off White', color: '#faebd7', position: 5,
59+
}),
60+
// 5 : red
61+
new AttributeValueData({
62+
id: 10, value: 'Red', color: '#E84C3D', position: 6,
63+
}),
64+
// 6 : black
65+
new AttributeValueData({
66+
id: 11, value: 'Black', color: '#434A54', position: 7,
67+
}),
68+
// 7 : camel
69+
new AttributeValueData({
70+
id: 12, value: 'Camel', color: '#C19A6B', position: 8,
71+
}),
72+
// 8 : orange
73+
new AttributeValueData({
74+
id: 13, value: 'Orange', color: '#F39C11', position: 9,
75+
}),
76+
// 9 : blue
77+
new AttributeValueData({
78+
id: 14, value: 'Blue', color: '#5D9CEC', position: 10,
79+
}),
80+
// 10 : green
81+
new AttributeValueData({
82+
id: 15, value: 'Green', color: '#A0D468', position: 11,
83+
}),
84+
// 11 : yellow
85+
new AttributeValueData({
86+
id: 16, value: 'Yellow', color: '#F1C40F', position: 12,
87+
}),
88+
// 12 : brown
89+
new AttributeValueData({
90+
id: 17, value: 'Brown', color: '#964B00', position: 13,
91+
}),
92+
// 13 : pink
93+
new AttributeValueData({
94+
id: 18, value: 'Pink', color: '#FCCACD', position: 14,
95+
}),
96+
],
97+
position: 2,
98+
}),
99+
dimension: new AttributeData({
100+
id: 3,
101+
name: 'Dimension',
102+
values: [
103+
// 0 : first
104+
new AttributeValueData({id: 19, value: '40*60cm', position: 1}),
105+
// 1 : second
106+
new AttributeValueData({id: 20, value: '60*90cm', position: 2}),
107+
// 2 : third
108+
new AttributeValueData({id: 21, value: '80*120cm', position: 3}),
109+
],
110+
position: 3,
111+
}),
112+
paperType: new AttributeData({
113+
id: 4,
114+
name: 'Paper Type',
115+
values: [
116+
// 0 : ruled
117+
new AttributeValueData({id: 22, value: 'Rules', position: 1}),
118+
// 1 : plain
119+
new AttributeValueData({id: 23, value: 'Plain', position: 2}),
120+
// 2 : squared
121+
new AttributeValueData({id: 24, value: 'Squared', position: 3}),
122+
// 3 : doted
123+
new AttributeValueData({id: 25, value: 'Doted', position: 4}),
124+
],
125+
position: 4,
126+
displayed: true,
127+
}),
128+
};

src/data/demo/boPages.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
pages: [
3+
'Dashboard',
4+
'Orders',
5+
'Products',
6+
],
7+
};

src/data/demo/brandAdresses.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import BrandAddressData from '@data/faker/brandAddress';
2+
3+
export default {
4+
brandAddress_3: new BrandAddressData({
5+
id: 3,
6+
brandName: '',
7+
firstName: 'supplier',
8+
lastName: 'supplier',
9+
postalCode: '10153',
10+
city: 'New York',
11+
country: 'United States',
12+
}),
13+
brandAddress_4: new BrandAddressData({
14+
id: 4,
15+
brandName: 'Studio Design',
16+
firstName: 'manufacturer',
17+
lastName: 'manufacturer',
18+
postalCode: '10154',
19+
city: 'New York',
20+
country: 'United States',
21+
}),
22+
};

src/data/demo/brands.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import BrandData from '@data/faker/brand';
2+
3+
export default {
4+
brand_1: new BrandData({
5+
id: 1,
6+
name: 'Studio Design',
7+
addresses: 1,
8+
products: 9,
9+
enabled: true,
10+
}),
11+
brand_2: new BrandData({
12+
id: 2,
13+
name: 'Graphic Corner',
14+
addresses: 0,
15+
products: 9,
16+
enabled: true,
17+
}),
18+
};

src/data/demo/carriers.ts

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import FakerCarrier from '@data/faker/carrier';
2+
3+
export default {
4+
clickAndCollect: new FakerCarrier({
5+
id: 1,
6+
name: 'Click and collect',
7+
delay: 'Pick up in-store',
8+
enable: true,
9+
freeShipping: true,
10+
position: 1,
11+
}),
12+
myCarrier: new FakerCarrier({
13+
id: 2,
14+
name: 'My carrier',
15+
delay: 'Delivery next day!',
16+
priceTTC: 8.40,
17+
price: 7.00,
18+
enable: true,
19+
freeShipping: false,
20+
position: 2,
21+
}),
22+
myCheapCarrier: new FakerCarrier({
23+
id: 3,
24+
name: 'My cheap carrier',
25+
delay: 'Buy more to pay less!',
26+
enable: false,
27+
freeShipping: false,
28+
priceTTC: 6.00,
29+
position: 3,
30+
}),
31+
myLightCarrier: new FakerCarrier({
32+
id: 4,
33+
name: 'My light carrier',
34+
delay: 'The lighter the cheaper!',
35+
enable: false,
36+
freeShipping: false,
37+
position: 4,
38+
}),
39+
};

src/data/demo/cmsPage.ts

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import FakerCMSPage from '@data/faker/cmsPage';
2+
3+
export default {
4+
delivery: new FakerCMSPage({
5+
id: 1,
6+
url: 'delivery',
7+
title: 'Delivery',
8+
metaTitle: '',
9+
position: 1,
10+
displayed: true,
11+
}),
12+
legalNotice: new FakerCMSPage({
13+
id: 2,
14+
url: 'legal-notice',
15+
title: 'Legal Notice',
16+
metaTitle: '',
17+
position: 2,
18+
displayed: true,
19+
}),
20+
termsAndCondition: new FakerCMSPage({
21+
id: 3,
22+
url: 'terms-and-conditions-of-use',
23+
title: 'Terms and conditions of use',
24+
metaTitle: '',
25+
position: 3,
26+
displayed: true,
27+
}),
28+
aboutUs: new FakerCMSPage({
29+
id: 4,
30+
url: 'about-us',
31+
title: 'About us',
32+
metaTitle: '',
33+
position: 4,
34+
displayed: true,
35+
}),
36+
securePayment: new FakerCMSPage({
37+
id: 5,
38+
url: 'secure-payment',
39+
title: 'Secure payment',
40+
metaTitle: '',
41+
position: 5,
42+
displayed: true,
43+
}),
44+
};

src/data/demo/contacts.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import FakerContact from '@data/faker/contact';
2+
3+
export default {
4+
webmaster: new FakerContact({
5+
id: 1,
6+
title: 'Webmaster',
7+
8+
description: 'If a technical problem occurs on this website',
9+
}),
10+
customerService: new FakerContact({
11+
id: 2,
12+
title: 'Customer service',
13+
14+
description: 'For any question about a product, an order',
15+
}),
16+
};

src/data/demo/employeeRoles.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import FakerEmployeeRole from '@data/faker/employeeRole';
2+
3+
export default [
4+
new FakerEmployeeRole({
5+
name: 'SuperAdmin',
6+
}),
7+
new FakerEmployeeRole({
8+
name: 'Logistician',
9+
}),
10+
new FakerEmployeeRole({
11+
name: 'Translator',
12+
}),
13+
new FakerEmployeeRole({
14+
name: 'Salesman',
15+
}),
16+
];

src/data/demo/employees.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import FakerEmployee from '@data/faker/employee';
2+
3+
export default {
4+
defaultEmployee: new FakerEmployee({
5+
id: 1,
6+
firstName: global.BO.FIRSTNAME,
7+
lastName: global.BO.LASTNAME,
8+
email: global.BO.EMAIL,
9+
password: global.BO.PASSWD,
10+
defaultPage: 'Dashboard',
11+
language: 'English (English)',
12+
active: true,
13+
}),
14+
};

src/data/demo/features.ts

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import FakerFeature from '@data/faker/feature';
2+
import FakerFeatureValue from '@data/faker/featureValue';
3+
4+
export default {
5+
composition: new FakerFeature({
6+
id: 1,
7+
position: 1,
8+
name: 'Composition',
9+
values: [
10+
new FakerFeatureValue({
11+
id: 1,
12+
value: 'Polyester',
13+
}),
14+
new FakerFeatureValue({
15+
id: 2,
16+
value: 'Wool',
17+
}),
18+
new FakerFeatureValue({
19+
id: 3,
20+
value: 'Ceramic',
21+
}),
22+
new FakerFeatureValue({
23+
id: 4,
24+
value: 'Cotton',
25+
}),
26+
new FakerFeatureValue({
27+
id: 5,
28+
value: 'Recycled cardboard',
29+
}),
30+
new FakerFeatureValue({
31+
id: 6,
32+
value: 'Matt paper',
33+
}),
34+
],
35+
}),
36+
property: new FakerFeature({
37+
id: 2,
38+
position: 2,
39+
name: 'Property',
40+
values: [],
41+
}),
42+
};

0 commit comments

Comments
 (0)