Skip to content

Commit d70c956

Browse files
committed
dateBy
1 parent 1f62068 commit d70c956

File tree

4 files changed

+46
-22
lines changed

4 files changed

+46
-22
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ qx.Class.define("osparc.dashboard.CardBase", {
324324
nullable: true
325325
},
326326

327+
trashedBy: {
328+
check: "Number",
329+
apply: "_applyTrashedBy",
330+
nullable: true
331+
},
332+
327333
classifiers: {
328334
check: "Array"
329335
},
@@ -544,6 +550,10 @@ qx.Class.define("osparc.dashboard.CardBase", {
544550
throw new Error("Abstract method called!");
545551
},
546552

553+
_applyTrashedBy: function(value, old) {
554+
throw new Error("Abstract method called!");
555+
},
556+
547557
_applyAccessRights: function(value, old) {
548558
throw new Error("Abstract method called!");
549559
},

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,8 @@ qx.Class.define("osparc.dashboard.GridButtonBase", {
251251
layout.add(control, {flex: 1});
252252
break;
253253
}
254-
case "date-text":
255-
control = new qx.ui.basic.Label().set({
256-
textColor: "contrasted-text-dark",
257-
alignY: "middle",
258-
rich: true,
259-
font: "text-12",
260-
allowGrowY: false
261-
});
254+
case "date-by":
255+
control = new osparc.ui.basic.DateAndBy();
262256
layout = this.getChildControl("footer");
263257
layout.add(control, this.self().FPOS.MODIFIED);
264258
break;

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

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,28 +178,38 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
178178
_applyLastChangeDate: function(value, old) {
179179
if (value) {
180180
if (this.isResourceType("study") || this.isResourceType("template")) {
181-
const label = this.getChildControl("date-text");
182-
label.set({
183-
value: osparc.utils.Utils.formatDateAndTime(value),
181+
const dateBy = this.getChildControl("date-by");
182+
dateBy.set({
183+
date: value,
184184
toolTipText: this.tr("Last modified"),
185185
});
186186
}
187187
}
188188
},
189189

190190
// overridden
191-
_applyTrasehdAt: function(value, old) {
191+
_applyTrasehdAt: function(value) {
192192
if (value && value.getTime() !== new Date(0).getTime()) {
193193
if (this.isResourceType("study") || this.isResourceType("template")) {
194-
const label = this.getChildControl("date-text");
195-
label.set({
196-
value: osparc.utils.Utils.formatDateAndTime(value),
194+
const dateBy = this.getChildControl("date-by");
195+
dateBy.set({
196+
date: value,
197197
toolTipText: this.tr("Moved to the bin"),
198198
});
199199
}
200200
}
201201
},
202202

203+
// overridden
204+
_applyTrashedBy: function(gid) {
205+
if (gid) {
206+
if (this.isResourceType("study") || this.isResourceType("template")) {
207+
const dateBy = this.getChildControl("date-by");
208+
dateBy.setGroupId(gid);
209+
}
210+
}
211+
},
212+
203213
__createOwner: function(label) {
204214
if (label === osparc.auth.Data.getInstance().getEmail()) {
205215
const resourceAlias = osparc.utils.Utils.resourceTypeToAlias(this.getResourceType());

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

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,28 +194,38 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
194194
_applyLastChangeDate: function(value, old) {
195195
if (value) {
196196
if (this.isResourceType("study") || this.isResourceType("template")) {
197-
const label = this.getChildControl("date-text");
198-
label.set({
199-
value: osparc.utils.Utils.formatDateAndTime(value),
197+
const dateBy = this.getChildControl("date-by");
198+
dateBy.set({
199+
date: value,
200200
toolTipText: this.tr("Last modified"),
201201
});
202202
}
203203
}
204204
},
205205

206206
// overridden
207-
_applyTrasehdAt: function(value, old) {
207+
_applyTrasehdAt: function(value) {
208208
if (value && value.getTime() !== new Date(0).getTime()) {
209209
if (this.isResourceType("study") || this.isResourceType("template")) {
210-
const label = this.getChildControl("date-text");
211-
label.set({
212-
value: osparc.utils.Utils.formatDateAndTime(value),
210+
const dateBy = this.getChildControl("date-by");
211+
dateBy.set({
212+
date: value,
213213
toolTipText: this.tr("Moved to the bin"),
214214
});
215215
}
216216
}
217217
},
218218

219+
// overridden
220+
_applyTrashedBy: function(gid) {
221+
if (gid) {
222+
if (this.isResourceType("study") || this.isResourceType("template")) {
223+
const dateBy = this.getChildControl("date-by");
224+
dateBy.setGroupId(gid);
225+
}
226+
}
227+
},
228+
219229
__createOwner: function(label) {
220230
if (label === osparc.auth.Data.getInstance().getEmail()) {
221231
const resourceAlias = osparc.utils.Utils.resourceTypeToAlias(this.getResourceType());

0 commit comments

Comments
 (0)