@@ -21,7 +21,7 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
2121 construct : function ( ) {
2222 this . base ( arguments ) ;
2323
24- const layout = new qx . ui . layout . VBox ( 20 ) ;
24+ const layout = new qx . ui . layout . VBox ( 15 ) ;
2525 this . _setLayout ( layout ) ;
2626
2727 this . __poplulateLayout ( ) ;
@@ -49,11 +49,9 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
4949 if ( anatomicalModelsData ) {
5050 const modelInfo = this . __createModelInfo ( anatomicalModelsData ) ;
5151 const pricingUnits = this . __createPricingUnits ( anatomicalModelsData ) ;
52- const purchasesSection = this . __createPurchasesSection ( anatomicalModelsData ) ;
53- const importButton = this . __createImportButton ( anatomicalModelsData ) ;
52+ const importButton = this . __createImportSection ( anatomicalModelsData ) ;
5453 this . _add ( modelInfo ) ;
5554 this . _add ( pricingUnits ) ;
56- this . _add ( purchasesSection ) ;
5755 this . _add ( importButton ) ;
5856 } else {
5957 const selectModelLabel = new qx . ui . basic . Label ( ) . set ( {
@@ -205,19 +203,19 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
205203 return pricingUnitsLayout ;
206204 } ,
207205
208- __createPurchasesSection : function ( anatomicalModelsData ) {
209- console . log ( "anatomicalModelsData" , anatomicalModelsData ) ;
210- const purchasesSection = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( 5 ) . set ( {
206+ __createImportSection : function ( anatomicalModelsData ) {
207+ const importSection = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( 5 ) . set ( {
211208 alignX : "center"
212209 } ) ) ;
210+
213211 anatomicalModelsData [ "purchases" ] . forEach ( purchase => {
214- const entry = new qx . ui . basic . Label ( "hey" ) ;
215- purchasesSection . push ( entry ) ;
212+ const seatsText = "seat" + purchase [ "numberOfSeats" ] > 1 ? "s" : "" ;
213+ const entry = new qx . ui . basic . Label ( ) . set ( {
214+ value : `${ purchase [ "numberOfSeats" ] } ${ seatsText } avaialable until ${ osparc . utils . Utils . formatDate ( purchase [ "expiresAt" ] ) } `
215+ } ) ;
216+ importSection . add ( entry ) ;
216217 } ) ;
217- return purchasesSection ;
218- } ,
219218
220- __createImportButton : function ( anatomicalModelsData ) {
221219 const importButton = new qx . ui . form . Button ( ) . set ( {
222220 label : this . tr ( "Import" ) ,
223221 appearance : "strong-button" ,
@@ -231,7 +229,8 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
231229 modelId : anatomicalModelsData [ "modelId" ]
232230 } ) ;
233231 } , this ) ;
234- return importButton ;
232+ importSection . add ( importButton ) ;
233+ return importSection ;
235234 } ,
236235 }
237236} ) ;
0 commit comments