mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-15 12:46:04 +05:30
Переименовал passwordChange -> changePassword
This commit is contained in:
parent
d19735b7e1
commit
7ce8637e38
@ -194,7 +194,7 @@ class PanelTransition extends Component {
|
||||
'/password': 1,
|
||||
'/activation': 1,
|
||||
'/oauth/permissions': -1,
|
||||
'/password-change': 1,
|
||||
'/change-password': 1,
|
||||
'/forgot-password': 1
|
||||
};
|
||||
const sign = map[key];
|
||||
@ -216,7 +216,7 @@ class PanelTransition extends Component {
|
||||
'/register': not('/activation') ? 'Y' : 'X',
|
||||
'/activation': not('/register') ? 'Y' : 'X',
|
||||
'/oauth/permissions': 'Y',
|
||||
'/password-change': 'Y',
|
||||
'/change-password': 'Y',
|
||||
'/forgot-password': not('/password') && not('/login') ? 'Y' : 'X'
|
||||
};
|
||||
|
||||
|
@ -5,15 +5,14 @@ import Helmet from 'react-helmet';
|
||||
|
||||
import buttons from 'components/ui/buttons.scss';
|
||||
import { Input } from 'components/ui/Form';
|
||||
|
||||
import BaseAuthBody from 'components/auth/BaseAuthBody';
|
||||
import passwordChangedMessages from './PasswordChange.messages';
|
||||
|
||||
import icons from 'components/ui/icons.scss';
|
||||
import styles from './passwordChange.scss';
|
||||
|
||||
import messages from './ChangePassword.messages';
|
||||
import styles from './changePassword.scss';
|
||||
|
||||
class Body extends BaseAuthBody {
|
||||
static displayName = 'PasswordChangeBody';
|
||||
static displayName = 'ChangePasswordBody';
|
||||
|
||||
render() {
|
||||
return (
|
||||
@ -25,40 +24,47 @@ class Body extends BaseAuthBody {
|
||||
</div>
|
||||
|
||||
<p className={styles.descriptionText}>
|
||||
<Message {...passwordChangedMessages.changePasswordMessage} />
|
||||
<Message {...messages.changePasswordMessage} />
|
||||
</p>
|
||||
|
||||
<Input {...this.bindField('newPassword')}
|
||||
<Input {...this.bindField('password')}
|
||||
icon="key"
|
||||
color="darkBlue"
|
||||
autoFocus
|
||||
onFocus={this.fixAutoFocus}
|
||||
required
|
||||
placeholder={passwordChangedMessages.newPassword}
|
||||
placeholder={messages.currentPassword}
|
||||
/>
|
||||
|
||||
<Input {...this.bindField('newPassword')}
|
||||
icon="key"
|
||||
color="darkBlue"
|
||||
required
|
||||
placeholder={messages.newPassword}
|
||||
/>
|
||||
|
||||
<Input {...this.bindField('newRePassword')}
|
||||
icon="key"
|
||||
color="darkBlue"
|
||||
required
|
||||
placeholder={passwordChangedMessages.newRePassword}
|
||||
placeholder={messages.newRePassword}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default function PasswordChange() {
|
||||
export default function ChangePassword() {
|
||||
const componentsMap = {
|
||||
Title: () => ( // TODO: separate component for PageTitle
|
||||
<Message {...passwordChangedMessages.changePasswordTitle}>
|
||||
<Message {...messages.changePasswordTitle}>
|
||||
{(msg) => <span>{msg}<Helmet title={msg} /></span>}
|
||||
</Message>
|
||||
),
|
||||
Body,
|
||||
Footer: () => (
|
||||
<button className={buttons.darkBlue} type="submit">
|
||||
<Message {...passwordChangedMessages.change} />
|
||||
<Message {...messages.change} />
|
||||
</button>
|
||||
),
|
||||
Links: (props, context) => (
|
||||
@ -67,7 +73,7 @@ export default function PasswordChange() {
|
||||
|
||||
context.reject();
|
||||
}}>
|
||||
<Message {...passwordChangedMessages.skipThisStep} />
|
||||
<Message {...messages.skipThisStep} />
|
||||
</a>
|
||||
)
|
||||
};
|
@ -17,6 +17,10 @@ export default defineMessages({
|
||||
id: 'change',
|
||||
defaultMessage: 'Change'
|
||||
},
|
||||
currentPassword: {
|
||||
id: 'currentPassword',
|
||||
defaultMessage: 'Enter current password'
|
||||
},
|
||||
newPassword: {
|
||||
id: 'newPassword',
|
||||
defaultMessage: 'Enter new password'
|
@ -14,7 +14,7 @@ import Permissions from 'components/auth/permissions/Permissions';
|
||||
import Activation from 'components/auth/activation/Activation';
|
||||
import Password from 'components/auth/password/Password';
|
||||
import Logout from 'components/auth/Logout';
|
||||
import PasswordChange from 'components/auth/passwordChange/PasswordChange';
|
||||
import ChangePassword from 'components/auth/changePassword/ChangePassword';
|
||||
import ForgotPassword from 'components/auth/forgotPassword/ForgotPassword';
|
||||
import Finish from 'components/auth/finish/Finish';
|
||||
|
||||
@ -47,7 +47,7 @@ export default function routesFactory(store) {
|
||||
<Route path="/activation" components={new Activation()} {...onEnter} />
|
||||
<Route path="/oauth/permissions" components={new Permissions()} {...onEnter} />
|
||||
<Route path="/oauth/finish" component={Finish} {...onEnter} />
|
||||
<Route path="/password-change" components={new PasswordChange()} {...onEnter} />
|
||||
<Route path="/change-password" components={new ChangePassword()} {...onEnter} />
|
||||
<Route path="/forgot-password" components={new ForgotPassword()} {...onEnter} />
|
||||
</Route>
|
||||
</Route>
|
||||
|
@ -96,7 +96,7 @@ export default class AuthFlow {
|
||||
case '/login':
|
||||
case '/password':
|
||||
case '/activation':
|
||||
case '/password-change':
|
||||
case '/change-password':
|
||||
case '/oauth/permissions':
|
||||
case '/oauth/finish':
|
||||
this.setState(new LoginState());
|
||||
|
@ -3,7 +3,7 @@ import CompleteState from './CompleteState';
|
||||
|
||||
export default class ChangePasswordState extends AbstractState {
|
||||
enter(context) {
|
||||
context.navigate('/password-change');
|
||||
context.navigate('/change-password');
|
||||
}
|
||||
|
||||
reject(context) {
|
||||
|
Loading…
Reference in New Issue
Block a user