From e20760e8bba0a9b2b42e9059b75c160ce78595d0 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Tue, 17 Jan 2017 16:27:46 -0300 Subject: [PATCH 1/9] Ivan - Update home page for user system disabled [skip ci] --- .../main/main-home/main-home-page-portal.js | 62 +++++++++++++++++-- .../src/app/main/main-home/main-home-page.js | 21 ++++--- client/src/app/main/main-layout-header.js | 2 +- client/src/core-components/button.js | 4 +- client/src/core-components/button.scss | 31 ++++++++++ client/src/core-components/card.js | 28 ++++++++- client/src/core-components/card.scss | 8 +++ client/src/data/fixtures/system-fixtures.js | 5 +- client/src/data/languages/en.js | 2 + 9 files changed, 146 insertions(+), 17 deletions(-) diff --git a/client/src/app/main/main-home/main-home-page-portal.js b/client/src/app/main/main-home/main-home-page-portal.js index 6f63cc37..3935e0d7 100644 --- a/client/src/app/main/main-home/main-home-page-portal.js +++ b/client/src/app/main/main-home/main-home-page-portal.js @@ -1,5 +1,7 @@ import React from 'react'; import classNames from 'classnames'; +import {browserHistory} from 'react-router'; +import {connect} from 'react-redux' import Widget from 'core-components/widget'; import Card from 'core-components/card'; @@ -7,26 +9,76 @@ import i18n from 'lib-app/i18n'; import Header from 'core-components/header'; class MainHomePagePortal extends React.Component { + static propTypes = { + type: React.PropTypes.oneOf(['default', 'complete']) + }; + render() { return (
-
+
- +
- +
- +
); } + + getTicketsCardProps() { + return { + title: i18n('TICKETS'), + description: i18n('TICKETS_DESCRIPTION'), + icon: 'ticket', + color: 'red', + buttonText: (this.props.type === 'complete') ? i18n('CREATE_TICKET') : null, + onButtonClick: () => browserHistory.push('/create-ticket') + }; + } + + getAccountCardProps() { + return { + title: i18n('ACCOUNT'), + description: i18n('ACCOUNT_DESCRIPTION'), + icon: 'user', + color: 'green' + }; + } + + getArticlesCardProps() { + return { + title: i18n('ARTICLES'), + description: i18n('ARTICLES_DESCRIPTION'), + icon: 'book', + color: 'blue', + buttonText: (this.props.type === 'complete') ? i18n('VIEW_ARTICLES') : null, + onButtonClick: () => browserHistory.push('/view-articles') + }; + } + + getViewTicketCardProps() { + return { + title: i18n('VIEW_TICKET'), + description: i18n('VIEW_TICKET_DESCRIPTION'), + icon: 'check-square-o', + color: 'green', + buttonText: (this.props.type === 'complete') ? i18n('CHECK_TICKET') : null, + onButtonClick: () => browserHistory.push('/check-ticket') + }; + } } -export default MainHomePagePortal; \ No newline at end of file +export default connect((store) => { + return { + title: store.config.title + }; +})(MainHomePagePortal); \ No newline at end of file diff --git a/client/src/app/main/main-home/main-home-page.js b/client/src/app/main/main-home/main-home-page.js index 5b258354..92840276 100644 --- a/client/src/app/main/main-home/main-home-page.js +++ b/client/src/app/main/main-home/main-home-page.js @@ -1,6 +1,6 @@ import React from 'react'; +import {connect} from 'react-redux' -import {connect} from 'react-redux' import i18n from 'lib-app/i18n'; import MainHomePageLoginWidget from 'app/main/main-home/main-home-page-login-widget'; @@ -13,11 +13,9 @@ class MainHomePage extends React.Component { return (
{this.renderMessage()} -
- -
-
- + {(this.props.config['user-system-enabled']) ? this.renderLoginWidget() : null} +
+
); @@ -34,6 +32,14 @@ class MainHomePage extends React.Component { } } + renderLoginWidget() { + return ( +
+ +
+ ); + } + renderSuccess() { return ( @@ -53,6 +59,7 @@ class MainHomePage extends React.Component { export default connect((store) => { return { - session: store.session + session: store.session, + config: store.config }; })(MainHomePage); \ No newline at end of file diff --git a/client/src/app/main/main-layout-header.js b/client/src/app/main/main-layout-header.js index dd031535..6702eb0b 100644 --- a/client/src/app/main/main-layout-header.js +++ b/client/src/app/main/main-layout-header.js @@ -12,7 +12,7 @@ class MainLayoutHeader extends React.Component { render() { return (
- {this.renderAccessLinks()} + {(this.props.config['user-system-enabled']) ? this.renderAccessLinks() : null}
); diff --git a/client/src/core-components/button.js b/client/src/core-components/button.js index 2932b38c..404834ad 100644 --- a/client/src/core-components/button.js +++ b/client/src/core-components/button.js @@ -17,6 +17,7 @@ class Button extends React.Component { static propTypes = { children: React.PropTypes.node, + inverted: React.PropTypes.bool, size: React.PropTypes.oneOf([ 'extra-small', 'small', @@ -70,7 +71,8 @@ class Button extends React.Component { let classes = { 'button': true, 'button_disabled': this.props.disabled, - + 'button_inverted': this.props.inverted, + 'button_primary': (this.props.type === 'primary'), 'button_secondary': (this.props.type === 'secondary'), 'button_tertiary': (this.props.type === 'tertiary'), diff --git a/client/src/core-components/button.scss b/client/src/core-components/button.scss index 2c133d1d..2729a652 100644 --- a/client/src/core-components/button.scss +++ b/client/src/core-components/button.scss @@ -31,6 +31,10 @@ &_secondary { background-color: $primary-green; + &:focus, &:hover { + background-color: lighten($primary-green, 5%); + outline: none; + } &.button_disabled, &.button_disabled:hover { @@ -41,6 +45,11 @@ &_tertiary { background-color: $secondary-blue; + &:focus, &:hover { + background-color: lighten($secondary-blue, 5%); + outline: none; + } + &.button_disabled, &.button_disabled:hover { background-color: lighten($secondary-blue, 15%); @@ -93,4 +102,26 @@ text-decoration: underline; } } + + &_inverted { + background-color: white; + + &:focus, &:hover { + background-color: white; + opacity: 0.9; + outline: none; + } + + &.button_primary { + color: $primary-red; + } + + &.button_secondary { + color: $primary-green; + } + + &.button_tertiary { + color: $secondary-blue; + } + } } \ No newline at end of file diff --git a/client/src/core-components/card.js b/client/src/core-components/card.js index 991b0161..29dda180 100644 --- a/client/src/core-components/card.js +++ b/client/src/core-components/card.js @@ -1,5 +1,6 @@ import React from 'react'; import Icon from 'core-components/icon'; +import Button from 'core-components/button'; import classNames from 'classnames'; class Card extends React.Component{ @@ -7,7 +8,9 @@ class Card extends React.Component{ description: React.PropTypes.string, title: React.PropTypes.string, icon: React.PropTypes.string, - color: React.PropTypes.string + color: React.PropTypes.string, + buttonText: React.PropTypes.string, + onButtonClick: React.PropTypes.func }; render() { @@ -16,12 +19,23 @@ class Card extends React.Component{
{this.props.title}
{this.props.description}
+ {(this.props.buttonText) ? this.renderButton() : null} +
+ ); + } + + renderButton() { + return ( +
+
); } getClass() { - var classes = { + let classes = { 'card': true, 'card_red': (this.props.color === 'red'), 'card_blue': (this.props.color === 'blue'), @@ -32,5 +46,15 @@ class Card extends React.Component{ return classNames(classes); } + + getButtonType() { + let types = { + 'red': 'primary', + 'green': 'secondary', + 'blue': 'tertiary' + }; + + return types[this.props.color]; + } } export default Card; diff --git a/client/src/core-components/card.scss b/client/src/core-components/card.scss index 77bd29e2..1044b8b5 100644 --- a/client/src/core-components/card.scss +++ b/client/src/core-components/card.scss @@ -5,6 +5,7 @@ color: white; height: 260px; padding: 15px; + position: relative; &__title { font-variant: small-caps; @@ -16,6 +17,13 @@ font-size: $font-size--sm; } + &__button { + position: absolute; + left: 0; + right: 0; + bottom: 17px; + } + &_red { background-color: $primary-red; } diff --git a/client/src/data/fixtures/system-fixtures.js b/client/src/data/fixtures/system-fixtures.js index ac2a5bbd..b317c0b1 100644 --- a/client/src/data/fixtures/system-fixtures.js +++ b/client/src/data/fixtures/system-fixtures.js @@ -11,7 +11,7 @@ module.exports = [ 'reCaptchaKey': '6LfM5CYTAAAAAGLz6ctpf-hchX2_l0Ge-Bn-n8wS', 'reCaptchaPrivate': 'LALA', 'url': 'http://www.opensupports.com/support', - 'title': 'Very Cool', + 'title': 'OpenSupports Support Center', 'layout': 'Boxed', 'time-zone': 3, 'no-reply-email': 'shitr@post.com', @@ -36,8 +36,11 @@ module.exports = [ status: 'success', data: { 'language': 'en', + 'title': '', + 'layout': 'Boxed', 'reCaptchaKey': '6LfM5CYTAAAAAGLz6ctpf-hchX2_l0Ge-Bn-n8wS', 'maintenance-mode': false, + 'user-system-enabled': false, 'departments': [ {id: 1, name: 'Sales Support', owners: 2}, {id: 2, name: 'Technical Issues', owners: 5}, diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js index 8e69269c..882ffabf 100644 --- a/client/src/data/languages/en.js +++ b/client/src/data/languages/en.js @@ -73,6 +73,7 @@ export default { 'ASSIGN_TO_ME': 'Assign to me', 'UN_ASSIGN': 'Unassign', 'VIEW_TICKET': 'View Ticket', + 'VIEW_TICKET_DESCRIPTION': 'Check the status of your ticket using your ticket number and email.', 'SELECT_CUSTOM_RESPONSE': 'Select a custom response...', 'WARNING': 'Warning', 'INFO': 'Information', @@ -152,6 +153,7 @@ export default { 'ALL_NOTIFICATIONS': 'All notifications', 'VERIFY_SUCCESS': 'User verified', 'VERIFY_FAILED': 'Could not verify', + 'CHECK_TICKET': 'Check Ticket', //ACTIVITIES 'ACTIVITY_COMMENT': 'commented ticket', From 4119509cc43057e2188a25bff286412abd73d430 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Thu, 19 Jan 2017 17:37:51 -0300 Subject: [PATCH 2/9] Ivan - Add create ticket for no user system [skip ci] --- client/src/app/Routes.js | 7 ++++ .../create-ticket-form.js | 37 ++++++++++++------- .../dashboard-create-ticket-page.js | 35 ++++++++++++++++-- .../dashboard-create-ticket-page.scss | 6 +++ client/src/app/main/main-check-ticket-page.js | 13 +++++++ .../src/app/main/main-check-ticket-page.scss | 0 .../app/main/main-signup/main-signup-page.js | 4 +- 7 files changed, 84 insertions(+), 18 deletions(-) create mode 100644 client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.scss create mode 100644 client/src/app/main/main-check-ticket-page.js create mode 100644 client/src/app/main/main-check-ticket-page.scss diff --git a/client/src/app/Routes.js b/client/src/app/Routes.js index 2a137332..59b5f961 100644 --- a/client/src/app/Routes.js +++ b/client/src/app/Routes.js @@ -13,6 +13,7 @@ import MainSignUpPage from 'app/main/main-signup/main-signup-page'; import MainVerifyTokenPage from 'app/main/main-verify-token-page'; import MainRecoverPasswordPage from 'app/main/main-recover-password/main-recover-password-page'; import MainMaintenancePage from 'app/main/main-maintenance-page'; +import MainCheckTicketPage from 'app/main/main-check-ticket-page'; import DashboardLayout from 'app/main/dashboard/dashboard-layout'; import DashboardListTicketsPage from 'app/main/dashboard/dashboard-list-tickets/dashboard-list-tickets-page'; @@ -63,6 +64,12 @@ export default ( + + + + + + diff --git a/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js b/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js index f8898b8f..a4c17908 100644 --- a/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js +++ b/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js @@ -10,6 +10,7 @@ import SessionStore from 'lib-app/session-store'; import store from 'app/store'; import SessionActions from 'actions/session-actions'; import LanguageSelector from 'app-components/language-selector'; +import Captcha from 'app/main/captcha'; import Header from 'core-components/header'; import Form from 'core-components/form'; @@ -34,6 +35,8 @@ class CreateTicketForm extends React.Component { title: '', content: RichTextEditor.createEmptyValue(), departmentIndex: 0, + email: '', + name: '', language: 'en' } }; @@ -79,7 +82,7 @@ class CreateTicketForm extends React.Component { renderCaptcha() { return (
- +
); } @@ -105,16 +108,23 @@ class CreateTicketForm extends React.Component { } onSubmit(formState) { - this.setState({ - loading: true - }); + let captcha = this.refs.captcha && this.refs.captcha.getWrappedInstance(); - API.call({ - path: '/ticket/create', - data: _.extend({}, formState, { - departmentId: SessionStore.getDepartments()[formState.departmentIndex].id - }) - }).then(this.onTicketSuccess.bind(this)).catch(this.onTicketFail.bind(this)); + if (captcha && !captcha.getValue()) { + captcha.focus(); + } else { + this.setState({ + loading: true + }); + + API.call({ + path: '/ticket/create', + data: _.extend({}, formState, { + captcha: captcha && captcha.getValue(), + departmentId: SessionStore.getDepartments()[formState.departmentIndex].id + }) + }).then(this.onTicketSuccess.bind(this)).catch(this.onTicketFail.bind(this)); + } } onTicketSuccess() { @@ -123,9 +133,10 @@ class CreateTicketForm extends React.Component { message: 'success' }); - store.dispatch(SessionActions.getUserData()); - - setTimeout(() => {browserHistory.push('/dashboard')}, 2000); + if(this.props.userLogged) { + store.dispatch(SessionActions.getUserData()); + setTimeout(() => {browserHistory.push('/dashboard')}, 2000); + } } onTicketFail() { diff --git a/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.js b/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.js index 596cc4a9..cc7ad75f 100644 --- a/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.js +++ b/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.js @@ -1,16 +1,45 @@ import React from 'react'; +import classNames from 'classnames'; +import {connect} from 'react-redux'; +import Captcha from 'app/main/captcha'; import CreateTicketForm from 'app/main/dashboard/dashboard-create-ticket/create-ticket-form'; +import Widget from 'core-components/widget'; class DashboardCreateTicketPage extends React.Component { + static propTypes = { + userSystemEnabled: React.PropTypes.bool + }; + render() { + let Wrapper = 'div'; + + if(!this.props.userSystemEnabled) { + Wrapper = Widget; + } + return ( -
- +
+ + +
); } + + getClass() { + let classes = { + 'dashboard-create-ticket-page': true, + 'dashboard-create-ticket-page_wrapped': (!this.props.userSystemEnabled) + }; + + return classNames(classes); + } } -export default DashboardCreateTicketPage; +export default connect((store) => { + return { + userSystemEnabled: store.config['user-system-enabled'] + }; +})(DashboardCreateTicketPage); diff --git a/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.scss b/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.scss new file mode 100644 index 00000000..cba5b276 --- /dev/null +++ b/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.scss @@ -0,0 +1,6 @@ +.dashboard-create-ticket-page { + + &_wrapped { + padding: 0 10px; + } +} \ No newline at end of file diff --git a/client/src/app/main/main-check-ticket-page.js b/client/src/app/main/main-check-ticket-page.js new file mode 100644 index 00000000..25ebb95a --- /dev/null +++ b/client/src/app/main/main-check-ticket-page.js @@ -0,0 +1,13 @@ +import React from 'react'; + +class MainCheckTicketPage extends React.Component { + render() { + return ( +
+ +
+ ) + } +} + +export default MainCheckTicketPage; \ No newline at end of file diff --git a/client/src/app/main/main-check-ticket-page.scss b/client/src/app/main/main-check-ticket-page.scss new file mode 100644 index 00000000..e69de29b diff --git a/client/src/app/main/main-signup/main-signup-page.js b/client/src/app/main/main-signup/main-signup-page.js index fa14d8f9..e5baab65 100644 --- a/client/src/app/main/main-signup/main-signup-page.js +++ b/client/src/app/main/main-signup/main-signup-page.js @@ -63,7 +63,7 @@ class MainSignUpPageWidget extends React.Component { return { loading: this.state.loading, className: 'signup-widget__form', - onSubmit: this.onLoginFormSubmit.bind(this) + onSubmit: this.onSignupFormSubmit.bind(this) }; } @@ -77,7 +77,7 @@ class MainSignUpPageWidget extends React.Component { }; } - onLoginFormSubmit(formState) { + onSignupFormSubmit(formState) { const captcha = this.refs.captcha.getWrappedInstance(); if (!captcha.getValue()) { From ec18363058928df136e13424402641a30d3e0f81 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Thu, 19 Jan 2017 19:48:55 -0300 Subject: [PATCH 3/9] Ivan - Add check ticket page [skip ci] --- client/src/app/Routes.js | 4 +- .../create-ticket-form.js | 8 +- client/src/app/main/main-check-ticket-page.js | 86 ++++++++++++++++++- .../src/app/main/main-check-ticket-page.scss | 24 ++++++ 4 files changed, 115 insertions(+), 7 deletions(-) diff --git a/client/src/app/Routes.js b/client/src/app/Routes.js index 59b5f961..c6b0b52b 100644 --- a/client/src/app/Routes.js +++ b/client/src/app/Routes.js @@ -66,8 +66,8 @@ export default ( - - + + diff --git a/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js b/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js index a4c17908..1ce083b3 100644 --- a/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js +++ b/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js @@ -2,7 +2,7 @@ import React from 'react'; import _ from 'lodash'; import ReCAPTCHA from 'react-google-recaptcha'; import { browserHistory } from 'react-router'; -import RichTextEditor from 'react-rte-browserify'; +import RichTextEditor from 'react-rte-browserify'; import i18n from 'lib-app/i18n'; import API from 'lib-app/api-call'; @@ -123,11 +123,11 @@ class CreateTicketForm extends React.Component { captcha: captcha && captcha.getValue(), departmentId: SessionStore.getDepartments()[formState.departmentIndex].id }) - }).then(this.onTicketSuccess.bind(this)).catch(this.onTicketFail.bind(this)); + }).then(this.onTicketSuccess.bind(this, formState.email)).catch(this.onTicketFail.bind(this)); } } - onTicketSuccess() { + onTicketSuccess(email, result) { this.setState({ loading: false, message: 'success' @@ -136,6 +136,8 @@ class CreateTicketForm extends React.Component { if(this.props.userLogged) { store.dispatch(SessionActions.getUserData()); setTimeout(() => {browserHistory.push('/dashboard')}, 2000); + } else { + setTimeout(() => {browserHistory.push('/check-ticket/' + email + '/' + result.data.ticketNumber)}, 2000); } } diff --git a/client/src/app/main/main-check-ticket-page.js b/client/src/app/main/main-check-ticket-page.js index 25ebb95a..4eb84a37 100644 --- a/client/src/app/main/main-check-ticket-page.js +++ b/client/src/app/main/main-check-ticket-page.js @@ -1,12 +1,94 @@ import React from 'react'; +import { browserHistory } from 'react-router'; + +import i18n from 'lib-app/i18n'; +import API from 'lib-app/api-call'; +import SessionStore from 'lib-app/session-store'; + +import Widget from 'core-components/widget'; +import Header from 'core-components/header'; +import Form from 'core-components/form'; +import FormField from 'core-components/form-field'; +import SubmitButton from 'core-components/submit-button'; +import Captcha from 'app/main/captcha'; class MainCheckTicketPage extends React.Component { + + state = { + loading: false, + form: { + email: this.props.params.email || '', + ticketNumber: this.props.params.ticketNumber || '' + }, + errors: {} + }; + render() { return (
- + +
+
+
+
+ +
+
+ +
+
+
+ +
+ {i18n('CHECK_TICKET')} +
+
- ) + ); + } + + getFormProps() { + return { + className: 'main-check-ticket-page__form', + loading: this.state.loading, + values: this.state.form, + errors: this.state.errors, + onChange: (form) => this.setState({form}), + onValidateErrors: (errors) => this.setState({errors}), + onSubmit: this.onFormSubmit.bind(this) + }; + } + + onFormSubmit(form) { + const captcha = this.refs.captcha.getWrappedInstance(); + + if (!captcha.getValue()) { + captcha.focus(); + } else { + this.setState({ + loading: true + }); + + API.call({ + path: '/ticket/get', + data: { + captcha: captcha && captcha.getValue(), + ticketNumber: form.ticketNumber, + email: form.email + } + }).then(this.onTicketGetSuccess.bind(this)).catch(() => this.setState({ + loading: false, + errors: { + email: i18n('INVALID_EMAIL_OR_TICKET_NUMBER'), + ticketNumber: i18n('INVALID_EMAIL_OR_TICKET_NUMBER') + } + })); + } + } + + onTicketGetSuccess(result) { + SessionStore.setItem('token', result.data.token); + setTimeout(() => {browserHistory.push('/view-ticket/' + this.state.form.email + '/' + this.state.form.ticketNumber)}, 2000); } } diff --git a/client/src/app/main/main-check-ticket-page.scss b/client/src/app/main/main-check-ticket-page.scss index e69de29b..935387f8 100644 --- a/client/src/app/main/main-check-ticket-page.scss +++ b/client/src/app/main/main-check-ticket-page.scss @@ -0,0 +1,24 @@ +.main-check-ticket-page { + padding: 0 15px; + + &__form { + margin: 0 auto; + max-width: 790px; + } + + &__inputs { + display: inline-block; + margin: 0 auto; + } + + &__input { + display: inline-block; + margin: 0 20px; + } + + &__captcha { + margin: 20px auto 20px; + height: 78px; + width: 304px; + } +} \ No newline at end of file From 4e0669c4ae0840248f7ce140dd146af8dd472018 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Fri, 20 Jan 2017 22:01:18 -0300 Subject: [PATCH 4/9] Ivan - WIP [skip ci] --- client/src/app/Routes.js | 2 +- client/src/app/main/main-view-ticket.js | 104 ++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 client/src/app/main/main-view-ticket.js diff --git a/client/src/app/Routes.js b/client/src/app/Routes.js index c6b0b52b..6349f569 100644 --- a/client/src/app/Routes.js +++ b/client/src/app/Routes.js @@ -67,7 +67,7 @@ export default ( - + diff --git a/client/src/app/main/main-view-ticket.js b/client/src/app/main/main-view-ticket.js new file mode 100644 index 00000000..3d093cc9 --- /dev/null +++ b/client/src/app/main/main-view-ticket.js @@ -0,0 +1,104 @@ +import React from 'react'; +import _ from 'lodash'; +import {connect} from 'react-redux'; + +import API from 'lib-app/api-call'; +import i18n from 'lib-app/i18n'; +import SessionStore from 'lib-app/session-store'; + +import TicketViewer from 'app-components/ticket-viewer'; +import Loading from 'core-components/loading'; +import Header from 'core-components/header'; + +class MainViewTicket extends React.Component { + + state = { + loading: true, + ticket: {} + }; + + componentDidMount() { + this.retrieveTicket(); + } + + render() { + return ( +
+
+ {(this.state.loading) ? this.renderLoading() : this.renderView()} +
+ ); + } + + renderLoading() { + return ( +
+ +
+ ) + }; + + renderView() { + return (_.isEmpty(this.state.ticket)) ? this.renderNoPermissionError() : this.renderTicketView(); + } + + renderNoPermissionError() { + return ( +
+ {i18n('NO_PERMISSION')} +
+ ); + } + + renderTicketView() { + return ( +
+ +
+ ); + } + + getTicketViewProps() { + return { + ticket: this.state.ticket, + onChange: this.retrieveTicket.bind(this), + assignmentAllowed: true, + customResponses: this.props.customResponses, + editable: this.state.ticket.owner && this.state.ticket.owner.id == SessionStore.getSessionData().userId + }; + } + + retrieveTicket() { + API.call({ + path: '/ticket/get', + data: { + ticketNumber: this.props.params.ticketNumber + } + }).then(this.onRetrieveSuccess.bind(this)).catch(this.onRetrieveFail.bind(this)) + } + + onRetrieveSuccess(result) { + this.setState({ + loading: false, + ticket: result.data + }); + + if(result.data.unreadStaff) { + API.call({ + path: '/ticket/seen', + data: { + ticketNumber: this.props.params.ticketNumber + } + }); + } + } + + onRetrieveFail() { + this.setState({ + loading: false, + ticket: {} + }); + } +} + +export default MainViewTicket; \ No newline at end of file From 9db530f2ddc8e0808ee7495789d7e7625dce70ea Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 21 Jan 2017 00:20:25 -0300 Subject: [PATCH 5/9] Ivan - Add ticket view page for no user system[skip ci] --- client/src/app/Routes.js | 3 +- .../panel/tickets/admin-panel-view-ticket.js | 14 ++- client/src/app/main/main-check-ticket-page.js | 2 +- client/src/app/main/main-view-ticket-page.js | 20 ++++ .../src/app/main/main-view-ticket-page.scss | 3 + client/src/app/main/main-view-ticket.js | 104 ------------------ client/src/data/fixtures/ticket-fixtures.js | 2 + 7 files changed, 40 insertions(+), 108 deletions(-) create mode 100644 client/src/app/main/main-view-ticket-page.js create mode 100644 client/src/app/main/main-view-ticket-page.scss delete mode 100644 client/src/app/main/main-view-ticket.js diff --git a/client/src/app/Routes.js b/client/src/app/Routes.js index 6349f569..70bcdcad 100644 --- a/client/src/app/Routes.js +++ b/client/src/app/Routes.js @@ -14,6 +14,7 @@ import MainVerifyTokenPage from 'app/main/main-verify-token-page'; import MainRecoverPasswordPage from 'app/main/main-recover-password/main-recover-password-page'; import MainMaintenancePage from 'app/main/main-maintenance-page'; import MainCheckTicketPage from 'app/main/main-check-ticket-page'; +import MainViewTicketPage from 'app/main/main-view-ticket-page'; import DashboardLayout from 'app/main/dashboard/dashboard-layout'; import DashboardListTicketsPage from 'app/main/dashboard/dashboard-list-tickets/dashboard-list-tickets-page'; @@ -67,7 +68,7 @@ export default ( - + diff --git a/client/src/app/admin/panel/tickets/admin-panel-view-ticket.js b/client/src/app/admin/panel/tickets/admin-panel-view-ticket.js index b0002fdc..6cf0f8c3 100644 --- a/client/src/app/admin/panel/tickets/admin-panel-view-ticket.js +++ b/client/src/app/admin/panel/tickets/admin-panel-view-ticket.js @@ -12,6 +12,16 @@ import Header from 'core-components/header'; class AdminPanelViewTicket extends React.Component { + static propTypes = { + avoidSeen: React.PropTypes.bool, + assignmentAllowed: React.PropTypes.bool + }; + + static defaultProps = { + avoidSeen: false, + assignmentAllowed: true + }; + state = { loading: true, ticket: {} @@ -62,7 +72,7 @@ class AdminPanelViewTicket extends React.Component { return { ticket: this.state.ticket, onChange: this.retrieveTicket.bind(this), - assignmentAllowed: true, + assignmentAllowed: this.props.assignmentAllowed, customResponses: this.props.customResponses, editable: this.state.ticket.owner && this.state.ticket.owner.id == SessionStore.getSessionData().userId }; @@ -83,7 +93,7 @@ class AdminPanelViewTicket extends React.Component { ticket: result.data }); - if(result.data.unreadStaff) { + if(!this.props.avoidSeen && result.data.unreadStaff) { API.call({ path: '/ticket/seen', data: { diff --git a/client/src/app/main/main-check-ticket-page.js b/client/src/app/main/main-check-ticket-page.js index 4eb84a37..f95297a3 100644 --- a/client/src/app/main/main-check-ticket-page.js +++ b/client/src/app/main/main-check-ticket-page.js @@ -88,7 +88,7 @@ class MainCheckTicketPage extends React.Component { onTicketGetSuccess(result) { SessionStore.setItem('token', result.data.token); - setTimeout(() => {browserHistory.push('/view-ticket/' + this.state.form.email + '/' + this.state.form.ticketNumber)}, 2000); + setTimeout(() => {browserHistory.push('/view-ticket/' + this.state.form.ticketNumber)}, 2000); } } diff --git a/client/src/app/main/main-view-ticket-page.js b/client/src/app/main/main-view-ticket-page.js new file mode 100644 index 00000000..b5517367 --- /dev/null +++ b/client/src/app/main/main-view-ticket-page.js @@ -0,0 +1,20 @@ +import React from 'react'; + +import AdminPanelViewTicket from 'app/admin/panel/tickets/admin-panel-view-ticket' + +import Widget from 'core-components/widget'; + +class MainViewTicketPage extends React.Component { + + render() { + return ( +
+ + + +
+ ); + } +} + +export default MainViewTicketPage; \ No newline at end of file diff --git a/client/src/app/main/main-view-ticket-page.scss b/client/src/app/main/main-view-ticket-page.scss new file mode 100644 index 00000000..4ba281a7 --- /dev/null +++ b/client/src/app/main/main-view-ticket-page.scss @@ -0,0 +1,3 @@ +.main-view-ticket-page { + padding: 0 15px; +} \ No newline at end of file diff --git a/client/src/app/main/main-view-ticket.js b/client/src/app/main/main-view-ticket.js deleted file mode 100644 index 3d093cc9..00000000 --- a/client/src/app/main/main-view-ticket.js +++ /dev/null @@ -1,104 +0,0 @@ -import React from 'react'; -import _ from 'lodash'; -import {connect} from 'react-redux'; - -import API from 'lib-app/api-call'; -import i18n from 'lib-app/i18n'; -import SessionStore from 'lib-app/session-store'; - -import TicketViewer from 'app-components/ticket-viewer'; -import Loading from 'core-components/loading'; -import Header from 'core-components/header'; - -class MainViewTicket extends React.Component { - - state = { - loading: true, - ticket: {} - }; - - componentDidMount() { - this.retrieveTicket(); - } - - render() { - return ( -
-
- {(this.state.loading) ? this.renderLoading() : this.renderView()} -
- ); - } - - renderLoading() { - return ( -
- -
- ) - }; - - renderView() { - return (_.isEmpty(this.state.ticket)) ? this.renderNoPermissionError() : this.renderTicketView(); - } - - renderNoPermissionError() { - return ( -
- {i18n('NO_PERMISSION')} -
- ); - } - - renderTicketView() { - return ( -
- -
- ); - } - - getTicketViewProps() { - return { - ticket: this.state.ticket, - onChange: this.retrieveTicket.bind(this), - assignmentAllowed: true, - customResponses: this.props.customResponses, - editable: this.state.ticket.owner && this.state.ticket.owner.id == SessionStore.getSessionData().userId - }; - } - - retrieveTicket() { - API.call({ - path: '/ticket/get', - data: { - ticketNumber: this.props.params.ticketNumber - } - }).then(this.onRetrieveSuccess.bind(this)).catch(this.onRetrieveFail.bind(this)) - } - - onRetrieveSuccess(result) { - this.setState({ - loading: false, - ticket: result.data - }); - - if(result.data.unreadStaff) { - API.call({ - path: '/ticket/seen', - data: { - ticketNumber: this.props.params.ticketNumber - } - }); - } - } - - onRetrieveFail() { - this.setState({ - loading: false, - ticket: {} - }); - } -} - -export default MainViewTicket; \ No newline at end of file diff --git a/client/src/data/fixtures/ticket-fixtures.js b/client/src/data/fixtures/ticket-fixtures.js index 1975b855..dea4ee7f 100644 --- a/client/src/data/fixtures/ticket-fixtures.js +++ b/client/src/data/fixtures/ticket-fixtures.js @@ -110,10 +110,12 @@ module.exports = [ closed: false, priority: 'medium', author: { + id: 3, name: 'Haskell Curry', email: 'haskell@lambda.com' }, owner: { + id: 1, name: 'Steve Jobs' }, events: [ From 0bd07ef211d5db93728bf11f38166312cef4a603 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 21 Jan 2017 01:17:28 -0300 Subject: [PATCH 6/9] Ivan - Add token ticket for backend [skip ci] --- server/controllers/ticket/comment.php | 12 +++++-- server/controllers/ticket/get.php | 45 +++++++++++++++++++++------ server/models/Session.php | 11 ++++++- 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/server/controllers/ticket/comment.php b/server/controllers/ticket/comment.php index cd7713e1..cc0d24ba 100644 --- a/server/controllers/ticket/comment.php +++ b/server/controllers/ticket/comment.php @@ -25,9 +25,15 @@ class CommentController extends Controller { if(!Controller::isUserSystemEnabled()) { $validations['permission'] = 'any'; - $validations['requestData']['email'] = [ - 'validation' => DataValidator::email(), - 'error' => ERRORS::INVALID_EMAIL + $session = Session::getInstance(); + + $validations['requestData']['csrf_token'] = [ + 'validation' => DataValidator::equals($session->getToken()), + 'error' => ERRORS::NO_PERMISSION + ]; + $validations['requestData']['ticketNumber'] = [ + 'validation' => DataValidator::equals($session->getTicketNumber()), + 'error' => ERRORS::INVALID_TICKET ]; } diff --git a/server/controllers/ticket/get.php b/server/controllers/ticket/get.php index 6e2a6758..61cba027 100644 --- a/server/controllers/ticket/get.php +++ b/server/controllers/ticket/get.php @@ -20,14 +20,28 @@ class TicketGetController extends Controller { if(!Controller::isUserSystemEnabled() && !Controller::isStaffLogged()) { $validations['permission'] = 'any'; - $validations['requestData']['email'] = [ - 'validation' => DataValidator::email(), - 'error' => ERRORS::INVALID_EMAIL - ]; - $validations['requestData']['captcha'] = [ - 'validation' => DataValidator::captcha(), - 'error' => ERRORS::INVALID_CAPTCHA - ]; + + if(Controller::request('token')) { + $session = Session::getInstance(); + + $validations['requestData']['csrf_token'] = [ + 'validation' => DataValidator::equals($session->getToken()), + 'error' => ERRORS::NO_PERMISSION + ]; + $validations['requestData']['ticketNumber'] = [ + 'validation' => DataValidator::equals($session->getTicketNumber()), + 'error' => ERRORS::INVALID_TICKET + ]; + } else { + $validations['requestData']['email'] = [ + 'validation' => DataValidator::email(), + 'error' => ERRORS::INVALID_EMAIL + ]; + $validations['requestData']['captcha'] = [ + 'validation' => DataValidator::captcha(), + 'error' => ERRORS::INVALID_CAPTCHA + ]; + } } return $validations; @@ -40,7 +54,11 @@ class TicketGetController extends Controller { if(!Controller::isUserSystemEnabled() && !Controller::isStaffLogged()) { if($this->ticket->authorEmail === $email) { - Response::respondSuccess($this->ticket->toArray()); + if(!Controller::request('token')) { + $this->generateSessionToken(); + } else { + Response::respondSuccess($this->ticket->toArray()); + } return; } else { throw new Exception(ERRORS::NO_PERMISSION); @@ -54,6 +72,15 @@ class TicketGetController extends Controller { } } + private function generateSessionToken() { + $session = Session::getInstance(); + $token = Hashing::generateRandomToken(); + + $session->createTicketSession($this->ticket->ticketNUmber); + + Response::respondSuccess(['token' => $token, 'ticketNumber' => $this->ticket->ticketNUmber]); + } + private function shouldDenyPermission() { $user = Controller::getLoggedUser(); diff --git a/server/models/Session.php b/server/models/Session.php index 9535876a..eceb9c13 100644 --- a/server/models/Session.php +++ b/server/models/Session.php @@ -29,6 +29,15 @@ class Session { $this->store('staff', $staff); $this->store('token', Hashing::generateRandomToken()); } + + public function createTicketSession($ticketNumber) { + $this->store('ticketNumber', $ticketNumber); + $this->store('token', Hashing::generateRandomToken()); + } + + public function getTicketNumber() { + return $this->getStoredData('ticketNumber'); + } public function getToken() { return $this->getStoredData('token'); @@ -51,7 +60,7 @@ class Session { $token === $data['token']; } - private function store($key, $value) { + public function store($key, $value) { $_SESSION[$key] = $value; } From 6109e1ac730619c44d9a7ffb1c5c9ace64678095 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 21 Jan 2017 01:42:48 -0300 Subject: [PATCH 7/9] Ivan - Add article list for no user system [skip ci] --- client/src/app-components/topic-viewer.js | 2 +- client/src/app/Routes.js | 1 + .../dashboard-article-page.js | 33 +++++++++++++++---- .../dashboard-article-page.scss | 4 +++ .../dashboard-list-articles-page.js | 33 +++++++++++++++---- .../dashboard-list-articles-page.scss | 4 +++ .../main/main-home/main-home-page-portal.js | 2 +- 7 files changed, 64 insertions(+), 15 deletions(-) diff --git a/client/src/app-components/topic-viewer.js b/client/src/app-components/topic-viewer.js index 2009da8c..d54164ff 100644 --- a/client/src/app-components/topic-viewer.js +++ b/client/src/app-components/topic-viewer.js @@ -105,7 +105,7 @@ class TopicViewer extends React.Component { {article.title} - + {(this.props.editable) ? : null} ); } diff --git a/client/src/app/Routes.js b/client/src/app/Routes.js index 70bcdcad..192fd723 100644 --- a/client/src/app/Routes.js +++ b/client/src/app/Routes.js @@ -70,6 +70,7 @@ export default ( + diff --git a/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.js b/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.js index f5d8b509..27062bf6 100644 --- a/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.js +++ b/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.js @@ -1,5 +1,6 @@ import React from 'react'; import _ from 'lodash'; +import classNames from 'classnames'; import {connect} from 'react-redux'; import ArticlesActions from 'actions/articles-actions'; @@ -10,6 +11,7 @@ import DateTransformer from 'lib-core/date-transformer'; import Header from 'core-components/header'; import Loading from 'core-components/loading'; import BreadCrumb from 'core-components/breadcrumb'; +import Widget from 'core-components/widget'; class DashboardArticlePage extends React.Component { @@ -32,12 +34,20 @@ class DashboardArticlePage extends React.Component { } render() { + let Wrapper = 'div'; + + if(_.startsWith(this.props.location.pathname, '/article/')) { + Wrapper = Widget; + } + return ( -
-
- -
- {(this.props.loading) ? : this.renderContent()} +
+ +
+ +
+ {(this.props.loading) ? : this.renderContent()} +
); } @@ -62,6 +72,15 @@ class DashboardArticlePage extends React.Component {
); } + + getClass() { + let classes = { + 'dashboard-article-page': true, + 'dashboard-article-page_wrapped': _.startsWith(this.props.location.pathname, '/article/') + }; + + return classNames(classes); + } findArticle() { let article = null; @@ -91,11 +110,11 @@ class DashboardArticlePage extends React.Component { let article = this.findArticle(); let topic = this.findTopic(); let items = [ - {content: i18n('ARTICLES'), url: '/dashboard/articles'} + {content: i18n('ARTICLES'), url: (_.startsWith(this.props.location.pathname, '/article/')) ? '/articles' : '/dashboard/articles'} ]; if(topic && topic.name) { - items.push({content: topic.name, url: '/dashboard/articles'}); + items.push({content: topic.name, url: (_.startsWith(this.props.location.pathname, '/article/')) ? '/articles' : '/dashboard/articles'}); } if(article && article.title) { diff --git a/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.scss b/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.scss index b165a2cd..aa91618e 100644 --- a/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.scss +++ b/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.scss @@ -5,4 +5,8 @@ text-align: right; margin-top: 20px; } + + &_wrapped { + padding: 0 15px; + } } \ No newline at end of file diff --git a/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.js b/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.js index da942c22..f7c434e8 100644 --- a/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.js +++ b/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.js @@ -1,4 +1,5 @@ import React from 'react'; +import classNames from 'classnames'; import {connect} from 'react-redux'; import _ from 'lodash'; import {Link} from 'react-router'; @@ -9,6 +10,7 @@ import ArticlesActions from 'actions/articles-actions'; import Header from 'core-components/header'; import SearchBox from 'core-components/search-box'; +import Widget from 'core-components/widget'; class DashboardListArticlesPage extends React.Component { @@ -22,18 +24,28 @@ class DashboardListArticlesPage extends React.Component { } render() { + let Wrapper = 'div'; + + if(this.props.location.pathname == '/articles') { + Wrapper = Widget; + } + return ( -
-
- - {(!this.state.showSearchResults) ? this.renderArticleList() : this.renderSearchResults()} +
+ +
+ + {(!this.state.showSearchResults) ? this.renderArticleList() : this.renderSearchResults()} +
); } renderArticleList() { + let articlePath = (this.props.location.pathname == '/articles') ? '/article/' : '/dashboard/article/'; + return ( - + ); } @@ -53,7 +65,7 @@ class DashboardListArticlesPage extends React.Component { return (
- {item.title} + {item.title}
{content}
{item.topic}
@@ -61,6 +73,15 @@ class DashboardListArticlesPage extends React.Component { ); } + getClass() { + let classes = { + 'dashboard-list-articles-page': true, + 'dashboard-list-articles-page_wrapped': (this.props.location.pathname == '/articles') + }; + + return classNames(classes); + } + onSearch(query) { this.setState({ results: SearchBox.searchQueryInList(this.getArticles(), query, this.isQueryInTitle.bind(this), this.isQueryInContent.bind(this)), diff --git a/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.scss b/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.scss index 418797af..709461c1 100644 --- a/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.scss +++ b/client/src/app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page.scss @@ -29,4 +29,8 @@ text-transform: uppercase; } } + + &_wrapped { + padding: 0 15px; + } } \ No newline at end of file diff --git a/client/src/app/main/main-home/main-home-page-portal.js b/client/src/app/main/main-home/main-home-page-portal.js index 3935e0d7..a27916de 100644 --- a/client/src/app/main/main-home/main-home-page-portal.js +++ b/client/src/app/main/main-home/main-home-page-portal.js @@ -61,7 +61,7 @@ class MainHomePagePortal extends React.Component { icon: 'book', color: 'blue', buttonText: (this.props.type === 'complete') ? i18n('VIEW_ARTICLES') : null, - onButtonClick: () => browserHistory.push('/view-articles') + onButtonClick: () => browserHistory.push('/articles') }; } From c18142f2ba9ff588c2cb7199f3bef0d7fc031856 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 21 Jan 2017 01:54:13 -0300 Subject: [PATCH 8/9] Ivan - Add home link and english keys for no user system [skip ci] --- client/src/app-components/topic-viewer.scss | 3 ++- .../dashboard-create-ticket-page.js | 14 ++++---------- client/src/app/main/main-check-ticket-page.js | 2 +- client/src/app/main/main-layout-header.js | 10 +++++++++- client/src/data/languages/en.js | 6 +++--- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/client/src/app-components/topic-viewer.scss b/client/src/app-components/topic-viewer.scss index f674fd88..97dd43f5 100644 --- a/client/src/app-components/topic-viewer.scss +++ b/client/src/app-components/topic-viewer.scss @@ -2,10 +2,11 @@ .topic-viewer { text-align: left; + margin: 35px 0; &__header { cursor: default; - margin-bottom: 15px; + margin-bottom: 20px; font-size: $font-size--bg; &:hover { diff --git a/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.js b/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.js index cc7ad75f..8edc3bcc 100644 --- a/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.js +++ b/client/src/app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page.js @@ -1,8 +1,6 @@ import React from 'react'; import classNames from 'classnames'; -import {connect} from 'react-redux'; -import Captcha from 'app/main/captcha'; import CreateTicketForm from 'app/main/dashboard/dashboard-create-ticket/create-ticket-form'; import Widget from 'core-components/widget'; @@ -15,14 +13,14 @@ class DashboardCreateTicketPage extends React.Component { render() { let Wrapper = 'div'; - if(!this.props.userSystemEnabled) { + if((this.props.location.pathname === '/create-ticket')) { Wrapper = Widget; } return (
- +
); @@ -31,15 +29,11 @@ class DashboardCreateTicketPage extends React.Component { getClass() { let classes = { 'dashboard-create-ticket-page': true, - 'dashboard-create-ticket-page_wrapped': (!this.props.userSystemEnabled) + 'dashboard-create-ticket-page_wrapped': (this.props.location.pathname === '/create-ticket') }; return classNames(classes); } } -export default connect((store) => { - return { - userSystemEnabled: store.config['user-system-enabled'] - }; -})(DashboardCreateTicketPage); +export default DashboardCreateTicketPage; diff --git a/client/src/app/main/main-check-ticket-page.js b/client/src/app/main/main-check-ticket-page.js index f95297a3..e0a1df21 100644 --- a/client/src/app/main/main-check-ticket-page.js +++ b/client/src/app/main/main-check-ticket-page.js @@ -27,7 +27,7 @@ class MainCheckTicketPage extends React.Component { return (
-
+
diff --git a/client/src/app/main/main-layout-header.js b/client/src/app/main/main-layout-header.js index c42545f0..7c705740 100644 --- a/client/src/app/main/main-layout-header.js +++ b/client/src/app/main/main-layout-header.js @@ -12,7 +12,7 @@ class MainLayoutHeader extends React.Component { render() { return (
- {(this.props.config['user-system-enabled']) ? this.renderAccessLinks() : null} + {(this.props.config['user-system-enabled']) ? this.renderAccessLinks() : this.renderHomeLink()}
); @@ -40,6 +40,14 @@ class MainLayoutHeader extends React.Component { return result; } + renderHomeLink() { + return ( +
+ +
+ ); + } + getLanguageSelectorProps() { return { className: 'main-layout-header__languages', diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js index 81277ea4..74d595a1 100644 --- a/client/src/data/languages/en.js +++ b/client/src/data/languages/en.js @@ -154,10 +154,10 @@ export default { 'VERIFY_SUCCESS': 'User verified', 'VERIFY_FAILED': 'Could not verify', 'CHECK_TICKET': 'Check Ticket', - 'STATISTICS': 'Statistics', 'ACTIVITY': 'Activity', - - + 'HOME': 'Home', + 'TICKET_NUMBER': 'Ticket number', + 'CHART_CREATE_TICKET': 'Tickets created', 'CHART_CLOSE': 'Tickets closed', 'CHART_SIGNUP': 'Signups', From 09c6453d46e4326cafac8b217f7ca1b5aaeca561 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 21 Jan 2017 02:00:04 -0300 Subject: [PATCH 9/9] Ivan - Fix some issues related to no user system [skip ci] --- .../dashboard/dashboard-article/dashboard-article-page.js | 4 ++-- client/src/app/main/main-layout-header.js | 2 +- client/src/data/fixtures/system-fixtures.js | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.js b/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.js index 27062bf6..19d17a3a 100644 --- a/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.js +++ b/client/src/app/main/dashboard/dashboard-article/dashboard-article-page.js @@ -42,12 +42,12 @@ class DashboardArticlePage extends React.Component { return (
- +
{(this.props.loading) ? : this.renderContent()} -
+
); } diff --git a/client/src/app/main/main-layout-header.js b/client/src/app/main/main-layout-header.js index 7c705740..5f575136 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} + {(this.props.config['registration'] === true) ? : null}
); } diff --git a/client/src/data/fixtures/system-fixtures.js b/client/src/data/fixtures/system-fixtures.js index d98c393a..37b65062 100644 --- a/client/src/data/fixtures/system-fixtures.js +++ b/client/src/data/fixtures/system-fixtures.js @@ -19,6 +19,7 @@ module.exports = [ 'smtp-port': '7070', 'smtp-user': 'Wesa', 'maintenance-mode': false, + 'user-system-enabled': true, 'allow-attachments': true, 'registration': true, 'max-size': 500, @@ -41,7 +42,8 @@ module.exports = [ 'layout': 'Boxed', 'reCaptchaKey': '6LfM5CYTAAAAAGLz6ctpf-hchX2_l0Ge-Bn-n8wS', 'maintenance-mode': false, - 'user-system-enabled': false, + 'user-system-enabled': true, + 'registration': true, 'departments': [ {id: 1, name: 'Sales Support', owners: 2}, {id: 2, name: 'Technical Issues', owners: 5},