mirror of
https://github.com/strapi/strapi.git
synced 2025-11-12 08:08:05 +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 = () => {
|
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 = () => {
|
||||||
|
|||||||
@ -49,8 +49,7 @@
|
|||||||
"Content-Type",
|
"Content-Type",
|
||||||
"Authorization",
|
"Authorization",
|
||||||
"X-Frame-Options",
|
"X-Frame-Options",
|
||||||
"Origin",
|
"Origin"
|
||||||
"X-Forwarded-Host"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ip": {
|
"ip": {
|
||||||
|
|||||||
@ -50,8 +50,7 @@
|
|||||||
"headers": [
|
"headers": [
|
||||||
"Content-Type",
|
"Content-Type",
|
||||||
"Authorization",
|
"Authorization",
|
||||||
"X-Frame-Options",
|
"X-Frame-Options"
|
||||||
"X-Forwarded-Host"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ip": {
|
"ip": {
|
||||||
|
|||||||
@ -48,8 +48,7 @@
|
|||||||
"headers": [
|
"headers": [
|
||||||
"Content-Type",
|
"Content-Type",
|
||||||
"Authorization",
|
"Authorization",
|
||||||
"X-Frame-Options",
|
"X-Frame-Options"
|
||||||
"X-Forwarded-Host"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ip": {
|
"ip": {
|
||||||
|
|||||||
@ -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 };
|
||||||
|
|||||||
@ -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();
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user