mirror of
https://github.com/strapi/strapi.git
synced 2025-08-27 10:15:59 +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.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
|
||||
await fs.copy(path.resolve(adminPath, 'package.json'), path.resolve(dest, 'package.json'));
|
||||
|
@ -1,6 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
const forgotPasswordTemplate = require('./email-templates/forgot-password');
|
||||
|
||||
module.exports = {
|
||||
layout: require('./layout'),
|
||||
...require('./settings'),
|
||||
forgotPassword: {
|
||||
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
|
||||
node_modules
|
||||
stats.json
|
||||
config/layout.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 { route } = ctx.state;
|
||||
|
||||
if (typeof route.handler !== 'string') {
|
||||
return next();
|
||||
}
|
||||
|
||||
const [, action] = route.handler.split('.');
|
||||
|
||||
const configPath =
|
||||
ct.plugin === 'admin'
|
||||
? ['server.admin.layout', ct.modelName, 'actions', ctx.request.route.action]
|
||||
: ['plugin', ct.plugin, 'layout', ct.modelName, 'actions', ctx.request.route.action];
|
||||
? ['server.admin.layout', ct.modelName, 'actions', action]
|
||||
: ['plugin', ct.plugin, 'layout', ct.modelName, 'actions', action];
|
||||
|
||||
const actionConfig = strapi.config.get(configPath);
|
||||
|
||||
|
@ -76,6 +76,7 @@ const getEnabledPlugins = async strapi => {
|
||||
const userPluginsConfig = existsSync(userPluginConfigPath)
|
||||
? loadConfigFile(userPluginConfigPath)
|
||||
: {};
|
||||
|
||||
_.forEach(userPluginsConfig, (declaration, pluginName) => {
|
||||
validatePluginName(pluginName);
|
||||
declaredPlugins[pluginName] = toDetailedDeclaration(declaration);
|
||||
@ -86,6 +87,7 @@ const getEnabledPlugins = async strapi => {
|
||||
p => !declaredPluginsResolves.includes(p.pathToPlugin),
|
||||
installedPlugins
|
||||
);
|
||||
|
||||
const enabledPlugins = pipe(
|
||||
defaultsDeep(declaredPlugins),
|
||||
defaultsDeep(installedPluginsNotAlreadyUsed),
|
||||
|
@ -5,10 +5,9 @@ node_modules
|
||||
|
||||
# writable files
|
||||
jwt.json
|
||||
config/layout.json
|
||||
actions.json
|
||||
|
||||
# Cruft
|
||||
.DS_Store
|
||||
npm-debug.log
|
||||
.idea
|
||||
.idea
|
||||
|
Loading…
x
Reference in New Issue
Block a user