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] Connect Anatomical modes to Licensed items #6911

Merged
merged 121 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
80243c8
linting
odeimaiz Dec 5, 2024
52209d7
add listing resource
odeimaiz Dec 5, 2024
806f653
more props
odeimaiz Dec 5, 2024
c20f488
more curated data
odeimaiz Dec 5, 2024
3d4e446
change layout
odeimaiz Dec 5, 2024
ceecb69
refactoring
odeimaiz Dec 5, 2024
9dcd855
[skip ci] show pricing units
odeimaiz Dec 5, 2024
3a98dc5
[skip ci] Show rent buttons
odeimaiz Dec 5, 2024
7e95307
rentAnatomicalModel
odeimaiz Dec 5, 2024
228469b
minors
odeimaiz Dec 5, 2024
5b1ea18
Merge branch 'master' into enh/list-licensed-items
odeimaiz Dec 6, 2024
a08f4e7
@pcrespov review
odeimaiz Dec 6, 2024
72b1e4f
Merge branch 'master' into enh/list-licensed-items
odeimaiz Dec 9, 2024
e43dc57
PricingPlan and PricingUnit models
odeimaiz Dec 9, 2024
38cd47e
Pricing own store and models
odeimaiz Dec 9, 2024
cf5c35c
LICENSE
odeimaiz Dec 9, 2024
351fee5
show classification prop
odeimaiz Dec 9, 2024
0f534b9
__addPricingUnitToCache
odeimaiz Dec 9, 2024
c071a48
[skip ci] classification in unit
odeimaiz Dec 9, 2024
5f7ab7b
[skip ci] more refactoring
odeimaiz Dec 9, 2024
eac4e13
[skip ci] refactoring
odeimaiz Dec 9, 2024
c0b74ff
[skip ci] more refactoring
odeimaiz Dec 9, 2024
3339b98
[skip ci] Units List working
odeimaiz Dec 9, 2024
872117d
Merge branch 'master' into enh/list-licensed-items
odeimaiz Dec 9, 2024
b53a1e2
minor
odeimaiz Dec 9, 2024
0c7a0e9
defaults
odeimaiz Dec 9, 2024
bc7cea9
[skip ci] step by step
odeimaiz Dec 9, 2024
9e4b9aa
edit to root
odeimaiz Dec 9, 2024
721863b
Unit Editor
odeimaiz Dec 9, 2024
48ca364
[skip ci] update plan
odeimaiz Dec 9, 2024
61443d7
plan editor ready
odeimaiz Dec 9, 2024
bc9e8bc
Merge branch 'master' into enh/list-licensed-items
odeimaiz Dec 9, 2024
993487d
[skip ci] refactor
odeimaiz Dec 9, 2024
829eae9
db layer licensed items purchase
matusdrobuliak66 Dec 9, 2024
973e8b6
[skip ci] enh
odeimaiz Dec 9, 2024
b80e61a
[skip ci] list units
odeimaiz Dec 9, 2024
3487e47
last call to Store
odeimaiz Dec 9, 2024
660d694
fetchPricingPlansService
odeimaiz Dec 9, 2024
d76006c
last call to Store
odeimaiz Dec 9, 2024
ba99088
[skip ci] typo
odeimaiz Dec 9, 2024
2712dfe
minor
odeimaiz Dec 9, 2024
4c0e3c5
Select button
odeimaiz Dec 9, 2024
a975a63
rut part
matusdrobuliak66 Dec 10, 2024
fc62c0d
merge master
matusdrobuliak66 Dec 10, 2024
78ef2cc
renaming tests
matusdrobuliak66 Dec 10, 2024
a6f49cd
rpc interface
matusdrobuliak66 Dec 10, 2024
ff850d2
Merge branch 'master' into enh/list-licensed-items
odeimaiz Dec 10, 2024
859396f
[skip ci] no hacks
odeimaiz Dec 10, 2024
13d259c
[skip ci] Not a Toggle Button
odeimaiz Dec 10, 2024
bfb0b09
[skip ci] border
odeimaiz Dec 10, 2024
e5f3648
renaming
odeimaiz Dec 10, 2024
7a6c3e4
select and unselect the rest
odeimaiz Dec 10, 2024
7e8355a
[skip ci] show error message
odeimaiz Dec 10, 2024
7109bbb
purchased
odeimaiz Dec 10, 2024
f5de79b
RUT unit tests
matusdrobuliak66 Dec 10, 2024
cda64e2
Import button
odeimaiz Dec 10, 2024
acd4c88
RUT unit tests
matusdrobuliak66 Dec 10, 2024
317cf1d
RUT unit tests
matusdrobuliak66 Dec 10, 2024
16650d8
refactor and 4 tabs
odeimaiz Dec 10, 2024
51c2b28
minor
odeimaiz Dec 10, 2024
bb97dec
all models
odeimaiz Dec 10, 2024
edc2c43
openCategory
odeimaiz Dec 10, 2024
7b742e0
minor
odeimaiz Dec 10, 2024
932fb00
webserver part
matusdrobuliak66 Dec 10, 2024
06f5743
webserver part
matusdrobuliak66 Dec 10, 2024
dbd1ffe
open api specs
matusdrobuliak66 Dec 10, 2024
6bec5ff
webserver part tests
matusdrobuliak66 Dec 10, 2024
754cd58
Merge branch 'master' into introduce-vip-models-pricing-4-part
matusdrobuliak66 Dec 10, 2024
3755dce
open api specs
matusdrobuliak66 Dec 10, 2024
8f264b1
Merge branch 'introduce-vip-models-pricing-4-part' of github.com:matu…
matusdrobuliak66 Dec 10, 2024
4185852
fix type
matusdrobuliak66 Dec 10, 2024
4c31cd0
fix type
matusdrobuliak66 Dec 10, 2024
530fda0
fix type
matusdrobuliak66 Dec 10, 2024
00d40bd
fix type
matusdrobuliak66 Dec 10, 2024
fa3c648
Merge branch 'master' into introduce-vip-models-pricing-4-part
matusdrobuliak66 Dec 10, 2024
256786c
Merge branch 'master' into enh/list-licensed-items
odeimaiz Dec 10, 2024
12ebf32
Merge branch 'master' into introduce-vip-models-pricing-4-part
matusdrobuliak66 Dec 11, 2024
969f982
review @pcrespov
matusdrobuliak66 Dec 11, 2024
138412e
adding purchase item functionality
matusdrobuliak66 Dec 11, 2024
7e9de14
open api specs
matusdrobuliak66 Dec 11, 2024
4f1c5d6
improve error handling
matusdrobuliak66 Dec 11, 2024
26f9c57
open api specs
matusdrobuliak66 Dec 11, 2024
583b2b4
fix import
matusdrobuliak66 Dec 11, 2024
4a1008f
fix import
matusdrobuliak66 Dec 11, 2024
776806b
fix typecheck
matusdrobuliak66 Dec 11, 2024
fadfa1f
fix typecheck
matusdrobuliak66 Dec 11, 2024
356b3ee
Merge branch 'master' into introduce-vip-models-pricing-4-part
matusdrobuliak66 Dec 11, 2024
eff2f88
fixes @odeimaiz issue
pcrespov Dec 11, 2024
046c628
adds tests
pcrespov Dec 11, 2024
243ad48
types
pcrespov Dec 11, 2024
33f6bfb
fixes OAS
pcrespov Dec 11, 2024
9ef6411
Merge branch 'master' into enh/list-licensed-items
odeimaiz Dec 11, 2024
6acc12f
Merge branch 'introduce-vip-models-pricing-4-part' of github.com:matu…
odeimaiz Dec 11, 2024
62e0688
services/webserver api version: 0.49.0 → 0.50.0
pcrespov Dec 11, 2024
5fbe4e8
fixes OAS
pcrespov Dec 11, 2024
739fad7
update oas
pcrespov Dec 11, 2024
d25b6f1
Merge branch 'is1779/fixes-master' of github.com:pcrespov/osparc-simc…
odeimaiz Dec 11, 2024
4bc3248
Merge branch 'master' into enh/list-licensed-items
odeimaiz Dec 11, 2024
3f83740
get purchases
odeimaiz Dec 11, 2024
f23e16f
Merge branch 'enh/list-licensed-items' of github.com:odeimaiz/osparc-…
odeimaiz Dec 11, 2024
d0ba254
numberOfSeats
odeimaiz Dec 11, 2024
cdec8e6
[skip ci] expiration date
odeimaiz Dec 11, 2024
4e9ed4a
Merge branch 'master' into enh/list-licensed-items
odeimaiz Dec 11, 2024
b10e456
purchases is an Array
odeimaiz Dec 11, 2024
a51c8a1
[skip ci] purchases
odeimaiz Dec 11, 2024
beccf2d
renaming
odeimaiz Dec 11, 2024
40a9b53
aesthetics
odeimaiz Dec 11, 2024
879ebfe
[skip ci] aesthtics
odeimaiz Dec 11, 2024
24b5fcf
minor
odeimaiz Dec 11, 2024
a381ac4
working
odeimaiz Dec 11, 2024
c8ac2bc
Feedback after purchase and hide Import
odeimaiz Dec 11, 2024
fda7fb6
openMarket from sim4life
odeimaiz Dec 11, 2024
7b6e32f
sendImportModelMessage
odeimaiz Dec 11, 2024
07a5547
minor
odeimaiz Dec 11, 2024
134acf0
Import button visibility
odeimaiz Dec 11, 2024
87362a3
gid string to int
odeimaiz Dec 11, 2024
436898e
minor binding
odeimaiz Dec 11, 2024
3f5ab00
get all licensedItems
odeimaiz Dec 11, 2024
0f0c6e4
minor
odeimaiz Dec 11, 2024
e626639
categories
odeimaiz Dec 11, 2024
45d9c21
Merge branch 'master' into enh/list-licensed-items
odeimaiz Dec 11, 2024
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 @@ -631,7 +631,7 @@ qx.Class.define("osparc.data.Resources", {
* PRICING PLANS
*/
"pricingPlans": {
useCache: true,
useCache: false, // handled in osparc.store.Pricing
endpoints: {
get: {
method: "GET",
Expand All @@ -656,7 +656,7 @@ qx.Class.define("osparc.data.Resources", {
* PRICING UNITS
*/
"pricingUnits": {
useCache: true,
useCache: false, // handled in osparc.store.Pricing
endpoints: {
getOne: {
method: "GET",
Expand Down Expand Up @@ -918,7 +918,11 @@ qx.Class.define("osparc.data.Resources", {
putAutoRecharge: {
method: "PUT",
url: statics.API + "/wallets/{walletId}/auto-recharge"
}
},
purchases: {
method: "GET",
url: statics.API + "/wallets/{walletId}/licensed-items-purchases"
},
}
},
/*
Expand Down Expand Up @@ -1247,6 +1251,27 @@ qx.Class.define("osparc.data.Resources", {
url: statics.API + "/tags/{tagId}"
}
}
},

/*
* LICENSED ITEMS
*/
"licensedItems": {
useCache: true,
endpoints: {
get: {
method: "GET",
url: statics.API + "/catalog/licensed-items"
},
getPage: {
method: "GET",
odeimaiz marked this conversation as resolved.
Show resolved Hide resolved
url: statics.API + "/catalog/licensed-items?offset={offset}&limit={limit}"
},
purchase: {
method: "POST",
url: statics.API + "/catalog/licensed-items/{licensedItemId}:purchase"
},
}
}
};
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/* ************************************************************************
osparc - the simcore frontend
https://osparc.io
Copyright:
2024 IT'IS Foundation, https://itis.swiss
License:
MIT: https://opensource.org/licenses/MIT
Authors:
* Odei Maiz (odeimaiz)
************************************************************************ */

/**
* Class that stores PricingPlan data.
*/

qx.Class.define("osparc.data.model.PricingPlan", {
extend: qx.core.Object,

/**
* @param pricingPlanData {Object} Object containing the serialized PricingPlan Data
*/
construct: function(pricingPlanData) {
this.base(arguments);

this.set({
pricingPlanId: pricingPlanData.pricingPlanId,
pricingPlanKey: pricingPlanData.pricingPlanKey,
classification: pricingPlanData.classification,
name: pricingPlanData.displayName,
description: pricingPlanData.description,
isActive: pricingPlanData.isActive,
pricingUnits: [],
});

if (pricingPlanData.pricingUnits) {
pricingPlanData.pricingUnits.forEach(pricingUnitData => {
const pricingUnit = new osparc.data.model.PricingUnit(pricingUnitData);
this.getPricingUnits().push(pricingUnit);
});
}
},

properties: {
pricingPlanId: {
check: "Number",
nullable: false,
init: null,
event: "changePricingPlanId"
},

pricingPlanKey: {
check: "String",
nullable: true,
init: null,
event: "changePricingPlanKey"
},

pricingUnits: {
check: "Array",
nullable: true,
init: [],
event: "changePricingunits"
},

classification: {
check: ["TIER", "LICENSE"],
nullable: false,
init: null,
event: "changeClassification"
},

name: {
check: "String",
nullable: false,
init: null,
event: "changeName"
},

description: {
check: "String",
nullable: true,
init: null,
event: "changeDescription"
},

isActive: {
check: "Boolean",
nullable: false,
init: false,
event: "changeIsActive"
},
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/* ************************************************************************
osparc - the simcore frontend
https://osparc.io
Copyright:
2024 IT'IS Foundation, https://itis.swiss
License:
MIT: https://opensource.org/licenses/MIT
Authors:
* Odei Maiz (odeimaiz)
************************************************************************ */

/**
* Class that stores PricingUnit data.
*/

qx.Class.define("osparc.data.model.PricingUnit", {
extend: qx.core.Object,

/**
* @param pricingUnitData {Object} Object containing the serialized PricingUnit Data
*/
construct: function(pricingUnitData) {
this.base(arguments);

this.set({
pricingUnitId: pricingUnitData.pricingUnitId,
name: pricingUnitData.unitName,
cost: parseFloat(pricingUnitData.currentCostPerUnit),
isDefault: pricingUnitData.default,
extraInfo: pricingUnitData.unitExtraInfo,
specificInfo: pricingUnitData.specificInfo || null,
});
},

properties: {
pricingUnitId: {
check: "Number",
nullable: true,
init: null,
event: "changePricingUnitId"
},

classification: {
check: ["TIER", "LICENSE"],
nullable: false,
init: null,
event: "changeClassification"
},

name: {
check: "String",
nullable: false,
init: null,
event: "changeName"
},

cost: {
check: "Number",
nullable: false,
init: null,
event: "changeCost"
},

isDefault: {
check: "Boolean",
nullable: false,
init: false,
event: "changeIsDefault",
},

extraInfo: {
check: "Object",
nullable: false,
init: null,
event: "changeExtraInfo",
},

specificInfo: {
check: "Object",
nullable: true,
init: null,
event: "changeSpecificInfo",
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
__iFrameChanged: function(node) {
this.__iframePage.removeAll();

if (node) {
if (node && node.getIFrame()) {
const loadingPage = node.getLoadingPage();
const iFrame = node.getIFrame();
const src = iFrame.getSource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ qx.Class.define("osparc.navigation.UserMenu", {
this.add(control);
break;
}
case "license":
case "license": {
control = new qx.ui.menu.Button(this.tr("License"));
osparc.utils.Utils.setIdToWidget(control, "userMenuLicenseBtn");
const licenseURL = osparc.store.Support.getLicenseURL();
control.addListener("execute", () => window.open(licenseURL));
this.add(control);
break;
}
case "tip-lite-button":
control = new qx.ui.menu.Button(this.tr("Access Full TIP"));
osparc.utils.Utils.setIdToWidget(control, "userMenuAccessTIPBtn");
Expand Down Expand Up @@ -237,7 +238,7 @@ qx.Class.define("osparc.navigation.UserMenu", {
this.addSeparator();

this.__addAnnouncements();

if (osparc.product.Utils.showS4LStore()) {
this.getChildControl("market");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,20 @@ qx.Class.define("osparc.node.TierSelectionView", {
tiersLayout.add(tierBox);

const node = this.getNode();
const plansParams = {
url: osparc.data.Resources.getServiceUrl(
node.getKey(),
node.getVersion()
)
};
const studyId = node.getStudy().getUuid();
const nodeId = node.getNodeId();
osparc.data.Resources.fetch("services", "pricingPlans", plansParams)
const pricingStore = osparc.store.Pricing.getInstance();
pricingStore.fetchPricingPlansService(node.getKey(), node.getVersion())
.then(pricingPlans => {
if (pricingPlans && "pricingUnits" in pricingPlans && pricingPlans["pricingUnits"].length) {
const pUnits = pricingPlans["pricingUnits"];
pUnits.forEach(pUnit => {
const tItem = new qx.ui.form.ListItem(pUnit.unitName, null, pUnit.pricingUnitId);
const pricingUnits = pricingPlans["pricingUnits"].map(princingUnitData => {
const pricingUnit = new osparc.data.model.PricingUnit(princingUnitData);
return pricingUnit;
});
pricingUnits.forEach(pricingUnit => {
const tItem = new qx.ui.form.ListItem(pricingUnit.getName(), null, pricingUnit.getPricingUnitId());
tierBox.add(tItem);
});
const studyId = node.getStudy().getUuid();
const nodeId = node.getNodeId();
const unitParams = {
url: {
studyId,
Expand All @@ -81,9 +79,9 @@ qx.Class.define("osparc.node.TierSelectionView", {
})
.finally(() => {
const pUnitUIs = [];
pUnits.forEach(pUnit => {
const pUnitUI = new osparc.study.PricingUnit(pUnit).set({
allowGrowX: false
pricingUnits.forEach(pricingUnit => {
const pUnitUI = new osparc.study.PricingUnitTier(pricingUnit).set({
showEditButton: false,
});
pUnitUI.getChildControl("name").exclude();
pUnitUI.exclude();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ qx.Class.define("osparc.node.slideshow.NodeView", {
this._iFrameLayout.removeAll();

const node = this.getNode();
if (node) {
if (node && node.getIFrame()) {
const loadingPage = node.getLoadingPage();
const iFrame = node.getIFrame();
const src = iFrame.getSource();
Expand Down
Loading
Loading