-
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-726 Additional Quick Check Question (#4413)
- Loading branch information
Showing
13 changed files
with
548 additions
and
95 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
51 changes: 51 additions & 0 deletions
51
packages/contentful/migrations/crn/manuscripts/20241015143955-add-additional-quick-check.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,51 @@ | ||
module.exports.description = 'Add additional quick check field'; | ||
|
||
module.exports.up = (migration) => { | ||
const manuscriptVersions = migration.editContentType('manuscriptVersions'); | ||
|
||
const field = 'availabilityStatement'; | ||
const name = 'Included an Availability Statement?'; | ||
|
||
manuscriptVersions | ||
.createField(field) | ||
.name(name) | ||
.type('Symbol') | ||
.localized(false) | ||
.required(false) | ||
.validations([ | ||
{ | ||
in: ['Yes', 'No'], | ||
}, | ||
]) | ||
.disabled(false) | ||
.omitted(false); | ||
|
||
manuscriptVersions | ||
.createField(`${field}Details`) | ||
.name(`${name} (Details)`) | ||
.type('Symbol') | ||
.localized(false) | ||
.required(false) | ||
.validations([]) | ||
.disabled(false) | ||
.omitted(false); | ||
|
||
manuscriptVersions.changeFieldControl( | ||
`${field}Details`, | ||
'builtin', | ||
'singleLine', | ||
{}, | ||
); | ||
|
||
manuscriptVersions | ||
.moveField(field) | ||
.afterField('labMaterialsRegisteredDetails'); | ||
manuscriptVersions.moveField(`${field}Details`).afterField(field); | ||
}; | ||
|
||
module.exports.down = (migration) => { | ||
const manuscriptVersions = migration.editContentType('manuscriptVersions'); | ||
|
||
manuscriptVersions.deleteField('availabilityStatement'); | ||
manuscriptVersions.deleteField('availabilityStatementDetails'); | ||
}; |
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.