@@ -39,6 +39,8 @@ interface ErrorInfo {
3939 show : ( ) => void ;
4040}
4141
42+ const WORKFLOW_EXEC_SUCCESS_ERROR_CODE = 'workflow_success' ;
43+
4244export const TableError = observer < Props > ( function TableError ( { model, loading, className } ) {
4345 const translate = useTranslate ( ) ;
4446
@@ -68,7 +70,6 @@ export const TableError = observer<Props>(function TableError({ model, loading,
6870 } ,
6971 false ,
7072 ) ;
71-
7273 const internalServerError = errorOf ( model . source . error , ServerInternalError ) ;
7374 const error = useErrorDetails ( model . source . error ) ;
7475 const animated = useStateDelay ( ! ! errorInfo . error && ! loading , 1 ) ;
@@ -94,12 +95,22 @@ export const TableError = observer<Props>(function TableError({ model, loading,
9495 ) ;
9596 } ;
9697
98+ const onWorkflowDetailNavigate = ( workflowId : string ) => {
99+ const [ projectName ] = connectionSchemaManagerService . currentConnection ?. name . split ( ':' ) ?? [ ] ;
100+
101+ window . open ( `/transit?from=cloudbeaver&to=workflow_detail&workflow_id=${ workflowId } &project_name=${ projectName } ` ) ;
102+ } ;
103+
97104 let icon = '/icons/error_icon.svg' ;
98105
99106 if ( quote ) {
100107 icon = '/icons/info_icon.svg' ;
101108 }
102109
110+ if ( error . errorCode === WORKFLOW_EXEC_SUCCESS_ERROR_CODE ) {
111+ icon = '/icons/success_icon.svg' ;
112+ }
113+
103114 let onRetry = ( ) => model . retry ( ) ;
104115
105116 if ( error . refresh ) {
@@ -176,6 +187,11 @@ export const TableError = observer<Props>(function TableError({ model, loading,
176187 { error . executionFailedMessage && (
177188 < div className = { s ( style , { errorSubMessage : true } ) } > { `${ translate ( 'ui_audit_error_tips' ) } :${ error . executionFailedMessage } ` } </ div >
178189 ) }
190+ { error . workflowId && (
191+ < div className = { s ( style , { errorSubMessage : true } ) } >
192+ { translate ( 'ui_workflow_id' ) } : { error . workflowId }
193+ </ div >
194+ ) }
179195 </ div >
180196 </ div >
181197 < div className = { s ( style , { controls : true } ) } >
@@ -189,12 +205,20 @@ export const TableError = observer<Props>(function TableError({ model, loading,
189205 { translate ( 'ui_errors_details' ) }
190206 </ Button >
191207 ) }
208+
192209 < Button className = { s ( style , { button : true } ) } type = "button" onClick = { onRetry } >
193210 { translate ( 'ui_processing_retry' ) }
194211 </ Button >
195- < Button className = { s ( style , { button : true } ) } type = "button" onClick = { onCreateWorkflowNavigate } >
196- { translate ( 'ui_create_workflow' ) }
197- </ Button >
212+
213+ { error . workflowId ? (
214+ < Button className = { s ( style , { button : true } ) } type = "button" onClick = { ( ) => onWorkflowDetailNavigate ( error . workflowId ! ) } >
215+ { translate ( 'ui_workflow_detail' ) }
216+ </ Button >
217+ ) : (
218+ < Button className = { s ( style , { button : true } ) } type = "button" onClick = { onCreateWorkflowNavigate } >
219+ { translate ( 'ui_create_workflow' ) }
220+ </ Button >
221+ ) }
198222 </ div >
199223 </ div >
200224 ) ;
0 commit comments