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

This commit is contained in:
Aurelsicoko 2017-12-07 14:05:47 +01:00
commit 48c9670240
11 changed files with 17 additions and 23 deletions

View File

@ -60,18 +60,6 @@ export class AdminPage extends React.Component { // eslint-disable-line react/pr
}
}
componentWillUpdate(nextProps) {
if (includes(nextProps.location.pathname, 'plugins') && nextProps.location.pathname !== '/list-plugins') {
const appPlugins = Object.keys(nextProps.plugins.toJS());
const pluginPath = nextProps.location.pathname.split('/')[2];
const shouldRedirect = appPlugins.filter(el => el === pluginPath).length === 0;
if (shouldRedirect) {
this.props.history.push('/404');
}
}
}
checkLogin = (props) => {
if (props.hasUserPlugin && this.isUrlProtected(props) && !auth.getToken()) {
const endPoint = this.hasAdminUser(props) ? 'login': 'register';

View File

@ -36,7 +36,7 @@ export function* pluginsGet() {
yield put(getPluginsSucceeded(response));
} catch(err) {
strapi.notification.error('app.components.listPluginsPage.deletePlugin.error');
strapi.notification.error('notification.error');
}
}
// Individual exports for testing

View File

@ -58,7 +58,7 @@ class SelectMany extends React.Component { // eslint-disable-line react/prefer-s
return { options };
})
.catch(() => {
strapi.notification.error('An error occurred during relationship fetch.');
strapi.notification.error('content-manager.notification.error.relationship.fetch');
});
}

View File

@ -58,7 +58,7 @@ class SelectOne extends React.Component { // eslint-disable-line react/prefer-st
return {options};
})
.catch(() => {
strapi.notification.error('An error occurred during relationship fetch.');
strapi.notification.error('content-manager.notification.relationship.fetch');
});
}
@ -72,7 +72,7 @@ class SelectOne extends React.Component { // eslint-disable-line react/prefer-st
: '';
const value = this.props.record.get(this.props.relation.alias);
/* eslint-disable jsx-a11y/label-has-for */
return (
<div className={`form-group ${styles.selectOne}`}>

View File

@ -37,6 +37,8 @@
"error.attribute.sameKeyAndName": "Can't be equals",
"error.validation.minSupMax": "Can't be superior",
"notification.error.relationship.fetch": "An error occurred during relationship fetch.",
"success.record.delete": "Deleted",
"success.record.save": "Saved",

View File

@ -38,6 +38,8 @@
"error.attribute.sameKeyAndName": "Ne peuvent pas être égaux",
"error.validation.minSupMax": "Ne peut pas être plus grand",
"notification.error.relationship.fetch": "Une erreur est survenue en récupérant les relations.",
"success.record.delete": "Supprimé",
"success.record.save": "Sauvegardé",

View File

@ -89,7 +89,7 @@
> button {
z-index: 999;
margin-right: -1.5rem;
margin-right: -2.5rem;
color: #C3C5C8;
opacity: 1;
font-size: 1.8rem;

View File

@ -43,7 +43,7 @@ export function* getTableExistance() {
yield put(checkIfTableExistsSucceeded(tableExists));
} catch(error) {
strapi.notification.error('An error occured');
strapi.notification.error('notification.error');
}
}
@ -58,7 +58,7 @@ export function* fetchModel(action) {
yield put(unsetButtonLoader());
} catch(error) {
strapi.notification.error('An error occured');
strapi.notification.error('notification.error');
}
}

View File

@ -94,6 +94,7 @@
"notification.error.message": "An error occured",
"notification.info.contentType.creating.notSaved": "Please save your current Content Type before creating a new one",
"notification.info.optimized": "This plugin is optimized with your localStorage",
"notification.success.message.contentType.edit": "Your content type has been updated",
"notification.success.message.contentType.create": "Your content type has been created",
"notification.success.contentTypeDeleted": "The content type has been deleted",

View File

@ -95,6 +95,7 @@
"notification.error.message": "Une erreur est survenue",
"notification.info.contentType.creating.notSaved": "Sauvegardez votre Modèle en cours avant d'en créer un nouveau",
"notification.info.optimized": "Ce plugin est optimisé pour votre localStorage",
"notification.success.message.contentType.edit": "Votre modèle a bien été modifié",
"notification.success.message.contentType.create": "Votre modèle a bien été créée",
"notification.success.contentTypeDeleted": "Le modèle a bien été supprimé.",

View File

@ -50,7 +50,7 @@ export const storeData = {
return localStorage.setItem(contentType, stringify(data));
}
return strapi.notification.info('This plugin is optimized with your localStorage');
return strapi.notification.info('content-type-builder.notification.info.optimized');
},
setMenu(data, menu = MENU) {
@ -58,7 +58,7 @@ export const storeData = {
return localStorage.setItem(menu, stringify(data));
}
return strapi.notification.info('This plugin is optimized with your localStorage');
return strapi.notification.info('content-type-builder.notification.info.optimized');
},
setModel(data, model = MODEL) {
@ -66,7 +66,7 @@ export const storeData = {
return localStorage.setItem(model, stringify(data));
}
return strapi.notification.info('This plugin is optimized with your localStorage');
return strapi.notification.info('content-type-builder.notification.info.optimized');
},
setIsModelTemporary(isModelTemporay = IS_MODEL_TEMPORARY) {
@ -74,6 +74,6 @@ export const storeData = {
return localStorage.setItem(isModelTemporay, true);
}
return strapi.notification.info('This plugin is optimized with your localStorage');
return strapi.notification.info('content-type-builder.notification.info.optimized');
},
};