Skip to content

Commit c625191

Browse files
committed
open conversations on click
1 parent d2fb93b commit c625191

File tree

4 files changed

+26
-18
lines changed

4 files changed

+26
-18
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ qx.Class.define("osparc.study.Conversations", {
261261
osparc.data.Resources.fetch("conversations", "getConversationsPage", params)
262262
.then(conversations => {
263263
if (conversations.length) {
264-
// Sort conversations by created date, newest first
265-
conversations.sort((a, b) => new Date(b["created"]) - new Date(a["created"]));
264+
// Sort conversations by created date, oldest first (the new ones will be next to the plus button)
265+
conversations.sort((a, b) => new Date(a["created"]) - new Date(b["created"]));
266266
conversations.forEach(conversation => this.__addConversationPage(conversation));
267267
if (this.__openConversationId) {
268268
const conversationsLayout = this.getChildControl("conversations-layout");

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ qx.Class.define("osparc.workbench.Annotation", {
120120
representation = this.__svgLayer.drawAnnotationText(attrs.x, attrs.y, attrs.text, this.getColor(), attrs.fontSize);
121121
break;
122122
case this.self().TYPES.CONVERSATION: {
123-
const text = `${attrs.x}, ${attrs.y}`;
124123
representation = this.__svgLayer.drawAnnotationConversation(attrs.x, attrs.y, attrs.title);
125124
break;
126125
}

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

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,16 +1211,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
12111211
edge.setSelected(true);
12121212
} else if (this.__isSelectedItemAnAnnotation()) {
12131213
const annotation = this.__getAnnotation(newID);
1214-
this.__setSelectedAnnotations([annotation]);
1215-
const annotationEditor = this.__getAnnotationEditorView();
1216-
annotationEditor.setAnnotation(annotation);
1217-
annotationEditor.makeItModal();
1218-
annotationEditor.addListener("deleteAnnotation", () => {
1219-
annotationEditor.exclude();
1220-
this.__removeAnnotation(annotation.getId());
1221-
this.resetSelection();
1222-
}, this);
1223-
annotation.addListener("changeColor", e => this.__annotationLastColor = e.getData());
1214+
this.__annotationSelected(annotation);
12241215
} else {
12251216
this.fireDataEvent("changeSelectedNode", newID);
12261217
}
@@ -1242,6 +1233,29 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
12421233
return this.__isSelectedItemAnAnnotation() ? this.__annotations[this.__selectedItemId] : null;
12431234
},
12441235

1236+
__annotationSelected: function(annotation) {
1237+
this.__setSelectedAnnotations([annotation]);
1238+
switch (annotation.getType()) {
1239+
case osparc.workbench.Annotation.TYPES.CONVERSATION: {
1240+
const studyData = this.getStudy().serialize();
1241+
osparc.study.Conversations.popUpInWindow(studyData, annotation.getAttributes()["conversationId"]);
1242+
break;
1243+
}
1244+
default: {
1245+
const annotationEditor = this.__getAnnotationEditorView();
1246+
annotationEditor.setAnnotation(annotation);
1247+
annotationEditor.makeItModal();
1248+
annotationEditor.addListener("deleteAnnotation", () => {
1249+
annotationEditor.exclude();
1250+
this.__removeAnnotation(annotation.getId());
1251+
this.resetSelection();
1252+
}, this);
1253+
annotation.addListener("changeColor", e => this.__annotationLastColor = e.getData());
1254+
break;
1255+
}
1256+
}
1257+
},
1258+
12451259
__scaleCoordinates: function(x, y) {
12461260
return {
12471261
x: parseInt(x / this.getScale()),

services/static-webserver/client/source/class/osparc/wrapper/Svg.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,6 @@ qx.Class.define("osparc.wrapper.Svg", {
319319
.move(padding + iconSize + 8, ((bubbleHeight - titleFontSize) / 2) - 3);
320320
bubble.add(title);
321321

322-
// Add a click event to the button
323-
icon.click(() => {
324-
alert('Popup or conversation panel here!');
325-
});
326-
327322
return bubble;
328323
},
329324

0 commit comments

Comments
 (0)