strapi-layout-plugin 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/index.js +0 -2
- package/server/register.js +11 -2
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
const controllers = require('./controllers');
|
|
4
4
|
const routes = require('./routes');
|
|
5
5
|
const contentTypes = require('./content-types');
|
|
6
|
-
const bootstrap = require('./bootstrap');
|
|
7
6
|
|
|
8
7
|
module.exports = {
|
|
9
8
|
controllers,
|
|
10
9
|
routes,
|
|
11
10
|
contentTypes,
|
|
12
|
-
bootstrap,
|
|
13
11
|
};
|
package/server/register.js
CHANGED
|
@@ -25,8 +25,17 @@ module.exports = ({ strapi }) => {
|
|
|
25
25
|
|
|
26
26
|
for (const [uid, schema] of Object.entries(componentsToInject)) {
|
|
27
27
|
if (!strapi.components[uid]) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const parts = uid.split('.');
|
|
29
|
+
const category = parts[0];
|
|
30
|
+
const modelName = parts.slice(1).join('.');
|
|
31
|
+
|
|
32
|
+
// Mock the structure Strapi expects for components to avoid database.init crash
|
|
33
|
+
strapi.components[uid] = Object.assign({}, schema, {
|
|
34
|
+
uid,
|
|
35
|
+
category,
|
|
36
|
+
modelName,
|
|
37
|
+
modelType: 'component'
|
|
38
|
+
});
|
|
30
39
|
}
|
|
31
40
|
}
|
|
32
41
|
|