@@ -29,7 +29,7 @@ qx.Class.define("osparc.ui.message.FlashMessageOEC", {
2929 this . base ( arguments , message , "ERROR" , duration * 2 ) ;
3030
3131 if ( osparc . product . Utils . isSupportEnabled ( ) ) {
32- console . log ( "bring it to support chat ") ;
32+ this . getChildControl ( "contact- support") ;
3333 } else {
3434 const oecAtom = this . getChildControl ( "oec-atom" ) ;
3535 this . bind ( "supportId" , oecAtom , "label" ) ;
@@ -40,6 +40,7 @@ qx.Class.define("osparc.ui.message.FlashMessageOEC", {
4040 properties : {
4141 supportId : {
4242 check : "String" ,
43+ init : "" ,
4344 nullable : true ,
4445 event : "changeSupportId" ,
4546 } ,
@@ -58,22 +59,46 @@ qx.Class.define("osparc.ui.message.FlashMessageOEC", {
5859 alignX : "center" ,
5960 allowGrowX : false ,
6061 } ) ;
61- control . addListener ( "tap" , ( ) => {
62- const currentStudy = osparc . store . Store . getInstance ( ) . getCurrentStudy ( ) ;
63- const dataToClipboard = {
64- message : this . getMessage ( ) ,
65- supportId : this . getSupportId ( ) ,
66- timestamp : new Date ( ) . toString ( ) ,
67- url : window . location . href ,
68- releaseTag : osparc . utils . Utils . getReleaseTag ( ) ,
69- studyId : currentStudy ? currentStudy . getUuid ( ) : "" ,
70- }
71- osparc . utils . Utils . copyTextToClipboard ( osparc . utils . Utils . prettifyJson ( dataToClipboard ) ) ;
62+ control . addListener ( "tap" , ( ) => this . __copyToClipboard ( ) ) ;
63+ this . addWidget ( control ) ;
64+ break ;
65+ case "contact-support" :
66+ control = new qx . ui . basic . Atom ( ) . set ( {
67+ label : this . tr ( "Contact Support" ) ,
68+ icon : "@FontAwesome5Solid/comments/10" ,
69+ iconPosition : "left" ,
70+ gap : 8 ,
71+ cursor : "pointer" ,
72+ alignX : "center" ,
73+ allowGrowX : false ,
7274 } ) ;
75+ control . addListener ( "tap" , ( ) => this . __openSupportChat ( ) ) ;
7376 this . addWidget ( control ) ;
7477 break ;
7578 }
7679 return control || this . base ( arguments , id ) ;
7780 } ,
81+
82+ __getContext : function ( ) {
83+ const currentStudy = osparc . store . Store . getInstance ( ) . getCurrentStudy ( ) ;
84+ const dataToClipboard = {
85+ message : this . getMessage ( ) ,
86+ supportId : this . getSupportId ( ) ,
87+ timestamp : new Date ( ) . toString ( ) ,
88+ url : window . location . href ,
89+ releaseTag : osparc . utils . Utils . getReleaseTag ( ) ,
90+ studyId : currentStudy ? currentStudy . getUuid ( ) : "" ,
91+ }
92+ osparc . utils . Utils . prettifyJson ( dataToClipboard ) ;
93+ } ,
94+
95+ __copyToClipboard : function ( ) {
96+ osparc . utils . Utils . copyTextToClipboard ( this . __getContext ( ) ) ;
97+ } ,
98+
99+ __openSupportChat : function ( ) {
100+ console . log ( this . __getContext ( ) ) ;
101+ osparc . support . SupportCenter . openWindow ( ) ;
102+ } ,
78103 }
79104} ) ;
0 commit comments