Merged in os-153-disable-registration (pull request #125)

Max Red - disable registration and fixed a message in en.js
This commit is contained in:
Ivan Diaz 2017-01-17 14:59:39 -03:00
commit 0e88a9715a
4 changed files with 13 additions and 8 deletions

View File

@ -86,20 +86,24 @@ class App extends React.Component {
browserHistory.push('/admin/panel'); browserHistory.push('/admin/panel');
} }
if (this.props.session.userLevel && !this.isPathAvailableForStaff()) { if (props.session.userLevel && !this.isPathAvailableForStaff(props)) {
browserHistory.push('/admin/panel'); browserHistory.push('/admin/panel');
} }
if (!props.config.registration && _.includes(props.location.pathname, 'signup')) {
browserHistory.push('/');
}
} }
isPathAvailableForStaff() { isPathAvailableForStaff(props) {
let pathForLevel2 = _.findIndex(level2Paths, path => _.includes(this.props.location.pathname, path)) !== -1; let pathForLevel2 = _.findIndex(level2Paths, path => _.includes(props.location.pathname, path)) !== -1;
let pathForLevel3 = _.findIndex(level3Paths, path => _.includes(this.props.location.pathname, path)) !== -1; let pathForLevel3 = _.findIndex(level3Paths, path => _.includes(props.location.pathname, path)) !== -1;
if (this.props.session.userLevel === 1) { if (props.session.userLevel === 1) {
return !pathForLevel2 && !pathForLevel3; return !pathForLevel2 && !pathForLevel3;
} }
if (this.props.session.userLevel === 2) { if (props.session.userLevel === 2) {
return !pathForLevel3; return !pathForLevel3;
} }

View File

@ -32,7 +32,7 @@ class MainLayoutHeader extends React.Component {
result = ( result = (
<div className="main-layout-header__login-links"> <div className="main-layout-header__login-links">
<Button type="clean" route={{to:'/'}}>{i18n('LOG_IN')}</Button> <Button type="clean" route={{to:'/'}}>{i18n('LOG_IN')}</Button>
<Button type="clean" route={{to:'/signup'}}>{i18n('SIGN_UP')}</Button> {this.props.config === true ? <Button type="clean" route={{to:'/signup'}}>{i18n('SIGN_UP')}</Button> : null}
</div> </div>
); );
} }

View File

@ -20,6 +20,7 @@ module.exports = [
'smtp-user': 'Wesa', 'smtp-user': 'Wesa',
'maintenance-mode': false, 'maintenance-mode': false,
'allow-attachments': true, 'allow-attachments': true,
'registration': true,
'max-size': 500, 'max-size': 500,
'departments': [ 'departments': [
{id: 1, name: 'Sales Support', owners: 2}, {id: 1, name: 'Sales Support', owners: 2},

View File

@ -186,7 +186,7 @@ export default {
'TICKET_LIST_DESCRIPTION': 'Here you can find a list of all tickets you have sent to our support team.', 'TICKET_LIST_DESCRIPTION': 'Here you can find a list of all tickets you have sent to our support team.',
'TICKETS_DESCRIPTION': 'Send ticket through our support center and get response of your doubts, suggestions and issues.', 'TICKETS_DESCRIPTION': 'Send ticket through our support center and get response of your doubts, suggestions and issues.',
'ARTICLES_DESCRIPTION': 'Take a look to our articles about common issues, guides and documentation.', 'ARTICLES_DESCRIPTION': 'Take a look to our articles about common issues, guides and documentation.',
'ACCOUNT_DESCRIPTION': 'All your tickets are stored in your accounts\'s profile. Keep track off all your tickets you send to our staff team.', 'ACCOUNT_DESCRIPTION': 'All your tickets are stored in your account\'s profile. Keep track of all your tickets you send to our staff team.',
'SUPPORT_CENTER_DESCRIPTION': 'Welcome to our support center. You can contact us through a tickets system. Your tickets will be answered by our staff.', 'SUPPORT_CENTER_DESCRIPTION': 'Welcome to our support center. You can contact us through a tickets system. Your tickets will be answered by our staff.',
'CUSTOM_RESPONSES_DESCRIPTION': 'Custom responses are automated responses for common problems', 'CUSTOM_RESPONSES_DESCRIPTION': 'Custom responses are automated responses for common problems',
'MY_TICKETS_DESCRIPTION': 'Here you can view the tickets you are responsible for.', 'MY_TICKETS_DESCRIPTION': 'Here you can view the tickets you are responsible for.',