Skip to content

Commit 8f93e8c

Browse files
committed
set-appointment-button
1 parent 48da413 commit 8f93e8c

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

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

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,19 @@ qx.Class.define("osparc.support.ConversationPage", {
105105
control.addListener("execute", () => this.__openProjectDetails());
106106
this.getChildControl("conversation-header-layout").addAt(control, 2);
107107
break;
108+
case "set-appointment-button": {
109+
control = new qx.ui.form.Button().set({
110+
maxWidth: 26,
111+
maxHeight: 24,
112+
padding: [0, 6],
113+
alignX: "center",
114+
alignY: "middle",
115+
icon: "@FontAwesome5Solid/clock/12",
116+
});
117+
control.addListener("execute", () => this.__openAppointmentDetails());
118+
this.getChildControl("conversation-header-layout").addAt(control, 3);
119+
break;
120+
}
108121
case "conversation-options": {
109122
control = new qx.ui.form.MenuButton().set({
110123
maxWidth: 24,
@@ -123,7 +136,7 @@ qx.Class.define("osparc.support.ConversationPage", {
123136
});
124137
renameButton.addListener("execute", () => this.__renameConversation());
125138
menu.add(renameButton);
126-
this.getChildControl("conversation-header-layout").addAt(control, 3);
139+
this.getChildControl("conversation-header-layout").addAt(control, 4);
127140
break;
128141
}
129142
case "conversation-content":
@@ -147,8 +160,8 @@ qx.Class.define("osparc.support.ConversationPage", {
147160
}
148161

149162
const extraContextLabel = this.getChildControl("conversation-extra-content");
163+
const amISupporter = osparc.store.Products.getInstance().amIASupportUser();
150164
if (conversation) {
151-
const amISupporter = osparc.store.Products.getInstance().amIASupportUser();
152165
conversation.bind("extraContext", extraContextLabel, "value", {
153166
converter: extraContext => {
154167
let extraContextText = "";
@@ -182,11 +195,18 @@ qx.Class.define("osparc.support.ConversationPage", {
182195
extraContextLabel.exclude();
183196
}
184197

185-
const openButton = this.getChildControl("open-project-button");
198+
const openProjectButton = this.getChildControl("open-project-button");
186199
if (conversation && conversation.getContextProjectId()) {
187-
openButton.show();
200+
openProjectButton.show();
201+
} else {
202+
openProjectButton.exclude();
203+
}
204+
205+
const setAppointmentButton = this.getChildControl("set-appointment-button");
206+
if (conversation && conversation.getAppointment() && amISupporter) {
207+
setAppointmentButton.show();
188208
} else {
189-
openButton.exclude();
209+
setAppointmentButton.exclude();
190210
}
191211

192212
const options = this.getChildControl("conversation-options");
@@ -212,6 +232,10 @@ qx.Class.define("osparc.support.ConversationPage", {
212232
}
213233
},
214234

235+
__openAppointmentDetails: function() {
236+
237+
},
238+
215239
__renameConversation: function() {
216240
let oldName = this.getConversation().getName();
217241
if (oldName === "null") {

0 commit comments

Comments
 (0)