Skip to content

Commit f30f76a

Browse files
committed
conversation buttons
1 parent 9fffac8 commit f30f76a

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

services/static-webserver/client/source/class/osparc/support/ConversationPage.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ qx.Class.define("osparc.support.ConversationPage", {
119119
case "copy-ticket-id-button": {
120120
control = new qx.ui.form.Button().set({
121121
icon: "@FontAwesome5Solid/copy/12",
122-
toolTipText: this.tr("Copy ID"),
122+
toolTipText: this.tr("Copy Ticket ID"),
123123
alignX: "center",
124124
alignY: "middle",
125125
});
126-
control.addListener("execute", () => this.__openAppointmentDetails());
126+
control.addListener("execute", () => this.__copyTicketId());
127127
this.getChildControl("buttons-layout").addAt(control, 2);
128128
break;
129129
}
@@ -134,7 +134,6 @@ qx.Class.define("osparc.support.ConversationPage", {
134134
alignX: "center",
135135
alignY: "middle",
136136
});
137-
control.addListener("execute", () => this.__openAppointmentDetails());
138137
this.getChildControl("buttons-layout").addAt(control, 3);
139138
break;
140139
}
@@ -239,19 +238,12 @@ qx.Class.define("osparc.support.ConversationPage", {
239238
conversation.addListener("changeExtraContext", () => updateExtraContext(), this);
240239
}
241240

242-
const openProjectButton = this.getChildControl("open-project-button");
243-
if (conversation && conversation.getContextProjectId()) {
244-
openProjectButton.show();
245-
} else {
246-
openProjectButton.exclude();
247-
}
241+
this.getChildControl("buttons-layout").setVisibility(conversation ? "visible" : "excluded");
248242

249-
const options = this.getChildControl("rename-conversation-button");
250-
if (conversation) {
251-
options.show();
252-
} else {
253-
options.exclude();
254-
}
243+
this.getChildControl("rename-conversation-button");
244+
const openProjectButton = this.getChildControl("open-project-button");
245+
openProjectButton.setVisibility(conversation && conversation.getContextProjectId() ? "visible" : "excluded");
246+
this.getChildControl("copy-ticket-id-button");
255247
},
256248

257249
__openProjectDetails: function() {
@@ -269,6 +261,13 @@ qx.Class.define("osparc.support.ConversationPage", {
269261
}
270262
},
271263

264+
__copyTicketId: function() {
265+
if (this.getConversation()) {
266+
const conversationId = this.getConversation().getConversationId();
267+
osparc.utils.Utils.copyTextToClipboard(conversationId);
268+
}
269+
},
270+
272271
__openAppointmentDetails: function() {
273272
const win = new osparc.widget.DateTimeChooser();
274273
win.addListener("dateChanged", e => {

0 commit comments

Comments
 (0)