Skip to content

Commit 4b1ab5b

Browse files
committed
simplify NavBar support
1 parent 3100ecd commit 4b1ab5b

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -375,15 +375,6 @@ qx.Class.define("osparc.navigation.NavigationBar", {
375375
// add support conversations
376376
osparc.store.Support.addSupportConversationsToMenu(menu);
377377

378-
// quick starts and manuals
379-
osparc.store.Support.addQuickStartToMenu(menu);
380-
osparc.store.Support.addGuidedToursToMenu(menu);
381-
osparc.store.Support.addManualsToMenu(menu);
382-
menu.addSeparator();
383-
384-
// feedback
385-
osparc.store.Support.addSupportButtonsToMenu(menu);
386-
osparc.store.Support.addReleaseNotesToMenu(menu);
387378

388379
return menuButton;
389380
},

services/static-webserver/client/source/class/osparc/store/Support.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,29 @@ qx.Class.define("osparc.store.Support", {
2121

2222
addSupportConversationsToMenu: function(menu) {
2323
const supportCenterButton = new qx.ui.menu.Button().set({
24-
icon: "@FontAwesome5Regular/question-circle/16",
25-
visibility: "excluded",
24+
label: qx.locale.Manager.tr("Support Center"),
25+
icon: "@FontAwesome5Solid/question-circle/16",
2626
});
2727
supportCenterButton.addListener("execute", () => osparc.support.SupportCenter.openWindow());
2828
menu.add(supportCenterButton);
2929

30-
const updateSupportButton = () => {
30+
const askAQuestionButton = new qx.ui.menu.Button().set({
31+
label: qx.locale.Manager.tr("Ask a Question"),
32+
icon: "@FontAwesome5Solid/comments/16",
33+
visibility: "excluded",
34+
});
35+
askAQuestionButton.addListener("execute", () => osparc.support.SupportCenter.openWindow("conversations"));
36+
menu.add(askAQuestionButton);
37+
38+
const updateAskAQuestionButton = () => {
3139
const isSupportEnabled = osparc.store.Groups.getInstance().isSupportEnabled();
32-
const isSupportUser = osparc.store.Groups.getInstance().amIASupportUser();
33-
supportCenterButton.set({
40+
askAQuestionButton.set({
3441
visibility: isSupportEnabled ? "visible" : "excluded",
35-
label: isSupportUser ? qx.locale.Manager.tr("Support Center") : qx.locale.Manager.tr("Support"),
3642
});
3743
}
3844

39-
updateSupportButton();
40-
osparc.store.Groups.getInstance().addListener("changeSupportGroup", () => updateSupportButton());
41-
osparc.store.Groups.getInstance().addListener("organizationsChanged", () => updateSupportButton());
45+
updateAskAQuestionButton();
46+
osparc.store.Groups.getInstance().addListener("changeSupportGroup", () => updateAskAQuestionButton());
4247
},
4348

4449
addQuickStartToMenu: function(menu) {

services/static-webserver/client/source/class/osparc/support/SupportCenter.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ qx.Class.define("osparc.support.SupportCenter", {
5858
return Math.min(600, parseInt(clientHeight * 0.8));
5959
},
6060

61-
openWindow: function() {
61+
openWindow: function(stackPage) {
6262
const supportCenterWindow = new osparc.support.SupportCenter();
6363

64+
if (stackPage === "conversations") {
65+
supportCenterWindow.showConversations();
66+
}
67+
6468
const positionWindow = () => {
6569
supportCenterWindow.set({
6670
height: osparc.support.SupportCenter.getMaxHeight(),
@@ -117,7 +121,7 @@ qx.Class.define("osparc.support.SupportCenter", {
117121
allowGrowX: true,
118122
center: true,
119123
});
120-
control.addListener("execute", () => this.__showConversations(), this);
124+
control.addListener("execute", () => this.showConversations(), this);
121125
this.getChildControl("buttons-layout").add(control, { flex: 1 });
122126
break;
123127
case "home-page":
@@ -139,7 +143,7 @@ qx.Class.define("osparc.support.SupportCenter", {
139143
break;
140144
case "conversation-page":
141145
control = new osparc.support.ConversationPage();
142-
control.addListener("showConversations", () => this.__showConversations(), this);
146+
control.addListener("showConversations", () => this.showConversations(), this);
143147
this.getChildControl("conversations-stack").add(control);
144148
break;
145149
}
@@ -157,7 +161,7 @@ qx.Class.define("osparc.support.SupportCenter", {
157161
});
158162
},
159163

160-
__showConversations: function() {
164+
showConversations: function() {
161165
this.setCaption(this.tr("Conversations"));
162166
this.getChildControl("main-stack").setSelection([this.getChildControl("conversations-stack")]);
163167
this.getChildControl("home-button").set({

0 commit comments

Comments
 (0)