From 4aa46c5d0fd97031d25d5c39c2eb9d8906e40875 Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Thu, 28 Jun 2018 09:31:17 +0200 Subject: [PATCH] Store config in core_store --- .../config/functions/bootstrap.js | 11 ++++++++--- .../strapi-plugin-content-manager/config/layout.json | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/strapi-plugin-content-manager/config/functions/bootstrap.js b/packages/strapi-plugin-content-manager/config/functions/bootstrap.js index 37c11afd5f..90a4836412 100644 --- a/packages/strapi-plugin-content-manager/config/functions/bootstrap.js +++ b/packages/strapi-plugin-content-manager/config/functions/bootstrap.js @@ -35,6 +35,11 @@ module.exports = async cb => { label: _.upperFirst(name), labelPlural: _.upperFirst(pluralize(name)), orm: model.orm || 'mongoose', + search: true, + filters: true, + bulkActions: true, + pageEntries: 20, + defaultSort: 'id' }; // Fields (non relation) @@ -50,10 +55,11 @@ module.exports = async cb => { // schemaModel.list = _.slice(_.keys(schemaModel.fields), 0, 4); schemaModel.listDisplay = Object.keys(schemaModel.fields) // Construct Array of attr ex { type: 'string', label: 'Foo', name: 'Foo', description: '' } - .map(attr => Object.assign(schemaModel.fields[attr], { name: attr })) + // NOTE: Do we allow sort on boolean? + .map(attr => Object.assign(schemaModel.fields[attr], { name: attr, sortable: true, searchable: true })) // Retrieve only the fourth first items .slice(0, 4); - + if (model.associations) { // Model relations schemaModel.relations = model.associations.reduce((acc, current) => { @@ -101,7 +107,6 @@ module.exports = async cb => { }); const buildSchemaKeys = (data) => Object.keys(data).reduce((acc, curr) => { - if (curr !== 'plugins') { if (!data[curr].fields && _.isObject(data[curr])) { diff --git a/packages/strapi-plugin-content-manager/config/layout.json b/packages/strapi-plugin-content-manager/config/layout.json index 53e5def681..430ecb52f2 100644 --- a/packages/strapi-plugin-content-manager/config/layout.json +++ b/packages/strapi-plugin-content-manager/config/layout.json @@ -6,6 +6,9 @@ }, "json": { "appearance": "" + }, + "bool": { + "appearance": "" } } }