Skip to content

Commit 717cc90

Browse files
committed
NodeUnknown
1 parent 227bde0 commit 717cc90

File tree

2 files changed

+70
-4
lines changed

2 files changed

+70
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ qx.Class.define("osparc.data.model.Node", {
6262
status: new osparc.data.model.NodeStatus(this)
6363
});
6464

65-
this.populateWithMetadata();
65+
this._populateWithMetadata();
6666
},
6767

6868
properties: {
@@ -482,7 +482,7 @@ qx.Class.define("osparc.data.model.Node", {
482482
return Object.keys(this.getOutputs()).length;
483483
},
484484

485-
populateWithMetadata: function() {
485+
_populateWithMetadata: function() {
486486
const metadata = this.__metaData;
487487
if (metadata) {
488488
if (metadata.name) {
@@ -1286,7 +1286,7 @@ qx.Class.define("osparc.data.model.Node", {
12861286
const value = this.__getInputData()["linspace_start"];
12871287
const label = this.getLabel();
12881288
this.setKey(newMetadata["key"]);
1289-
this.populateWithMetadata();
1289+
this._populateWithMetadata();
12901290
this.populateNodeData();
12911291
this.setLabel(label);
12921292
osparc.node.ParameterEditor.setParameterOutputValue(this, value);
@@ -1303,7 +1303,7 @@ qx.Class.define("osparc.data.model.Node", {
13031303
const value = this.__getOutputData("out_1");
13041304
const label = this.getLabel();
13051305
this.setKey(metadata["key"]);
1306-
this.populateWithMetadata();
1306+
this._populateWithMetadata();
13071307
this.populateNodeData();
13081308
this.setLabel(label);
13091309
this.__setInputData({
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/* ************************************************************************
2+
3+
osparc - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2025 IT'IS Foundation, https://itis.swiss
9+
10+
License:
11+
MIT: https://opensource.org/licenses/MIT
12+
13+
Authors:
14+
* Odei Maiz (odeimaiz)
15+
16+
************************************************************************ */
17+
18+
/**
19+
* Class that stores Node data without a known metadata.
20+
*/
21+
22+
qx.Class.define("osparc.data.model.NodeUnknown", {
23+
extend: osparc.data.model.Node,
24+
25+
/**
26+
* @param study {osparc.data.model.Study} Study or Serialized Study Object
27+
* @param key {String} service's key
28+
* @param version {String} service's version
29+
* @param nodeId {String} uuid of the service represented by the node (not needed for new Nodes)
30+
*/
31+
construct: function(study, key, version, nodeId) {
32+
const metadata = this.self().getUnknownMetadata(key, version);
33+
34+
this.base(arguments, study, metadata, nodeId);
35+
},
36+
37+
statics: {
38+
getUnknownMetadata: function(key, version) {
39+
return {
40+
key: key,
41+
version: version,
42+
type: "unknown",
43+
name: "Unknown Node",
44+
inputs: {},
45+
outputs: {},
46+
bootOptions: {
47+
boot_mode: {
48+
items: {},
49+
default: null
50+
}
51+
},
52+
propsForm: null,
53+
outputsForm: null,
54+
inputsUnits: {},
55+
};
56+
},
57+
},
58+
59+
members: {
60+
// overridden to avoid populating with metadata
61+
_populateWithMetadata: function() {
62+
// this is overridden by the NodeUnknown class
63+
// to avoid populating with metadata
64+
}
65+
}
66+
});

0 commit comments

Comments
 (0)