@@ -41,6 +41,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
4141 "updateStudy" : "qx.event.type.Data" ,
4242 "updateTemplate" : "qx.event.type.Data" ,
4343 "updateService" : "qx.event.type.Data" ,
44+ "updateHypertool" : "qx.event.type.Data" ,
4445 "publishTemplate" : "qx.event.type.Data" ,
4546 "tagClicked" : "qx.event.type.Data" ,
4647 "emptyStudyClicked" : "qx.event.type.Data"
@@ -160,10 +161,10 @@ qx.Class.define("osparc.dashboard.CardBase", {
160161 return false ;
161162 } ,
162163
163- filterServiceType : function ( resourceType , metadata , serviceType ) {
164- if ( serviceType && resourceType === "service" ) {
164+ filterAppType : function ( resourceType , metadata , appType ) {
165+ if ( appType && [ "service" , "hypertool" ] . includes ( resourceType ) ) {
165166 if ( metadata && metadata . type ) {
166- const matches = metadata . type === serviceType ;
167+ const matches = metadata . type === appType ;
167168 return ! matches ;
168169 }
169170 return false ;
@@ -221,11 +222,11 @@ qx.Class.define("osparc.dashboard.CardBase", {
221222 const organizations = groupsStore . getOrganizations ( ) ;
222223 const myGroupId = groupsStore . getMyGroupId ( ) ;
223224
224- const sharedGrps = [ ] ;
225225 const groups = [ ] ;
226226 groups . push ( groupEveryone ) ;
227227 groups . push ( groupProductEveryone ) ;
228228 groups . push ( ...Object . values ( organizations ) ) ;
229+ const sharedGrps = [ ] ;
229230 groups . forEach ( group => {
230231 const idx = gids . indexOf ( group . getGroupId ( ) ) ;
231232 if ( idx > - 1 ) {
@@ -260,7 +261,10 @@ qx.Class.define("osparc.dashboard.CardBase", {
260261 sharedGrpLabels . push ( "..." ) ;
261262 break ;
262263 }
263- const sharedGrpLabel = sharedGrps [ i ] . getLabel ( ) ;
264+ let sharedGrpLabel = sharedGrps [ i ] . getLabel ( ) ;
265+ if ( [ groupEveryone , groupProductEveryone ] . includes ( sharedGrps [ i ] ) ) {
266+ sharedGrpLabel = "Public" ;
267+ }
264268 if ( ! sharedGrpLabels . includes ( sharedGrpLabel ) ) {
265269 sharedGrpLabels . push ( sharedGrpLabel ) ;
266270 }
@@ -315,7 +319,12 @@ qx.Class.define("osparc.dashboard.CardBase", {
315319 } ,
316320
317321 resourceType : {
318- check : [ "study" , "template" , "service" ] ,
322+ check : [
323+ "study" ,
324+ "template" ,
325+ "service" ,
326+ "hypertool" ,
327+ ] ,
319328 init : true ,
320329 nullable : true ,
321330 event : "changeResourceType"
@@ -506,11 +515,8 @@ qx.Class.define("osparc.dashboard.CardBase", {
506515 let icon = null ;
507516 switch ( resourceData [ "resourceType" ] ) {
508517 case "study" :
509- uuid = resourceData . uuid ? resourceData . uuid : null ;
510- owner = resourceData . prjOwner ? resourceData . prjOwner : "" ;
511- workbench = resourceData . workbench ? resourceData . workbench : { } ;
512- break ;
513518 case "template" :
519+ case "hypertool" :
514520 uuid = resourceData . uuid ? resourceData . uuid : null ;
515521 owner = resourceData . prjOwner ? resourceData . prjOwner : "" ;
516522 workbench = resourceData . workbench ? resourceData . workbench : { } ;
@@ -543,7 +549,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
543549 workbench
544550 } ) ;
545551
546- if ( resourceData [ "resourceType" ] === "study" || resourceData [ "resourceType" ] === "template" ) {
552+ if ( [ "study" , "template" , "hypertool" ] . includes ( resourceData [ "resourceType" ] ) ) {
547553 osparc . store . Services . getStudyServices ( resourceData . uuid )
548554 . then ( resp => {
549555 const services = resp [ "services" ] ;
@@ -993,7 +999,8 @@ qx.Class.define("osparc.dashboard.CardBase", {
993999 [
9941000 "updateStudy" ,
9951001 "updateTemplate" ,
996- "updateService"
1002+ "updateService" ,
1003+ "updateHypertool" ,
9971004 ] . forEach ( ev => {
9981005 resourceDetails . addListener ( ev , e => this . fireDataEvent ( ev , e . getData ( ) ) ) ;
9991006 } ) ;
@@ -1045,6 +1052,8 @@ qx.Class.define("osparc.dashboard.CardBase", {
10451052 toolTipText += osparc . product . Utils . getStudyAlias ( ) ;
10461053 } else if ( this . isResourceType ( "template" ) ) {
10471054 toolTipText += osparc . product . Utils . getTemplateAlias ( ) ;
1055+ } else if ( this . isResourceType ( "hypertool" ) ) {
1056+ toolTipText += osparc . product . Utils . getAppAlias ( ) ;
10481057 }
10491058 const control = new qx . ui . basic . Image ( ) . set ( {
10501059 source : "@FontAwesome5Solid/times-circle/14" ,
@@ -1103,10 +1112,10 @@ qx.Class.define("osparc.dashboard.CardBase", {
11031112 return this . self ( ) . filterSharedWith ( checks , sharedWith ) ;
11041113 } ,
11051114
1106- _filterServiceType : function ( serviceType ) {
1115+ __filterAppType : function ( appType ) {
11071116 const resourceType = this . getResourceType ( ) ;
11081117 const resourceData = this . getResourceData ( ) ;
1109- return this . self ( ) . filterServiceType ( resourceType , resourceData , serviceType ) ;
1118+ return this . self ( ) . filterAppType ( resourceType , resourceData , appType ) ;
11101119 } ,
11111120
11121121 _filterClassifiers : function ( classifiers ) {
@@ -1117,7 +1126,14 @@ qx.Class.define("osparc.dashboard.CardBase", {
11171126 _shouldApplyFilter : function ( data ) {
11181127 let filterId = "searchBarFilter" ;
11191128 if ( this . isPropertyInitialized ( "resourceType" ) ) {
1120- filterId += "-" + this . getResourceType ( ) ;
1129+ switch ( this . getResourceType ( ) ) {
1130+ case "hypertool" :
1131+ filterId += "-service" ;
1132+ break ;
1133+ default :
1134+ filterId += "-" + this . getResourceType ( ) ;
1135+ break ;
1136+ }
11211137 }
11221138 data = filterId in data ? data [ filterId ] : data ;
11231139 if ( this . _filterText ( data . text ) ) {
@@ -1129,7 +1145,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
11291145 if ( this . _filterSharedWith ( data . sharedWith ) ) {
11301146 return true ;
11311147 }
1132- if ( this . _filterServiceType ( data . serviceType ) ) {
1148+ if ( this . __filterAppType ( data . appType ) ) {
11331149 return true ;
11341150 }
11351151 if ( this . _filterClassifiers ( data . classifiers ) ) {
@@ -1141,7 +1157,14 @@ qx.Class.define("osparc.dashboard.CardBase", {
11411157 _shouldReactToFilter : function ( data ) {
11421158 let filterId = "searchBarFilter" ;
11431159 if ( this . isPropertyInitialized ( "resourceType" ) ) {
1144- filterId += "-" + this . getResourceType ( ) ;
1160+ switch ( this . getResourceType ( ) ) {
1161+ case "hypertool" :
1162+ filterId += "-service" ;
1163+ break ;
1164+ default :
1165+ filterId += "-" + this . getResourceType ( ) ;
1166+ break ;
1167+ }
11451168 }
11461169 data = filterId in data ? data [ filterId ] : data ;
11471170 if ( data . text && data . text . length > 1 ) {
@@ -1153,7 +1176,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
11531176 if ( data . sharedWith ) {
11541177 return true ;
11551178 }
1156- if ( "serviceType " in data ) {
1179+ if ( "appType " in data ) {
11571180 return true ;
11581181 }
11591182 if ( data . classifiers && data . classifiers . length ) {
0 commit comments