-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
area: extensions/widgets/relationtype: bugcode to address defects in shipped codecode to address defects in shipped code
Description
Describe the bug
If we define a relation
field with multiple: true
and min
or max
we get the following typescript typings error
Object literal may only specify known properties, and 'min' does not exist in type '(CmsFieldBase & CmsFieldRelation) | (CmsFieldBase & CmsFieldMeta)'.
To Reproduce
- Have a project using Typescript
- Have your CMS schema defined in typescript
Sample code:
import CMS from 'netlify-cms-app';
const local_backend = process.env.NODE_ENV === 'development';
CMS.init({
config: {
local_backend,
load_config_file: false,
backend: {
name: 'git-gateway',
branch: 'main',
},
collections: [
{
name: 'pages',
label: 'Pages',
folder: 'cms/content/pages',
create: false,
slug: '{{slug}}',
fields: [
{
label: 'Fund Types',
name: 'fundTypes',
widget: 'relation',
collection: 'Options',
search_fields: ['label'],
value_field: 'label',
multiple: true,
min: 1, // we get the error here
},
],
},
],
},
});
Expected behavior
No typescript error should occur, because min
and max
are valid relation properties
Screenshots
Applicable Versions:
- "netlify-cms-app": "^2.15.72",
CMS configuration
import CMS from 'netlify-cms-app';
const local_backend = process.env.NODE_ENV === 'development';
CMS.init({
config: {
local_backend,
load_config_file: false,
backend: {
name: 'git-gateway',
branch: 'main',
},
collections: [
{
name: 'pages',
label: 'Pages',
folder: 'cms/content/pages',
create: false,
slug: '{{slug}}',
fields: [
{
label: 'Fund Types',
name: 'fundTypes',
widget: 'relation',
collection: 'Options',
search_fields: ['label'],
value_field: 'label',
multiple: true,
min: 1, // we get the error here
},
],
},
],
},
});
Additional context
Metadata
Metadata
Assignees
Labels
area: extensions/widgets/relationtype: bugcode to address defects in shipped codecode to address defects in shipped code