Skip to content

Commit 5fefda0

Browse files
committed
last changes
1 parent 7966ca8 commit 5fefda0

File tree

6 files changed

+10
-29
lines changed

6 files changed

+10
-29
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
930930
request = osparc.store.Templates.searchTemplatesPaginated(params, options);
931931
break;
932932
case osparc.dashboard.StudyBrowser.CONTEXT.FUNCTIONS:
933-
// OM: implement this
934933
request = osparc.store.Functions.fetchFunctionsPaginated(params, options);
935934
}
936935
return request;
@@ -1179,6 +1178,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
11791178
searchContext = osparc.dashboard.StudyBrowser.CONTEXT.SEARCH_PUBLIC_TEMPLATES;
11801179
break;
11811180
case osparc.dashboard.StudyBrowser.CONTEXT.FUNCTIONS:
1181+
// functions are not searchable yet
11821182
searchContext = null;
11831183
break;
11841184
default:
@@ -1286,6 +1286,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
12861286
this._searchBarFilter.resetFilters();
12871287
this._searchBarFilter.getChildControl("text-field").setPlaceholder("Search in Functions");
12881288
this._searchBarFilter.setEnabled(false);
1289+
// functions can't be sorted yet
12891290
this._toolbar.exclude();
12901291
this._loadingResourcesBtn.setFetching(false);
12911292
this.invalidateFunctions();
@@ -1651,7 +1652,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
16511652
_updateFunctionData: function(functionData) {
16521653
functionData["resourceType"] = "function";
16531654

1654-
const index = this._resourcesList.findIndex(study => study["uuid"] === studyData["uuid"]);
1655+
const index = this._resourcesList.findIndex(func => func["uuid"] === functionData["uuid"]);
16551656
if (index === -1) {
16561657
// add it in first position, most likely it's a new study
16571658
this._resourcesList.unshift(functionData);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ qx.Class.define("osparc.data.Permissions", {
312312

313313
// This needs to be provided by the backend
314314
if (action === "readFunctions") {
315-
return true;
315+
return osparc.utils.Utils.isDevelopmentPlatform();
316316
}
317317

318318
if (

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,6 @@ qx.Class.define("osparc.data.model.Node", {
577577
*/
578578
__addSettings: function(inputs) {
579579
const form = this.__settingsForm = new osparc.form.Auto(inputs);
580-
if (!this.getStudy()) {
581-
return;
582-
}
583580
const propsForm = new osparc.form.renderer.PropForm(form, this, this.getStudy());
584581
this.setPropsForm(propsForm);
585582
propsForm.addListener("linkFieldModified", e => {

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ qx.Class.define("osparc.data.model.Workbench", {
6868
event: "changeStudy"
6969
},
7070

71-
function: {
72-
check: "osparc.data.model.Function",
73-
init: null,
74-
nullable: true,
75-
event: "changeFunction"
76-
},
77-
7871
deserialized: {
7972
check: "Boolean",
8073
init: false,

services/static-webserver/client/source/class/osparc/study/StudyPreview.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ qx.Class.define("osparc.study.StudyPreview", {
2626

2727
this._setLayout(new qx.ui.layout.VBox(5));
2828

29-
if (study instanceof osparc.data.model.Study) {
30-
const uiMode = study.getUi().getMode();
31-
if (["workbench", "pipeline"].includes(uiMode)) {
32-
this.__buildPreview(study);
33-
}
34-
} else if (study instanceof osparc.data.model.Function) {
29+
const uiMode = study.getUi().getMode();
30+
if (["workbench", "pipeline"].includes(uiMode)) {
3531
this.__buildPreview(study);
3632
}
3733
},
@@ -40,11 +36,7 @@ qx.Class.define("osparc.study.StudyPreview", {
4036
__buildPreview: function(study) {
4137
const workbenchReady = () => {
4238
const workbenchUIPreview = new osparc.workbench.WorkbenchUIPreview();
43-
if (study instanceof osparc.data.model.Study) {
44-
workbenchUIPreview.setStudy(study);
45-
} else if (study instanceof osparc.data.model.Function) {
46-
workbenchUIPreview.setFunction(study);
47-
}
39+
workbenchUIPreview.setStudy(study);
4840
workbenchUIPreview.loadModel(study.getWorkbench());
4941
workbenchUIPreview.setMaxHeight(550);
5042
this._add(workbenchUIPreview);

services/static-webserver/client/source/class/osparc/workbench/NodeUI.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,9 @@ qx.Class.define("osparc.workbench.NodeUI", {
298298
node.addListener("changeMarker", () => updateMarker());
299299
updateMarker();
300300

301-
if (node.getStudy()) {
302-
node.getStudy().bind("pipelineRunning", this._deleteBtn, "enabled", {
303-
converter: running => !running
304-
});
305-
}
301+
node.getStudy().bind("pipelineRunning", this._deleteBtn, "enabled", {
302+
converter: running => !running
303+
});
306304

307305
const evaluateLifeCycleIcon = () => {
308306
const deprecatedIcon = this.getChildControl("deprecated-icon");

0 commit comments

Comments
 (0)