Skip to content

Commit 4b8b407

Browse files
authored
Merge branch 'master' into feature/localized-chats
2 parents 21b9009 + 7b1a8b9 commit 4b8b407

File tree

4 files changed

+36
-11
lines changed

4 files changed

+36
-11
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ qx.Class.define("osparc.desktop.credits.CreditsSummary", {
4646
WIDTH: 350,
4747
TIME_RANGES: [{
4848
key: 1,
49-
label: "Today"
49+
label: "Last 24h"
5050
}, {
5151
key: 7,
5252
label: "Last week"
@@ -116,8 +116,8 @@ qx.Class.define("osparc.desktop.credits.CreditsSummary", {
116116
const trItem = new qx.ui.form.ListItem(tr.label, null, tr.key);
117117
control.add(trItem);
118118
});
119-
// default one week
120-
const found = control.getSelectables().find(trItem => trItem.getModel() === 7);
119+
// default last 24h
120+
const found = control.getSelectables().find(trItem => trItem.getModel() === 1);
121121
if (found) {
122122
control.setSelection([found]);
123123
}

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,25 @@ qx.Class.define("osparc.desktop.credits.DateFilters", {
2121
members: {
2222
_buildLayout() {
2323
this._removeAll();
24-
const defaultFrom = new Date()
25-
defaultFrom.setMonth(defaultFrom.getMonth() - 1)
26-
// Range defaults to previous month
24+
25+
// Range defaults: today
26+
const defaultFrom = new Date();
27+
const defaultTo = new Date();
28+
2729
this.__from = this.__addDateInput("From", defaultFrom);
28-
this.__until = this.__addDateInput("Until");
30+
this.__until = this.__addDateInput("Until", defaultTo);
31+
32+
const todayBtn = new qx.ui.form.Button("Today").set({
33+
allowStretchY: false,
34+
alignY: "bottom"
35+
});
36+
todayBtn.addListener("execute", () => {
37+
const today = new Date();
38+
this.__from.setValue(today);
39+
this.__until.setValue(today);
40+
});
41+
this._add(todayBtn);
42+
2943
const lastWeekBtn = new qx.ui.form.Button("Last week").set({
3044
allowStretchY: false,
3145
alignY: "bottom"
@@ -38,6 +52,7 @@ qx.Class.define("osparc.desktop.credits.DateFilters", {
3852
this.__until.setValue(today);
3953
});
4054
this._add(lastWeekBtn);
55+
4156
const lastMonthBtn = new qx.ui.form.Button("Last month").set({
4257
allowStretchY: false,
4358
alignY: "bottom"
@@ -50,6 +65,7 @@ qx.Class.define("osparc.desktop.credits.DateFilters", {
5065
this.__until.setValue(today);
5166
});
5267
this._add(lastMonthBtn);
68+
5369
const lastYearBtn = new qx.ui.form.Button("Last year").set({
5470
allowStretchY: false,
5571
alignY: "bottom"

services/static-webserver/client/source/class/osparc/store/Services.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,15 @@ qx.Class.define("osparc.store.Services", {
349349
},
350350

351351
getPricingPlan: function(serviceKey, serviceVersion) {
352-
const serviceUrl = osparc.data.Resources.getServiceUrl(serviceKey, serviceVersion)
352+
const serviceUrl = osparc.data.Resources.getServiceUrl(serviceKey, serviceVersion);
353+
const key = serviceUrl["key"];
354+
const version = serviceUrl["version"];
353355
// check if the service is already cached
354-
if (serviceUrl in this.__pricingPlansCached) {
355-
return Promise.resolve(this.__pricingPlansCached[serviceUrl]);
356+
if (
357+
key in this.__pricingPlansCached &&
358+
version in this.__pricingPlansCached[key]
359+
) {
360+
return Promise.resolve(this.__pricingPlansCached[key][version]);
356361
}
357362

358363
const plansParams = {
@@ -361,7 +366,10 @@ qx.Class.define("osparc.store.Services", {
361366
return osparc.data.Resources.fetch("services", "pricingPlans", plansParams)
362367
.then(pricingPlansData => {
363368
// store the fetched pricing plans in the cache
364-
this.__pricingPlansCached[serviceUrl] = pricingPlansData;
369+
if (!(key in this.__pricingPlansCached)) {
370+
this.__pricingPlansCached[key] = {};
371+
}
372+
this.__pricingPlansCached[key][version] = pricingPlansData;
365373
return pricingPlansData;
366374
});
367375
},

tests/e2e-playwright/tests/sleepers/test_sleepers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def test_sleepers(
170170
RunningState.WAITING_FOR_CLUSTER,
171171
RunningState.WAITING_FOR_RESOURCES,
172172
RunningState.STARTED,
173+
RunningState.SUCCESS,
173174
),
174175
timeout_ms=_WAITING_FOR_PIPELINE_TO_CHANGE_STATE,
175176
)

0 commit comments

Comments
 (0)