-
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.
fix(editor-interface): control changes of newly created fields should…
… not trigger errors for editor interfaces with editorLayout property (#1142) * fix(editor-interface): add tests for field control updates with editorLayout present * fix(editor-interface): add more unit tests for field control updates * fix(editor-interface): if editorLayout exists add field id on field control updates * fix(editor-interface): use available util functions for id check * fix(editor-interface): test moving new field on ct with editorLayout * Update src/lib/entities/content-type.ts Co-authored-by: Joanna Zakrzewska <[email protected]>
- Loading branch information
1 parent
df81a25
commit 20efd48
Showing
5 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
examples/50-change-field-control-on-editor-interface-with-editor-layout.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,12 @@ | ||
module.exports = function (migration) { | ||
const contentTypeWithEditorLayout = migration.editContentType('page') | ||
|
||
contentTypeWithEditorLayout | ||
.createField('additionalField') | ||
.type('Text') | ||
.name('additionalFieldName') | ||
.localized(true) | ||
.validations([{ size: { max: 3 } }]) | ||
|
||
contentTypeWithEditorLayout.changeFieldControl('additionalField', 'builtin', 'singleLine') | ||
} |
12 changes: 12 additions & 0 deletions
12
examples/51-move-field-on-content-type-with-editor-layout.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,12 @@ | ||
module.exports = function (migration) { | ||
const contentTypeWithEditorLayout = migration.editContentType('page') | ||
|
||
contentTypeWithEditorLayout | ||
.createField('anotherAdditionalField') | ||
.type('Text') | ||
.name('anotherAdditionalFieldName') | ||
.localized(true) | ||
.validations([{ size: { max: 3 } }]) | ||
|
||
contentTypeWithEditorLayout.moveField('anotherAdditionalField').beforeField('additionalField') | ||
} |
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