Fix settings-manager description typo, expose only the needed informations in /plugins

This commit is contained in:
cyril lopez 2017-11-09 13:30:54 +01:00
parent f3bddb77c8
commit aa3de8a310
5 changed files with 10 additions and 13 deletions

View File

@ -18,13 +18,7 @@ export function getPlugins() {
}; };
} }
export function getPluginsSucceeded(data) { export function getPluginsSucceeded({ plugins }) {
const plugins = Object.keys(data.plugins).reduce((acc, key) => {
acc[key] = data.plugins[key].package.strapi;
return acc;
}, {});
return { return {
type: GET_PLUGINS_SUCCEEDED, type: GET_PLUGINS_SUCCEEDED,
plugins, plugins,

View File

@ -63,9 +63,7 @@ export class ListPluginsPage extends React.Component { // eslint-disable-line re
} }
} }
ListPluginsPage.contextTypes = { ListPluginsPage.contextTypes = {};
// plugins: PropTypes.object,
};
ListPluginsPage.propTypes = { ListPluginsPage.propTypes = {
getPlugins: PropTypes.func.isRequired, getPlugins: PropTypes.func.isRequired,

View File

@ -45,7 +45,13 @@ module.exports = {
plugins: async ctx => { plugins: async ctx => {
try { try {
ctx.send({ plugins: strapi.plugins }); const plugins = Object.keys(strapi.plugins).reduce((acc, key) => {
acc[key] = strapi.plugins[key].package.strapi;
return acc;
}, {});
ctx.send({ plugins });
} catch(err) { } catch(err) {
ctx.badRequest(null, [{ messages: [{ id: 'An error occured' }] }]); ctx.badRequest(null, [{ messages: [{ id: 'An error occured' }] }]);
} }

View File

@ -1,5 +1,5 @@
{ {
"plugin.description": "Configurate your project in seconds", "plugin.description": "Configure your project in seconds",
"menu.section.global-settings": "Global settings", "menu.section.global-settings": "Global settings",
"menu.item.application": "Application", "menu.item.application": "Application",
"menu.item.languages": "Languages", "menu.item.languages": "Languages",

View File

@ -33,7 +33,6 @@ module.exports = function() {
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
// Load configurations. // Load configurations.
glob('{./plugins/*/!(config|node_modules)/*.*(js|json),./plugins/*/package.json}', {}, (err, files) => { glob('{./plugins/*/!(config|node_modules)/*.*(js|json),./plugins/*/package.json}', {}, (err, files) => {
if (err) { if (err) {
return reject(err); return reject(err);
} }