@@ -405,7 +405,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
405405 services : {
406406 check : "Array" ,
407407 init : true ,
408- nullable : false ,
408+ nullable : true ,
409409 apply : "__applyServices" ,
410410 event : "changeServices" ,
411411 } ,
@@ -567,7 +567,10 @@ qx.Class.define("osparc.dashboard.CardBase", {
567567 resourceData [ "services" ] = services ;
568568 this . setServices ( services ) ;
569569 } )
570- . catch ( err => console . error ( err ) ) ;
570+ . catch ( err => {
571+ this . setServices ( null ) ;
572+ console . error ( err ) ;
573+ } ) ;
571574
572575 osparc . study . Utils . guessIcon ( resourceData )
573576 . then ( iconSource => this . setIcon ( iconSource ) ) ;
@@ -688,27 +691,37 @@ qx.Class.define("osparc.dashboard.CardBase", {
688691 } ,
689692
690693 __applyServices : function ( services ) {
691- this . setEmptyWorkbench ( services . length === 0 ) ;
692-
693- // Updatable study
694- if ( osparc . study . Utils . anyServiceRetired ( services ) ) {
695- this . setUpdatable ( "retired" ) ;
696- } else if ( osparc . study . Utils . anyServiceDeprecated ( services ) ) {
697- this . setUpdatable ( "deprecated" ) ;
698- } else if ( osparc . study . Utils . anyServiceUpdatable ( services ) ) {
699- this . setUpdatable ( "updatable" ) ;
700- }
701-
702- // Block card
703- const cantReadServices = osparc . study . Utils . getCantReadServices ( services ) ;
704- if ( cantReadServices . length ) {
694+ const unknownServices = cantReadServices => {
695+ // Block card
705696 this . setBlocked ( "UNKNOWN_SERVICES" ) ;
706697 const image = "@FontAwesome5Solid/ban/" ;
707- let toolTipText = this . tr ( "Inaccessible service(s):" ) ;
708- cantReadServices . forEach ( unSrv => {
709- toolTipText += "<br>" + unSrv . key + ":" + osparc . service . Utils . extractVersionDisplay ( unSrv . release ) ;
710- } ) ;
698+ if ( cantReadServices && cantReadServices . length ) {
699+ let toolTipText = this . tr ( "Inaccessible service(s):" ) ;
700+ cantReadServices . forEach ( unSrv => {
701+ toolTipText += "<br>" + unSrv . key + ":" + osparc . service . Utils . extractVersionDisplay ( unSrv . release ) ;
702+ } ) ;
703+ }
711704 this . __showBlockedCard ( image , toolTipText ) ;
705+ } ;
706+
707+ if ( services ) {
708+ this . setEmptyWorkbench ( services . length === 0 ) ;
709+
710+ // Updatable study
711+ if ( osparc . study . Utils . anyServiceRetired ( services ) ) {
712+ this . setUpdatable ( "retired" ) ;
713+ } else if ( osparc . study . Utils . anyServiceDeprecated ( services ) ) {
714+ this . setUpdatable ( "deprecated" ) ;
715+ } else if ( osparc . study . Utils . anyServiceUpdatable ( services ) ) {
716+ this . setUpdatable ( "updatable" ) ;
717+ }
718+
719+ const cantReadServices = osparc . study . Utils . getCantReadServices ( services ) ;
720+ if ( cantReadServices . length ) {
721+ unknownServices ( cantReadServices ) ;
722+ }
723+ } else {
724+ unknownServices ( ) ;
712725 }
713726
714727 this . evaluateMenuButtons ( ) ;
0 commit comments