1
1
import React from 'react' ;
2
2
import { OverlayTrigger , Button , Popover , Panel , Table } from 'react-bootstrap' ;
3
3
import { connect } from 'react-redux' ;
4
+ import { Link } from 'react-router'
4
5
import { getWorkflowDetails } from '../../../actions/WorkflowActions' ;
5
6
import WorkflowAction from './WorkflowAction' ;
6
7
import WorkflowMetaDia from '../WorkflowMetaDia' ;
@@ -98,7 +99,6 @@ function showFailure(wf) {
98
99
class WorkflowDetails extends React . Component {
99
100
constructor ( props ) {
100
101
super ( props ) ;
101
-
102
102
http . get ( '/api/sys/' ) . then ( ( data ) => {
103
103
window . sys = data . sys ;
104
104
} ) ;
@@ -118,6 +118,12 @@ class WorkflowDetails extends React.Component {
118
118
return true ;
119
119
}
120
120
121
+ gotoParentWorkflow = ( ) => {
122
+ history . push ( {
123
+ pathname :"/workflow/id/" + this . props . data . parentWorkflowId
124
+ } )
125
+ }
126
+
121
127
render ( ) {
122
128
let wf = this . props . data ;
123
129
if ( wf == null ) {
@@ -131,6 +137,13 @@ class WorkflowDetails extends React.Component {
131
137
return a . seq - b . seq ;
132
138
} ) ;
133
139
140
+ let parentWorkflowButton = "" ;
141
+ if ( wf . parentWorkflowId ) {
142
+ parentWorkflowButton = < Link to = { "/workflow/id/" + wf . parentWorkflowId } > < Button bsStyle = "default" bsSize = "xsmall" >
143
+ Parent
144
+ </ Button > </ Link > ;
145
+ }
146
+
134
147
return (
135
148
< div className = "ui-content" >
136
149
< h4 >
@@ -142,6 +155,9 @@ class WorkflowDetails extends React.Component {
142
155
< span >
143
156
< WorkflowAction workflowStatus = { wf . status } workflowId = { wf . workflowId } />
144
157
</ span >
158
+ < span >
159
+ { parentWorkflowButton }
160
+ </ span >
145
161
</ h4 >
146
162
< br /> < br />
147
163
< Table responsive = { true } striped = { false } hover = { false } condensed = { false } bordered = { true } >
0 commit comments