@@ -156,16 +156,24 @@ qx.Class.define("osparc.service.Utils", {
156156 DEPRECATED_AUTOUPDATABLE_INSTRUCTIONS : qx . locale . Manager . tr ( "Please Stop the Service and then Update it" ) ,
157157 RETIRED_AUTOUPDATABLE_INSTRUCTIONS : qx . locale . Manager . tr ( "Please Update the Service" ) ,
158158
159- extractVersionFromHistory : function ( metadata ) {
159+ getHistoryEntry : function ( metadata ) {
160160 if ( metadata [ "history" ] ) {
161161 const found = metadata [ "history" ] . find ( historyEntry => historyEntry [ "version" ] === metadata [ "version" ] ) ;
162162 return found ;
163163 }
164164 return null ;
165165 } ,
166166
167+ extractReleasedDateFromHistory : function ( metadata ) {
168+ const historyEntry = this . getHistoryEntry ( metadata ) ;
169+ if ( historyEntry && historyEntry [ "released" ] ) {
170+ return historyEntry [ "released" ] ;
171+ }
172+ return null ;
173+ } ,
174+
167175 isUpdatable : function ( metadata ) {
168- const historyEntry = this . extractVersionFromHistory ( metadata ) ;
176+ const historyEntry = this . getHistoryEntry ( metadata ) ;
169177 if ( historyEntry && historyEntry [ "compatibility" ] && historyEntry [ "compatibility" ] [ "canUpdateTo" ] ) {
170178 const latestCompatible = historyEntry [ "compatibility" ] [ "canUpdateTo" ] ;
171179 return latestCompatible && ( metadata [ "key" ] !== latestCompatible [ "key" ] || metadata [ "version" ] !== latestCompatible [ "version" ] ) ;
@@ -182,7 +190,7 @@ qx.Class.define("osparc.service.Utils", {
182190 // this works for service latest
183191 return new Date ( metadata [ "release" ] [ "retired" ] ) ;
184192 }
185- const historyEntry = this . extractVersionFromHistory ( metadata ) ;
193+ const historyEntry = this . getHistoryEntry ( metadata ) ;
186194 if ( historyEntry && "retired" in historyEntry && historyEntry [ "retired" ] ) {
187195 return new Date ( historyEntry [ "retired" ] ) ;
188196 }
0 commit comments