@@ -24,7 +24,10 @@ qx.Class.define("osparc.support.CallTopicSelector", {
2424
2525 this . _setLayout ( new qx . ui . layout . VBox ( 10 ) ) ;
2626
27- this . setPadding ( 10 ) ;
27+ this . set ( {
28+ padding : 10 ,
29+ font : "text-14" ,
30+ } ) ;
2831
2932 this . __buildLayout ( ) ;
3033 } ,
@@ -58,7 +61,7 @@ qx.Class.define("osparc.support.CallTopicSelector", {
5861 break ;
5962 case "specific-intro-select-box" :
6063 control = new qx . ui . form . SelectBox ( ) . set ( {
61- paddingLeft : 20 ,
64+ marginLeft : 20 ,
6265 } ) ;
6366 this . _add ( control ) ;
6467 this . getChildControl ( "specific-intro-button" ) . bind ( "value" , control , "visibility" , {
@@ -77,7 +80,7 @@ qx.Class.define("osparc.support.CallTopicSelector", {
7780 control = new qx . ui . form . CheckBox ( ) . set ( {
7881 value : true ,
7982 label : this . tr ( "share current project with support team (optional)" ) ,
80- paddingLeft : 20 ,
83+ marginLeft : 20 ,
8184 } ) ;
8285 this . _add ( control ) ;
8386 this . getChildControl ( "help-with-project-button" ) . bind ( "value" , control , "visibility" , {
@@ -93,9 +96,9 @@ qx.Class.define("osparc.support.CallTopicSelector", {
9396 this . _add ( control ) ;
9497 break ;
9598 case "specific-topic-textfield" :
96- control = new qx . ui . form . TextField ( ) . set ( {
99+ control = new qx . ui . form . TextArea ( ) . set ( {
97100 placeholder : this . tr ( "please provide any background information that could help us make this meeting more productive" ) ,
98- paddingLeft : 20 ,
101+ marginLeft : 20 ,
99102 } ) ;
100103 this . _add ( control ) ;
101104 this . getChildControl ( "specific-topic-button" ) . bind ( "value" , control , "visibility" , {
@@ -105,11 +108,11 @@ qx.Class.define("osparc.support.CallTopicSelector", {
105108 case "next-button" :
106109 control = new qx . ui . form . Button ( ) . set ( {
107110 label : this . tr ( "Next" ) ,
108- alignX : "right" ,
109- marginTop : 10 ,
110111 appearance : "strong-button" ,
111- allowGrowX : false ,
112112 center : true ,
113+ allowGrowX : false ,
114+ alignX : "right" ,
115+ marginTop : 20 ,
113116 } ) ;
114117 control . addListener ( "execute" , ( ) => this . __nextPressed ( ) ) ;
115118 this . _add ( control ) ;
@@ -120,40 +123,49 @@ qx.Class.define("osparc.support.CallTopicSelector", {
120123
121124 __buildLayout : function ( ) {
122125 this . getChildControl ( "intro-label" ) ;
123- this . getChildControl ( "generic-intro-button" ) ;
124- this . getChildControl ( "specific-intro-button" ) ;
126+ const genericIntroButton = this . getChildControl ( "generic-intro-button" ) ;
127+ const specificIntroButton = this . getChildControl ( "specific-intro-button" ) ;
125128 const selectBox = this . getChildControl ( "specific-intro-select-box" ) ;
126- const topics = [
127- this . tr ( "How to use osparc" ) ,
128- this . tr ( "How to create and manage projects" ) ,
129- this . tr ( "How to use the Workbench" ) ,
130- this . tr ( "How to use the Data Manager" ) ,
131- this . tr ( "How to use the App Store" ) ,
132- this . tr ( "How to use the Dashboard" ) ,
133- this . tr ( "How to use Teams" ) ,
134- this . tr ( "Billing and Subscription" ) ,
135- this . tr ( "Other" ) ,
136- ] ;
137- topics . forEach ( topic => {
138- const item = new qx . ui . form . ListItem ( topic ) ;
139- selectBox . add ( item ) ;
129+ osparc . product . Utils . S4L_TOPICS . forEach ( topic => {
130+ const lItem = new qx . ui . form . ListItem ( topic . label , null , topic . id ) . set ( {
131+ rich : true
132+ } ) ;
133+ selectBox . add ( lItem ) ;
140134 } ) ;
141- this . getChildControl ( "help-with-project-button" ) ;
135+ const helpWithProjectButton = this . getChildControl ( "help-with-project-button" ) ;
142136 this . getChildControl ( "share-project-checkbox" ) ;
143- this . getChildControl ( "specific-topic-button" ) ;
137+ const specificTopicButton = this . getChildControl ( "specific-topic-button" ) ;
144138 this . getChildControl ( "specific-topic-textfield" ) ;
145139 this . getChildControl ( "next-button" ) ;
140+
141+ // make them act as radio buttons
142+ [
143+ genericIntroButton ,
144+ specificIntroButton ,
145+ helpWithProjectButton ,
146+ specificTopicButton ,
147+ ] . forEach ( rb => {
148+ rb . addListener ( "changeValue" , ( ) => {
149+ if ( rb . getValue ( ) ) {
150+ [ genericIntroButton , specificIntroButton , helpWithProjectButton , specificTopicButton ] . forEach ( otherRb => {
151+ if ( otherRb !== rb ) {
152+ otherRb . setValue ( false ) ;
153+ }
154+ } ) ;
155+ }
156+ } ) ;
157+ } ) ;
146158 } ,
147159
148160 __nextPressed : function ( ) {
149161 const topicData = { } ;
150162 if ( this . getChildControl ( "generic-intro-button" ) . getValue ( ) ) {
151163 topicData [ "topic" ] = "specific-topic" ;
152- } else if ( this . getChildControl ( "specific-topic -button" ) . getValue ( ) ) {
153- topicData [ "topic" ] = "specific-topic " ;
154- const selectBox = this . getChildControl ( "specific-topic -select-box" ) ;
164+ } else if ( this . getChildControl ( "specific-intro -button" ) . getValue ( ) ) {
165+ topicData [ "topic" ] = "specific-intro " ;
166+ const selectBox = this . getChildControl ( "specific-intro -select-box" ) ;
155167 const selectedItem = selectBox . getSelection ( ) [ 0 ] ;
156- topicData [ "extraInfo" ] = selectedItem ? selectedItem . getLabel ( ) : "" ;
168+ topicData [ "extraInfo" ] = selectedItem ? selectedItem . getModel ( ) : "" ;
157169 } else if ( this . getChildControl ( "help-with-project-button" ) . getValue ( ) ) {
158170 topicData [ "topic" ] = "help-with-project" ;
159171 if ( this . getChildControl ( "share-project-checkbox" ) . getValue ( ) ) {
0 commit comments