From 6f7b0d42194d75eb69c605308a2005f69bb115e2 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 13 Nov 2024 14:45:35 +0100 Subject: [PATCH 1/2] trashedAt property --- .../source/class/osparc/data/model/Folder.js | 9 ++++++++- .../client/source/class/osparc/data/model/Study.js | 14 +++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Folder.js b/services/static-webserver/client/source/class/osparc/data/model/Folder.js index 1dd99d015a2..b8b9eb03b21 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Folder.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Folder.js @@ -37,6 +37,7 @@ qx.Class.define("osparc.data.model.Folder", { owner: folderData.owner, createdAt: new Date(folderData.createdAt), lastModified: new Date(folderData.modifiedAt), + trashedAt: folderData.trashedAt ? new Date(folderData.trashedAt) : this.getTrashedAt(), }); }, @@ -95,7 +96,13 @@ qx.Class.define("osparc.data.model.Folder", { nullable: true, init: null, event: "changeLastModified" - } + }, + + trashedAt: { + check: "Date", + nullable: true, + init: null, + }, }, statics: { diff --git a/services/static-webserver/client/source/class/osparc/data/model/Study.js b/services/static-webserver/client/source/class/osparc/data/model/Study.js index 598e0575d22..ab178aca669 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Study.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Study.js @@ -58,7 +58,8 @@ qx.Class.define("osparc.data.model.Study", { state: studyData.state || this.getState(), quality: studyData.quality || this.getQuality(), permalink: studyData.permalink || this.getPermalink(), - dev: studyData.dev || this.getDev() + dev: studyData.dev || this.getDev(), + trashedAt: studyData.trashedAt ? new Date(studyData.trashedAt) : this.getTrashedAt(), }); const wbData = studyData.workbench || this.getWorkbench(); @@ -209,7 +210,13 @@ qx.Class.define("osparc.data.model.Study", { nullable: true, event: "changeReadOnly", init: true - } + }, + + trashedAt: { + check: "Date", + nullable: true, + init: null, + }, // ------ ignore for serializing ------ }, @@ -218,7 +225,8 @@ qx.Class.define("osparc.data.model.Study", { "permalink", "state", "pipelineRunning", - "readOnly" + "readOnly", + "trashedAt", ], IgnoreModelizationProps: [ From dcf87f7e81b5e93b3660575273a9d29d63c98163 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 13 Nov 2024 14:46:49 +0100 Subject: [PATCH 2/2] convert to Date --- .../client/source/class/osparc/store/Folders.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/static-webserver/client/source/class/osparc/store/Folders.js b/services/static-webserver/client/source/class/osparc/store/Folders.js index 16385de935c..cc625506e5c 100644 --- a/services/static-webserver/client/source/class/osparc/store/Folders.js +++ b/services/static-webserver/client/source/class/osparc/store/Folders.js @@ -141,6 +141,8 @@ qx.Class.define("osparc.store.Folders", { folder.set("createdAt", new Date(folderData["createdAt"])); } else if (key === "modifiedAt") { folder.set("lastModified", new Date(folderData["modifiedAt"])); + } else if (key === "trashedAt") { + folder.set("trashedAt", new Date(folderData["trashedAt"])); } else { folder.set(key, folderData[key]); }