contentstack / ui-extensions-sdk

The function of Contentstack's UI can be extended by adding custom widgets and fields through extensions. The following Extensions SDK gives an overview of different custom extensions for you to add to the Contentstack app.
MIT License
21 stars 12 forks source link

Feat/throw error for unavailable nested fields #38

Closed Deepak-Kharah closed 2 years ago

Deepak-Kharah commented 2 years ago

The entry data is empty when the user is on the create the new page. This would work if getField is used to fetch root elements. But, when we try to fetch the nested elements it fails with no useful information to the user. Hence, to have a consistent output, we are throwing an error for all the getField() calls within the new entry page.

We determine whether the page is in create mode or edit mode by checking if the entry is present. Because entry data is not passed to SDK when it is on the create page.

Please Note: Since we allow only custom fields within the create new entry page, this change only applies to the custom fields.

fixes: CS-27725