Skip to content

Commit 9d7ad1d

Browse files
committed
title and refactoring
1 parent 806d878 commit 9d7ad1d

File tree

7 files changed

+28
-40
lines changed

7 files changed

+28
-40
lines changed

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ qx.Class.define("osparc.info.ServiceLarge", {
2020
extend: osparc.info.CardLarge,
2121

2222
/**
23-
* @param serviceData {Object} Serialized Service Object
23+
* @param metadata {Object} Serialized Service Object
2424
* @param instance {Object} instance related data
2525
* @param openOptions {Boolean} open edit options in new window or fire event
2626
*/
27-
construct: function(serviceData, instance = null, openOptions = true) {
27+
construct: function(metadata, instance = null, openOptions = true) {
2828
this.base(arguments);
2929

30-
this.setService(serviceData);
30+
this.setService(metadata);
3131

3232
if (instance) {
3333
if ("nodeId" in instance) {
@@ -79,6 +79,19 @@ qx.Class.define("osparc.info.ServiceLarge", {
7979
}
8080
},
8181

82+
statics: {
83+
popUpInWindow: function(serviceLarge) {
84+
const metadata = serviceLarge.getService();
85+
const versionDisplay = osparc.service.Utils.extractVersionDisplay(metadata);
86+
const title = `${metadata["name"]} ${versionDisplay}`;
87+
const width = osparc.info.CardLarge.WIDTH;
88+
const height = osparc.info.CardLarge.HEIGHT;
89+
osparc.ui.window.Window.popUpInWindow(serviceLarge, title, width, height).set({
90+
maxHeight: height
91+
});
92+
},
93+
},
94+
8295
members: {
8396
_rebuildLayout: function() {
8497
this._removeAll();

services/static-webserver/client/source/class/osparc/metadata/ServicesInStudy.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,7 @@ qx.Class.define("osparc.metadata.ServicesInStudy", {
147147
studyId: this._studyData["uuid"],
148148
label: node["label"]
149149
});
150-
const title = this.tr("Service information");
151-
const width = osparc.info.CardLarge.WIDTH;
152-
const height = osparc.info.CardLarge.HEIGHT;
153-
osparc.ui.window.Window.popUpInWindow(serviceDetails, title, width, height).set({
154-
maxHeight: height
155-
});
150+
osparc.info.ServiceLarge.popUpInWindow(serviceDetails);
156151
}, this);
157152
this._servicesGrid.add(infoButton, {
158153
row: i,

services/static-webserver/client/source/class/osparc/node/slideshow/BaseNodeView.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,13 @@ qx.Class.define("osparc.node.slideshow.BaseNodeView", {
217217

218218
__openServiceDetails: function() {
219219
const node = this.getNode();
220-
const serviceDetails = new osparc.info.ServiceLarge(node.getMetaData(), {
220+
const metadata = node.getMetaData();
221+
const serviceDetails = new osparc.info.ServiceLarge(metadata, {
221222
nodeId: node.getNodeId(),
222223
label: node.getLabel(),
223224
studyId: node.getStudy().getUuid()
224225
});
225-
const title = this.tr("Service information");
226-
const width = osparc.info.CardLarge.WIDTH;
227-
const height = osparc.info.CardLarge.HEIGHT;
228-
osparc.ui.window.Window.popUpInWindow(serviceDetails, title, width, height).set({
229-
maxHeight: height
230-
});
226+
osparc.info.ServiceLarge.popUpInWindow(serviceDetails);
231227
},
232228

233229
__openInstructions: function() {

services/static-webserver/client/source/class/osparc/service/ServiceListItem.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,7 @@ qx.Class.define("osparc.service.ServiceListItem", {
161161
osparc.store.Services.getService(key, version)
162162
.then(serviceMetadata => {
163163
const serviceDetails = new osparc.info.ServiceLarge(serviceMetadata);
164-
const title = this.tr("Service information");
165-
const width = osparc.info.CardLarge.WIDTH;
166-
const height = osparc.info.CardLarge.HEIGHT;
167-
osparc.ui.window.Window.popUpInWindow(serviceDetails, title, width, height).set({
168-
maxHeight: height
169-
});
164+
osparc.info.ServiceLarge.popUpInWindow(serviceDetails);
170165
});
171166
},
172167

services/static-webserver/client/source/class/osparc/widget/NodesTree.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,13 @@ qx.Class.define("osparc.widget.NodesTree", {
290290
});
291291
} else {
292292
const node = study.getWorkbench().getNode(nodeId);
293-
const serviceDetails = new osparc.info.ServiceLarge(node.getMetaData(), {
293+
const metadata = node.getMetaData();
294+
const serviceDetails = new osparc.info.ServiceLarge(metadata, {
294295
nodeId,
295296
label: node.getLabel(),
296297
studyId: study.getUuid()
297298
});
298-
const title = this.tr("Service information");
299-
osparc.ui.window.Window.popUpInWindow(serviceDetails, title, width, height).set({
300-
maxHeight: height
301-
});
299+
osparc.info.ServiceLarge.popUpInWindow(serviceDetails);
302300
}
303301
}
304302
},

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,7 @@ qx.Class.define("osparc.workbench.ServiceCatalog", {
300300
__showServiceDetails: async function() {
301301
const serviceMetadata = await this.__getSelectedService();
302302
const serviceDetails = new osparc.info.ServiceLarge(serviceMetadata);
303-
const title = this.tr("Service information");
304-
const width = osparc.info.CardLarge.WIDTH;
305-
const height = osparc.info.CardLarge.HEIGHT;
306-
osparc.ui.window.Window.popUpInWindow(serviceDetails, title, width, height).set({
307-
maxHeight: height,
308-
});
303+
osparc.info.ServiceLarge.popUpInWindow(serviceDetails);
309304
},
310305

311306
__onCancel: function() {

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,17 +1665,13 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
16651665
__openNodeInfo: function(nodeId) {
16661666
if (nodeId) {
16671667
const node = this.getStudy().getWorkbench().getNode(nodeId);
1668-
const serviceDetails = new osparc.info.ServiceLarge(node.getMetaData(), {
1668+
const metadata = node.getMetaData();
1669+
const serviceDetails = new osparc.info.ServiceLarge(metadata, {
16691670
nodeId,
16701671
label: node.getLabel(),
16711672
studyId: this.getStudy().getUuid()
16721673
});
1673-
const title = this.tr("Service information");
1674-
const width = osparc.info.CardLarge.WIDTH;
1675-
const height = osparc.info.CardLarge.HEIGHT;
1676-
osparc.ui.window.Window.popUpInWindow(serviceDetails, title, width, height).set({
1677-
maxHeight: height
1678-
});
1674+
osparc.info.ServiceLarge.popUpInWindow(serviceDetails);
16791675
}
16801676
},
16811677

0 commit comments

Comments
 (0)