diff --git a/client/src/app-components/are-you-sure.js b/client/src/app-components/are-you-sure.js index f2bb55d5..4bff7460 100644 --- a/client/src/app-components/are-you-sure.js +++ b/client/src/app-components/are-you-sure.js @@ -41,7 +41,7 @@ class AreYouSure extends React.Component { {i18n('ARE_YOU_SURE')}
- {this.props.description} + {this.props.description || (this.props.type === 'secure' && i18n('PLEASE_CONFIRM_PASSWORD'))}
{(this.props.type === 'secure') ? this.renderPassword() : null}
diff --git a/client/src/app/admin/panel/settings/admin-panel-advanced-settings.js b/client/src/app/admin/panel/settings/admin-panel-advanced-settings.js index d453e030..010aa405 100644 --- a/client/src/app/admin/panel/settings/admin-panel-advanced-settings.js +++ b/client/src/app/admin/panel/settings/admin-panel-advanced-settings.js @@ -39,13 +39,13 @@ class AdminPanelAdvancedSettings extends React.Component {
- {i18n('USER_SYSTEM_ENABLED')} + {i18n('ENABLE_USER_SYSTEM')}
- {i18n('REGISTRATION')} + {i18n('ENABLE_USER_REGISTRATION')}
@@ -127,11 +127,11 @@ class AdminPanelAdvancedSettings extends React.Component { } onToggleButtonUserSystemChange() { - AreYouSure.openModal(
{i18n('PLEASE_CONFIRM_PASSWORD')}
, this.onAreYouSureUserSystemOk.bind(this), 'secure'); + AreYouSure.openModal(null, this.onAreYouSureUserSystemOk.bind(this), 'secure'); } onToggleButtonRegistrationChange() { - AreYouSure.openModal(
{i18n('PLEASE_CONFIRM_PASSWORD')}
, this.onAreYouSureRegistrationOk.bind(this), 'secure'); + AreYouSure.openModal(null, this.onAreYouSureRegistrationOk.bind(this), 'secure'); } onAreYouSureUserSystemOk(password) { @@ -143,10 +143,10 @@ class AdminPanelAdvancedSettings extends React.Component { }).then(() => { this.setState({ messageType: 'success', - messageContent: this.props.config['user-system-enabled'] ? i18n('USER_SYSTEM_DISABLE_DESCRIPTION') : i18n('USER_SYSTEM_ENABLE_DESCRIPTION') + messageContent: this.props.config['user-system-enabled'] ? i18n('USER_SYSTEM_DISABLED') : i18n('USER_SYSTEM_ENABLED') }); this.props.dispatch(ConfigActions.updateData()); - }).catch(() => this.setState({messageType: 'fail', messageContent: i18n('ERROR_UPDATING_SETTINGS')})); + }).catch(() => this.setState({messageType: 'error', messageContent: i18n('ERROR_UPDATING_SETTINGS')})); } onAreYouSureRegistrationOk(password) { @@ -158,18 +158,18 @@ class AdminPanelAdvancedSettings extends React.Component { }).then(() => { this.setState({ messageType: 'success', - messageContent: this.props.config['user-system-enabled'] ? i18n('REGISTRATION_DISABLE_DESCRIPTION') : i18n('REGISTRATION_ENABLE_DESCRIPTION') + messageContent: this.props.config['registration'] ? i18n('REGISTRATION_DISABLED') : i18n('REGISTRATION_ENABLED') }); this.props.dispatch(ConfigActions.updateData()); - }).catch(() => this.setState({messageType: 'fail', messageContent: i18n('ERROR_UPDATING_SETTINGS')})); + }).catch(() => this.setState({messageType: 'error', messageContent: i18n('ERROR_UPDATING_SETTINGS')})); } onImportCSV(event) { - AreYouSure.openModal(
{i18n('PLEASE_CONFIRM_PASSWORD')}
, this.onAreYouSureCSVOk.bind(this, event.target.value), 'secure'); + AreYouSure.openModal(null, this.onAreYouSureCSVOk.bind(this, event.target.value), 'secure'); } onImportSQL(event) { - AreYouSure.openModal(
{i18n('PLEASE_CONFIRM_PASSWORD')}
, this.onAreYouSureSQLOk.bind(this, event.target.value), 'secure'); + AreYouSure.openModal(null, this.onAreYouSureSQLOk.bind(this, event.target.value), 'secure'); } onAreYouSureCSVOk(file, password) { @@ -180,7 +180,7 @@ class AdminPanelAdvancedSettings extends React.Component { password: password } }).then(() => this.setState({messageType: 'success', messageContent: i18n('SUCCESS_IMPORTING_CSV_DESCRIPTION')} - )).catch(() => this.setState({messageType: 'fail', messageContent: i18n('ERROR_IMPORTING_CSV_DESCRIPTION')})); + )).catch(() => this.setState({messageType: 'error', messageContent: i18n('ERROR_IMPORTING_CSV_DESCRIPTION')})); } onAreYouSureSQLOk(file, password) { @@ -191,7 +191,7 @@ class AdminPanelAdvancedSettings extends React.Component { password: password } }).then(() => this.setState({messageType: 'success', messageContent: i18n('SUCCESS_IMPORTING_SQL_DESCRIPTION')} - )).catch(() => this.setState({messageType: 'fail', messageContent: i18n('ERROR_IMPORTING_SQL_DESCRIPTION')})); + )).catch(() => this.setState({messageType: 'error', messageContent: i18n('ERROR_IMPORTING_SQL_DESCRIPTION')})); } onBackupDatabase() { @@ -210,7 +210,7 @@ class AdminPanelAdvancedSettings extends React.Component { } onDeleteAllUsers() { - AreYouSure.openModal(
{i18n('PLEASE_CONFIRM_PASSWORD')}
, this.onAreYouSureDeleteAllUsersOk.bind(this), 'secure'); + AreYouSure.openModal(null, this.onAreYouSureDeleteAllUsersOk.bind(this), 'secure'); } onAreYouSureDeleteAllUsersOk(password) { @@ -220,7 +220,7 @@ class AdminPanelAdvancedSettings extends React.Component { password: password } }).then(() => this.setState({messageType: 'success', messageContent: i18n('SUCCESS_DELETING_ALL_USERS')} - )).catch(() => this.setState({messageType: 'fail', messageContent: i18n('ERROR_DELETING_ALL_USERS')})); + )).catch(() => this.setState({messageType: 'error', messageContent: i18n('ERROR_DELETING_ALL_USERS')})); } } diff --git a/client/src/data/fixtures/system-fixtures.js b/client/src/data/fixtures/system-fixtures.js index f84766b7..64f7d3d8 100644 --- a/client/src/data/fixtures/system-fixtures.js +++ b/client/src/data/fixtures/system-fixtures.js @@ -140,6 +140,26 @@ module.exports = [ return 'text content'; } }, + { + path: '/system/import-csv', + time: 100, + response: function () { + return { + status: 'success', + data: {} + }; + } + }, + { + path: '/system/import-sql', + time: 100, + response: function () { + return { + status: 'success', + data: {} + }; + } + }, { path: '/system/get-mail-templates', time: 100, diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js index 5b9fd926..4d2564fa 100644 --- a/client/src/data/languages/en.js +++ b/client/src/data/languages/en.js @@ -152,8 +152,8 @@ export default { 'ALL_NOTIFICATIONS': 'All notifications', 'VERIFY_SUCCESS': 'User verified', 'VERIFY_FAILED': 'Could not verify', - 'USER_SYSTEM_ENABLED': 'Use user system for customers', - 'REGISTRATION': 'Enable user registration', + 'ENABLE_USER_SYSTEM': 'Use user system for customers', + 'ENABLE_USER_REGISTRATION': 'Enable user registration', 'INCLUDE_USERS_VIA_CSV': 'Include users via CSV file', 'INCLUDE_DATABASE_VIA_SQL': 'Include database via SQL file', 'BACKUP_DATABASE': 'Backup database', @@ -223,7 +223,11 @@ export default { 'SYSTEM_PREFERENCES_DESCRIPTION': 'Here you can edit the preferences of the system.', 'VERIFY_SUCCESS_DESCRIPTION': 'You user has been verified correctly. You can log in now.', 'VERIFY_FAILED_DESCRIPTION': 'The verification could not be done.', - 'ADVANCED_SETTINGS_DESCRIPTION': 'Advanced settings description should go here!', + 'ADVANCED_SETTINGS_DESCRIPTION': 'Here you can change the advanced settings of your system. Please be careful, the changes you make can not be reversed.', + 'USER_SYSTEM_DISABLED': 'User system has been disabled', + 'USER_SYSTEM_ENABLED': 'User system has been enabled', + 'REGISTRATION_DISABLED': 'Registration has been disabled', + 'REGISTRATION_ENABLED': 'Registration has been enabled', //ERRORS 'EMAIL_OR_PASSWORD': 'Email or password invalid',