Skip to content

Commit 1f62068

Browse files
committed
[skip ci] reuse widget
1 parent 7863d91 commit 1f62068

File tree

3 files changed

+17
-28
lines changed

3 files changed

+17
-28
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
265265
__applyTrashedBy: function(gid) {
266266
if (gid) {
267267
const dateBy = this.getChildControl("date-by");
268-
dateBy.setGid(gid);
268+
dateBy.setGroupid(gid);
269269
}
270270
},
271271

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

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,11 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonItem", {
145145
layout = this.getChildControl("header");
146146
layout.addAt(control, osparc.dashboard.WorkspaceButtonBase.HPOS.MENU);
147147
break;
148-
case "date-text":
149-
control = new qx.ui.basic.Label().set({
150-
textColor: "contrasted-text-dark",
151-
alignY: "middle",
152-
rich: true,
153-
font: "text-12",
154-
allowGrowY: false
155-
});
148+
case "date-by":
149+
control = new osparc.ui.basic.DateAndBy();
156150
layout = this.getChildControl("footer");
157151
layout.addAt(control, osparc.dashboard.WorkspaceButtonBase.FPOS.DATE);
158152
break;
159-
case "last-touching":
160-
control = osparc.info.StudyUtils.createLastTouchedBy();
161-
layout = this.getChildControl("footer");
162-
layout.addAt(control, osparc.dashboard.WorkspaceButtonBase.FPOS.LAST_TOUCHING);
163-
break;
164153
}
165154
return control || this.base(arguments, id);
166155
},
@@ -261,28 +250,28 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonItem", {
261250

262251
__applyModifiedAt: function(value) {
263252
if (value) {
264-
const label = this.getChildControl("date-text");
265-
label.set({
266-
value: osparc.utils.Utils.formatDateAndTime(value),
253+
const dateBy = this.getChildControl("date-by");
254+
dateBy.set({
255+
date: value,
267256
toolTipText: this.tr("Last modified"),
268257
})
269258
}
270259
},
271260

272261
__applyTrashedAt: function(value) {
273262
if (value && value.getTime() !== new Date(0).getTime()) {
274-
const label = this.getChildControl("date-text");
275-
label.set({
276-
value: osparc.utils.Utils.formatDateAndTime(value),
263+
const dateBy = this.getChildControl("date-by");
264+
dateBy.set({
265+
date: value,
277266
toolTipText: this.tr("Moved to the bin"),
278267
});
279268
}
280269
},
281270

282271
__applyTrashedBy: function(gid) {
283272
if (gid) {
284-
const atom = this.getChildControl("last-touching");
285-
osparc.dashboard.CardBase.addHintFromGids(atom, [gid]);
273+
const dateBy = this.getChildControl("date-by");
274+
dateBy.setGroupId(gid);
286275
}
287276
},
288277

services/static-webserver/client/source/class/osparc/ui/basic/DateAndBy.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ qx.Class.define("osparc.ui.basic.DateAndBy", {
3838
apply: "__applyDate",
3939
},
4040

41-
gid: {
41+
groupId: {
4242
check: "Number",
4343
nullable: true,
44-
apply: "__applyGid",
44+
apply: "__applyGroupId",
4545
},
4646
},
4747

@@ -60,7 +60,7 @@ qx.Class.define("osparc.ui.basic.DateAndBy", {
6060
this._addAt(control, 0);
6161
break;
6262
case "last-touching":
63-
new qx.ui.basic.Atom().set({
63+
control = new qx.ui.basic.Atom().set({
6464
alignY: "middle",
6565
allowGrowX: false,
6666
allowShrinkX: false,
@@ -84,10 +84,10 @@ qx.Class.define("osparc.ui.basic.DateAndBy", {
8484
}
8585
},
8686

87-
__applyGid: function(gid) {
88-
if (gid) {
87+
__applyGroupId: function(groupId) {
88+
if (groupId) {
8989
const atom = this.getChildControl("last-touching");
90-
osparc.dashboard.CardBase.addHintFromGids(atom, [gid]);
90+
osparc.dashboard.CardBase.addHintFromGids(atom, [groupId]);
9191
}
9292
},
9393
}

0 commit comments

Comments
 (0)