Skip to content

Commit 4476cac

Browse files
Merge branch 'master' into add-filter-on-active-jobs
2 parents 9d6a2e9 + d0874a0 commit 4476cac

File tree

30 files changed

+665
-508
lines changed

30 files changed

+665
-508
lines changed

.codecov.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ component_management:
2525
branches:
2626
- "!master"
2727
individual_components:
28-
- component_id: api
29-
paths:
30-
- api/**
3128
- component_id: pkg_aws_library
3229
paths:
3330
- packages/aws-library/**
@@ -133,6 +130,7 @@ comment:
133130

134131

135132
ignore:
133+
- "api/tests"
136134
- "test_*.py"
137135
- "**/generated_models/*.py"
138136
- "**/generated_code/*.py"

packages/settings-library/src/settings_library/utils_cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def print_as_envfile(
2727
):
2828
exclude_unset = pydantic_export_options.get("exclude_unset", False)
2929

30-
for name, field in settings_obj.model_fields.items():
30+
for name, field in type(settings_obj).model_fields.items():
3131
auto_default_from_env = (
3232
field.json_schema_extra is not None
3333
and field.json_schema_extra.get("auto_default_from_env", False)
@@ -66,6 +66,9 @@ def print_as_envfile(
6666
typer.echo(f"# {field.description}")
6767
if isinstance(value, Enum):
6868
value = value.value
69+
elif isinstance(value, dict | list):
70+
# Serialize complex objects as JSON to ensure they can be parsed correctly
71+
value = json_dumps(value)
6972
typer.echo(f"{name}={value}")
7073

7174

services/static-webserver/client/source/class/osparc/dashboard/CardBase.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,13 +790,15 @@ qx.Class.define("osparc.dashboard.CardBase", {
790790
}
791791
},
792792

793-
// pipelineState: ["NOT_STARTED", "STARTED", "SUCCESS", "ABORTED", "FAILED", "UNKNOWN"]
793+
// pipelineState: ["NOT_STARTED", "PUBLISHED", "STOPPING", "STARTED", "SUCCESS", "ABORTED", "FAILED", "UNKNOWN"]
794794
__applyPipelineState: function(pipelineState) {
795795
let iconSource;
796796
let toolTipText;
797797
let borderColor;
798798
switch (pipelineState) {
799+
case "PUBLISHED":
799800
case "STARTED":
801+
case "STOPPING":
800802
iconSource = "@FontAwesome5Solid/spinner/10";
801803
toolTipText = this.tr("Running");
802804
borderColor = "info";

services/static-webserver/client/source/class/osparc/data/model/Study.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,13 @@ qx.Class.define("osparc.data.model.Study", {
249249
init: null,
250250
event: "changeTrashedBy",
251251
},
252+
253+
savePending: {
254+
check: "Boolean",
255+
nullable: true,
256+
event: "changeSavePending",
257+
init: false
258+
},
252259
// ------ ignore for serializing ------
253260
},
254261

@@ -259,6 +266,7 @@ qx.Class.define("osparc.data.model.Study", {
259266
"pipelineRunning",
260267
"readOnly",
261268
"trashedAt",
269+
"savePending",
262270
],
263271

264272
IgnoreModelizationProps: [

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
105105

106106
statics: {
107107
AUTO_SAVE_INTERVAL: 3000,
108+
DIFF_CHECK_INTERVAL: 300,
108109
READ_ONLY_TEXT: qx.locale.Manager.tr("You do not have writing permissions.<br>Your changes will not be saved."),
109110
},
110111

@@ -114,6 +115,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
114115
__workbenchView: null,
115116
__slideshowView: null,
116117
__autoSaveTimer: null,
118+
__savingTimer: null,
117119
__studyEditorIdlingTracker: null,
118120
__studyDataInBackend: null,
119121
__updatingStudy: null,
@@ -226,6 +228,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
226228

227229
if (osparc.data.model.Study.canIWrite(study.getAccessRights())) {
228230
this.__startAutoSaveTimer();
231+
this.__startSavingTimer();
229232
} else {
230233
const msg = this.self().READ_ONLY_TEXT;
231234
osparc.FlashMessenger.logAs(msg, "WARNING");
@@ -794,6 +797,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
794797
}, this);
795798
},
796799

800+
// ------------------ IDLING TRACKER ------------------
797801
__startIdlingTracker: function() {
798802
if (this.__studyEditorIdlingTracker) {
799803
this.__studyEditorIdlingTracker.stop();
@@ -810,7 +814,9 @@ qx.Class.define("osparc.desktop.StudyEditor", {
810814
this.__studyEditorIdlingTracker = null;
811815
}
812816
},
817+
// ------------------ IDLING TRACKER ------------------
813818

819+
// ------------------ AUTO SAVER ------------------
814820
__startAutoSaveTimer: function() {
815821
// Save every 3 seconds
816822
const timer = this.__autoSaveTimer = new qx.event.Timer(this.self().AUTO_SAVE_INTERVAL);
@@ -835,10 +841,32 @@ qx.Class.define("osparc.desktop.StudyEditor", {
835841
this.__autoSaveTimer.restart();
836842
}
837843
},
844+
// ------------------ AUTO SAVER ------------------
845+
846+
// ---------------- SAVING TIMER ------------------
847+
__startSavingTimer: function() {
848+
const timer = this.__savingTimer = new qx.event.Timer(this.self().DIFF_CHECK_INTERVAL);
849+
timer.addListener("interval", () => {
850+
if (!osparc.wrapper.WebSocket.getInstance().isConnected()) {
851+
return;
852+
}
853+
this.getStudy().setSavePending(this.didStudyChange());
854+
}, this);
855+
timer.start();
856+
},
857+
858+
__stopSavingTimer: function() {
859+
if (this.__savingTimer && this.__savingTimer.isEnabled()) {
860+
this.__savingTimer.stop();
861+
this.__savingTimer.setEnabled(false);
862+
}
863+
},
864+
// ---------------- SAVING TIMER ------------------
838865

839866
__stopTimers: function() {
840867
this.__stopIdlingTracker();
841868
this.__stopAutoSaveTimer();
869+
this.__stopSavingTimer();
842870
},
843871

844872
__getStudyDiffs: function() {
@@ -857,6 +885,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
857885
return studyDiffs;
858886
},
859887

888+
// didStudyChange takes around 0.5ms
860889
didStudyChange: function() {
861890
const studyDiffs = this.__getStudyDiffs();
862891
return Boolean(Object.keys(studyDiffs.delta).length);

services/static-webserver/client/source/class/osparc/info/MergedLarge.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ qx.Class.define("osparc.info.MergedLarge", {
296296
},
297297

298298
__createDescription: function() {
299-
const maxHeight = 400;
300299
const descriptionLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(5).set({
301300
alignY: "middle"
302301
}));
@@ -306,7 +305,8 @@ qx.Class.define("osparc.info.MergedLarge", {
306305
});
307306
descriptionLayout.add(label);
308307

309-
const descriptionContainer = osparc.info.StudyUtils.createDescriptionMD(this.getStudy(), maxHeight);
308+
const maxHeight = 400;
309+
const descriptionContainer = osparc.info.StudyUtils.createDescription(this.getStudy(), maxHeight);
310310
descriptionLayout.add(descriptionContainer);
311311

312312
return descriptionLayout;

0 commit comments

Comments
 (0)