Skip to content

Commit ace6b69

Browse files
committed
workspace show trashed at
1 parent 814898c commit ace6b69

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,13 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonItem", {
9191
check: "Date",
9292
nullable: true,
9393
apply: "__applyModifiedAt"
94-
}
94+
},
95+
96+
trashedAt: {
97+
check: "Date",
98+
nullable: true,
99+
apply: "__applyTrashedAt"
100+
},
95101
},
96102

97103
statics: {
@@ -133,7 +139,7 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonItem", {
133139
layout = this.getChildControl("header");
134140
layout.addAt(control, osparc.dashboard.WorkspaceButtonBase.HPOS.MENU);
135141
break;
136-
case "modified-text":
142+
case "footer-text":
137143
control = new qx.ui.basic.Label().set({
138144
textColor: "contrasted-text-dark",
139145
alignY: "middle",
@@ -161,6 +167,7 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonItem", {
161167
});
162168
workspace.bind("accessRights", this, "accessRights");
163169
workspace.bind("modifiedAt", this, "modifiedAt");
170+
workspace.bind("trashedAt", this, "trashedAt");
164171
workspace.bind("myAccessRights", this, "myAccessRights");
165172

166173
osparc.utils.Utils.setIdToWidget(this, "workspaceItem_" + workspace.getWorkspaceId());
@@ -242,8 +249,17 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonItem", {
242249
},
243250

244251
__applyModifiedAt: function(value) {
245-
const label = this.getChildControl("modified-text");
246-
label.setValue(osparc.utils.Utils.formatDateAndTime(value));
252+
if (value) {
253+
const label = this.getChildControl("footer-text");
254+
label.setValue(osparc.utils.Utils.formatDateAndTime(value));
255+
}
256+
},
257+
258+
__applyTrashedAt: function(value) {
259+
if (value && value.getTime() !== new Date(0).getTime()) {
260+
const label = this.getChildControl("footer-text");
261+
label.setValue(osparc.utils.Utils.formatDateAndTime(value));
262+
}
247263
},
248264

249265
__updateTooltip: function() {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ qx.Class.define("osparc.data.model.Workspace", {
103103
check: "Date",
104104
nullable: true,
105105
init: null,
106+
event: "changeTrashedAt",
106107
},
107108

108109
trashedBy: {

0 commit comments

Comments
 (0)