Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 [Frontend] ViP Market enhancements #7212

Merged
merged 31 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f148110
market icons and rented category
odeimaiz Feb 11, 2025
67b144c
refactor
odeimaiz Feb 11, 2025
c28b363
all black
odeimaiz Feb 11, 2025
5df7dc9
color images
odeimaiz Feb 11, 2025
9786dbf
For now, do not add checkouts page
odeimaiz Feb 11, 2025
90b4201
shopping-bag icon
odeimaiz Feb 11, 2025
f36aec9
Show cost
odeimaiz Feb 11, 2025
116f5a7
Merge branch 'master' into enh/market
odeimaiz Feb 12, 2025
575529d
renaming
odeimaiz Feb 12, 2025
c3e3508
Merge branch 'master' into enh/market
odeimaiz Feb 12, 2025
47d2e97
Merge branch 'enh/market' of github.com:odeimaiz/osparc-simcore into …
odeimaiz Feb 12, 2025
ea10585
openCategory
odeimaiz Feb 12, 2025
2bfd5a9
refactor
odeimaiz Feb 12, 2025
669875f
rename
odeimaiz Feb 12, 2025
6769888
repopulate Rented category
odeimaiz Feb 12, 2025
082c8c5
Merge branch 'master' into enh/market
odeimaiz Feb 12, 2025
47fef32
Merge branch 'master' into enh/market
odeimaiz Feb 13, 2025
820b22b
Merge branch 'master' into enh/market
odeimaiz Feb 13, 2025
66bc76f
Merge branch 'master' into enh/market
odeimaiz Feb 13, 2025
f661afc
categories
odeimaiz Feb 13, 2025
5425db3
list items
odeimaiz Feb 13, 2025
e24d664
display manufacturer
odeimaiz Feb 13, 2025
cb51de9
change model
odeimaiz Feb 13, 2025
d167acd
import with model card
odeimaiz Feb 13, 2025
2b0b31b
don't always show the doi
odeimaiz Feb 13, 2025
e5cdfa6
don't show the money
odeimaiz Feb 13, 2025
245d80f
renting works
odeimaiz Feb 13, 2025
7d46fdc
minor
odeimaiz Feb 13, 2025
99d8540
seats goes apart
odeimaiz Feb 13, 2025
bc53c88
pass correct modelId
odeimaiz Feb 13, 2025
85b2890
Merge branch 'master' into enh/market
odeimaiz Feb 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ qx.Class.define("osparc.desktop.credits.BillingCenter", {

if (osparc.product.Utils.showS4LStore()) {
this.__addPurchasesPage();
this.__addCheckoutsPage();
// For now, do not add checkouts page
// this.__addCheckoutsPage();
}
},

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

__addPurchasesPage: function() {
const title = this.tr("Purchases");
const iconSrc = "@FontAwesome5Solid/list/22";
const iconSrc = "@FontAwesome5Solid/shopping-bag/22";
const purchases = new osparc.desktop.credits.Purchases();
const page = this.addTab(title, iconSrc, purchases);
return page;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@ qx.Class.define("osparc.desktop.preferences.pages.BasePage", {
paddingLeft: 15
});

this.__showLabelOnTab(title)
this.__showLabelOnTab(title);

const tabButton = this.getChildControl("button");
if (tabButton.getIcon() && tabButton.getIcon().includes(".svg")) {
tabButton.getChildControl("icon").set({
minWidth: 24,
minHeight: 24,
scale: true,
});
osparc.ui.basic.SVGImage.setColorToImage(tabButton.getChildControl("icon"), "text");
}
},

members: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ qx.Class.define("osparc.study.PricingUnitLicense", {
},

__rentUnit: function() {
const nCredits = this.getUnitData().getCost();
const expirationDate = osparc.study.PricingUnitLicense.getExpirationDate();
const msg = this.getUnitData().getName() + this.tr(" will be available until ") + osparc.utils.Utils.formatDate(expirationDate);
let msg = this.getUnitData().getName() + this.tr(" will be available until ") + osparc.utils.Utils.formatDate(expirationDate);
msg += "<br>";
msg += `The rental will cost ${nCredits} credits: ${osparc.store.Store.getInstance().getCreditPrice()*nCredits}$`;
const confirmationWin = new osparc.ui.window.Confirmation(msg).set({
caption: this.tr("Rent"),
confirmText: this.tr("Rent"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,22 @@ qx.Class.define("osparc.ui.basic.SVGImage", {
const brightnessValue = l3 => l3;
const contrastValue = l4 => l4 > 50 ? 50 : l4;
return `invert(${invertValue(l)}%) sepia(${sepiaValue(s)}%) saturate(${saturateValue(s)}%) hue-rotate(${h}deg) brightness(${brightnessValue(l)}%) contrast(${contrastValue(l)}%)`;
},

setColorToImage: function(image, keywordOrRgb) {
if (keywordOrRgb === null) {
keywordOrRgb = "text";
}
let filterValue = this.self().keywordToCSSFilter(keywordOrRgb);
if (filterValue === null) {
const hexColor = qx.theme.manager.Color.getInstance().resolve(keywordOrRgb);
const rgbColor = qx.util.ColorUtil.hexStringToRgb(hexColor);
filterValue = this.self().rgbToCSSFilter(rgbColor);
}
const myStyle = {
"filter": filterValue
};
image.getContentElement().setStyles(myStyle);
}
},

Expand Down Expand Up @@ -160,19 +176,7 @@ qx.Class.define("osparc.ui.basic.SVGImage", {
* @param keywordOrRgb {string} predefined keyword or rgb in the following format "0,255,0"
*/
__applyImageColor: function(keywordOrRgb) {
if (keywordOrRgb === null) {
keywordOrRgb = "text";
}
let filterValue = this.self().keywordToCSSFilter(keywordOrRgb);
if (filterValue === null) {
const hexColor = qx.theme.manager.Color.getInstance().resolve(keywordOrRgb);
const rgbColor = qx.util.ColorUtil.hexStringToRgb(hexColor);
filterValue = this.self().rgbToCSSFilter(rgbColor);
}
const myStyle = {
"filter": filterValue
};
this.getChildControl("image").getContentElement().setStyles(myStyle);
}
this.self().setColorToImage(this.getChildControl("image"), keywordOrRgb);
},
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,27 @@ qx.Class.define("osparc.vipMarket.Market", {
])
.then(values => {
const licensedItems = values[0];
const purchasedItems = values[1];
const categories = [];
const rentedCategory = {
categoryId: "rentedModels",
label: this.tr("Rented"),
icon: "osparc/market/RentedModels.svg",
items: [],
};
categories.push(rentedCategory);
licensedItems.forEach(licensedItem => {
if (purchasedItems.find(purchasedItem => purchasedItem["licensedItemId"] === licensedItem["licensedItemId"])) {
rentedCategory["items"].push(licensedItem);
}
if (licensedItem["licensedResourceData"] && licensedItem["licensedResourceData"]["categoryId"]) {
const categoryId = licensedItem["licensedResourceData"]["categoryId"];
let category = categories.find(cat => cat["categoryId"] === categoryId);
if (!category) {
category = {
categoryId,
label: licensedItem["licensedResourceData"]["categoryDisplay"] || "Category",
icon: licensedItem["licensedResourceData"]["categoryIcon"] || "@FontAwesome5Solid/users/20",
icon: licensedItem["licensedResourceData"]["categoryIcon"] || `osparc/market/${categoryId}.svg`,
items: [],
};
categories.push(category);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading