[Layout] Does renaming collection will erase collection's layout configuration

Hello,

We have a collection name “lead” and we would like to rename her “lead-family” (in code). We were
wonderring if this operation will remove all of layout configuration (field, altered value, …).

If it’s the case, can we copy the layout configuration in our new collection ?

Hello @Justin_Martin,

Unfortunately, it will erase the layout configuration for this collection. :confused:

To understand and help us get better in the future, why do you need to change it code-wise?

Impossible to do that too. I’m gonna push your request to the product team.

Kind regards,
Morgan

My problem is due to a missing of renaming the collection when I splited “lead” into “lead-family” and “lead-institution”. I also want to rename my model but due to the declaration of collection it’s not easy without renaming collection.

The second cause is link to the declaration of collection :
collection('collection-name-and-model-name', { .... })

We can’t define the model to use in collection declaration, the collection and model must have the same name. If we break this rule, the front will request the wrong endpoint because the default route are generated by Resources for each model and not each collection.

Proposal :
An other definition of collection with a new “model” params can allow us to link a model and a collection :
collection('collection-name', 'model-name' { .... })
and change the reference modelsManager.getModelByName(name) by modelsManager.getModelByName(modelName)

Hello @Justin_Martin,

Thanks for your proposal. In this case, the second parameter is like a fixedModelName.
We can study this solution, but we should look at potential drawbacks…

We don’t have the bandwidth to work on this right now.

I have shared your feedback with our product team so they can prioritize this in the future. :pray:

Kind regards,
Morgan

1 Like