File tree Expand file tree Collapse file tree
workspaces/x2a/plugins/x2a/src/components/ModuleTable Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,6 +96,21 @@ const useColumns = ({
9696 } , [ t , lastPhaseCell , artifactsCell ] ) ;
9797} ;
9898
99+ const canRunNextPhase = ( { module } : { module : Module } ) => {
100+ const nextPhase = getNextPhase ( module ) ;
101+ if ( ! nextPhase ) {
102+ return false ;
103+ }
104+
105+ // TODO: Consider check whether we have all artifacts instead of just checking the last job status
106+ const lastJob = getLastJob ( module ) ;
107+ if ( ! lastJob || lastJob . status === 'success' ) {
108+ return true ;
109+ }
110+
111+ return false ;
112+ } ;
113+
99114export const ModuleTable = ( {
100115 modules,
101116 forceRefresh,
@@ -154,7 +169,7 @@ export const ModuleTable = ({
154169 icon : PlayArrowIcon ,
155170 onClick : ( ) => handleRunNext ( rowData ) ,
156171 tooltip : t ( 'module.actions.runNextPhase' ) ,
157- disabled : ! getNextPhase ( rowData ) ,
172+ disabled : ! canRunNextPhase ( { module : rowData } ) ,
158173 } ) ,
159174 ] ;
160175
You can’t perform that action at this time.
0 commit comments