Skip to content

Commit

Permalink
[FIX] Correct message for manual approval user Registration (#1906)
Browse files Browse the repository at this point in the history
* [FIX] Correct message for manual approval from admin shown on Registeration

* lint fix - added semicolon

* Updated the translations

* [FIX] Translations

* i18n to match server

Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
  • Loading branch information
3 people committed Apr 1, 2020
1 parent 6982d76 commit df0a385
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
3 changes: 3 additions & 0 deletions app/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export default {
Accounts_ShowFormLogin: {
type: 'valueAsBoolean'
},
Accounts_ManuallyApproveNewUsers: {
type: 'valueAsBoolean'
},
CROWD_Enable: {
type: 'valueAsBoolean'
},
Expand Down
4 changes: 3 additions & 1 deletion app/i18n/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ export default {
Uses_server_configuration: 'Uses server configuration',
Usually_a_discussion_starts_with_a_question_like_How_do_I_upload_a_picture: 'Usually, a discussion starts with a question, like "How do I upload a picture?"',
Validating: 'Validating',
Registration_Succeeded: 'Registration Succeeded!',
Verify: 'Verify',
Verify_email_title: 'Registration Succeeded!',
Verify_email_desc: 'We have sent you an email to confirm your registration. If you do not receive an email shortly, please come back and try again.',
Expand Down Expand Up @@ -557,5 +558,6 @@ export default {
You_will_be_logged_out_of_this_application: 'You will be logged out of this application.',
Clear: 'Clear',
This_will_clear_all_your_offline_data: 'This will clear all your offline data.',
Mark_unread: 'Mark Unread'
Mark_unread: 'Mark Unread',
Wait_activation_warning: 'Before you can login, your account must be manually activated by an administrator.'
};
3 changes: 2 additions & 1 deletion app/i18n/locales/pt-BR.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,5 +498,6 @@ export default {
You_will_be_logged_out_of_this_application: 'Você sairá deste aplicativo.',
Clear: 'Limpar',
This_will_clear_all_your_offline_data: 'Isto limpará todos os seus dados offline.',
Mark_unread: 'Marcar como não Lida'
Mark_unread: 'Marcar como não Lida',
Wait_activation_warning: 'Antes que você possa fazer o login, sua conta deve ser manualmente ativada por um administrador.'
};
14 changes: 12 additions & 2 deletions app/views/RegisterView.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class RegisterView extends React.Component {
server: PropTypes.string,
Accounts_CustomFields: PropTypes.string,
Accounts_EmailVerification: PropTypes.bool,
Accounts_ManuallyApproveNewUsers: PropTypes.bool,
theme: PropTypes.string,
Site_Name: PropTypes.string,
loginRequest: PropTypes.func,
Expand Down Expand Up @@ -127,7 +128,12 @@ class RegisterView extends React.Component {
const {
name, email, password, username, customFields
} = this.state;
const { loginRequest, Accounts_EmailVerification, navigation } = this.props;
const {
loginRequest,
Accounts_EmailVerification,
navigation,
Accounts_ManuallyApproveNewUsers
} = this.props;

try {
await RocketChat.register({
Expand All @@ -136,7 +142,10 @@ class RegisterView extends React.Component {

if (Accounts_EmailVerification) {
await navigation.goBack();
showErrorAlert(I18n.t('Verify_email_desc'), I18n.t('Verify_email_title'));
showErrorAlert(I18n.t('Verify_email_desc'), I18n.t('Registration_Succeeded'));
} else if (Accounts_ManuallyApproveNewUsers) {
await navigation.goBack();
showErrorAlert(I18n.t('Wait_activation_warning'), I18n.t('Registration_Succeeded'));
} else {
await loginRequest({ user: email, password });
}
Expand Down Expand Up @@ -325,6 +334,7 @@ const mapStateToProps = state => ({
CAS_login_url: state.settings.CAS_login_url,
Accounts_CustomFields: state.settings.Accounts_CustomFields,
Accounts_EmailVerification: state.settings.Accounts_EmailVerification,
Accounts_ManuallyApproveNewUsers: state.settings.Accounts_ManuallyApproveNewUsers,
showLoginButton: getShowLoginButton(state)
});

Expand Down

0 comments on commit df0a385

Please sign in to comment.