Skip to content

Commit 362dba4

Browse files
committed
refactor
1 parent 4294b91 commit 362dba4

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,5 +207,16 @@ qx.Class.define("osparc.support.ConversationPage", {
207207
renamer.center();
208208
renamer.open();
209209
},
210+
211+
postMessage: function(message) {
212+
if (
213+
this.getChildControl("conversation-content") &&
214+
this.getChildControl("conversation-content").getChildControl("add-message") &&
215+
this.getChildControl("conversation-content").getChildControl("add-message").getChildControl("comment-field")
216+
) {
217+
this.getChildControl("conversation-content").getChildControl("add-message").getChildControl("comment-field").setText(message);
218+
this.getChildControl("conversation-content").getChildControl("add-message").addComment();
219+
}
220+
},
210221
}
211222
});

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ qx.Class.define("osparc.support.SupportCenter", {
172172
const conversationPage = this.getChildControl("conversation-page");
173173
conversationPage.setConversation(null);
174174
this.__showConversation();
175+
conversationPage.postMessage("I want a call!");
175176
},
176177
}
177178
});

services/static-webserver/client/source/class/osparc/ui/message/FlashMessageOEC.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,8 @@ qx.Class.define("osparc.ui.message.FlashMessageOEC", {
117117
supportCenter.openConversation(null);
118118

119119
const textToAddMessageField = msg => {
120-
if (
121-
supportCenter.getChildControl("conversation-page") &&
122-
supportCenter.getChildControl("conversation-page").getChildControl("conversation-content") &&
123-
supportCenter.getChildControl("conversation-page").getChildControl("conversation-content").getChildControl("add-message") &&
124-
supportCenter.getChildControl("conversation-page").getChildControl("conversation-content").getChildControl("add-message").getChildControl("comment-field")
125-
) {
126-
supportCenter.getChildControl("conversation-page").getChildControl("conversation-content").getChildControl("add-message").getChildControl("comment-field").setText(msg);
127-
supportCenter.getChildControl("conversation-page").getChildControl("conversation-content").getChildControl("add-message").addComment();
120+
if (supportCenter.getChildControl("conversation-page")) {
121+
supportCenter.getChildControl("conversation-page").postMessage(msg);
128122
}
129123
}
130124

0 commit comments

Comments
 (0)