Skip to content

Commit af76c71

Browse files
committed
refactor
1 parent 0574cb8 commit af76c71

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,26 @@ qx.Class.define("osparc.support.SuggestedQuestion", {
3333
},
3434

3535
members: {
36-
isProjectRelated: function(answers) {
37-
this._removeAll();
38-
36+
__addProductThumbnail: function() {
3937
const thumbnail = osparc.utils.Utils.createThumbnail(32).set({
4038
source: osparc.product.Utils.getIconUrl(),
4139
});
4240
this._add(thumbnail, {
4341
row: 0,
4442
column: 0,
4543
});
44+
},
4645

47-
const question = new qx.ui.basic.Label(this.tr("Is your question related to this project?"));
46+
__addQuestionLabel: function(text) {
47+
const question = new qx.ui.basic.Label(text);
4848
this._add(question, {
4949
row: 0,
5050
column: 1,
5151
});
52+
},
5253

53-
const answersContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox(10));
54+
__addAnswers: function(answers) {
55+
const answersContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox(5));
5456
answers.forEach(answer => {
5557
const button = new qx.ui.form.Button(answer.label).set({
5658
appearance: "strong-button",
@@ -64,5 +66,19 @@ qx.Class.define("osparc.support.SuggestedQuestion", {
6466
column: 1,
6567
});
6668
},
69+
70+
isProjectRelated: function(answers) {
71+
this._removeAll();
72+
this.__addProductThumbnail();
73+
this.__addQuestionLabel(this.tr("Is your question related to the current project?"));
74+
this.__addAnswers(answers);
75+
},
76+
77+
shareProject: function() {
78+
this._removeAll();
79+
this.__addProductThumbnail();
80+
this.__addQuestionLabel(this.tr("Do you want to share this project with Support?"));
81+
this.__addAnswers(answers);
82+
},
6783
}
6884
});

0 commit comments

Comments
 (0)