Skip to content

Commit

Permalink
[skip ci] reuse widget
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Jan 17, 2025
1 parent 7863d91 commit 1f62068
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ qx.Class.define("osparc.dashboard.FolderButtonItem", {
__applyTrashedBy: function(gid) {
if (gid) {
const dateBy = this.getChildControl("date-by");
dateBy.setGid(gid);
dateBy.setGroupid(gid);
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,11 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonItem", {
layout = this.getChildControl("header");
layout.addAt(control, osparc.dashboard.WorkspaceButtonBase.HPOS.MENU);
break;
case "date-text":
control = new qx.ui.basic.Label().set({
textColor: "contrasted-text-dark",
alignY: "middle",
rich: true,
font: "text-12",
allowGrowY: false
});
case "date-by":
control = new osparc.ui.basic.DateAndBy();
layout = this.getChildControl("footer");
layout.addAt(control, osparc.dashboard.WorkspaceButtonBase.FPOS.DATE);
break;
case "last-touching":
control = osparc.info.StudyUtils.createLastTouchedBy();
layout = this.getChildControl("footer");
layout.addAt(control, osparc.dashboard.WorkspaceButtonBase.FPOS.LAST_TOUCHING);
break;
}
return control || this.base(arguments, id);
},
Expand Down Expand Up @@ -261,28 +250,28 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonItem", {

__applyModifiedAt: function(value) {
if (value) {
const label = this.getChildControl("date-text");
label.set({
value: osparc.utils.Utils.formatDateAndTime(value),
const dateBy = this.getChildControl("date-by");
dateBy.set({
date: value,
toolTipText: this.tr("Last modified"),
})
}
},

__applyTrashedAt: function(value) {
if (value && value.getTime() !== new Date(0).getTime()) {
const label = this.getChildControl("date-text");
label.set({
value: osparc.utils.Utils.formatDateAndTime(value),
const dateBy = this.getChildControl("date-by");
dateBy.set({
date: value,
toolTipText: this.tr("Moved to the bin"),
});
}
},

__applyTrashedBy: function(gid) {
if (gid) {
const atom = this.getChildControl("last-touching");
osparc.dashboard.CardBase.addHintFromGids(atom, [gid]);
const dateBy = this.getChildControl("date-by");
dateBy.setGroupId(gid);
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ qx.Class.define("osparc.ui.basic.DateAndBy", {
apply: "__applyDate",
},

gid: {
groupId: {
check: "Number",
nullable: true,
apply: "__applyGid",
apply: "__applyGroupId",
},
},

Expand All @@ -60,7 +60,7 @@ qx.Class.define("osparc.ui.basic.DateAndBy", {
this._addAt(control, 0);
break;
case "last-touching":
new qx.ui.basic.Atom().set({
control = new qx.ui.basic.Atom().set({
alignY: "middle",
allowGrowX: false,
allowShrinkX: false,
Expand All @@ -84,10 +84,10 @@ qx.Class.define("osparc.ui.basic.DateAndBy", {
}
},

__applyGid: function(gid) {
if (gid) {
__applyGroupId: function(groupId) {
if (groupId) {
const atom = this.getChildControl("last-touching");
osparc.dashboard.CardBase.addHintFromGids(atom, [gid]);
osparc.dashboard.CardBase.addHintFromGids(atom, [groupId]);
}
},
}
Expand Down

0 comments on commit 1f62068

Please sign in to comment.