allow components in the list view

This commit is contained in:
Pierre Noël 2022-01-10 12:06:36 +01:00
parent 828b143bb2
commit 0dba1fc644
2 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ const { PUBLISHED_AT_ATTRIBUTE } = contentTypesUtils.constants;
const NON_SORTABLES = ['component', 'json', 'media', 'richtext', 'dynamiczone']; const NON_SORTABLES = ['component', 'json', 'media', 'richtext', 'dynamiczone'];
const SORTABLE_RELATIONS = ['oneToOne', 'manyToOne']; const SORTABLE_RELATIONS = ['oneToOne', 'manyToOne'];
const NON_LISTABLES = ['component', 'json', 'password', 'richtext', 'dynamiczone']; const NON_LISTABLES = ['json', 'password', 'richtext', 'dynamiczone'];
const LISTABLE_RELATIONS = ['oneToOne', 'oneToMany', 'manyToOne', 'manyToMany']; const LISTABLE_RELATIONS = ['oneToOne', 'oneToMany', 'manyToOne', 'manyToMany'];
// hidden fields are fields that are configured to be hidden from list, and edit views // hidden fields are fields that are configured to be hidden from list, and edit views

View File

@ -19,7 +19,7 @@ function createDefaultMetadatas(schema) {
id: { id: {
edit: {}, edit: {},
list: { list: {
label: 'Id', label: 'id',
searchable: true, searchable: true,
sortable: true, sortable: true,
}, },
@ -29,7 +29,7 @@ function createDefaultMetadatas(schema) {
function createDefaultMetadata(schema, name) { function createDefaultMetadata(schema, name) {
const edit = { const edit = {
label: _.upperFirst(name), label: name,
description: '', description: '',
placeholder: '', placeholder: '',
visible: isVisible(schema, name), visible: isVisible(schema, name),
@ -59,7 +59,7 @@ function createDefaultMetadata(schema, name) {
); );
const list = { const list = {
label: _.upperFirst(name), label: name,
searchable: isSearchable(schema, name), searchable: isSearchable(schema, name),
sortable: isSortable(schema, name), sortable: isSortable(schema, name),
..._.pick(_.get(schema, ['config', 'metadatas', name, 'list'], {}), [ ..._.pick(_.get(schema, ['config', 'metadatas', name, 'list'], {}), [