-
Notifications
You must be signed in to change notification settings - Fork 150
/
54-create-experience-type.js
90 lines (80 loc) · 2.27 KB
/
54-create-experience-type.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
80
81
82
83
84
85
86
87
88
89
90
module.exports = function (migration) {
const experienceType = migration.createContentType('experienceType').name('Experience')
experienceType
.createField('title')
.name('Title')
.type('Symbol')
.localized(false)
.required(true)
.validations([])
.disabled(false)
.omitted(false)
experienceType.displayField('title')
experienceType
.createField('slug')
.name('Slug')
.type('Symbol')
.localized(false)
.required(true)
.validations([{ unique: true }])
.disabled(false)
.omitted(false)
experienceType
.createField('componentTree')
.name('Component Tree')
.type('Object')
.localized(false)
.required(true)
.validations([])
.disabled(false)
.omitted(false)
experienceType
.createField('dataSource')
.name('Data Source')
.type('Object')
.localized(false)
.required(true)
.validations([])
.disabled(false)
.omitted(false)
experienceType
.createField('unboundValues')
.name('Unbound Values')
.type('Object')
.localized(false)
.required(true)
.validations([])
.disabled(false)
.omitted(false)
experienceType
.createField('componentSettings')
.name('Component Settings')
.type('Object')
.localized(false)
.required(false)
.validations([])
.disabled(false)
.omitted(false)
experienceType
.createField('usedComponents')
.name('Used Components')
.type('Array')
.localized(false)
.required(false)
.validations([])
.disabled(false)
.omitted(false)
.items({
type: 'Link',
validations: [{ linkContentType: ['experienceType'] }],
linkType: 'Entry'
})
experienceType.changeFieldControl('title', 'builtin', 'singleLine')
experienceType.changeFieldControl('slug', 'builtin', 'slugEditor')
experienceType.changeFieldControl('componentTree', 'builtin', 'objectEditor')
experienceType.changeFieldControl('dataSource', 'builtin', 'objectEditor')
experienceType.changeFieldControl('unboundValues', 'builtin', 'objectEditor')
experienceType.changeFieldControl('componentSettings', 'builtin', 'objectEditor')
experienceType.changeFieldControl('usedComponents', 'builtin', 'entryLinksEditor')
experienceType.setAnnotations(['Contentful:ExperienceType'])
}