mirror of
				https://github.com/opensupports/opensupports.git
				synced 2025-10-31 03:24:38 +01:00 
			
		
		
		
	[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:
		
							parent
							
								
									59fb9eaef3
								
							
						
					
					
						commit
						ae076de88f
					
				| @ -43,7 +43,7 @@ class DashboardCreateTicketPage extends React.Component { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     onCreateTicketSuccess(message) { |     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() { |     getClass() { | ||||||
|  | |||||||
| @ -17,4 +17,8 @@ | |||||||
|     &__create-ticket-form__hidden { |     &__create-ticket-form__hidden { | ||||||
|         display: none; |         display: none; | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     &__message { | ||||||
|  |         margin-bottom: 30px; | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -7,6 +7,8 @@ import Widget from 'core-components/widget'; | |||||||
| import Card from 'core-components/card'; | import Card from 'core-components/card'; | ||||||
| import i18n from 'lib-app/i18n'; | import i18n from 'lib-app/i18n'; | ||||||
| import Header from 'core-components/header'; | import Header from 'core-components/header'; | ||||||
|  | import queryString from 'query-string'; | ||||||
|  | import Message from 'core-components/message'; | ||||||
| 
 | 
 | ||||||
| class MainHomePagePortal extends React.Component { | class MainHomePagePortal extends React.Component { | ||||||
|     static propTypes = { |     static propTypes = { | ||||||
| @ -14,23 +16,35 @@ class MainHomePagePortal extends React.Component { | |||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     render() { |     render() { | ||||||
|  | 
 | ||||||
|  |         const currentSearchParams = queryString.parse(window.location.search) || {}; | ||||||
|  | 
 | ||||||
|         return ( |         return ( | ||||||
|             <Widget className={classNames('main-home-page-portal', this.props.className)}> |             <div className=""> | ||||||
|                 <div className="main-home-page-portal__title"> |                 { | ||||||
|                     <Header title={this.props.title || i18n('SUPPORT_CENTER')} description={i18n('SUPPORT_CENTER_DESCRIPTION')} /> |                     currentSearchParams["message"] ? | ||||||
|                 </div> |                         <Message className="dashboard-create-ticket-page__message" type="success"> | ||||||
|                 <div className="main-home-page-portal__cards"> |                             {i18n('TICKET_NUMBER_SENT')} | ||||||
|                     <div className="main-home-page-portal__card col-md-4"> |                         </Message> : | ||||||
|                         <Card {...this.getTicketsCardProps()}/> |                         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> | ||||||
|                     <div className="main-home-page-portal__card col-md-4"> |                     <div className="main-home-page-portal__cards"> | ||||||
|                         <Card {...((this.props.type === 'complete') ? this.getViewTicketCardProps() : this.getAccountCardProps())} /> |                         <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> | ||||||
|                     <div className="main-home-page-portal__card col-md-4"> |                 </Widget> | ||||||
|                         <Card {...this.getArticlesCardProps()} /> |             </div> | ||||||
|                     </div> |  | ||||||
|                 </div> |  | ||||||
|             </Widget> |  | ||||||
|         ); |         ); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user