contentful/field-editors

Default Field Editors does not recognize `Link` field type

catdalfonso opened this issue · 2 comments

Case

 <Field sdk={sdk} />

where this is being rendered in a reference field.

Expected result

Field renders the default Contentful editor for a reference field.

Actual Result

The field does not render, with this in the console:

 controls-defaults.js?6882:240 Uncaught Error: Invalid field type
    at Object.getDefaultControlOfField (controls-defaults.js?6882:240:1)
    at getDefaultWidgetId (default-field-editors.esm.js?aacc:48:1)
    at Field (default-field-editors.esm.js?aacc:104:1)

Logging the sdk.field.type appears to log Link, which the underlying function here: https://github.com/contentful/contentful-management.js/blob/master/lib/constants/editor-interface-defaults/controls-defaults.ts#L50 does not seem to work with - it expects this to be Entry.

This appears to be a regression introduced with https://github.com/contentful/field-editors/pull/943/files#diff-5a67f874c5238f3bca3597587cd0915ed3758475ad2f884ff97c496f4bb6f28d .

Versions

 "@contentful/default-field-editors": "^1.1.33",
  "@contentful/app-sdk": "^4.8.0",

As a temporary workaround, I'm reverting to @contentful/default-field-editors@1.0.7.

Marking issue as stale since there was no acitivty for 30 days