From a70778db9cd4ae07e949beacfb8dc13f8944a826 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 16 Jan 2017 16:06:19 -0300 Subject: [PATCH 1/2] Max Red - disable registration and fixed a message in en.js[skip ci] --- client/src/app/App.js | 16 ++++++++++------ client/src/app/main/main-layout-header.js | 2 +- client/src/data/fixtures/system-fixtures.js | 1 + client/src/data/languages/en.js | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/client/src/app/App.js b/client/src/app/App.js index d52ea248..6d327fa8 100644 --- a/client/src/app/App.js +++ b/client/src/app/App.js @@ -86,20 +86,24 @@ class App extends React.Component { browserHistory.push('/admin/panel'); } - if (this.props.session.userLevel && !this.isPathAvailableForStaff()) { + if (props.session.userLevel && !this.isPathAvailableForStaff(props)) { browserHistory.push('/admin/panel'); } + + if (!props.config.registration && _.includes(props.location.pathname, 'signup')) { + browserHistory.push('/'); + } } - isPathAvailableForStaff() { - let pathForLevel2 = _.findIndex(level2Paths, path => _.includes(this.props.location.pathname, path)) !== -1; - let pathForLevel3 = _.findIndex(level3Paths, path => _.includes(this.props.location.pathname, path)) !== -1; + isPathAvailableForStaff(props) { + let pathForLevel2 = _.findIndex(level2Paths, path => _.includes(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; } - if (this.props.session.userLevel === 2) { + if (props.session.userLevel === 2) { return !pathForLevel3; } diff --git a/client/src/app/main/main-layout-header.js b/client/src/app/main/main-layout-header.js index dd031535..2254590c 100644 --- a/client/src/app/main/main-layout-header.js +++ b/client/src/app/main/main-layout-header.js @@ -32,7 +32,7 @@ class MainLayoutHeader extends React.Component { result = (
- + {this.props.config === true ? : null}
); } diff --git a/client/src/data/fixtures/system-fixtures.js b/client/src/data/fixtures/system-fixtures.js index ac2a5bbd..ecf3916e 100644 --- a/client/src/data/fixtures/system-fixtures.js +++ b/client/src/data/fixtures/system-fixtures.js @@ -20,6 +20,7 @@ module.exports = [ 'smtp-user': 'Wesa', 'maintenance-mode': false, 'allow-attachments': true, + 'registration': false, 'max-size': 500, 'departments': [ {id: 1, name: 'Sales Support', owners: 2}, diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js index 8e69269c..a7ec1983 100644 --- a/client/src/data/languages/en.js +++ b/client/src/data/languages/en.js @@ -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.', '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.', - '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.', 'CUSTOM_RESPONSES_DESCRIPTION': 'Custom responses are automated responses for common problems', 'MY_TICKETS_DESCRIPTION': 'Here you can view the tickets you are responsible for.', From a40121111efdaac2322cfe7230b1dc9a90a9749e Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 17 Jan 2017 14:58:28 -0300 Subject: [PATCH 2/2] Max Red - modified registration setting in fixtures [skip ci] --- client/src/data/fixtures/system-fixtures.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/data/fixtures/system-fixtures.js b/client/src/data/fixtures/system-fixtures.js index ecf3916e..ddff91bd 100644 --- a/client/src/data/fixtures/system-fixtures.js +++ b/client/src/data/fixtures/system-fixtures.js @@ -20,7 +20,7 @@ module.exports = [ 'smtp-user': 'Wesa', 'maintenance-mode': false, 'allow-attachments': true, - 'registration': false, + 'registration': true, 'max-size': 500, 'departments': [ {id: 1, name: 'Sales Support', owners: 2},