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" } }, 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); } } });