mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
Merge branch 'user-permissions' of https://github.com/strapi/strapi into user-permissions
This commit is contained in:
commit
cbc0cf73dd
@ -17,7 +17,10 @@ class Logout extends React.Component { // eslint-disable-line react/prefer-state
|
||||
|
||||
handleGoTo = () => {
|
||||
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 = () => {
|
||||
|
||||
@ -49,8 +49,7 @@
|
||||
"Content-Type",
|
||||
"Authorization",
|
||||
"X-Frame-Options",
|
||||
"Origin",
|
||||
"X-Forwarded-Host"
|
||||
"Origin"
|
||||
]
|
||||
},
|
||||
"ip": {
|
||||
|
||||
@ -50,8 +50,7 @@
|
||||
"headers": [
|
||||
"Content-Type",
|
||||
"Authorization",
|
||||
"X-Frame-Options",
|
||||
"X-Forwarded-Host"
|
||||
"X-Frame-Options"
|
||||
]
|
||||
},
|
||||
"ip": {
|
||||
|
||||
@ -48,8 +48,7 @@
|
||||
"headers": [
|
||||
"Content-Type",
|
||||
"Authorization",
|
||||
"X-Frame-Options",
|
||||
"X-Forwarded-Host"
|
||||
"X-Frame-Options"
|
||||
]
|
||||
},
|
||||
"ip": {
|
||||
|
||||
@ -22,9 +22,9 @@ const pluginId = pluginPkg.name.replace(
|
||||
* @param messages
|
||||
*/
|
||||
const formatMessages = messages => reduce(messages, (result, value, key) => {
|
||||
const obj = result;
|
||||
obj[`${pluginId}.${key}`] = value;
|
||||
return obj;
|
||||
result[`${pluginId}.${key}`] = value;
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
|
||||
/**
|
||||
@ -37,7 +37,7 @@ const requireTranslations = language => {
|
||||
return require(`translations/${language}.json`); // eslint-disable-line global-require
|
||||
} 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.`);
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
@ -46,10 +46,9 @@ const requireTranslations = language => {
|
||||
*/
|
||||
|
||||
const translationMessages = reduce(strapi.languages, (result, language) => {
|
||||
const obj = result;
|
||||
const messages = requireTranslations(language);
|
||||
obj[language] = formatMessages(messages);
|
||||
return obj;
|
||||
result[language] = formatMessages(requireTranslations(language));
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
|
||||
export { translationMessages };
|
||||
|
||||
@ -82,8 +82,9 @@ function serverRestartWatcher(response) {
|
||||
// Set headers
|
||||
options.headers = Object.assign({
|
||||
'Content-Type': 'application/json',
|
||||
}, options.headers, {
|
||||
'X-Forwarded-Host': 'strapi',
|
||||
}, options.headers);
|
||||
});
|
||||
|
||||
const token = auth.getToken();
|
||||
|
||||
|
||||
@ -281,7 +281,7 @@ module.exports = {
|
||||
const connector = models[model].orm;
|
||||
|
||||
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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user