Skip to content

Commit cb7bf5c

Browse files
committed
addHelper
1 parent 9ee06d8 commit cb7bf5c

File tree

4 files changed

+21
-26
lines changed

4 files changed

+21
-26
lines changed

services/static-webserver/client/source/class/osparc/desktop/account/ProfilePage.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
337337
const privacyModel = this.__userPrivacyModel = qx.data.marshal.Json.createModel(defaultModel, true);
338338

339339
const box = this.self().createSectionBox(this.tr("Privacy"));
340-
341-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Choose what others see."));
342-
box.add(label);
340+
box.addHelper(this.tr("Choose what others see."));
343341

344342
const hideUserName = new qx.ui.form.CheckBox().set({
345343
value: defaultModel.hideUserName
@@ -453,9 +451,7 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
453451

454452
__create2FASection: function() {
455453
const box = this.self().createSectionBox(this.tr("Two-Factor Authentication"));
456-
457-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Set your preferred method to use for two-factor authentication when signing in:"));
458-
box.add(label);
454+
box.addHelper(this.tr("Set your preferred method to use for two-factor authentication when signing in:"));
459455

460456
const form = new qx.ui.form.Form();
461457

@@ -659,9 +655,7 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
659655
__createDeleteAccount: function() {
660656
// layout
661657
const box = this.self().createSectionBox(this.tr("Delete Account"));
662-
663-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Request the deletion of your account."));
664-
box.add(label);
658+
box.addHelper(this.tr("Request the deletion of your account."));
665659

666660
const deleteBtn = new qx.ui.form.Button(this.tr("Delete Account")).set({
667661
appearance: "danger-button",

services/static-webserver/client/source/class/osparc/desktop/preferences/pages/ConfirmationsPage.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,7 @@ qx.Class.define("osparc.desktop.preferences.pages.ConfirmationsPage", {
126126
__createExperimentalSettings: function() {
127127
// layout
128128
const box = new osparc.widget.SectionBox("Experimental preferences");
129-
130-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr(
131-
"This is a list of experimental preferences"
132-
));
133-
box.add(label);
129+
box.addHelper(this.tr("This is a list of experimental preferences"));
134130

135131
const preferencesSettings = osparc.Preferences.getInstance();
136132

services/static-webserver/client/source/class/osparc/desktop/preferences/pages/GeneralPage.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ qx.Class.define("osparc.desktop.preferences.pages.GeneralPage", {
4646

4747
members: {
4848
__addCreditsIndicatorSettings: function() {
49-
const box = osparc.ui.window.TabbedView.createSectionBox(this.tr("Credits Indicator"));
49+
const box = new osparc.widget.SectionBox(this.tr("Credits Indicator"));
5050

5151
const form = new qx.ui.form.Form();
5252

@@ -93,10 +93,9 @@ qx.Class.define("osparc.desktop.preferences.pages.GeneralPage", {
9393
},
9494

9595
__addInactivitySetting: function() {
96-
const box = osparc.ui.window.TabbedView.createSectionBox(this.tr("Automatic Shutdown of Idle Instances"));
96+
const box = new osparc.widget.SectionBox(this.tr("Automatic Shutdown of Idle Instances"));
9797

98-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Enter 0 to disable this function"), "text-13-italic");
99-
box.add(label);
98+
box.addHelper(this.tr("Enter 0 to disable this function"));
10099

101100
const form = new qx.ui.form.Form();
102101
const inactivitySpinner = new qx.ui.form.Spinner().set({
@@ -118,7 +117,7 @@ qx.Class.define("osparc.desktop.preferences.pages.GeneralPage", {
118117
},
119118

120119
__addJobConcurrencySetting: function() {
121-
const box = osparc.ui.window.TabbedView.createSectionBox(this.tr("Job Concurrency"));
120+
const box = new osparc.widget.SectionBox(this.tr("Job Concurrency"));
122121
const form = new qx.ui.form.Form();
123122
const jobConcurrencySpinner = new qx.ui.form.Spinner().set({
124123
minimum: 1,
@@ -136,9 +135,9 @@ qx.Class.define("osparc.desktop.preferences.pages.GeneralPage", {
136135
},
137136

138137
__addLowDiskSpaceSetting: function() {
139-
const box = osparc.ui.window.TabbedView.createSectionBox(this.tr("Low Disk Space Threshold"));
140-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Set the warning Threshold for Low Disk Space availability"), "text-13-italic");
141-
box.add(label);
138+
const box = new osparc.widget.SectionBox(this.tr("Low Disk Space Threshold"));
139+
box.addHelper(this.tr("Set the warning Threshold for Low Disk Space availability"));
140+
142141
const form = new qx.ui.form.Form();
143142
const diskUsageSpinner = new qx.ui.form.Spinner().set({
144143
minimum: 1,
@@ -157,10 +156,8 @@ qx.Class.define("osparc.desktop.preferences.pages.GeneralPage", {
157156
},
158157

159158
__addS4LUserPrivacySettings: function() {
160-
const box = osparc.ui.window.TabbedView.createSectionBox("Privacy Settings");
161-
162-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Help us improve Sim4Life user experience"), "text-13-italic");
163-
box.add(label);
159+
const box = new osparc.widget.SectionBox("Privacy Settings");
160+
box.addHelper(this.tr("Help us improve Sim4Life user experience"));
164161

165162
const preferencesSettings = osparc.Preferences.getInstance();
166163

services/static-webserver/client/source/class/osparc/widget/SectionBox.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,13 @@ qx.Class.define("osparc.widget.SectionBox", {
9090
}
9191
return control || this.base(arguments, id);
9292
},
93+
94+
addHelper: function(message, font="text-13") {
95+
const label = new qx.ui.basic.Label(message).set({
96+
font,
97+
});
98+
this.add(label);
99+
return label;
100+
},
93101
}
94102
});

0 commit comments

Comments
 (0)