Skip to content

Commit 272cd51

Browse files
authored
🎨 Separate Privacy Policy and EULA checkboxes (#5420)
1 parent 25c813c commit 272cd51

File tree

1 file changed

+17
-27
lines changed

1 file changed

+17
-27
lines changed

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

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,6 @@ qx.Class.define("osparc.auth.ui.RequestAccount", {
151151
doubleSpaced.push(message);
152152
this._form.add(message, this.tr("Message"), null, "message");
153153

154-
const eula = new qx.ui.form.CheckBox().set({
155-
required: true
156-
})
157-
doubleSpaced.push(eula);
158-
this._form.add(eula, this.tr("I accept the below Privacy Policy and EULA"), null, "eula")
159-
160154
// const formRenderer = new qx.ui.form.renderer.Single(this._form);
161155
const formRenderer = new osparc.ui.form.renderer.DoubleV(this._form, doubleSpaced);
162156
this.add(formRenderer);
@@ -165,26 +159,22 @@ qx.Class.define("osparc.auth.ui.RequestAccount", {
165159
const grp = new qx.ui.container.Composite(new qx.ui.layout.VBox(15));
166160
const buttons = new qx.ui.container.Composite(new qx.ui.layout.HBox(5));
167161

168-
const eulaTextContainer = new qx.ui.container.Composite(new qx.ui.layout.Flow()).set({
169-
width: 100
162+
const color = qx.theme.manager.Color.getInstance().resolve("text");
163+
const ppText = `I acknowledge that data will be processed in accordance with <a href='https://sim4life.swiss/privacy' style='color: ${color}' target='_blank''>our privacy policy</a>`;
164+
const privacyPolicy = new qx.ui.form.CheckBox().set({
165+
required: true,
166+
value: false
170167
})
171-
const part1 = "Data will be processed in accordance with"
172-
part1.split(" ").forEach(word => eulaTextContainer.add(new qx.ui.basic.Label(word).set({
173-
marginRight: 2
174-
})))
175-
eulaTextContainer.add(new osparc.ui.basic.LinkLabel("our privacy policy.", "https://sim4life.swiss/privacy").set({
176-
marginRight: 2,
177-
rich: false
178-
}))
179-
const part2 = "Users are authorized to use the web product in accordance with"
180-
part2.split(" ").forEach(word => eulaTextContainer.add(new qx.ui.basic.Label(word).set({
181-
marginRight: 2
182-
})))
183-
eulaTextContainer.add(new osparc.ui.basic.LinkLabel("the EULA.", "https://zurichmedtech.github.io/s4l-manual/#/docs/licensing/copyright_Sim4Life?id=zurich-medtech-ag-zmt").set({
184-
rich: false
185-
}))
186-
187-
grp.add(eulaTextContainer)
168+
doubleSpaced.push(privacyPolicy);
169+
this._form.add(privacyPolicy, ppText, null, "privacyPolicy")
170+
171+
const eulaText = `I accept the <a href='https://zurichmedtech.github.io/s4l-manual/#/docs/licensing/copyright_Sim4Life?id=zurich-medtech-ag-zmt' style='color: ${color}' target='_blank''>end users license agreement (EULA)</a> and I will use the product in accordance with it.`;
172+
const eula = new qx.ui.form.CheckBox().set({
173+
required: true,
174+
value: false
175+
})
176+
doubleSpaced.push(eula);
177+
this._form.add(eula, eulaText, null, "eula")
188178

189179
const submitBtn = this.__requestButton = new qx.ui.form.Button(this.tr("Request")).set({
190180
center: true,
@@ -204,8 +194,8 @@ qx.Class.define("osparc.auth.ui.RequestAccount", {
204194

205195
// interaction
206196
submitBtn.addListener("execute", e => {
207-
const valid = this._form.validate();
208-
if (valid) {
197+
const validForm = this._form.validate();
198+
if (validForm) {
209199
const formData = {};
210200
Object.entries(this._form.getItems()).forEach(([key, field]) => {
211201
const val = field.getValue();

0 commit comments

Comments
 (0)