@@ -86,7 +86,49 @@ qx.Class.define("osparc.FlashMessenger", {
8686 console . error ( error ) ;
8787 }
8888 const msg = this . extractMessage ( error , defaultMessage ) ;
89- return this . getInstance ( ) . logAs ( msg , "ERROR" , duration ) ;
89+ const flashMessage = this . getInstance ( ) . logAs ( msg , "ERROR" , duration ) ;
90+ error [ "supportId" ] = "1234" ;
91+ if ( error && error [ "supportId" ] ) {
92+ flashMessage . addWidget ( this . self ( ) . createCopyEOCWidget ( error [ "supportId" ] ) ) ;
93+ }
94+ return flashMessage ;
95+ } ,
96+
97+ createCopyEOCWidget : function ( supportId ) {
98+ const widget = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( 5 ) ) ;
99+ const showErrorLabel = new qx . ui . basic . Atom ( ) . set ( {
100+ label : this . tr ( "Show error code" ) ,
101+ icon : "@FontAwesome5Solid/chevron-right/10" ,
102+ cursor : "pointer" ,
103+ visibility : "visible" ,
104+ } ) ;
105+ widget . add ( showErrorLabel ) ;
106+ const hideErrorLabel = new qx . ui . basic . Atom ( ) . set ( {
107+ label : this . tr ( "Hide error code" ) ,
108+ icon : "@FontAwesome5Solid/chevron-down/10" ,
109+ cursor : "pointer" ,
110+ visibility : "exclude" ,
111+ } ) ;
112+ widget . add ( hideErrorLabel ) ;
113+ const errorLabel = new qx . ui . basic . Atom ( ) . set ( {
114+ label : this . tr ( "Show error code" ) ,
115+ icon : "@FontAwesome5Solid/chevron-down/10" ,
116+ cursor : "pointer" ,
117+ visibility : "exclude" ,
118+ } ) ;
119+ showErrorLabel . addListener ( "tap" , ( ) => {
120+ showErrorLabel . exclude ( ) ;
121+ hideErrorLabel . show ( ) ;
122+ errorLabel . show ( ) ;
123+ } ) ;
124+ hideErrorLabel . addListener ( "tap" , ( ) => {
125+ hideErrorLabel . exclude ( ) ;
126+ errorLabel . exclude ( ) ;
127+ showErrorLabel . show ( ) ;
128+ } ) ;
129+ errorLabel . addListener ( "tap" , ( ) => osparc . utils . Utils . copyTextToClipboard ( supportId ) ) ;
130+ widget . add ( errorLabel ) ;
131+ return widget ;
90132 } ,
91133 } ,
92134
0 commit comments