Skip to content

Commit cf70bbc

Browse files
committed
"share-project-checkbox"
1 parent af76c71 commit cf70bbc

File tree

1 file changed

+32
-13
lines changed
  • services/static-webserver/client/source/class/osparc/support

1 file changed

+32
-13
lines changed

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

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ qx.Class.define("osparc.support.Conversation", {
4444
event: "changeConversationId",
4545
apply: "__applyConversationId",
4646
},
47+
48+
studyId: {
49+
check: "String",
50+
init: null,
51+
nullable: true,
52+
event: "changeStudyId",
53+
apply: "__applyStudyId",
54+
},
4755
},
4856

4957
members: {
@@ -78,14 +86,32 @@ qx.Class.define("osparc.support.Conversation", {
7886
break;
7987
case "add-message":
8088
control = new osparc.conversation.AddMessage().set({
81-
padding: 10,
89+
padding: 5,
8290
});
8391
this.bind("conversationId", control, "conversationId");
8492
// make it more compact
8593
control.getChildControl("comment-field").getChildControl("tabs").getChildControl("bar").exclude();
8694
control.getChildControl("comment-field").getChildControl("subtitle").exclude();
8795
this._addAt(control, 3);
8896
break;
97+
case "share-project-layout":
98+
control = new qx.ui.container.Composite(new qx.ui.layout.HBox()).set({
99+
backgroundColor: "strong-main",
100+
decorator: "rounded",
101+
});
102+
this._addAt(control, 4);
103+
break;
104+
case "share-project-checkbox":
105+
control = new qx.ui.form.CheckBox().set({
106+
value: false,
107+
label: this.tr("Share Project with Support"),
108+
textColor: "white",
109+
padding: 3,
110+
});
111+
this.getChildControl("share-project-layout").add(new qx.ui.core.Spacer(), { flex: 1 });
112+
this.getChildControl("share-project-layout").add(control);
113+
this.getChildControl("share-project-layout").add(new qx.ui.core.Spacer(), { flex: 1 });
114+
break;
89115
}
90116
return control || this.base(arguments, id);
91117
},
@@ -108,21 +134,14 @@ qx.Class.define("osparc.support.Conversation", {
108134
const supportSuggestion = this.getChildControl("support-suggestion");
109135
supportSuggestion.exclude();
110136
if (conversationId === null && osparc.store.Store.getInstance().getCurrentStudy()) {
111-
supportSuggestion.show();
112-
const suggestedQuestion = new osparc.support.SuggestedQuestion();
113-
const answers = [
114-
{ label: this.tr("No"), key: "no" },
115-
{ label: this.tr("Yes"), key: "yes" },
116-
];
117-
suggestedQuestion.isProjectRelated(answers);
118-
suggestedQuestion.addListener("questionAnswered", e => {
119-
const answer = e.getData();
120-
console.log(answer);
121-
});
122-
supportSuggestion.add(suggestedQuestion);
137+
this.getChildControl("share-project-checkbox").show();
123138
}
124139
},
125140

141+
__applyStudyId: function(studyId) {
142+
143+
},
144+
126145
__getNextRequest: function() {
127146
const params = {
128147
url: {

0 commit comments

Comments
 (0)