-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASAP-21 (GP2) Add tags to news (#4218)
- Loading branch information
Showing
21 changed files
with
443 additions
and
215 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
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
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
32 changes: 32 additions & 0 deletions
32
packages/contentful/migrations/gp2/news/20240326151708-add-tags-field.js
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,32 @@ | ||
module.exports.description = 'Add tags to news content model'; | ||
|
||
module.exports.up = (migration) => { | ||
const news = migration.editContentType('news'); | ||
|
||
news | ||
.createField('tags') | ||
.name('Tags') | ||
.type('Array') | ||
.localized(false) | ||
.required(false) | ||
.validations([]) | ||
.disabled(false) | ||
.omitted(false) | ||
.items({ | ||
type: 'Link', | ||
|
||
validations: [ | ||
{ | ||
linkContentType: ['tags'], | ||
}, | ||
], | ||
|
||
linkType: 'Entry', | ||
}); | ||
|
||
news.moveField('tags').afterField('linkText'); | ||
}; | ||
|
||
module.exports.down = (migration) => { | ||
migration.editContentType('news').deleteField('tags'); | ||
}; |
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
Oops, something went wrong.