update items.validtion to allow single entry inserts to existing array#1507
update items.validtion to allow single entry inserts to existing array#1507eric-foster-angi wants to merge 5 commits intocontentful:mainfrom
Conversation
|
SUPPORT. This is great. |
|
Hey. Thank you for making this commit. Our team is taking a look at it and will let you know if we have any questions. |
|
Just a quick update: still taking a look at this, will have more concrete feedback/questions/approvals in the next 2 weeks, hopefully sooner. In the meantime I'll run the circle CI tests. Thanks for the patience. |
|
Looks like there might be some failing tests? |
744ad3d to
6791b71
Compare
|
Sorry for the delay, rebased with master, fixed tests, and updated based on feedback. How can I run the tests here for the MR? |
Hey @eric-foster-angi we can help you run the PR checks and get this merged in after the holidays. We will sync back with you the week of 12/29. |
Summary
Implements fix for issue: #1166
When updating the valid Content Types for a reference Content Model field, you cannot just insert or add a single entry as
validationswill completely write over the existing entries. This requires copying and pasting the list which introduces the risk that someone might do it wrong and wipe out needed values.Instead, we should be able to just add/insert a new value to the array, reducing risk and headache.
Description
implements a new method addItemsValidation that allows you to update existing validations on items without completely writing over the existing values.
Motivation and Context
Given an existing model defined as:
Today if we wanted to add contentModelC to this list of validations, we must redefine the entire array:
Instead it would be desirable to be able to add a single entry:
Todos
None
Screenshots