File tree Expand file tree Collapse file tree 2 files changed +20
-10
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -170,16 +170,24 @@ qx.Class.define("osparc.conversation.AddMessage", {
170170 this . __postMessage ( ) ;
171171 } else {
172172 const studyData = this . getStudyData ( ) ;
173+ let promise = null ;
173174 if ( studyData ) {
174- // create new conversation first
175- osparc . store . ConversationsProject . getInstance ( ) . addConversation ( studyData )
176- . then ( data => {
177- this . setConversationId ( data [ "conversationId" ] ) ;
178- this . __postMessage ( ) ;
179- } ) ;
175+ // create new project conversation first
176+ promise = osparc . store . ConversationsProject . getInstance ( ) . addConversation ( studyData )
180177 } else {
181178 // support conversation
179+ const extraContext = { } ;
180+ const currentStudy = osparc . store . Store . getInstance ( ) . getCurrentStudy ( )
181+ if ( currentStudy ) {
182+ extraContext [ "projectId" ] = currentStudy . getUuid ( ) ;
183+ }
184+ promise = osparc . store . ConversationsSupport . getInstance ( ) . addConversation ( extraContext ) ;
182185 }
186+ promise
187+ . then ( data => {
188+ this . setConversationId ( data [ "conversationId" ] ) ;
189+ this . __postMessage ( ) ;
190+ } ) ;
183191 }
184192 } ,
185193
@@ -191,7 +199,7 @@ qx.Class.define("osparc.conversation.AddMessage", {
191199 const studyData = this . getStudyData ( ) ;
192200 const conversationId = this . getConversationId ( ) ;
193201 if ( studyData ) {
194- promise = osparc . store . ConversationsProject . getInstance ( ) . addMessage ( studyData [ "uuid" ] , conversationId , content ) ; ;
202+ promise = osparc . store . ConversationsProject . getInstance ( ) . addMessage ( studyData [ "uuid" ] , conversationId , content ) ;
195203 } else {
196204 promise = osparc . store . ConversationsSupport . getInstance ( ) . addMessage ( conversationId , content ) ;
197205 }
Original file line number Diff line number Diff line change @@ -58,11 +58,13 @@ qx.Class.define("osparc.store.ConversationsSupport", {
5858 return osparc . data . Resources . fetch ( "conversationsSupport" , "getConversation" , params ) ;
5959 } ,
6060
61- addConversation : function ( name = "null" , type = osparc . store . ConversationsSupport . TYPES . SUPPORT ) {
61+ addConversation : function ( extraContext = { } ) {
62+ extraContext [ "deployment" ] = window . location . href ;
6263 const params = {
6364 data : {
64- name,
65- type,
65+ name : "null" ,
66+ type : osparc . store . ConversationsSupport . TYPES . SUPPORT ,
67+ extraContext,
6668 }
6769 } ;
6870 return osparc . data . Resources . fetch ( "conversationsSupport" , "addConversation" , params )
You can’t perform that action at this time.
0 commit comments