Ivan - Add message for ticket comment error [skip ci]

This commit is contained in:
ivan 2016-12-21 19:16:21 -03:00
parent b6af2f44ab
commit d2c2327a60
3 changed files with 14 additions and 3 deletions

View File

@ -14,6 +14,7 @@ import FormField from 'core-components/form-field';
import SubmitButton from 'core-components/submit-button';
import DropDown from 'core-components/drop-down';
import Button from 'core-components/button';
import Message from 'core-components/message';
class TicketViewer extends React.Component {
static propTypes = {
@ -188,6 +189,7 @@ class TicketViewer extends React.Component {
<SubmitButton>{i18n('RESPOND_TICKET')}</SubmitButton>
</Form>
</div>
{(this.state.commentError) ? this.renderCommentError() : null}
</div>
);
}
@ -216,6 +218,12 @@ class TicketViewer extends React.Component {
return customResponsesNode;
}
renderCommentError() {
return (
<Message className="ticket-viewer__message" type="error">{i18n('TICKET_COMMENT_ERROR')}</Message>
);
}
getCommentFormProps() {
return {
onSubmit: this.onSubmit.bind(this),
@ -316,7 +324,8 @@ class TicketViewer extends React.Component {
onCommentSuccess() {
this.setState({
loading: false
loading: false,
commentError: false
});
this.onTicketModification();
@ -324,7 +333,8 @@ class TicketViewer extends React.Component {
onCommentFail() {
this.setState({
loading: false
loading: false,
commentError: true
});
}

View File

@ -23,7 +23,7 @@ class DashboardListArticlesPage extends React.Component {
render() {
return (
<div classnames="dashboard-list-articles-page">
<div className="dashboard-list-articles-page">
<Header title={i18n('LIST_ARTICLES')} description={i18n('LIST_ARTICLES_DESCRIPTION')}/>
<SearchBox className="dashboard-list-articles-page__search-box" onSearch={this.onSearch.bind(this)} searchOnType />
{(!this.state.showSearchResults) ? this.renderArticleList() : this.renderSearchResults()}

View File

@ -157,6 +157,7 @@ export default {
'PASSWORD_NOT_MATCH': 'Password does not match',
'INVALID_RECOVER': 'Invalid recover data',
'TICKET_SENT_ERROR': 'An error occurred while trying to create the ticket.',
'TICKET_COMMENT_ERROR': 'An error occurred while trying to add the comment.',
'NO_PERMISSION': 'You\'ve no permission to access to this page.',
'INVALID_USER': 'User id is invalid',