@@ -27,8 +27,10 @@ qx.Class.define("osparc.support.ConversationPage", {
2727 this . _setLayout ( new qx . ui . layout . VBox ( 5 ) ) ;
2828
2929 this . getChildControl ( "back-button" ) ;
30+
3031 const conversation = this . getChildControl ( "conversation" ) ;
3132 this . bind ( "conversationId" , conversation , "conversationId" ) ;
33+ conversation . bind ( "conversationId" , this , "conversationId" ) ;
3234 } ,
3335
3436 properties : {
@@ -37,6 +39,7 @@ qx.Class.define("osparc.support.ConversationPage", {
3739 init : null ,
3840 nullable : true ,
3941 event : "changeConversationId" ,
42+ apply : "__applyConversationId" ,
4043 } ,
4144 } ,
4245
@@ -48,7 +51,7 @@ qx.Class.define("osparc.support.ConversationPage", {
4851 _createChildControlImpl : function ( id ) {
4952 let control ;
5053 switch ( id ) {
51- case "conversation-header" :
54+ case "conversation-header-layout " :
5255 control = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 5 ) ) ;
5356 this . _add ( control ) ;
5457 break ;
@@ -59,7 +62,23 @@ qx.Class.define("osparc.support.ConversationPage", {
5962 backgroundColor : "transparent"
6063 } ) ;
6164 control . addListener ( "execute" , ( ) => this . fireEvent ( "showConversations" ) ) ;
62- this . getChildControl ( "conversation-header" ) . add ( control ) ;
65+ this . getChildControl ( "conversation-header-layout" ) . add ( control ) ;
66+ break ;
67+ case "conversation-title" :
68+ control = new qx . ui . basic . Label ( ) . set ( {
69+ alignY : "middle" ,
70+ } ) ;
71+ this . getChildControl ( "conversation-header-layout" ) . add ( control ) ;
72+ break ;
73+ case "conversation-options" :
74+ control = new qx . ui . form . MenuButton ( ) . set ( {
75+ maxWidth : 22 ,
76+ maxHeight : 22 ,
77+ alignX : "center" ,
78+ alignY : "middle" ,
79+ icon : "@FontAwesome5Solid/ellipsis-v/14" ,
80+ } ) ;
81+ this . getChildControl ( "conversation-header-layout" ) . add ( control ) ;
6382 break ;
6483 case "conversation" :
6584 control = new osparc . support . Conversation ( ) ;
@@ -72,5 +91,25 @@ qx.Class.define("osparc.support.ConversationPage", {
7291 }
7392 return control || this . base ( arguments , id ) ;
7493 } ,
94+
95+ __applyConversationId : function ( conversationId ) {
96+ const title = this . getChildControl ( "conversation-title" ) ;
97+ const options = this . getChildControl ( "conversation-options" ) ;
98+ if ( conversationId ) {
99+ osparc . store . ConversationsSupport . getInstance ( ) . getConversation ( conversationId )
100+ . then ( conversation => {
101+ let titleText = "" ;
102+ if ( conversation [ "name" ] === "null" ) {
103+ titleText = this . tr ( "Conversation: {id}" , { id : conversationId } ) ;
104+ } else {
105+ title . setValue ( titleText ) ;
106+ }
107+ options . show ( ) ;
108+ } ) ;
109+ } else {
110+ title . setValue ( "" ) ;
111+ options . exclude ( ) ;
112+ }
113+ }
75114 }
76115} ) ;
0 commit comments