Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List types in CustomFields #416

Closed
michaelbromley opened this issue Jul 23, 2020 · 0 comments
Closed

List types in CustomFields #416

michaelbromley opened this issue Jul 23, 2020 · 0 comments

Comments

@michaelbromley
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently the permitted data types for a custom field are:

export type CustomFieldType = 'string' | 'localeString' | 'int' | 'float' | 'boolean' | 'datetime';

It would be useful to allow lists/arrays of each of the above. This is already being implemented as part of #414 and a similar approach could be used for custom fields.

Describe the solution you'd like
Add a list: boolean config property to the TypedCustomFieldConfig type, so a list can be defined as:

customFields: {
  Product: [
    {
      name: 'keywords',
      type: 'localeString',
      list: true,
    },
 ],
}

In the AdminUI, this would then be presented as the regular string input but contained in a "list container" which includes a means to add new items, delete existing items, and re-order the list.

In the DB they would be stored as a simple-array type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant