Fix design

This commit is contained in:
cyril lopez 2017-11-28 15:04:02 +01:00
parent 4d56b185bf
commit 2a27b915f8
7 changed files with 23 additions and 10 deletions

View File

@ -58,6 +58,14 @@ export class AdminPage extends React.Component { // eslint-disable-line react/pr
const endPoint = this.hasAdminUser() ? 'login': 'register';
this.props.history.push(`/plugins/users-permissions/auth/${endPoint}`);
}
if (!this.isUrlProtected(props) && includes(props.location.pathname, 'login') && !this.hasAdminUser()) {
this.props.history.push('/plugins/users-permissions/auth/register');
}
if (!this.isUrlProtected(props) && includes(props.location.pathname, 'register') && this.hasAdminUser()) {
this.props.history.push('/plugins/users-permissions/auth/login');
}
}
hasUsersPlugin = () => !isUndefined(get(this.props.plugins.toJS(), 'users-permissions'));

View File

@ -180,11 +180,11 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
<FormattedMessage id={`${this.props.label}`} />
</label>
<div className={`input-group ${styles.input}`} style={{ marginBottom: '1rem'}}>
<span className={`input-group-addon ${styles.addonEmail}`} />
<span className={`input-group-addon ${styles.addonEmail} ${!this.props.deactivateErrorHighlight && !isEmpty(this.state.errors) ? styles.errorAddon: ''}`} />
<FormattedMessage id={this.props.placeholder || this.props.label} values={this.props.labelValues}>
{(placeholder) => (
<input
className={`form-control ${!this.props.deactivateErrorHighlight && !isEmpty(this.state.errors) ? 'form-control-danger is-invalid': ''}`}
className={`form-control ${!this.props.deactivateErrorHighlight && !isEmpty(this.state.errors) ? `form-control-danger is-invalid ${styles.error}`: ''}`}
onChange={this.props.onChange}
value={this.props.value}
name={this.props.name}

View File

@ -1,5 +1,14 @@
/* stylelint-disable */
.error {
border-left: none!important;
}
.errorAddon {
border: 1px solid #ff203c!important;
border-right: none!important;
}
.errorContainer {
margin-top: .5rem;
margin-bottom: .5rem;
@ -77,7 +86,7 @@
display: inline-table;
color: #B3B5B9;
font-size: 16px;
font-weight: 600;
font-weight: 900;
font-family: Lato;
}
}

View File

@ -38,10 +38,6 @@ export function* submitForm() {
yield call(auth.setUserInfo, response.user, body.rememberMe);
}
if (formType === 'forgot-password') {
strapi.notification.info('The email has been sent');
}
yield put(submitSucceeded());
} catch(error) {
const formType = yield select(makeSelectFormType());

View File

@ -58,7 +58,7 @@
text-align: right;
> button {
margin-right: 1.4rem;
margin-right: 1.6rem;
}
}

View File

@ -40,7 +40,7 @@
"Auth.form.error.params.provide": "Incorrect params provided.",
"Auth.link.forgot-password": "Forgot your password?",
"Auth.link.ready": "Reasy to sign-in?",
"Auth.link.ready": "Ready to sign-in?",
"components.Input.error.password.noMatch": "Password don't match",

View File

@ -101,7 +101,7 @@ module.exports = {
init: async (ctx) => {
const hasAdmin = await strapi.query('user', 'users-permissions').find({
where: {
admin: true
role: '0'
}
});