Skip to content

Commit ae48944

Browse files
committed
Safer
1 parent 8ad5b66 commit ae48944

File tree

14 files changed

+25
-31
lines changed

14 files changed

+25
-31
lines changed

services/static-webserver/client/source/class/osparc/dashboard/GridButtonBase.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ qx.Class.define("osparc.dashboard.GridButtonBase", {
188188
break;
189189
}
190190
case "title":
191-
control = new qx.ui.basic.Label().set({
191+
control = new osparc.ui.basic.SafeLabel().set({
192192
textColor: "contrasted-text-light",
193193
font: "text-14",
194+
rich: false, // do not allow multi-line titles
194195
});
195196
layout = this.getChildControl("header");
196197
layout.add(control, this.self().HPOS.TITLE);
@@ -205,12 +206,11 @@ qx.Class.define("osparc.dashboard.GridButtonBase", {
205206
break;
206207
}
207208
case "subtitle-text": {
208-
control = new qx.ui.basic.Label().set({
209+
control = new osparc.ui.basic.SafeLabel().set({
209210
textColor: "contrasted-text-dark",
210211
alignY: "middle",
211212
allowGrowX: true,
212213
allowShrinkX: true,
213-
rich: true,
214214
anonymous: true,
215215
font: "text-12",
216216
allowGrowY: false

services/static-webserver/client/source/class/osparc/dashboard/GridButtonTaskPlaceholder.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ qx.Class.define("osparc.dashboard.GridButtonTaskPlaceholder", {
6262
let layout;
6363
switch (id) {
6464
case "state-label": {
65-
control = new qx.ui.basic.Label().set({
65+
control = new osparc.ui.basic.SafeLabel().set({
6666
textColor: "contrasted-text-dark",
6767
allowGrowX: true,
6868
allowShrinkX: true,
69-
rich: true,
7069
anonymous: true,
7170
font: "text-12",
7271
allowGrowY: true,

services/static-webserver/client/source/class/osparc/dashboard/GroupedCardContainer.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,18 @@ qx.Class.define("osparc.dashboard.GroupedCardContainer", {
101101
allowGrowX: false
102102
});
103103
control.getChildControl("icon").set(osparc.utils.Utils.getThumbnailProps(32));
104-
control.getChildControl("label").set({
104+
const atomLabel = control.getChildControl("label");
105+
atomLabel.set({
105106
rich: true,
106107
wrap: true
107-
})
108+
});
109+
atomLabel.addListener("changeValue", e => {
110+
const val = e.getData();
111+
const sanitized = osparc.wrapper.DOMPurify.sanitize(val);
112+
if (sanitized !== val) {
113+
atomLabel.setValue(sanitized);
114+
}
115+
});
108116
control.getContentElement().setStyles({
109117
"border-top-left-radius": "4px",
110118
"border-top-right-radius": "4px"

services/static-webserver/client/source/class/osparc/dashboard/ListButtonBase.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,11 @@ qx.Class.define("osparc.dashboard.ListButtonBase", {
7575
break;
7676
}
7777
case "title":
78-
control = new qx.ui.basic.Label().set({
78+
control = new osparc.ui.basic.SafeLabel().set({
7979
textColor: "contrasted-text-light",
8080
font: "text-14",
8181
alignY: "middle",
8282
maxWidth: 300,
83-
rich: true,
8483
});
8584
this._add(control, {
8685
row: 0,

services/static-webserver/client/source/class/osparc/desktop/credits/CreditsServiceListItem.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,11 @@ qx.Class.define("osparc.desktop.credits.CreditsServiceListItem", {
9393
break;
9494
}
9595
case "title":
96-
control = new qx.ui.basic.Label().set({
96+
control = new osparc.ui.basic.SafeLabel().set({
9797
font: "text-12",
9898
alignY: "middle",
9999
maxWidth: 200,
100100
allowGrowX: true,
101-
rich: true,
102101
});
103102
this._add(control, this.self().GRID.NAME);
104103
break;

services/static-webserver/client/source/class/osparc/desktop/organizations/ServicesList.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ qx.Class.define("osparc.desktop.organizations.ServicesList", {
4747
const intro = new qx.ui.basic.Label().set({
4848
value: msg,
4949
alignX: "left",
50-
rich: true,
5150
font: "text-13"
5251
});
5352
return intro;

services/static-webserver/client/source/class/osparc/desktop/organizations/TutorialsList.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ qx.Class.define("osparc.desktop.organizations.TutorialsList", {
4747
const intro = new qx.ui.basic.Label().set({
4848
value: msg,
4949
alignX: "left",
50-
rich: true,
5150
font: "text-13"
5251
});
5352
return intro;

services/static-webserver/client/source/class/osparc/desktop/preferences/window/APIKeyBase.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ qx.Class.define("osparc.desktop.preferences.window.APIKeyBase", {
3737

3838
members: {
3939
__addInfoText: function(infoText) {
40-
const introLabel = new qx.ui.basic.Label(infoText).set({
40+
const introLabel = new osparc.ui.basic.SafeLabel(infoText).set({
4141
paddingLeft: 5,
4242
paddingRight: 5,
43-
rich: true
4443
});
4544
this.add(introLabel);
4645
}

services/static-webserver/client/source/class/osparc/desktop/wallets/WalletListItem.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ qx.Class.define("osparc.desktop.wallets.WalletListItem", {
9595
});
9696
break;
9797
case "subtitle":
98-
control = new qx.ui.basic.Label().set({
98+
control = new osparc.ui.basic.SafeLabel().set({
9999
font: "text-13",
100-
rich: true
101100
});
102101
this._add(control, {
103102
row: 1,

services/static-webserver/client/source/class/osparc/desktop/wallets/WalletsList.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,9 @@ qx.Class.define("osparc.desktop.wallets.WalletsList", {
215215

216216
__createHeader: function(label, showCurrently) {
217217
const header = new qx.ui.container.Composite(new qx.ui.layout.HBox());
218-
const userWallets = new qx.ui.basic.Label().set({
218+
const userWallets = new osparc.ui.basic.SafeLabel().set({
219219
value: label,
220220
alignX: "left",
221-
rich: true,
222221
font: "text-14"
223222
});
224223
header.add(userWallets);

0 commit comments

Comments
 (0)