mirror of
https://github.com/strapi/strapi.git
synced 2025-09-16 12:02:41 +00:00
remove possibility to set collectionName table for a CT or component through that CTB API
This commit is contained in:
parent
7f0877b73f
commit
a933d6c71a
@ -42,13 +42,13 @@ module.exports = function createComponentBuilder() {
|
|||||||
filename: `${nameToSlug(infos.name)}.json`,
|
filename: `${nameToSlug(infos.name)}.json`,
|
||||||
});
|
});
|
||||||
|
|
||||||
const defaultCollectionName = `components_${nameToCollectionName(
|
const collectionName = `components_${nameToCollectionName(
|
||||||
infos.category
|
infos.category
|
||||||
)}_${nameToCollectionName(pluralize(infos.name))}`;
|
)}_${nameToCollectionName(pluralize(infos.name))}`;
|
||||||
|
|
||||||
handler
|
handler
|
||||||
.setUID(uid)
|
.setUID(uid)
|
||||||
.set('collectionName', infos.collectionName || defaultCollectionName)
|
.set('collectionName', collectionName)
|
||||||
.set(['info', 'name'], infos.name)
|
.set(['info', 'name'], infos.name)
|
||||||
.set(['info', 'icon'], infos.icon)
|
.set(['info', 'icon'], infos.icon)
|
||||||
.set(['info', 'description'], infos.description)
|
.set(['info', 'description'], infos.description)
|
||||||
@ -98,7 +98,6 @@ module.exports = function createComponentBuilder() {
|
|||||||
component
|
component
|
||||||
.setUID(newUID)
|
.setUID(newUID)
|
||||||
.setDir(newDir)
|
.setDir(newDir)
|
||||||
.set('collectionName', infos.collectionName)
|
|
||||||
.set(['info', 'name'], infos.name)
|
.set(['info', 'name'], infos.name)
|
||||||
.set(['info', 'icon'], infos.icon)
|
.set(['info', 'icon'], infos.icon)
|
||||||
.set(['info', 'description'], infos.description)
|
.set(['info', 'description'], infos.description)
|
||||||
|
@ -84,8 +84,6 @@ module.exports = function createComponentBuilder() {
|
|||||||
|
|
||||||
this.contentTypes.set(uid, contentType);
|
this.contentTypes.set(uid, contentType);
|
||||||
|
|
||||||
const defaultCollectionName = nameToCollectionName(infos.pluralName);
|
|
||||||
|
|
||||||
// support self referencing content type relation
|
// support self referencing content type relation
|
||||||
Object.keys(infos.attributes).forEach(key => {
|
Object.keys(infos.attributes).forEach(key => {
|
||||||
const { target } = infos.attributes[key];
|
const { target } = infos.attributes[key];
|
||||||
@ -97,16 +95,14 @@ module.exports = function createComponentBuilder() {
|
|||||||
contentType
|
contentType
|
||||||
.setUID(uid)
|
.setUID(uid)
|
||||||
.set('kind', infos.kind || typeKinds.COLLECTION_TYPE)
|
.set('kind', infos.kind || typeKinds.COLLECTION_TYPE)
|
||||||
.set('collectionName', infos.collectionName || defaultCollectionName)
|
.set('collectionName', nameToCollectionName(infos.pluralName))
|
||||||
.set('info', {
|
.set('info', {
|
||||||
singularName: infos.singularName,
|
singularName: infos.singularName,
|
||||||
pluralName: infos.pluralName,
|
pluralName: infos.pluralName,
|
||||||
displayName: infos.displayName,
|
displayName: infos.displayName,
|
||||||
description: infos.description,
|
description: infos.description,
|
||||||
})
|
})
|
||||||
.set('options', {
|
.set('options', { draftAndPublish: infos.draftAndPublish || false })
|
||||||
draftAndPublish: infos.draftAndPublish || false,
|
|
||||||
})
|
|
||||||
.set('pluginOptions', infos.pluginOptions)
|
.set('pluginOptions', infos.pluginOptions)
|
||||||
.setAttributes(this.convertAttributes(infos.attributes));
|
.setAttributes(this.convertAttributes(infos.attributes));
|
||||||
|
|
||||||
@ -213,7 +209,6 @@ module.exports = function createComponentBuilder() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
contentType
|
contentType
|
||||||
.set('collectionName', infos.collectionName)
|
|
||||||
.set('kind', infos.kind || contentType.schema.kind)
|
.set('kind', infos.kind || contentType.schema.kind)
|
||||||
.set(['info', 'displayName'], infos.displayName)
|
.set(['info', 'displayName'], infos.displayName)
|
||||||
.set(['info', 'description'], infos.description)
|
.set(['info', 'description'], infos.description)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user