@@ -125,11 +125,11 @@ qx.Class.define("osparc.vipMarket.LicensedItemDetails", {
125125 const modelLayout = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 4 ) ) . set ( {
126126 allowGrowX : false ,
127127 } ) ;
128- const miniThumbnail = this . self ( ) . createThumbnail ( licensedResource [ "thumbnail" ] , 32 ) ;
128+ const miniThumbnail = this . self ( ) . createThumbnail ( licensedResource . getThumbnail ( ) , 32 ) ;
129129 osparc . utils . Utils . addBorder ( miniThumbnail ) ;
130130 modelLayout . add ( miniThumbnail ) ;
131131 const title = new qx . ui . basic . Label ( ) . set ( {
132- value : osparc . data . model . LicensedItem . licensedResourceTitle ( licensedResource ) ,
132+ value : osparc . data . model . LicensedItemResource . longName ( licensedResource ) ,
133133 alignY : "middle"
134134 } ) ;
135135 modelLayout . add ( title ) ;
@@ -156,13 +156,9 @@ qx.Class.define("osparc.vipMarket.LicensedItemDetails", {
156156 const topGrid = new qx . ui . layout . Grid ( 8 , 6 ) ;
157157 topGrid . setColumnFlex ( 0 , 1 ) ;
158158 const headerLayout = new qx . ui . container . Composite ( topGrid ) ;
159- let description = licensedResource [ "description" ] || "" ;
160- description = description . replace ( / S P E A G / g, " " ) ; // remove SPEAG substring
161- const delimiter = " - " ;
162- let titleAndSubtitle = description . split ( delimiter ) ;
163- if ( titleAndSubtitle . length > 0 ) {
159+ if ( licensedResource . getTitle ( ) ) {
164160 const titleLabel = new qx . ui . basic . Label ( ) . set ( {
165- value : titleAndSubtitle [ 0 ] ,
161+ value : licensedResource . getTitle ( ) ,
166162 font : "text-16" ,
167163 alignY : "middle" ,
168164 allowGrowX : true ,
@@ -172,12 +168,10 @@ qx.Class.define("osparc.vipMarket.LicensedItemDetails", {
172168 column : 0 ,
173169 row : 0 ,
174170 } ) ;
175- titleAndSubtitle . shift ( ) ;
176171 }
177- if ( titleAndSubtitle . length > 0 ) {
178- titleAndSubtitle = titleAndSubtitle . join ( delimiter ) ;
172+ if ( licensedResource . getSubtitle ( ) ) {
179173 const subtitleLabel = new qx . ui . basic . Label ( ) . set ( {
180- value : titleAndSubtitle ,
174+ value : licensedResource . getSubtitle ( ) ,
181175 font : "text-16" ,
182176 alignY : "middle" ,
183177 allowGrowX : true ,
@@ -188,48 +182,36 @@ qx.Class.define("osparc.vipMarket.LicensedItemDetails", {
188182 row : 1 ,
189183 } ) ;
190184 }
191- if ( licensedResource [ "thumbnail" ] ) {
192- const manufacturerData = { } ;
193- if ( licensedResource [ "thumbnail" ] . includes ( "itis.swiss" ) ) {
194- manufacturerData [ "label" ] = "IT'IS Foundation" ;
195- manufacturerData [ "link" ] = "https://itis.swiss/virtual-population/" ;
196- manufacturerData [ "icon" ] = "https://media.licdn.com/dms/image/v2/C4D0BAQE_FGa66IyvrQ/company-logo_200_200/company-logo_200_200/0/1631341490431?e=2147483647&v=beta&t=7f_IK-ArGjPrz-1xuWolAT4S2NdaVH-e_qa8hsKRaAc" ;
197- } else if ( licensedResource [ "thumbnail" ] . includes ( "speag.swiss" ) ) {
198- manufacturerData [ "label" ] = "Speag" ;
199- manufacturerData [ "link" ] = "https://speag.swiss/products/em-phantoms/overview-2/" ;
200- manufacturerData [ "icon" ] = "https://media.licdn.com/dms/image/v2/D4E0BAQG2CYG28KAKbA/company-logo_200_200/company-logo_200_200/0/1700045977122/schmid__partner_engineering_ag_logo?e=2147483647&v=beta&t=6CZb1jjg5TnnzQWkrZBS9R3ebRKesdflg-_xYi4dwD8" ;
201- }
202- if ( Object . keys ( manufacturerData ) . length ) {
203- const manufacturerLink = new qx . ui . basic . Atom ( ) . set ( {
204- label : manufacturerData [ "label" ] ,
205- icon : manufacturerData [ "icon" ] ,
206- font : "text-16" ,
207- gap : 10 ,
208- iconPosition : "right" ,
209- cursor : "pointer" ,
210- } ) ;
211- manufacturerLink . getChildControl ( "icon" ) . set ( {
212- maxWidth : 32 ,
213- maxHeight : 32 ,
214- scale : true ,
215- decorator : "rounded" ,
216- } ) ;
217- manufacturerLink . addListener ( "tap" , ( ) => window . open ( manufacturerData [ "link" ] ) ) ;
218- headerLayout . add ( manufacturerLink , {
219- column : 1 ,
220- row : 0 ,
221- rowSpan : 2 ,
222- } ) ;
223- }
185+ if ( licensedResource . getManufacturerLabel ( ) ) {
186+ const manufacturerLink = new qx . ui . basic . Atom ( ) . set ( {
187+ label : licensedResource . getManufacturerLabel ( ) ,
188+ icon : licensedResource . getManufacturerIcon ( ) ,
189+ font : "text-16" ,
190+ gap : 10 ,
191+ iconPosition : "right" ,
192+ cursor : "pointer" ,
193+ } ) ;
194+ manufacturerLink . getChildControl ( "icon" ) . set ( {
195+ maxWidth : 32 ,
196+ maxHeight : 32 ,
197+ scale : true ,
198+ decorator : "rounded" ,
199+ } ) ;
200+ manufacturerLink . addListener ( "tap" , ( ) => window . open ( licensedResource . getManufacturerLink ( ) ) ) ;
201+ headerLayout . add ( manufacturerLink , {
202+ column : 1 ,
203+ row : 0 ,
204+ rowSpan : 2 ,
205+ } ) ;
224206 }
225207 modelInfoLayout . add ( headerLayout ) ;
226208
227209
228210 const middleLayout = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 16 ) ) ;
229- const thumbnail = this . self ( ) . createThumbnail ( licensedResource [ "thumbnail" ] , 256 ) ;
211+ const thumbnail = this . self ( ) . createThumbnail ( licensedResource . getThumbnail ( ) , 256 ) ;
230212 middleLayout . add ( thumbnail ) ;
231213
232- const features = licensedResource [ "features" ] ;
214+ const features = licensedResource . getFeatures ( ) ;
233215 const featuresGrid = new qx . ui . layout . Grid ( 8 , 8 ) ;
234216 const featuresLayout = new qx . ui . container . Composite ( featuresGrid ) ;
235217 let idx = 0 ;
@@ -278,7 +260,7 @@ qx.Class.define("osparc.vipMarket.LicensedItemDetails", {
278260 }
279261 } ) ;
280262
281- if ( licensedResource [ "doi" ] ) {
263+ if ( licensedResource . getDoi ( ) ) {
282264 const doiTitle = new qx . ui . basic . Label ( ) . set ( {
283265 value : "DOI" ,
284266 font : "text-14" ,
@@ -305,22 +287,22 @@ qx.Class.define("osparc.vipMarket.LicensedItemDetails", {
305287 }
306288 return doiLabel ;
307289 } ;
308- featuresLayout . add ( doiToLink ( licensedResource [ "doi" ] ) , {
290+ featuresLayout . add ( doiToLink ( licensedResource . getDoi ( ) ) , {
309291 column : 1 ,
310292 row : idx ,
311293 } ) ;
312294 idx ++ ;
313295 }
314296
315- if ( licensedItem [ "termsOfUseUrl" ] || licensedResource [ "termsOfUseUrl" ] ) { // remove the first one when this info goes down to the model
297+ if ( licensedResource . getTermsOfUseUrl ( ) ) { // remove the first one when this info goes down to the model
316298 const tAndC = new qx . ui . basic . Label ( ) . set ( {
317299 font : "text-14" ,
318300 value : this . tr ( "<u>Terms and Conditions</u>" ) ,
319301 rich : true ,
320302 anonymous : false ,
321303 cursor : "pointer" ,
322304 } ) ;
323- tAndC . addListener ( "tap" , ( ) => this . __openLicense ( licensedItem [ "termsOfUseUrl" ] || licensedResource [ "termsOfUseUrl" ] ) ) ;
305+ tAndC . addListener ( "tap" , ( ) => this . __openLicense ( licensedResource . getTermsOfUseUrl ( ) ) ) ;
324306 featuresLayout . add ( tAndC , {
325307 column : 1 ,
326308 row : idx ,
0 commit comments