11import React , { useEffect , useRef , useState } from 'react'
22import { FormattedMessage } from 'react-intl'
33import { ProjectConfiguration } from '../../types' ;
4- import { faCheck , faExclamationCircle , faRedoAlt , faToggleOn , faCaretDown , faCaretUp } from '@fortawesome/free-solid-svg-icons' ;
4+ import { faCheck , faTimes , faCaretDown , faCaretUp } from '@fortawesome/free-solid-svg-icons' ;
55import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
66import { CustomTooltip } from '@remix-ui/helper' ;
77
@@ -84,7 +84,7 @@ export default function ConfigSection(props: ConfigSectionProps) {
8484 < section className = "mb-2" >
8585 < section className = "d-flex flex-row " >
8686 < SectionHeader />
87- < >
87+ < div >
8888 { ! props . config . isLoading && ! props . config . errorStatus && ! props . config . error &&
8989 < div onClick = { ( ) => props . loadScriptRunner ( props . config ) } className = "pointer px-2 pb-1" >
9090 { props . activeConfig && props . activeConfig . name === props . config . name &&
@@ -95,32 +95,34 @@ export default function ConfigSection(props: ConfigSectionProps) {
9595 }
9696 </ div >
9797 }
98- </ >
99- < div className = "d-flex flex-row mx-4" >
100- { props . config . isLoading && < div className = "d-flex flex-row pb-1 align-items-center justify-content-center" >
101- < i className = "fas fa-spinner fa-spin" > </ i > < span className = 'pl-3' > Loading config</ span >
102- </ div > }
10398 </ div >
104- </ section >
105- < section id = "errorSection" >
106- { props . config . errorStatus && props . config . error && < div className = "text-danger" >
107- < CustomTooltip tooltipText = { props . config . error } >
108- < FontAwesomeIcon data-id = { `sr-error-${ props . config . name } ` } icon = { faExclamationCircle } > </ FontAwesomeIcon >
109- </ CustomTooltip >
110-
99+ { props . config . isLoading && < div className = "d-flex flex-row mx-4" >
100+ < div className = "d-flex flex-row pb-1 align-items-center justify-content-center" >
101+ < i className = "fas fa-spinner fa-spin" > </ i > < span className = 'pl-3' > Loading config</ span >
102+ </ div >
111103 </ div > }
112- { ! props . config . isLoading && props . config . errorStatus && props . config . error &&
104+ < div className = "ml-4 d-flex" id = "errorSection" >
105+ { props . config . errorStatus && props . config . error && < div className = "text-danger" >
106+ < CustomTooltip tooltipText = { props . config . error } >
107+ < FontAwesomeIcon data-id = { `sr-error-${ props . config . name } ` } icon = { faTimes } > </ FontAwesomeIcon >
108+ </ CustomTooltip >
109+
110+ </ div > }
111+ { ! props . config . isLoading && props . config . errorStatus && props . config . error &&
113112 < div
114113 onClick = { ( ) => {
115114 props . loadScriptRunner ( props . config )
116- props . _paq . push ( [ 'trackEvent' , 'scriptRunnerPlugin' , 'loadScriptRunnerConfig ' , props . config . name ] )
115+ props . _paq . push ( [ 'trackEvent' , 'scriptRunnerPlugin' , 'error_reloadScriptRunnerConfig ' , props . config . name ] )
117116 } }
118- className = "pointer px-2"
117+ className = "pointer px-2 text-danger d-flex flex-row "
119118 >
120- < FontAwesomeIcon data-id = { `sr-reload-${ props . config . name } ` } icon = { faRedoAlt } > </ FontAwesomeIcon >
119+ < span className = "pr-1 text-danger font-weight-bold" > Loading error</ span >
120+ < span className = "text-danger" > We are not able to load your requested configuration for now, please try again later.</ span >
121121 </ div >
122- }
122+ }
123+ </ div >
123124 </ section >
125+
124126 < section className = "d-flex flex-column w-100" >
125127 < div className = "mt-2 mb-4 bg-dark p-3 " >
126128 < p className = "text-dark text-monospace" > { props . config . description } </ p >
0 commit comments