Skip to content

Commit

Permalink
remove trash related code
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Oct 24, 2024
1 parent 139d61e commit 06ad073
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ qx.Class.define("osparc.dashboard.ContextBreadcrumbs", {

properties: {
currentContext: {
check: ["studiesAndFolders", "workspaces", "search", "trash"],
check: ["studiesAndFolders", "workspaces", "search"],
nullable: false,
init: "studiesAndFolders",
event: "changeCurrentContext",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
},

events: {
"trashContext": "qx.event.type.Event",
"changeSharedWith": "qx.event.type.Data",
"changeSelectedTags": "qx.event.type.Data",
"changeServiceType": "qx.event.type.Data"
Expand All @@ -43,15 +42,13 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
members: {
__resourceType: null,
__workspacesAndFoldersTree: null,
__trashButton: null,
__sharedWithButtons: null,
__tagButtons: null,
__serviceTypeButtons: null,

__buildLayout: function() {
if (this.__resourceType === "study" && osparc.utils.DisabledPlugins.isFoldersEnabled()) {
this._add(this.__createWorkspacesAndFoldersTree());
this._add(this.__createTrashBin());
} else {
this._add(this.__createSharedWithFilterLayout());
}
Expand Down Expand Up @@ -87,24 +84,6 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
},
/* /WORKSPACES AND FOLDERS */

/* TRASH BIN */
__createTrashBin: function() {
const trashButton = this.__trashButton = new qx.ui.toolbar.RadioButton().set({
value: false,
appearance: "filter-toggle-button",
label: this.tr("Trash"),
icon: "@FontAwesome5Solid/trash/18",
});
trashButton.addListener("changeValue", e => {
const trashEnabled = e.getData();
if (trashEnabled) {
this.fireEvent("trashContext");
}
});
return trashButton;
},
/* /TRASH BIN */

/* SHARED WITH */
__createSharedWithFilterLayout: function() {
const sharedWithLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(5));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {

properties: {
currentContext: {
check: ["studiesAndFolders", "workspaces", "search", "trash"],
check: ["studiesAndFolders", "workspaces", "search"],
nullable: false,
init: "studiesAndFolders",
event: "changeCurrentContext"
Expand Down Expand Up @@ -932,10 +932,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
}
}, this);

this._resourceFilter.addListener("trashContext", () => {
this.__changeContext("trash");
});

this._searchBarFilter.addListener("filterChanged", e => {
const filterData = e.getData();
if (filterData.text) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ qx.Class.define("osparc.dashboard.StudyBrowserHeader", {

properties: {
currentContext: {
check: ["studiesAndFolders", "workspaces", "search", "trash"],
check: ["studiesAndFolders", "workspaces", "search"],
nullable: false,
init: "studiesAndFolders",
event: "changeCurrentContext",
Expand Down Expand Up @@ -200,13 +200,6 @@ qx.Class.define("osparc.dashboard.StudyBrowserHeader", {
value: this.tr("Search results"),
cursor: "auto",
});
} else if (currentContext === "trash") {
this.__setIcon("@FontAwesome5Solid/trash/20");
const trashDays = osparc.store.StaticInfo.getInstance().getTrashRetentionDays();
title.set({
value: this.tr(`Trash: Items in the bin will be permanently deleted after ${trashDays} days.`),
cursor: "auto",
});
} else if (currentContext === "workspaces") {
this.__setIcon(osparc.store.Workspaces.iconPath(32));
title.set({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,6 @@ qx.Class.define("osparc.store.StaticInfo", {
return null;
},

getTrashRetentionDays: function() {
const staticKey = "webserverProjects";
const wsStaticData = this.getValue(staticKey);
const key = "PROJECTS_TRASH_RETENTION_DAYS";
if (key in wsStaticData) {
return wsStaticData[key];
}
return "unknown";
},

getAccountDeletionRetentionDays: function() {
const staticKey = "webserverLogin";
const wsStaticData = this.getValue(staticKey);
Expand Down

0 comments on commit 06ad073

Please sign in to comment.