Merge branch 'user-permissions' of https://github.com/strapi/strapi into user-permissions

This commit is contained in:
Jim Laurie 2017-12-07 14:57:45 +01:00
commit cbc0cf73dd
7 changed files with 17 additions and 17 deletions

View File

@ -17,7 +17,10 @@ class Logout extends React.Component { // eslint-disable-line react/prefer-state
handleGoTo = () => { handleGoTo = () => {
const id = get(auth.getUserInfo(), 'id') || get(auth.getUserInfo(), '_id'); const id = get(auth.getUserInfo(), 'id') || get(auth.getUserInfo(), '_id');
this.context.router.history.push(`/plugins/content-manager/user/${id}?redirectUrl=/plugins/content-manager/user/?page=0&limit=0&sort=id&source=users-permissions`); this.context.router.history.push({
pathname: `/plugins/content-manager/user/${id}`,
search: '?redirectUrl=/plugins/content-manager/user/?page=0&limit=0&sort=id&source=users-permissions',
});
} }
handleLogout = () => { handleLogout = () => {

View File

@ -49,8 +49,7 @@
"Content-Type", "Content-Type",
"Authorization", "Authorization",
"X-Frame-Options", "X-Frame-Options",
"Origin", "Origin"
"X-Forwarded-Host"
] ]
}, },
"ip": { "ip": {

View File

@ -50,8 +50,7 @@
"headers": [ "headers": [
"Content-Type", "Content-Type",
"Authorization", "Authorization",
"X-Frame-Options", "X-Frame-Options"
"X-Forwarded-Host"
] ]
}, },
"ip": { "ip": {

View File

@ -48,8 +48,7 @@
"headers": [ "headers": [
"Content-Type", "Content-Type",
"Authorization", "Authorization",
"X-Frame-Options", "X-Frame-Options"
"X-Forwarded-Host"
] ]
}, },
"ip": { "ip": {

View File

@ -22,9 +22,9 @@ const pluginId = pluginPkg.name.replace(
* @param messages * @param messages
*/ */
const formatMessages = messages => reduce(messages, (result, value, key) => { const formatMessages = messages => reduce(messages, (result, value, key) => {
const obj = result; result[`${pluginId}.${key}`] = value;
obj[`${pluginId}.${key}`] = value;
return obj; return result;
}, {}); }, {});
/** /**
@ -37,7 +37,7 @@ const requireTranslations = language => {
return require(`translations/${language}.json`); // eslint-disable-line global-require return require(`translations/${language}.json`); // eslint-disable-line global-require
} catch (error) { } catch (error) {
console.error(`Unable to load "${language}" translation for the plugin ${pluginId}. Please make sure "${language}.json" file exists in "pluginPath/admin/src/translations" folder.`); console.error(`Unable to load "${language}" translation for the plugin ${pluginId}. Please make sure "${language}.json" file exists in "pluginPath/admin/src/translations" folder.`);
return false; return;
} }
}; };
@ -46,10 +46,9 @@ const requireTranslations = language => {
*/ */
const translationMessages = reduce(strapi.languages, (result, language) => { const translationMessages = reduce(strapi.languages, (result, language) => {
const obj = result; result[language] = formatMessages(requireTranslations(language));
const messages = requireTranslations(language);
obj[language] = formatMessages(messages); return result;
return obj;
}, {}); }, {});
export { translationMessages }; export { translationMessages };

View File

@ -82,8 +82,9 @@ function serverRestartWatcher(response) {
// Set headers // Set headers
options.headers = Object.assign({ options.headers = Object.assign({
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, options.headers, {
'X-Forwarded-Host': 'strapi', 'X-Forwarded-Host': 'strapi',
}, options.headers); });
const token = auth.getToken(); const token = auth.getToken();

View File

@ -281,7 +281,7 @@ module.exports = {
const connector = models[model].orm; const connector = models[model].orm;
if (!connector) { if (!connector) {
throw new Error(`Impossible to determine the use ORM for the model ${model}.`); throw new Error(`Impossible to determine the ORM used for the model ${model}.`);
} }
const convertor = strapi.hook[connector].load().getQueryParams; const convertor = strapi.hook[connector].load().getQueryParams;