Skip to content

Commit b608a55

Browse files
committed
Appointment
1 parent b8367ef commit b608a55

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

services/static-webserver/client/source/class/osparc/data/model/Conversation.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,13 @@ qx.Class.define("osparc.data.model.Conversation", {
291291
return this.getExtraContext()["projectId"];
292292
}
293293
return null;
294-
}
294+
},
295+
296+
getAppointment: function() {
297+
if (this.getExtraContext() && "appointment" in this.getExtraContext()) {
298+
return this.getExtraContext()["appointment"];
299+
}
300+
return null;
301+
},
295302
},
296303
});

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

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,37 @@ qx.Class.define("osparc.support.ConversationPage", {
147147
}
148148

149149
const extraContextLabel = this.getChildControl("conversation-extra-content");
150-
const amISupporter = osparc.store.Products.getInstance().amIASupportUser();
151-
if (conversation && amISupporter) {
152-
const extraContext = conversation.getExtraContext();
153-
if (extraContext && Object.keys(extraContext).length) {
154-
let extraContextText = `Ticket ID: ${conversation.getConversationId()}`;
155-
const contextProjectId = conversation.getContextProjectId();
156-
if (contextProjectId) {
157-
extraContextText += `<br>Project ID: ${contextProjectId}`;
150+
if (conversation) {
151+
const amISupporter = osparc.store.Products.getInstance().amIASupportUser();
152+
conversation.bind("extraContext", extraContextLabel, "value", {
153+
converter: extraContext => {
154+
let extraContextText = "";
155+
if (extraContext && Object.keys(extraContext).length) {
156+
extraContextText = `Ticket ID: ${conversation.getConversationId()}`;
157+
const contextProjectId = conversation.getContextProjectId();
158+
if (contextProjectId && amISupporter) {
159+
extraContextText += `<br>Project ID: ${contextProjectId}`;
160+
}
161+
const appointment = conversation.getAppointment();
162+
if (appointment) {
163+
extraContextText += "<br>Appointment: ";
164+
if (appointment === "requested") {
165+
// still pending
166+
extraContextText += appointment;
167+
} else {
168+
// already set
169+
extraContextText += osparc.utils.Utils.formatDateAndTime(appointment);
170+
}
171+
}
172+
}
173+
return extraContextText;
158174
}
159-
extraContextLabel.setValue(extraContextText);
160-
}
161-
extraContextLabel.show();
175+
});
176+
extraContextLabel.bind("value", extraContextLabel, "visibility", {
177+
converter: extraContext => {
178+
return extraContext ? "visible" : "excluded";
179+
}
180+
});
162181
} else {
163182
extraContextLabel.exclude();
164183
}

0 commit comments

Comments
 (0)