remove possibility to set collectionName table for a CT or component through that CTB API

This commit is contained in:
Pierre Noël 2021-09-16 11:52:46 +02:00
parent 7f0877b73f
commit a933d6c71a
2 changed files with 4 additions and 10 deletions

View File

@ -42,13 +42,13 @@ module.exports = function createComponentBuilder() {
filename: `${nameToSlug(infos.name)}.json`,
});
const defaultCollectionName = `components_${nameToCollectionName(
const collectionName = `components_${nameToCollectionName(
infos.category
)}_${nameToCollectionName(pluralize(infos.name))}`;
handler
.setUID(uid)
.set('collectionName', infos.collectionName || defaultCollectionName)
.set('collectionName', collectionName)
.set(['info', 'name'], infos.name)
.set(['info', 'icon'], infos.icon)
.set(['info', 'description'], infos.description)
@ -98,7 +98,6 @@ module.exports = function createComponentBuilder() {
component
.setUID(newUID)
.setDir(newDir)
.set('collectionName', infos.collectionName)
.set(['info', 'name'], infos.name)
.set(['info', 'icon'], infos.icon)
.set(['info', 'description'], infos.description)

View File

@ -84,8 +84,6 @@ module.exports = function createComponentBuilder() {
this.contentTypes.set(uid, contentType);
const defaultCollectionName = nameToCollectionName(infos.pluralName);
// support self referencing content type relation
Object.keys(infos.attributes).forEach(key => {
const { target } = infos.attributes[key];
@ -97,16 +95,14 @@ module.exports = function createComponentBuilder() {
contentType
.setUID(uid)
.set('kind', infos.kind || typeKinds.COLLECTION_TYPE)
.set('collectionName', infos.collectionName || defaultCollectionName)
.set('collectionName', nameToCollectionName(infos.pluralName))
.set('info', {
singularName: infos.singularName,
pluralName: infos.pluralName,
displayName: infos.displayName,
description: infos.description,
})
.set('options', {
draftAndPublish: infos.draftAndPublish || false,
})
.set('options', { draftAndPublish: infos.draftAndPublish || false })
.set('pluginOptions', infos.pluginOptions)
.setAttributes(this.convertAttributes(infos.attributes));
@ -213,7 +209,6 @@ module.exports = function createComponentBuilder() {
});
contentType
.set('collectionName', infos.collectionName)
.set('kind', infos.kind || contentType.schema.kind)
.set(['info', 'displayName'], infos.displayName)
.set(['info', 'description'], infos.description)