Skip to content

Change static texts according to the new styleguide #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 2 additions & 32 deletions src/javascript/app/pages/user/account/change_password.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ChangePassword = (() => {
}
return localize('Check the email account associated with your Apple ID and click the link in the email to proceed.');
case 'trading_password':
return localize('Please click on the link in the email to reset your trading password.');
return localize('Please click on the link in the email to reset your MT5 password.');
default:
return localize('Please click on the link in the email to reset your binary password.');
}
Expand Down Expand Up @@ -111,7 +111,7 @@ const ChangePassword = (() => {
$social_signup_container.setVisibility(1);
getElementById('linked_social_identifier').innerHTML = localize('Linked with [_1]', social_signups[social_signup_identifier].name);
getElementById('ic_linked_social_identifier').src = Url.urlForStatic(`images/pages/account_password/${social_signups[social_signup_identifier].icon}.svg`);

// Handle unlinking social signup
$(social_unlink_btn_id).off('click').on('click', () => {
Dialog.confirm({
Expand All @@ -130,18 +130,6 @@ const ChangePassword = (() => {
$trading_password_container.setVisibility(1);
$set_trading_password_container.setVisibility(0);

// Handle change trading password
FormManager.init(trading_form_id, [
{ selector: '#old_trading_password', request_field: 'old_password', validations: ['req', ['length', { min: 6, max: 25 }]], clear_form_error_on_input: true },
{ selector: '#new_trading_password', request_field: 'new_password', validations: ['req', 'password', ['not_equal', { to: '#old_trading_password', name1: localize('Current password'), name2: localize('New password') }], 'compare_to_email'] },
{ request_field: 'trading_platform_password_change', value: 1 },
]);
FormManager.handleSubmit({
form_selector : trading_form_id,
fnc_response_handler: tradingPwHandler,
enable_button : true,
});

// Handle forgot trading password
$(forgot_trading_pw_btn_id).off('click').on('click', () => {
onSentEmail('trading_password');
Expand Down Expand Up @@ -199,24 +187,6 @@ const ChangePassword = (() => {
}
};

const tradingPwHandler = (response) => {
if ('error' in response) {
const $frm_change_trading_password_error = $('#frm_change_trading_password_error');
$frm_change_trading_password_error.text(response.error.message).setVisibility(1);
setTimeout(() => {
$frm_change_trading_password_error.setVisibility(0);
}, 5000);
} else {
$msg_success_trading.text(localize('Your trading password has been changed. Please use this to log in to MetaTrader 5.'));
$msg_success_trading_container.setVisibility(1);
$(trading_form_id).trigger('reset');
Password.removeCheck('#new_trading_password', true);
setTimeout(() => {
$msg_success_trading_container.setVisibility(0);
}, 5000);
}
};

const onLoad = () => {
$change_password_container = $('#change_password_container');
$change_password_loading = $('#change_password_loading');
Expand Down
4 changes: 2 additions & 2 deletions src/javascript/app/pages/user/trading_reset_password.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const TradingResetPassword = (() => {
} else {
Dialog.alert({
id : 'success_reset_trading_pw_dialog',
localized_message: localize('You have a new trading password. Use this to log in to MetaTrader 5.'),
localized_title : localize('Trading password'),
localized_message: localize('You have a new MT5 password to log in to your MT5 accounts on web and mobile apps. '),
localized_title : localize('Success'),
ok_text : localize('Done'),
onConfirm : () => { BinaryPjax.load(Url.urlFor('trading')); },
});
Expand Down
110 changes: 46 additions & 64 deletions src/templates/app/user/security/change_password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,78 +95,60 @@ const ChangePassword = () => (
</Fieldset>
</form>
<form className='form gr-padding-10' id='frm_trading_password'>
<Fieldset legend={it.L('Trading password')}>
<p className='hint'>{it.L('Use this to log in and trade with MT5.')}</p>
<div className='gr-gutter gr-padding-20'>
<div className='gr-row clear' id='trading_password_content_wrapper'>
<div id='trading_password_container' className='row-inner gr-7 gr-12-p gr-12-m align-self-center invisible'>
<div className='align-start'>
<FormRow autoComplete='current-password' type='password' id='old_trading_password' label={it.L('Current password')} />
<FormRow
autoComplete='new-password'
has_password_meter
type='password'
id='new_trading_password'
label={it.L('New password')}
<Fieldset legend={it.L('MT5 password')}>
<div className='gr-7 gr-12-p gr-12-m'>
<p className='hint'>{it.L('Use the MT5 password to log in to your MT5 accounts on the desktop, web and mobile apps.')}</p>
</div>
<div className='gr-row clear' id='trading_password_content_wrapper'>
<div id='trading_password_container' className='row-inner gr-7 gr-12-p gr-12-m align-self-center invisible'>
<div className='align-start'>
<div className='gr-row gr-padding-10'>
<a
id='forgot_trading_pw_btn'
className='button gr-6 gr-12-p gr-12-m gr-gutter center-text-m align-end'
href='javascript:;'
>
<span>{it.L('Change password')}</span>
</a>
<p
id='frm_change_trading_password_error'
className='error-msg no-margin gr-gutter invisible'
/>
<div className='gr-row gr-padding-10'>
<a
id='forgot_trading_pw_btn'
className='button-secondary gr-6 gr-12-p gr-12-m gr-gutter center-text-m align-end'
href='javascript:;'
>
<span>{it.L('Forgot password')}</span>
</a>
<div className='gr-6 gr-12-p gr-12-m gr-gutter center-text-m'>
<button
id='change_trading_pw_btn'
className='button'
msg_id='frm_change_trading_password_error'
type='submit'
>
{it.L('Change password')}
</button>
</div>
<p
id='frm_change_trading_password_error'
className='error-msg no-margin gr-gutter invisible'
/>
</div>
</div>
</div>
<div id='set_trading_password_container' className='row-inner gr-7 gr-12-p gr-12-m align-self-center invisible'>
<div className='align-start'>
<FormRow
autoComplete='set_trading-password'
has_password_meter
type='password'
id='set_new_trading_password'
label={it.L('Trading password')}
/>
<div className='gr-row gr-padding-10'>
<div className='gr-4 gr-0-p gr-0-m'>&nbsp;</div>
<div className='gr-6 gr-12-p gr-12-m gr-gutter center-text-m'>
<button
id='set_trading_btn'
className='button'
msg_id='frm_set_trading_password_error'
type='submit'
>
{it.L('Set trading password')}
</button>
</div>
</div>
<div id='set_trading_password_container' className='row-inner gr-7 gr-12-p gr-12-m align-self-center invisible'>
<div className='align-start'>
<FormRow
autoComplete='set_trading-password'
has_password_meter
type='password'
id='set_new_trading_password'
label={it.L('Trading password')}
/>
<div className='gr-row gr-padding-10'>
<div className='gr-4 gr-0-p gr-0-m'>&nbsp;</div>
<div className='gr-6 gr-12-p gr-12-m gr-gutter center-text-m'>
<button
id='set_trading_btn'
className='button'
msg_id='frm_set_trading_password_error'
type='submit'
>
{it.L('Set trading password')}
</button>
</div>
</div>
</div>
<div className='gr-5 gr-12-p gr-12-m'>
<p className='hint'>{it.L('Apps you have linked to this password:')}</p>
<AppsList platform='trading' />
</div>
</div>
<ul id='msg_success_trading_container' className='gr-padding-10 checked invisible'>
<li id='msg_success_trading' />
</ul>
<div className='gr-5 gr-12-p gr-12-m'>
<p className='hint'>{it.L('Apps you have linked to this password:')}</p>
<AppsList platform='trading' />
</div>
</div>
<ul id='msg_success_trading_container' className='gr-padding-10 checked invisible'>
<li id='msg_success_trading' />
</ul>
</Fieldset>
</form>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/templates/app/user/trading_reset_password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ const TradingResetPassword = () => (
<form id='frm_trading_reset_password'>
<Fieldset legend={it.L('Details')}>
<div className='gr-12'>
<p className='fieldset-subtitle'>{it.L('Enter a new trading password.')}</p>
<p className='fieldset-subtitle'>{it.L('Create a new MT5 password.')}</p>
<FormRow
autoComplete='new-password'
has_password_meter
type='password'
id='new_password'
label={it.L('New trading password')}
label={it.L('MT5 password')}
/>
<SubmitButton type='submit' no_error text={it.L('Confirm password')} />
<SubmitButton type='submit' no_error text={it.L('Create')} />
</div>
</Fieldset>
</form>
Expand Down