Skip to content

Commit 43afd74

Browse files
authored
🎨 [Frontend] ViP Market enhancements (#7212)
1 parent c6b7aff commit 43afd74

File tree

14 files changed

+629
-179
lines changed

14 files changed

+629
-179
lines changed

services/static-webserver/client/source/class/osparc/desktop/credits/BillingCenter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ qx.Class.define("osparc.desktop.credits.BillingCenter", {
3636

3737
if (osparc.product.Utils.showS4LStore()) {
3838
this.__addPurchasesPage();
39-
this.__addCheckoutsPage();
39+
// For now, do not add checkouts page
40+
// this.__addCheckoutsPage();
4041
}
4142
},
4243

@@ -102,7 +103,7 @@ qx.Class.define("osparc.desktop.credits.BillingCenter", {
102103

103104
__addPurchasesPage: function() {
104105
const title = this.tr("Purchases");
105-
const iconSrc = "@FontAwesome5Solid/list/22";
106+
const iconSrc = "@FontAwesome5Solid/shopping-bag/22";
106107
const purchases = new osparc.desktop.credits.Purchases();
107108
const page = this.addTab(title, iconSrc, purchases);
108109
return page;

services/static-webserver/client/source/class/osparc/desktop/preferences/pages/BasePage.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,17 @@ qx.Class.define("osparc.desktop.preferences.pages.BasePage", {
3030
paddingLeft: 15
3131
});
3232

33-
this.__showLabelOnTab(title)
33+
this.__showLabelOnTab(title);
34+
35+
const tabButton = this.getChildControl("button");
36+
if (tabButton.getIcon() && tabButton.getIcon().includes(".svg")) {
37+
tabButton.getChildControl("icon").set({
38+
minWidth: 24,
39+
minHeight: 24,
40+
scale: true,
41+
});
42+
osparc.ui.basic.SVGImage.setColorToImage(tabButton.getChildControl("icon"), "text");
43+
}
3444
},
3545

3646
members: {

services/static-webserver/client/source/class/osparc/study/PricingUnitLicense.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ qx.Class.define("osparc.study.PricingUnitLicense", {
8585
},
8686

8787
__rentUnit: function() {
88+
const nCredits = this.getUnitData().getCost();
8889
const expirationDate = osparc.study.PricingUnitLicense.getExpirationDate();
89-
const msg = this.getUnitData().getName() + this.tr(" will be available until ") + osparc.utils.Utils.formatDate(expirationDate);
90+
let msg = this.getUnitData().getName() + this.tr(" will be available until ") + osparc.utils.Utils.formatDate(expirationDate);
91+
msg += "<br>";
92+
msg += `The rental will cost ${nCredits} credits`;
9093
const confirmationWin = new osparc.ui.window.Confirmation(msg).set({
9194
caption: this.tr("Rent"),
9295
confirmText: this.tr("Rent"),

services/static-webserver/client/source/class/osparc/ui/basic/SVGImage.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,22 @@ qx.Class.define("osparc.ui.basic.SVGImage", {
127127
const brightnessValue = l3 => l3;
128128
const contrastValue = l4 => l4 > 50 ? 50 : l4;
129129
return `invert(${invertValue(l)}%) sepia(${sepiaValue(s)}%) saturate(${saturateValue(s)}%) hue-rotate(${h}deg) brightness(${brightnessValue(l)}%) contrast(${contrastValue(l)}%)`;
130+
},
131+
132+
setColorToImage: function(image, keywordOrRgb) {
133+
if (keywordOrRgb === null) {
134+
keywordOrRgb = "text";
135+
}
136+
let filterValue = this.self().keywordToCSSFilter(keywordOrRgb);
137+
if (filterValue === null) {
138+
const hexColor = qx.theme.manager.Color.getInstance().resolve(keywordOrRgb);
139+
const rgbColor = qx.util.ColorUtil.hexStringToRgb(hexColor);
140+
filterValue = this.self().rgbToCSSFilter(rgbColor);
141+
}
142+
const myStyle = {
143+
"filter": filterValue
144+
};
145+
image.getContentElement().setStyles(myStyle);
130146
}
131147
},
132148

@@ -160,19 +176,7 @@ qx.Class.define("osparc.ui.basic.SVGImage", {
160176
* @param keywordOrRgb {string} predefined keyword or rgb in the following format "0,255,0"
161177
*/
162178
__applyImageColor: function(keywordOrRgb) {
163-
if (keywordOrRgb === null) {
164-
keywordOrRgb = "text";
165-
}
166-
let filterValue = this.self().keywordToCSSFilter(keywordOrRgb);
167-
if (filterValue === null) {
168-
const hexColor = qx.theme.manager.Color.getInstance().resolve(keywordOrRgb);
169-
const rgbColor = qx.util.ColorUtil.hexStringToRgb(hexColor);
170-
filterValue = this.self().rgbToCSSFilter(rgbColor);
171-
}
172-
const myStyle = {
173-
"filter": filterValue
174-
};
175-
this.getChildControl("image").getContentElement().setStyles(myStyle);
176-
}
179+
this.self().setColorToImage(this.getChildControl("image"), keywordOrRgb);
180+
},
177181
}
178182
});

0 commit comments

Comments
 (0)