-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1320 from contentful/feat/SPA-2047-experience-type
feat: support annotation for experience types [SPA-2047]
- Loading branch information
Showing
6 changed files
with
175 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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']) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters