Skip to content

Commit 8ba352b

Browse files
committed
S4L_TOPICS
1 parent d4da958 commit 8ba352b

File tree

3 files changed

+90
-74
lines changed

3 files changed

+90
-74
lines changed

services/static-webserver/client/source/class/osparc/auth/ui/RequestAccount.js

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -144,50 +144,8 @@ qx.Class.define("osparc.auth.ui.RequestAccount", {
144144
case "s4lacad":
145145
case "s4ldesktopacad": {
146146
const application = new qx.ui.form.SelectBox();
147-
[{
148-
id: "other",
149-
label: "Other"
150-
}, {
151-
id: "Antenna_Design_for_Wireless_Communication",
152-
label: "Antenna Design for Wireless Communication"
153-
}, {
154-
id: "Bioelectronics,_Electroceuticals_and_Neuroprosthetics",
155-
label: "Bioelectronics, Electroceuticals & Neuroprosthetics"
156-
}, {
157-
id: "Safety_and_Efficacy_Assessment",
158-
label: "Safety & Efficacy Assessment"
159-
}, {
160-
id: "Exposure_and_Compliance",
161-
label: "Exposure & Compliance"
162-
}, {
163-
id: "Focused_Ultrasound",
164-
label: "Focused Ultrasound"
165-
}, {
166-
id: "In_Silico_Trials",
167-
label: "In <i>Silico</i> Trials"
168-
}, {
169-
id: "Implant_Design",
170-
label: "Implant Design"
171-
}, {
172-
id: "Magnetic_Resonance_Imaging",
173-
label: "Magnetic Resonance Imaging"
174-
}, {
175-
id: "Neurostimulation",
176-
label: "Neurostimulation"
177-
}, {
178-
id: "Personalized_Medicine",
179-
label: "Personalized Medicine"
180-
}, {
181-
id: "Thermal_Therapies",
182-
label: "Thermal Therapies"
183-
}, {
184-
id: "Wireless_Power_Transfer_Systems",
185-
label: "Wireless Power Transfer Systems"
186-
}, {
187-
id: "Vascular_Flow_and_Perfusion",
188-
label: "Vascular Flow & Perfusion"
189-
}].forEach(appData => {
190-
const lItem = new qx.ui.form.ListItem(appData.label, null, appData.id).set({
147+
osparc.product.Utils.S4L_TOPICS.forEach(topic => {
148+
const lItem = new qx.ui.form.ListItem(topic.label, null, topic.id).set({
191149
rich: true
192150
});
193151
application.add(lItem);

services/static-webserver/client/source/class/osparc/product/Utils.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,5 +450,51 @@ qx.Class.define("osparc.product.Utils", {
450450
groupServices: function() {
451451
return Boolean(osparc.store.Products.getInstance().getGroupedServicesUiConfig());
452452
},
453+
454+
S4L_TOPICS: [
455+
{
456+
id: "other",
457+
label: "Other"
458+
}, {
459+
id: "Antenna_Design_for_Wireless_Communication",
460+
label: "Antenna Design for Wireless Communication"
461+
}, {
462+
id: "Bioelectronics,_Electroceuticals_and_Neuroprosthetics",
463+
label: "Bioelectronics, Electroceuticals & Neuroprosthetics"
464+
}, {
465+
id: "Safety_and_Efficacy_Assessment",
466+
label: "Safety & Efficacy Assessment"
467+
}, {
468+
id: "Exposure_and_Compliance",
469+
label: "Exposure & Compliance"
470+
}, {
471+
id: "Focused_Ultrasound",
472+
label: "Focused Ultrasound"
473+
}, {
474+
id: "In_Silico_Trials",
475+
label: "In <i>Silico</i> Trials"
476+
}, {
477+
id: "Implant_Design",
478+
label: "Implant Design"
479+
}, {
480+
id: "Magnetic_Resonance_Imaging",
481+
label: "Magnetic Resonance Imaging"
482+
}, {
483+
id: "Neurostimulation",
484+
label: "Neurostimulation"
485+
}, {
486+
id: "Personalized_Medicine",
487+
label: "Personalized Medicine"
488+
}, {
489+
id: "Thermal_Therapies",
490+
label: "Thermal Therapies"
491+
}, {
492+
id: "Wireless_Power_Transfer_Systems",
493+
label: "Wireless Power Transfer Systems"
494+
}, {
495+
id: "Vascular_Flow_and_Perfusion",
496+
label: "Vascular Flow & Perfusion"
497+
}
498+
],
453499
}
454500
});

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

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)