@@ -27,11 +27,12 @@ qx.Class.define("osparc.metadata.ServicesInStudyUpdate", {
2727 UPDATE_BUTTON : Object . keys ( osparc . metadata . ServicesInStudy . GRID_POS ) . length + 2
2828 } ,
2929
30- updatableNodeIds : function ( workbench ) {
30+ updatableNodeIds : function ( workbench , services ) {
3131 const nodeIds = [ ] ;
3232 for ( const nodeId in workbench ) {
3333 const node = workbench [ nodeId ] ;
34- if ( osparc . service . Utils . isUpdatable ( node ) ) {
34+ const serviceFound = services . find ( service => service [ "key" ] === node [ "key" ] && service [ "release" ] [ "version" ] === node [ "version" ] ) ;
35+ if ( serviceFound && serviceFound [ "release" ] && serviceFound [ "release" ] [ "compatibility" ] ) {
3536 nodeIds . push ( nodeId ) ;
3637 }
3738 }
@@ -167,6 +168,7 @@ qx.Class.define("osparc.metadata.ServicesInStudyUpdate", {
167168 const canIWrite = osparc . data . model . Study . canIWrite ( this . _studyData [ "accessRights" ] ) ;
168169
169170 let i = 0 ;
171+ const updatableServices = [ ] ;
170172 const workbench = this . _studyData [ "workbench" ] ;
171173 for ( const nodeId in workbench ) {
172174 i ++ ;
@@ -208,8 +210,8 @@ qx.Class.define("osparc.metadata.ServicesInStudyUpdate", {
208210 } ) ;
209211
210212 if ( latestCompatible && canIWrite ) {
211- const isUpdatable = osparc . service . Utils . isUpdatable ( metadata ) ;
212213 const updateButton = new osparc . ui . form . FetchButton ( null , "@MaterialIcons/update/14" ) ;
214+ const isUpdatable = osparc . service . Utils . isUpdatable ( metadata ) ;
213215 updateButton . set ( {
214216 enabled : isUpdatable
215217 } ) ;
@@ -223,6 +225,7 @@ qx.Class.define("osparc.metadata.ServicesInStudyUpdate", {
223225 label : this . tr ( "Update" ) ,
224226 center : true
225227 } ) ;
228+ updatableServices . push ( nodeId ) ;
226229 }
227230 updateButton . addListener ( "execute" , ( ) => this . __updateService ( nodeId , node [ "key" ] , node [ "version" ] , updateButton ) , this ) ;
228231 this . _servicesGrid . add ( updateButton , {
@@ -232,7 +235,6 @@ qx.Class.define("osparc.metadata.ServicesInStudyUpdate", {
232235 }
233236 }
234237
235- const updatableServices = osparc . metadata . ServicesInStudyUpdate . updatableNodeIds ( workbench ) ;
236238 if ( updatableServices . length && canIWrite ) {
237239 const updateAllButton = this . __updateAllButton ;
238240 updateAllButton . show ( ) ;
0 commit comments