Fix tests

This commit is contained in:
Alexandre Bodin 2019-07-22 17:39:36 +02:00
parent 128b26f1ee
commit e68f230baa
3 changed files with 1 additions and 34 deletions

View File

@ -306,18 +306,6 @@ module.exports = {
return ctx.badRequest(null, [{ messages: removeModelErrors }]); return ctx.badRequest(null, [{ messages: removeModelErrors }]);
} }
const pluginStore = strapi.store({
environment: '',
type: 'plugin',
name: 'content-manager',
});
const schema = await pluginStore.get({ key: 'schema' });
delete schema.layout[model];
await pluginStore.set({ key: 'schema', value: schema });
ctx.send({ ok: true }); ctx.send({ ok: true });
strapi.reload(); strapi.reload();

View File

@ -53,14 +53,6 @@ module.exports = {
? _.get(strapi.plugins, [source, 'models', name]) ? _.get(strapi.plugins, [source, 'models', name])
: _.get(strapi.models, name); : _.get(strapi.models, name);
const pluginStore = strapi.store({
environment: '',
type: 'plugin',
name: 'content-manager',
});
const schema = await pluginStore.get({ key: 'schema' });
const attributes = []; const attributes = [];
_.forEach(model.attributes, (params, attr) => { _.forEach(model.attributes, (params, attr) => {
const relation = _.find(model.associations, { alias: attr }); const relation = _.find(model.associations, { alias: attr });
@ -90,17 +82,6 @@ module.exports = {
} }
} }
const appearance = _.get(schema, [
'layout',
name,
'attributes',
attr,
'appearance',
]);
if (appearance) {
_.set(params, ['appearance', appearance], true);
}
attributes.push({ attributes.push({
name: attr, name: attr,
params, params,

View File

@ -1,7 +1,5 @@
'use strict'; 'use strict';
const _ = require('lodash');
const initMap = groups => { const initMap = groups => {
const map = new Map(); const map = new Map();
@ -17,7 +15,7 @@ const initMap = groups => {
map.set(key, { map.set(key, {
uid: key, uid: key,
schema: { schema: {
name: _.upperFirst(name || key), name: name || key,
connection, connection,
collectionName, collectionName,
description, description,