@@ -70,9 +70,14 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
7070 }
7171 } ,
7272
73+ events : {
74+ "startPartialPipeline" : "qx.event.type.Data" ,
75+ "stopPipeline" : "qx.event.type.Event"
76+ } ,
77+
7378 members : {
7479 _header : null ,
75- __inputsStateButton : null ,
80+ __inputsButton : null ,
7681 __preparingInputs : null ,
7782 __nodeStatusUI : null ,
7883 _mainView : null ,
@@ -103,33 +108,32 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
103108 } ,
104109
105110 _buildHeader : function ( ) {
106- const header = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 5 ) . set ( {
111+ const header = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 10 ) . set ( {
107112 alignX : "center"
108113 } ) ) . set ( {
109114 padding : 6 ,
110115 height : this . self ( ) . HEADER_HEIGHT
111116 } ) ;
112117
113- const infoBtn = new qx . ui . form . Button ( null , "@MaterialIcons/info_outline/16" ) . set ( {
114- backgroundColor : "transparent" ,
115- toolTipText : this . tr ( "Information" )
118+
119+ const inputsStateBtn = this . __inputsButton = new qx . ui . form . Button ( ) . set ( {
120+ label : this . tr ( "Inputs" ) ,
121+ icon : "@FontAwesome5Solid/sign-in-alt/14" ,
122+ backgroundColor : "transparent"
116123 } ) ;
117- infoBtn . addListener ( "execute" , ( ) => this . __openServiceDetails ( ) , this ) ;
118- header . add ( infoBtn ) ;
124+ inputsStateBtn . addListener ( "execute" , ( ) => this . showPreparingInputs ( ) , this ) ;
125+ header . add ( inputsStateBtn ) ;
119126
120127 header . add ( new qx . ui . core . Spacer ( ) , {
121128 flex : 1
122129 } ) ;
123130
124- const inputsStateBtn = this . __inputsStateButton = new qx . ui . form . Button ( ) . set ( {
125- label : this . tr ( "Preparing inputs..." ) ,
126- icon : "@FontAwesome5Solid/circle-notch/14" ,
131+ const infoBtn = new qx . ui . form . Button ( null , "@MaterialIcons/info_outline/16" ) . set ( {
127132 backgroundColor : "transparent" ,
128- toolTipText : this . tr ( "The view will remain disabled until the inputs are fetched " )
133+ toolTipText : this . tr ( "Information " )
129134 } ) ;
130- inputsStateBtn . getChildControl ( "icon" ) . getContentElement ( ) . addClass ( "rotate" ) ;
131- inputsStateBtn . addListener ( "execute" , ( ) => this . showPreparingInputs ( ) , this ) ;
132- header . add ( inputsStateBtn ) ;
135+ infoBtn . addListener ( "execute" , ( ) => this . __openServiceDetails ( ) , this ) ;
136+ header . add ( infoBtn ) ;
133137
134138 const nodeStatusUI = this . __nodeStatusUI = new osparc . ui . basic . NodeStatusUI ( ) . set ( {
135139 backgroundColor : "background-main-4"
@@ -141,9 +145,10 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
141145 flex : 1
142146 } ) ;
143147
144- const outputsBtn = this . _outputsBtn = new qx . ui . form . ToggleButton ( null , "@FontAwesome5Solid/sign-out-alt/14" ) . set ( {
145- backgroundColor : "transparent" ,
146- toolTipText : this . tr ( "Outputs" )
148+ const outputsBtn = this . _outputsBtn = new qx . ui . form . ToggleButton ( ) . set ( {
149+ label : this . tr ( "Outputs" ) ,
150+ icon : "@FontAwesome5Solid/sign-out-alt/14" ,
151+ backgroundColor : "transparent"
147152 } ) ;
148153 osparc . utils . Utils . setIdToWidget ( outputsBtn , "outputsBtn" ) ;
149154 header . add ( outputsBtn ) ;
@@ -256,7 +261,7 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
256261
257262 __areInputsReady : function ( ) {
258263 const wb = this . getNode ( ) . getStudy ( ) . getWorkbench ( ) ;
259- const upstreamNodeIds = wb . getUpstreamNodes ( this . getNode ( ) , false ) ;
264+ const upstreamNodeIds = wb . getUpstreamCompNodes ( this . getNode ( ) , false ) ;
260265 for ( let i = 0 ; i < upstreamNodeIds . length ; i ++ ) {
261266 const upstreamNodeId = upstreamNodeIds [ i ] ;
262267 if ( ! osparc . data . model . NodeStatus . isCompNodeReady ( wb . getNode ( upstreamNodeId ) ) ) {
@@ -266,8 +271,7 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
266271 return true ;
267272 } ,
268273
269- __enableContent : function ( enable ) {
270- this . _mainView . setEnabled ( enable ) ;
274+ __enableIframeContent : function ( enable ) {
271275 const iframe = this . getNode ( ) . getIFrame ( ) ;
272276 if ( iframe ) {
273277 // enable/disable user interaction on iframe
@@ -276,29 +280,47 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
276280 "pointer-events" : enable ? "auto" : "none"
277281 } ) ;
278282 }
283+ if ( enable ) {
284+ if ( "tapListenerId" in this . _iFrameLayout ) {
285+ this . _iFrameLayout . removeListenerById ( this . _iFrameLayout . tapListenerId ) ;
286+ }
287+ } else if ( ! this . _iFrameLayout . hasListener ( "tap" ) ) {
288+ const tapListenerId = this . _iFrameLayout . addListener ( "tap" , ( ) => this . showPreparingInputs ( ) ) ;
289+ this . _iFrameLayout . tapListenerId = tapListenerId ;
290+ }
279291 } ,
280292
281- setNotReadyDependencies : function ( notReadyNodeIds = [ ] ) {
293+ setUpstreamDependencies : function ( upstreamDependencies ) {
294+ this . __inputsButton . setVisibility ( upstreamDependencies . length > 0 ? "visible" : "excluded" ) ;
282295 const monitoredNodes = [ ] ;
283296 const workbench = this . getNode ( ) . getStudy ( ) . getWorkbench ( ) ;
284- notReadyNodeIds . forEach ( notReadyNodeId => monitoredNodes . push ( workbench . getNode ( notReadyNodeId ) ) ) ;
297+ upstreamDependencies . forEach ( nodeId => monitoredNodes . push ( workbench . getNode ( nodeId ) ) ) ;
285298 this . __preparingInputs . setMonitoredNodes ( monitoredNodes ) ;
286299 } ,
287300
288301 __dependeciesChanged : function ( ) {
289302 const preparingNodes = this . __preparingInputs . getPreparingNodes ( ) ;
290303 const waiting = Boolean ( preparingNodes && preparingNodes . length ) ;
291- this . __inputsStateButton . setVisibility ( waiting ? "visible" : "excluded" ) ;
292- this . __enableContent ( ! waiting ) ;
304+ const buttonsIcon = this . __inputsButton . getChildControl ( "icon" ) ;
305+ if ( waiting ) {
306+ this . __inputsButton . setIcon ( "@FontAwesome5Solid/circle-notch/14" ) ;
307+ osparc . utils . Utils . addClass ( buttonsIcon . getContentElement ( ) , "rotate" ) ;
308+ } else {
309+ this . __inputsButton . setIcon ( "@FontAwesome5Solid/sign-in-alt/14" ) ;
310+ osparc . utils . Utils . removeClass ( buttonsIcon . getContentElement ( ) , "rotate" ) ;
311+ }
312+ this . __enableIframeContent ( ! waiting ) ;
293313 } ,
294314
295315 __applyNode : function ( node ) {
296316 if ( this . __nodeStatusUI ) {
297317 this . __nodeStatusUI . setNode ( node ) ;
298318 }
299319
300- this . __preparingInputs = new osparc . component . widget . PreparingInputs ( ) ;
320+ this . __preparingInputs = new osparc . component . widget . PreparingInputs ( node . getStudy ( ) ) ;
301321 this . __preparingInputs . addListener ( "changePreparingNodes" , ( ) => this . __dependeciesChanged ( ) ) ;
322+ this . __preparingInputs . addListener ( "startPartialPipeline" , e => this . fireDataEvent ( "startPartialPipeline" , e . getData ( ) ) ) ;
323+ this . __preparingInputs . addListener ( "stopPipeline" , ( ) => this . fireEvent ( "stopPipeline" ) ) ;
302324 this . __dependeciesChanged ( ) ;
303325
304326 this . _mainView . removeAll ( ) ;
@@ -310,7 +332,7 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
310332 const updateProgress = ( ) => {
311333 const running = node . getStatus ( ) . getRunning ( ) ;
312334 const progress = node . getStatus ( ) . getProgress ( ) ;
313- if ( [ "PENDING " , "PUBLISHED " ] . includes ( running ) ||
335+ if ( [ "PUBLISHED " , "PENDING " ] . includes ( running ) ||
314336 ( [ "STARTED" ] . includes ( running ) && progress === 0 ) ) {
315337 this . __progressBar . setBackgroundColor ( "busy-orange" ) ;
316338 this . __progressBar . getContentElement ( ) . setStyles ( {
@@ -348,7 +370,7 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
348370 outputCounter ++ ;
349371 }
350372 } ) ;
351- return ` (${ outputCounter } )`;
373+ return this . tr ( "Outputs" ) + ` (${ outputCounter } )`;
352374 }
353375 } ) ;
354376 this . _outputsBtn . addListener ( "changeLabel" , ( ) => {
0 commit comments