[DEV-104] - Redirect to home/dashboard after ticket is created without user system (#1037)

* Redirect to home/dashboard after ticket is created without user system

* fix min-height in main-home-page-portal component

* Move success messagge

* querystring check
This commit is contained in:
Joel Elias Méndez 2021-09-27 19:00:43 -03:00 committed by GitHub
parent 59fb9eaef3
commit ae076de88f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 15 deletions

View File

@ -43,7 +43,7 @@ class DashboardCreateTicketPage extends React.Component {
}
onCreateTicketSuccess(message) {
history.push(`${(this.props.location.pathname !== '/create-ticket') ? "/dashboard" : "/create-ticket"}?message=${message}`);
history.push(`${(this.props.location.pathname !== '/create-ticket') ? "/dashboard" : "/"}?message=${message}`);
}
getClass() {

View File

@ -17,4 +17,8 @@
&__create-ticket-form__hidden {
display: none;
}
&__message {
margin-bottom: 30px;
}
}

View File

@ -7,6 +7,8 @@ import Widget from 'core-components/widget';
import Card from 'core-components/card';
import i18n from 'lib-app/i18n';
import Header from 'core-components/header';
import queryString from 'query-string';
import Message from 'core-components/message';
class MainHomePagePortal extends React.Component {
static propTypes = {
@ -14,23 +16,35 @@ class MainHomePagePortal extends React.Component {
};
render() {
const currentSearchParams = queryString.parse(window.location.search) || {};
return (
<Widget className={classNames('main-home-page-portal', this.props.className)}>
<div className="main-home-page-portal__title">
<Header title={this.props.title || i18n('SUPPORT_CENTER')} description={i18n('SUPPORT_CENTER_DESCRIPTION')} />
</div>
<div className="main-home-page-portal__cards">
<div className="main-home-page-portal__card col-md-4">
<Card {...this.getTicketsCardProps()}/>
<div className="">
{
currentSearchParams["message"] ?
<Message className="dashboard-create-ticket-page__message" type="success">
{i18n('TICKET_NUMBER_SENT')}
</Message> :
null
}
<Widget className={classNames('main-home-page-portal', this.props.className)}>
<div className="main-home-page-portal__title">
<Header title={this.props.title || i18n('SUPPORT_CENTER')} description={i18n('SUPPORT_CENTER_DESCRIPTION')} />
</div>
<div className="main-home-page-portal__card col-md-4">
<Card {...((this.props.type === 'complete') ? this.getViewTicketCardProps() : this.getAccountCardProps())} />
<div className="main-home-page-portal__cards">
<div className="main-home-page-portal__card col-md-4">
<Card {...this.getTicketsCardProps()}/>
</div>
<div className="main-home-page-portal__card col-md-4">
<Card {...((this.props.type === 'complete') ? this.getViewTicketCardProps() : this.getAccountCardProps())} />
</div>
<div className="main-home-page-portal__card col-md-4">
<Card {...this.getArticlesCardProps()} />
</div>
</div>
<div className="main-home-page-portal__card col-md-4">
<Card {...this.getArticlesCardProps()} />
</div>
</div>
</Widget>
</Widget>
</div>
);
}