From 9092253aec345b2dfb67356348ea3e0ba26c8af9 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Tue, 13 Aug 2024 14:16:35 +0200 Subject: [PATCH 1/2] do not initialize --- .../source/class/osparc/desktop/credits/CreditsPerService.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/credits/CreditsPerService.js b/services/static-webserver/client/source/class/osparc/desktop/credits/CreditsPerService.js index 546f2135217..4faa1259c1f 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/credits/CreditsPerService.js +++ b/services/static-webserver/client/source/class/osparc/desktop/credits/CreditsPerService.js @@ -22,15 +22,13 @@ qx.Class.define("osparc.desktop.credits.CreditsPerService", { this.base(arguments); this._setLayout(new qx.ui.layout.VBox(5)); - - this.initDaysRange(); }, properties: { daysRange: { check: [1, 7, 30], nullable: false, - init: 1, + init: null, apply: "__populateList" } }, From 68e5bc8b3c799c7c3e82f6f9f5940b1b3005802f Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Tue, 13 Aug 2024 14:16:48 +0200 Subject: [PATCH 2/2] listen to changes --- .../osparc/desktop/credits/CreditsSummary.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/credits/CreditsSummary.js b/services/static-webserver/client/source/class/osparc/desktop/credits/CreditsSummary.js index 1d077749802..5fac222d96b 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/credits/CreditsSummary.js +++ b/services/static-webserver/client/source/class/osparc/desktop/credits/CreditsSummary.js @@ -25,7 +25,8 @@ qx.Class.define("osparc.desktop.credits.CreditsSummary", { this.set({ appearance: "floating-menu", - padding: 8 + padding: 8, + maxWidth: this.self().WIDTH }); osparc.utils.Utils.setIdToWidget(this, "creditsSummary"); @@ -141,22 +142,21 @@ qx.Class.define("osparc.desktop.credits.CreditsSummary", { this.getChildControl("credits-indicator"); this.getChildControl("billing-center-button"); this.__buildConsumptionSummary(); - - this.set({ - maxWidth: this.self().WIDTH - }) }, __buildConsumptionSummary: function() { const timeRangeSB = this.getChildControl("time-range-sb"); const servicesConsumption = this.getChildControl("services-consumption"); - timeRangeSB.addListener("changeSelection", e => { - const selection = e.getData(); + const fetchData = () => { + const selection = timeRangeSB.getSelection(); if (selection.length) { servicesConsumption.setDaysRange(selection[0].getModel()); } - }); + }; + + fetchData(); + timeRangeSB.addListener("changeSelection", () => fetchData(), this); } } });