From 671ea5c7ff071ee53735537274f25205404df8df Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Mon, 16 Dec 2024 10:26:11 +0100 Subject: [PATCH 1/7] minor aesthetics --- .../class/osparc/filter/group/ServiceFilterGroup.js | 2 +- .../source/class/osparc/workbench/ServiceCatalog.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/filter/group/ServiceFilterGroup.js b/services/static-webserver/client/source/class/osparc/filter/group/ServiceFilterGroup.js index 721333e8945..e5a35318f73 100644 --- a/services/static-webserver/client/source/class/osparc/filter/group/ServiceFilterGroup.js +++ b/services/static-webserver/client/source/class/osparc/filter/group/ServiceFilterGroup.js @@ -27,7 +27,7 @@ qx.Class.define("osparc.filter.group.ServiceFilterGroup", { */ construct: function(filterGroupId) { this.base(arguments); - this._setLayout(new qx.ui.layout.HBox(5)); + this._setLayout(new qx.ui.layout.HBox(10)); this.__filterGroupId = filterGroupId; const textFilter = this.__textFilter = new osparc.filter.TextFilter("text", filterGroupId); osparc.utils.Utils.setIdToWidget(textFilter, "serviceFiltersTextFld"); diff --git a/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js b/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js index 682e2d00fe0..216e5ff535e 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js +++ b/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js @@ -103,9 +103,11 @@ qx.Class.define("osparc.workbench.ServiceCatalog", { }); const filters = new osparc.filter.group.ServiceFilterGroup("serviceCatalog").set({ - maxHeight: 30 + maxHeight: 30, + }); + this.__textFilter = filters.getTextFilter().getChildControl("textfield", true).set({ + minWidth: 150, }); - this.__textFilter = filters.getTextFilter().getChildControl("textfield", true); layout.add(filters); layout.add(new qx.ui.core.Spacer(), { @@ -131,9 +133,7 @@ qx.Class.define("osparc.workbench.ServiceCatalog", { width: 568, backgroundColor: "background-main" }); - const scrolledServices = new qx.ui.container.Scroll().set({ - height: 260 - }); + const scrolledServices = new qx.ui.container.Scroll(); scrolledServices.add(serviceList); this.__serviceList.addListener("changeSelected", e => { From cb0993ed4e927adb3bc54282be0f9d0f4e298014 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Mon, 16 Dec 2024 10:29:34 +0100 Subject: [PATCH 2/7] center service catalog --- .../client/source/class/osparc/workbench/WorkbenchUI.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js b/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js index 0bde129f15e..040c73b1a75 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js +++ b/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js @@ -304,11 +304,6 @@ qx.Class.define("osparc.workbench.WorkbenchUI", { return null; } const srvCat = new osparc.workbench.ServiceCatalog(); - const maxLeft = this.getBounds().width - osparc.workbench.ServiceCatalog.Width; - const maxHeight = this.getBounds().height - osparc.workbench.ServiceCatalog.Height; - const posX = Math.min(winPos.x, maxLeft); - const posY = Math.min(winPos.y, maxHeight); - srvCat.moveTo(posX + this.__getLeftOffset(), posY + this.__getTopOffset()); srvCat.addListener("addService", async e => { const { service, @@ -321,6 +316,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", { this._createEdgeBetweenNodes(nodeLeftId ? nodeLeftId : newNodeId, nodeRightId ? nodeRightId : newNodeId, true); } }, this); + srvCat.center(); srvCat.open(); return srvCat; }, From ff364203c9924b014123a1ce632d35d799f75adf Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Mon, 16 Dec 2024 10:34:10 +0100 Subject: [PATCH 3/7] [skip ci] Pop up Service catlog always on center --- .../class/osparc/desktop/WorkbenchView.js | 3 --- .../class/osparc/workbench/WorkbenchUI.js | 18 +++++------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index 4dfad42c6e9..9d70f9a85e0 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -356,9 +356,6 @@ qx.Class.define("osparc.desktop.WorkbenchView", { this.__workbenchUI.openServiceCatalog({ x: 50, y: 50 - }, { - x: 50, - y: 50 }); }); homeAndNodesTree.add(addNewNodeBtn); diff --git a/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js b/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js index 040c73b1a75..bf42bde89f7 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js +++ b/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js @@ -290,12 +290,11 @@ qx.Class.define("osparc.workbench.WorkbenchUI", { }, __openServiceCatalog: function(e) { - const winPos = this.__pointerEventToScreenPos(e); const nodePos = this.__pointerEventToWorkbenchPos(e); - this.openServiceCatalog(winPos, nodePos); + this.openServiceCatalog(nodePos); }, - openServiceCatalog: function(winPos, nodePos) { + openServiceCatalog: function(nodePos) { if (this.getStudy().isReadOnly()) { return null; } @@ -766,8 +765,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", { let dragNodeId = data.nodeId; if (this.__tempEdgeNodeId === dragNodeId) { - const winPos = this.__unscaleCoordinates(this.__pointerPos.x, this.__pointerPos.y); - const srvCat = this.openServiceCatalog(winPos, this.__pointerPos); + const srvCat = this.openServiceCatalog(this.__pointerPos); if (srvCat) { this.__tempEdgeIsInput === true ? srvCat.setContext(null, dragNodeId) : srvCat.setContext(dragNodeId, null); srvCat.addListener("close", () => this.__removeTempEdge(), this); @@ -1327,10 +1325,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", { "text": "\uf090", // in "action": () => { const freePos = this.getStudy().getWorkbench().getFreePosition(nodeUI.getNode(), true); - const srvCat = this.openServiceCatalog({ - x: 50, - y: 50 - }, freePos); + const srvCat = this.openServiceCatalog(freePos); if (srvCat) { srvCat.setContext(null, nodeUI.getNodeId()); } @@ -1340,10 +1335,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", { "text": "\uf08b", // out "action": () => { const freePos = this.getStudy().getWorkbench().getFreePosition(nodeUI.getNode(), false); - const srvCat = this.openServiceCatalog({ - x: 50, - y: 50 - }, freePos); + const srvCat = this.openServiceCatalog(freePos); if (srvCat) { srvCat.setContext(nodeUI.getNodeId(), null); } From b33f2fd4db1c94ce35135447c69a8f6a22047a37 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Mon, 16 Dec 2024 10:56:56 +0100 Subject: [PATCH 4/7] [skip ci] unused --- .../class/osparc/service/ServiceListItem.js | 65 ------------------- 1 file changed, 65 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/service/ServiceListItem.js b/services/static-webserver/client/source/class/osparc/service/ServiceListItem.js index 9363fbb19a2..cb8e5c4550e 100644 --- a/services/static-webserver/client/source/class/osparc/service/ServiceListItem.js +++ b/services/static-webserver/client/source/class/osparc/service/ServiceListItem.js @@ -60,33 +60,6 @@ qx.Class.define("osparc.service.ServiceListItem", { __versionsBox: null, __infoBtn: null, - _createChildControlImpl: function(id) { - let control; - switch (id) { - case "extended-layout": - control = new qx.ui.container.Composite(new qx.ui.layout.VBox(10)); - this._add(control, { - row: 1, - column: 0, - colSpan: osparc.dashboard.ListButtonBase.POS.HITS - }); - break; - case "version-layout": { - control = new qx.ui.container.Composite(new qx.ui.layout.HBox(10)); - this.getChildControl("extended-layout").add(control); - const versionLabel = new qx.ui.basic.Label(this.tr("Version")); - control.add(versionLabel); - const selectBox = this.__versionsBox = new qx.ui.form.SelectBox(); - control.add(selectBox); - const infoBtn = this.__infoBtn = new qx.ui.form.Button(null, "@MaterialIcons/info_outline/16"); - infoBtn.addListener("execute", () => this.__showServiceDetails(), this); - control.add(infoBtn); - break; - } - } - return control || this.base(arguments, id); - }, - __applyService: function(service) { // BASE if (service.getThumbnail()) { @@ -123,44 +96,6 @@ qx.Class.define("osparc.service.ServiceListItem", { }); }, - __itemSelected: function(selected) { - this.setHeight(selected ? 70 : 35); - const extendedLayout = this.getChildControl("extended-layout"); - const versionLayout = this.getChildControl("version-layout"); - extendedLayout.setVisibility(selected ? "visible" : "excluded"); - versionLayout.setVisibility(selected ? "visible" : "excluded"); - this.__populateVersions(); - }, - - __populateVersions: function() { - const serviceKey = this.getService().getKey(); - const selectBox = this.__versionsBox; - selectBox.removeAll(); - const versions = osparc.service.Utils.getVersions(serviceKey); - const latest = new qx.ui.form.ListItem(this.self().LATEST); - latest.version = this.self().LATEST; - selectBox.add(latest); - versions.forEach(version => { - const listItem = osparc.service.Utils.versionToListItem(serviceKey, version); - selectBox.add(listItem); - }); - osparc.utils.Utils.growSelectBox(selectBox, 200); - selectBox.setSelection([latest]); - }, - - __showServiceDetails: function() { - const key = this.getService().getKey(); - let version = this.__versionsBox.getSelection()[0].version; - if (version === this.self().LATEST) { - version = this.__versionsBox.getChildrenContainer().getSelectables()[1].version; - } - osparc.store.Services.getService(key, version) - .then(serviceMetadata => { - const serviceDetails = new osparc.info.ServiceLarge(serviceMetadata); - osparc.info.ServiceLarge.popUpInWindow(serviceDetails); - }); - }, - _filterText: function(text) { const checks = [ this.getService().getName(), From 350b698402e8477c46c7f220706f3d4882848101 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Mon, 16 Dec 2024 11:08:29 +0100 Subject: [PATCH 5/7] [skip ci] focusable --- .../client/source/class/osparc/service/ServiceList.js | 2 +- .../client/source/class/osparc/service/ServiceListItem.js | 3 ++- .../source/class/osparc/workbench/ServiceCatalog.js | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/service/ServiceList.js b/services/static-webserver/client/source/class/osparc/service/ServiceList.js index 72d1164f6dd..d216effd964 100644 --- a/services/static-webserver/client/source/class/osparc/service/ServiceList.js +++ b/services/static-webserver/client/source/class/osparc/service/ServiceList.js @@ -29,7 +29,7 @@ qx.Class.define("osparc.service.ServiceList", { */ construct: function(filterGroupId) { this.base(arguments); - this._setLayout(new qx.ui.layout.Flow(5, 5)); + this._setLayout(new qx.ui.layout.VBox(5)); if (filterGroupId) { this.__filterGroup = filterGroupId; } diff --git a/services/static-webserver/client/source/class/osparc/service/ServiceListItem.js b/services/static-webserver/client/source/class/osparc/service/ServiceListItem.js index cb8e5c4550e..ce84ade1dcb 100644 --- a/services/static-webserver/client/source/class/osparc/service/ServiceListItem.js +++ b/services/static-webserver/client/source/class/osparc/service/ServiceListItem.js @@ -26,7 +26,8 @@ qx.Class.define("osparc.service.ServiceListItem", { height: this.self().ITEM_HEIGHT, paddingTop: 0, paddingBottom: 0, - allowGrowX: true + allowGrowX: true, + focusable: true, }); this.setResourceType("service"); diff --git a/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js b/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js index 216e5ff535e..d14212aa20f 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js +++ b/services/static-webserver/client/source/class/osparc/workbench/ServiceCatalog.js @@ -54,18 +54,18 @@ qx.Class.define("osparc.workbench.ServiceCatalog", { this.__sortBy = osparc.service.SortServicesButtons.DefaultSorting; - let catalogLayout = new qx.ui.layout.VBox(); + const catalogLayout = new qx.ui.layout.VBox(); this.setLayout(catalogLayout); - let filterLayout = this.__createFilterLayout(); + const filterLayout = this.__createFilterLayout(); this.add(filterLayout); - let list = this.__createListLayout(); + const list = this.__createListLayout(); this.add(list, { flex: 1 }); - let btnLayout = this.__createButtonsLayout(); + const btnLayout = this.__createButtonsLayout(); this.add(btnLayout); this.__createEvents(); From d45de5a3ad928fc435f15a507286268fa798f048 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Mon, 16 Dec 2024 11:12:27 +0100 Subject: [PATCH 6/7] [skip ci] filter by type --- .../source/class/osparc/data/model/Service.js | 13 +++++++++++-- .../source/class/osparc/filter/NodeTypeFilter.js | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Service.js b/services/static-webserver/client/source/class/osparc/data/model/Service.js index 203796d2bd0..d7f37db2e00 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Service.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Service.js @@ -43,7 +43,8 @@ qx.Class.define("osparc.data.model.Service", { bootOptions: serviceData.bootOptions, classifiers: serviceData.classifiers || [], quality: serviceData.quality || null, - hits: serviceData.hits || 0 + xType: serviceData.xType || null, + hits: serviceData.hits || 0, }); }, @@ -147,6 +148,13 @@ qx.Class.define("osparc.data.model.Service", { }, // ------ ignore for serializing ------ + xType: { + check: "String", + nullable: true, + init: null, + event: "changeXType", + }, + hits: { check: "Number", init: 0, @@ -158,7 +166,8 @@ qx.Class.define("osparc.data.model.Service", { statics: { IgnoreSerializationProps: [ - "hits" + "xType", + "hits", ] }, diff --git a/services/static-webserver/client/source/class/osparc/filter/NodeTypeFilter.js b/services/static-webserver/client/source/class/osparc/filter/NodeTypeFilter.js index 80becd17ada..a87a0e2d513 100644 --- a/services/static-webserver/client/source/class/osparc/filter/NodeTypeFilter.js +++ b/services/static-webserver/client/source/class/osparc/filter/NodeTypeFilter.js @@ -27,7 +27,7 @@ qx.Class.define("osparc.filter.NodeTypeFilter", { * @extends osparc.filter.TagsFilter */ construct: function(filterId, filterGroupId) { - this.base(arguments, this.tr("Service types"), filterId, filterGroupId); + this.base(arguments, this.tr("Type"), filterId, filterGroupId); this._setLayout(new qx.ui.layout.HBox()); this.__buildMenu(); From 05a472a82590d873bdb4b091c321ef7fed521f9c Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Mon, 16 Dec 2024 11:14:51 +0100 Subject: [PATCH 7/7] [skip ci] minor --- .../client/source/class/osparc/data/model/IframeHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index 583b31f979e..2ca74c47274 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -378,7 +378,7 @@ qx.Class.define("osparc.data.model.IframeHandler", { const node = this.getNode(); if (node.getServiceUrl() !== null) { // restart button pushed - if (this.getIFrame().getSource().includes(node.getServiceUrl())) { + if (this.getIFrame() && this.getIFrame().getSource().includes(node.getServiceUrl())) { this.__loadIframe(); }