Skip to content

Commit ee996cd

Browse files
committed
reuse JsonFormatterWidget
1 parent 1c6eb98 commit ee996cd

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

services/static-webserver/client/source/class/osparc/info/FunctionLarge.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ qx.Class.define("osparc.info.FunctionLarge", {
6161
"Default Inputs": this.getFunction().getDefaultInputs(),
6262
"Outputs": this.getFunction().getOutputSchema()["schema_content"],
6363
};
64-
const jsonViewer = new osparc.widget.JsonFormatterWidget();
64+
const jsonViewer = new osparc.widget.JsonFormatterWidget(info);
6565
const scroll = new qx.ui.container.Scroll();
66-
scroll.add(jsonViewer, { flex: 1 });
67-
vBox.add(scroll, { flex: 1 });
68-
jsonViewer.setJson(info);
66+
scroll.add(jsonViewer);
67+
vBox.add(scroll, {
68+
flex: 1
69+
});
6970

7071
// Copy Id button
7172
const text = "Function Id";

services/static-webserver/client/source/class/osparc/jobs/Info.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ qx.Class.define("osparc.jobs.Info", {
2424

2525
this._setLayout(new qx.ui.layout.VBox());
2626

27-
const divId = "job-info-viewer";
28-
const htmlEmbed = osparc.wrapper.JsonFormatter.getInstance().createContainer(divId);
29-
this._add(htmlEmbed, {
27+
const jsonViewer = new osparc.widget.JsonFormatterWidget(info);
28+
const scroll = new qx.ui.container.Scroll();
29+
scroll.add(jsonViewer);
30+
this._add(scroll, {
3031
flex: 1
3132
});
32-
this.addListener("appear", () => {
33-
osparc.wrapper.JsonFormatter.getInstance().setJson(info, divId);
34-
});
3533
},
3634

3735
statics: {

services/static-webserver/client/source/class/osparc/user/UserDetails.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,12 @@ qx.Class.define("osparc.user.UserDetails", {
309309
this.getChildControl("postal-code").setValue(user.getPostalCode() || "-");
310310

311311
// remaining data
312-
const jsonViewer = new osparc.widget.JsonFormatterWidget();
312+
const jsonViewer = new osparc.widget.JsonFormatterWidget(this.__remainingUserData);
313313
const scroll = new qx.ui.container.Scroll();
314-
scroll.add(jsonViewer, { flex: 1 });
315-
this.add(scroll, { flex: 1 });
316-
jsonViewer.setJson(this.__remainingUserData);
314+
scroll.add(jsonViewer);
315+
this.add(scroll, {
316+
flex: 1
317+
});
317318
},
318319
}
319320
});

0 commit comments

Comments
 (0)