@@ -69,7 +69,7 @@ qx.Class.define("osparc.desktop.NavigationBar", {
6969 } ,
7070
7171 statics : {
72- FEEDBACK_FORM_URL : "https://docs.google.com/forms/d/e/1FAIpQLSe232bTigsM2zV97Kjp2OhCenl6o9gNGcDFt2kO_dfkIjtQAQ/viewform?usp=sf_link" ,
72+ FEEDBACK_GFORM_URL : "https://docs.google.com/forms/d/e/1FAIpQLSe232bTigsM2zV97Kjp2OhCenl6o9gNGcDFt2kO_dfkIjtQAQ/viewform?usp=sf_link" ,
7373 BUTTON_OPTIONS : {
7474 font : "title-14" ,
7575 allowGrowY : false ,
@@ -103,10 +103,7 @@ qx.Class.define("osparc.desktop.NavigationBar", {
103103 flex : 1
104104 } ) ;
105105
106- if ( osparc . utils . Utils . isInZ43 ( ) ) {
107- this . getChildControl ( "z43-manual" ) ;
108- }
109- this . getChildControl ( "user-manual" ) ;
106+ this . getChildControl ( "manual" ) ;
110107 this . getChildControl ( "feedback" ) ;
111108 this . getChildControl ( "theme-switch" ) ;
112109 this . getChildControl ( "user-menu" ) ;
@@ -141,23 +138,18 @@ qx.Class.define("osparc.desktop.NavigationBar", {
141138 } ) ) ;
142139 this . _add ( control ) ;
143140 break ;
144- case "z43-manual" :
145- control = new osparc . ui . form . LinkButton ( this . tr ( "Z43 manual" ) , "https://itisfoundation.github.io/osparc-manual-z43" ) . set ( {
146- appearance : "link-button" ,
147- font : "text-14"
148- } ) ;
149- this . _add ( control ) ;
150- break ;
151- case "user-manual" :
152- control = new osparc . ui . form . LinkButton ( this . tr ( "User manual" ) , "https://docs.osparc.io" ) . set ( {
153- appearance : "link-button" ,
141+ case "manual" :
142+ control = this . __createManualMenuBtn ( ) ;
143+ control . set ( {
144+ ...this . self ( ) . BUTTON_OPTIONS ,
154145 font : "text-14"
155146 } ) ;
156147 this . _add ( control ) ;
157148 break ;
158149 case "feedback" :
159- control = new osparc . ui . form . LinkButton ( this . tr ( "Give us feedback" ) , this . self ( ) . FEEDBACK_FORM_URL ) . set ( {
160- appearance : "link-button" ,
150+ control = this . __createFeedbackMenuBtn ( ) ;
151+ control . set ( {
152+ ...this . self ( ) . BUTTON_OPTIONS ,
161153 font : "text-14"
162154 } ) ;
163155 this . _add ( control ) ;
@@ -241,6 +233,62 @@ qx.Class.define("osparc.desktop.NavigationBar", {
241233 }
242234 } ,
243235
236+ __createManualMenuBtn : function ( ) {
237+ const manuals = [
238+ [ this . tr ( "User manual" ) , "https://docs.osparc.io" ]
239+ ] ;
240+ if ( osparc . utils . Utils . isInZ43 ( ) ) {
241+ manuals . push ( [ this . tr ( "Z43 manual" ) , "https://itisfoundation.github.io/osparc-manual-z43" ] ) ;
242+ }
243+
244+ let control = null ;
245+ if ( manuals . length > 1 ) {
246+ const menu = new qx . ui . menu . Menu ( ) . set ( {
247+ font : "text-14"
248+ } ) ;
249+
250+ manuals . forEach ( manual => {
251+ const manualBtn = new qx . ui . menu . Button ( manual [ 0 ] ) ;
252+ manualBtn . addListener ( "execute" , ( ) => {
253+ window . open ( manual [ 1 ] ) ;
254+ } , this ) ;
255+ menu . add ( manualBtn ) ;
256+ } ) ;
257+
258+ control = new qx . ui . form . MenuButton ( this . tr ( "Manuals" ) , null , menu ) ;
259+ } else {
260+ const manual = manuals [ 0 ] ;
261+ control = new osparc . ui . form . LinkButton ( manual [ 0 ] , manual [ 1 ] ) . set ( {
262+ appearance : "link-button" ,
263+ font : "text-14"
264+ } ) ;
265+ }
266+ return control ;
267+ } ,
268+
269+ __createFeedbackMenuBtn : function ( ) {
270+ const menu = new qx . ui . menu . Menu ( ) . set ( {
271+ font : "text-14"
272+ } ) ;
273+
274+ const newGHIssueBtn = new qx . ui . menu . Button ( this . tr ( "Issue in GitHub" ) ) ;
275+ newGHIssueBtn . addListener ( "execute" , this . __openGithubIssueInfoDialog , this ) ;
276+ menu . add ( newGHIssueBtn ) ;
277+
278+ if ( osparc . utils . Utils . isInZ43 ( ) ) {
279+ const newFogbugzIssueBtn = new qx . ui . menu . Button ( this . tr ( "Issue in Fogbugz" ) ) ;
280+ newFogbugzIssueBtn . addListener ( "execute" , this . __openFogbugzIssueInfoDialog , this ) ;
281+ menu . add ( newFogbugzIssueBtn ) ;
282+ }
283+
284+ const feedbackAnonBtn = new qx . ui . menu . Button ( this . tr ( "Anonymous feedback" ) ) ;
285+ feedbackAnonBtn . addListener ( "execute" , ( ) => window . open ( this . self ( ) . FEEDBACK_GFORM_URL ) ) ;
286+ menu . add ( feedbackAnonBtn ) ;
287+
288+ const feedbackBtn = new qx . ui . form . MenuButton ( this . tr ( "Give us feedback" ) , null , menu ) ;
289+ return feedbackBtn ;
290+ } ,
291+
244292 __createUserMenuBtn : function ( ) {
245293 const menu = new qx . ui . menu . Menu ( ) . set ( {
246294 font : "text-14"
@@ -261,12 +309,6 @@ qx.Class.define("osparc.desktop.NavigationBar", {
261309 helpBtn . addListener ( "execute" , ( ) => window . open ( "https://docs.osparc.io" ) ) ;
262310 osparc . utils . Utils . setIdToWidget ( helpBtn , "userMenuHelpBtn" ) ;
263311 menu . add ( helpBtn ) ;
264-
265- const newIssueBtn = new qx . ui . menu . Button ( this . tr ( "Open issue in GitHub" ) ) ;
266- newIssueBtn . addListener ( "execute" , this . __openIssueInfoDialog , this ) ;
267- osparc . utils . Utils . setIdToWidget ( newIssueBtn , "userMenuGithubBtn" ) ;
268- menu . add ( newIssueBtn ) ;
269-
270312 const aboutBtn = new qx . ui . menu . Button ( this . tr ( "About" ) ) ;
271313 aboutBtn . addListener ( "execute" , ( ) => osparc . About . getInstance ( ) . open ( ) ) ;
272314 osparc . utils . Utils . setIdToWidget ( aboutBtn , "userMenuAboutBtn" ) ;
@@ -317,13 +359,13 @@ qx.Class.define("osparc.desktop.NavigationBar", {
317359 activityWindow . open ( ) ;
318360 } ,
319361
320- __openIssueInfoDialog : function ( ) {
362+ __openGithubIssueInfoDialog : function ( ) {
321363 const issueConfirmationWindow = new osparc . ui . window . Dialog ( "Information" , null ,
322364 this . tr ( "To create an issue in GitHub, you must have an account in GitHub and be already logged-in." )
323365 ) ;
324366 const contBtn = new qx . ui . toolbar . Button ( this . tr ( "Continue" ) , "@FontAwesome5Solid/external-link-alt/12" ) ;
325367 contBtn . addListener ( "execute" , ( ) => {
326- window . open ( osparc . component . widget . NewGHIssue . getNewIssueUrl ( ) ) ;
368+ window . open ( osparc . utils . NewGHIssue . getNewIssueUrl ( ) ) ;
327369 issueConfirmationWindow . close ( ) ;
328370 } , this ) ;
329371 const loginBtn = new qx . ui . toolbar . Button ( this . tr ( "Log in in GitHub" ) , "@FontAwesome5Solid/external-link-alt/12" ) ;
@@ -334,6 +376,23 @@ qx.Class.define("osparc.desktop.NavigationBar", {
334376 issueConfirmationWindow . open ( ) ;
335377 } ,
336378
379+ __openFogbugzIssueInfoDialog : function ( ) {
380+ const issueConfirmationWindow = new osparc . ui . window . Dialog ( "Information" , null ,
381+ this . tr ( "To create an issue in Fogbugz, you must have an account in Fogbugz and be already logged-in." )
382+ ) ;
383+ const contBtn = new qx . ui . toolbar . Button ( this . tr ( "Continue" ) , "@FontAwesome5Solid/external-link-alt/12" ) ;
384+ contBtn . addListener ( "execute" , ( ) => {
385+ window . open ( osparc . utils . NewFogbugzIssue . getNewIssueUrl ( ) ) ;
386+ issueConfirmationWindow . close ( ) ;
387+ } , this ) ;
388+ const loginBtn = new qx . ui . toolbar . Button ( this . tr ( "Log in in Fogbugz" ) , "@FontAwesome5Solid/external-link-alt/12" ) ;
389+ loginBtn . addListener ( "execute" , ( ) => window . open ( "https://z43.manuscript.com/login" ) , this ) ;
390+ issueConfirmationWindow . addButton ( contBtn ) ;
391+ issueConfirmationWindow . addButton ( loginBtn ) ;
392+ issueConfirmationWindow . addCancelButton ( ) ;
393+ issueConfirmationWindow . open ( ) ;
394+ } ,
395+
337396 _applyStudy : function ( study ) {
338397 if ( study ) {
339398 study . bind ( "name" , this . __studyTitle , "value" ) ;
0 commit comments