Skip to content

Commit e1b0be4

Browse files
committed
[skip ci] getIcon
1 parent ed19d3a commit e1b0be4

File tree

1 file changed

+19
-0
lines changed
  • services/static-webserver/client/source/class/osparc/data/model

1 file changed

+19
-0
lines changed

services/static-webserver/client/source/class/osparc/data/model/Study.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ qx.Class.define("osparc.data.model.Study", {
6161
dev: studyData.dev || this.getDev(),
6262
trashedAt: studyData.trashedAt ? new Date(studyData.trashedAt) : this.getTrashedAt(),
6363
trashedBy: studyData.trashedBy || null,
64+
icon: this.self().getIcon(studyData),
6465
});
6566

6667
const wbData = studyData.workbench || this.getWorkbench();
@@ -225,6 +226,13 @@ qx.Class.define("osparc.data.model.Study", {
225226
init: null,
226227
event: "changeTrashedBy",
227228
},
229+
230+
icon: {
231+
check: "String",
232+
nullable: false,
233+
event: "changeIcon",
234+
init: ""
235+
},
228236
// ------ ignore for serializing ------
229237
},
230238

@@ -235,6 +243,7 @@ qx.Class.define("osparc.data.model.Study", {
235243
"pipelineRunning",
236244
"readOnly",
237245
"trashedAt",
246+
"icon",
238247
],
239248

240249
IgnoreModelizationProps: [
@@ -308,6 +317,16 @@ qx.Class.define("osparc.data.model.Study", {
308317
return false;
309318
},
310319

320+
getIcon: function(studyData) {
321+
let icon = "";
322+
if (this.getUiMode() === "standalone") {
323+
return "@FontAwesome5Solid/user/14";
324+
} else if (this.getUiMode() === "workbench") {
325+
return "@FontAwesome5Solid/globe/14";
326+
}
327+
return icon;
328+
},
329+
311330
getUiMode: function(studyData) {
312331
if ("ui" in studyData && "mode" in studyData["ui"]) {
313332
return studyData["ui"]["mode"];

0 commit comments

Comments
 (0)