mirror of
https://github.com/strapi/strapi.git
synced 2025-08-27 18:25:49 +00:00
Cleanup layout not needed
This commit is contained in:
parent
caee87bc10
commit
c6c4a62d2d
@ -149,10 +149,6 @@ async function copyAdmin(dest) {
|
|||||||
|
|
||||||
await fs.ensureDir(path.resolve(dest, 'config'));
|
await fs.ensureDir(path.resolve(dest, 'config'));
|
||||||
await fs.copy(path.resolve(adminPath, 'admin'), path.resolve(dest, 'admin'));
|
await fs.copy(path.resolve(adminPath, 'admin'), path.resolve(dest, 'admin'));
|
||||||
await fs.copy(
|
|
||||||
path.resolve(adminPath, 'server', 'config', 'layout.js'),
|
|
||||||
path.resolve(dest, 'config', 'layout.js')
|
|
||||||
);
|
|
||||||
|
|
||||||
// Copy package.json
|
// Copy package.json
|
||||||
await fs.copy(path.resolve(adminPath, 'package.json'), path.resolve(dest, 'package.json'));
|
await fs.copy(path.resolve(adminPath, 'package.json'), path.resolve(dest, 'package.json'));
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const forgotPasswordTemplate = require('./email-templates/forgot-password');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
layout: require('./layout'),
|
forgotPassword: {
|
||||||
...require('./settings'),
|
emailTemplate: forgotPasswordTemplate,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
administrator: {
|
|
||||||
actions: {
|
|
||||||
create: 'Admin.create',
|
|
||||||
update: 'Admin.update',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
1
packages/core/content-manager/.gitignore
vendored
1
packages/core/content-manager/.gitignore
vendored
@ -2,7 +2,6 @@
|
|||||||
coverage
|
coverage
|
||||||
node_modules
|
node_modules
|
||||||
stats.json
|
stats.json
|
||||||
config/layout.json
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,10 +12,19 @@ module.exports = async (ctx, next) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const target = ct.plugin === 'admin' ? strapi.admin : strapi.plugin(ct.plugin);
|
const target = ct.plugin === 'admin' ? strapi.admin : strapi.plugin(ct.plugin);
|
||||||
|
|
||||||
|
const { route } = ctx.state;
|
||||||
|
|
||||||
|
if (typeof route.handler !== 'string') {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
|
||||||
|
const [, action] = route.handler.split('.');
|
||||||
|
|
||||||
const configPath =
|
const configPath =
|
||||||
ct.plugin === 'admin'
|
ct.plugin === 'admin'
|
||||||
? ['server.admin.layout', ct.modelName, 'actions', ctx.request.route.action]
|
? ['server.admin.layout', ct.modelName, 'actions', action]
|
||||||
: ['plugin', ct.plugin, 'layout', ct.modelName, 'actions', ctx.request.route.action];
|
: ['plugin', ct.plugin, 'layout', ct.modelName, 'actions', action];
|
||||||
|
|
||||||
const actionConfig = strapi.config.get(configPath);
|
const actionConfig = strapi.config.get(configPath);
|
||||||
|
|
||||||
|
@ -76,6 +76,7 @@ const getEnabledPlugins = async strapi => {
|
|||||||
const userPluginsConfig = existsSync(userPluginConfigPath)
|
const userPluginsConfig = existsSync(userPluginConfigPath)
|
||||||
? loadConfigFile(userPluginConfigPath)
|
? loadConfigFile(userPluginConfigPath)
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
_.forEach(userPluginsConfig, (declaration, pluginName) => {
|
_.forEach(userPluginsConfig, (declaration, pluginName) => {
|
||||||
validatePluginName(pluginName);
|
validatePluginName(pluginName);
|
||||||
declaredPlugins[pluginName] = toDetailedDeclaration(declaration);
|
declaredPlugins[pluginName] = toDetailedDeclaration(declaration);
|
||||||
@ -86,6 +87,7 @@ const getEnabledPlugins = async strapi => {
|
|||||||
p => !declaredPluginsResolves.includes(p.pathToPlugin),
|
p => !declaredPluginsResolves.includes(p.pathToPlugin),
|
||||||
installedPlugins
|
installedPlugins
|
||||||
);
|
);
|
||||||
|
|
||||||
const enabledPlugins = pipe(
|
const enabledPlugins = pipe(
|
||||||
defaultsDeep(declaredPlugins),
|
defaultsDeep(declaredPlugins),
|
||||||
defaultsDeep(installedPluginsNotAlreadyUsed),
|
defaultsDeep(installedPluginsNotAlreadyUsed),
|
||||||
|
@ -5,10 +5,9 @@ node_modules
|
|||||||
|
|
||||||
# writable files
|
# writable files
|
||||||
jwt.json
|
jwt.json
|
||||||
config/layout.json
|
|
||||||
actions.json
|
actions.json
|
||||||
|
|
||||||
# Cruft
|
# Cruft
|
||||||
.DS_Store
|
.DS_Store
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
.idea
|
.idea
|
||||||
|
Loading…
x
Reference in New Issue
Block a user