Skip to content

Commit 02f7d3f

Browse files
authored
🐛 [Frontend] Fix: Credits summary time range (#6179)
1 parent 98e338f commit 02f7d3f

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ qx.Class.define("osparc.desktop.credits.CreditsPerService", {
2222
this.base(arguments);
2323

2424
this._setLayout(new qx.ui.layout.VBox(5));
25-
26-
this.initDaysRange();
2725
},
2826

2927
properties: {
3028
daysRange: {
3129
check: [1, 7, 30],
3230
nullable: false,
33-
init: 1,
31+
init: null,
3432
apply: "__populateList"
3533
}
3634
},

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ qx.Class.define("osparc.desktop.credits.CreditsSummary", {
2525

2626
this.set({
2727
appearance: "floating-menu",
28-
padding: 8
28+
padding: 8,
29+
maxWidth: this.self().WIDTH
2930
});
3031
osparc.utils.Utils.setIdToWidget(this, "creditsSummary");
3132

@@ -141,22 +142,21 @@ qx.Class.define("osparc.desktop.credits.CreditsSummary", {
141142
this.getChildControl("credits-indicator");
142143
this.getChildControl("billing-center-button");
143144
this.__buildConsumptionSummary();
144-
145-
this.set({
146-
maxWidth: this.self().WIDTH
147-
})
148145
},
149146

150147
__buildConsumptionSummary: function() {
151148
const timeRangeSB = this.getChildControl("time-range-sb");
152149
const servicesConsumption = this.getChildControl("services-consumption");
153150

154-
timeRangeSB.addListener("changeSelection", e => {
155-
const selection = e.getData();
151+
const fetchData = () => {
152+
const selection = timeRangeSB.getSelection();
156153
if (selection.length) {
157154
servicesConsumption.setDaysRange(selection[0].getModel());
158155
}
159-
});
156+
};
157+
158+
fetchData();
159+
timeRangeSB.addListener("changeSelection", () => fetchData(), this);
160160
}
161161
}
162162
});

0 commit comments

Comments
 (0)