diff --git a/cypress/integration/custom_buttons.js b/cypress/integration/custom_buttons.js index fd93613900..ac3027bfba 100644 --- a/cypress/integration/custom_buttons.js +++ b/cypress/integration/custom_buttons.js @@ -40,7 +40,7 @@ describe( () => { before(() => { cy.login(); - cy.visit(`/app/note/new`); + cy.visit(`/desk/note/new`); // close the sidebar cause default is expanded cy.get(".body-sidebar .collapse-sidebar-link").click(); }); diff --git a/cypress/integration/workspace.js b/cypress/integration/workspace.js index 447c1d678d..c5917c332d 100644 --- a/cypress/integration/workspace.js +++ b/cypress/integration/workspace.js @@ -12,7 +12,7 @@ context("Workspace 2.0", () => { }); it("Create Private Page", () => { - cy.visit("/desk/build"); + cy.visit("/desk/website"); cy.intercept({ method: "POST", url: "api/method/frappe.desk.doctype.workspace.workspace.new_page", diff --git a/frappe/desk/doctype/workspace/workspace.py b/frappe/desk/doctype/workspace/workspace.py index 757a842277..d534041493 100644 --- a/frappe/desk/doctype/workspace/workspace.py +++ b/frappe/desk/doctype/workspace/workspace.py @@ -127,6 +127,14 @@ class Workspace(Document): def on_trash(self): if self.public and not is_workspace_manager(): frappe.throw(_("You need to be Workspace Manager to delete a public workspace.")) + self.delete_from_my_workspaces() + + def delete_from_my_workspaces(self): + if not self.public: + my_workspaces = frappe.get_doc("Workspace Sidebar", "My Workspaces") + for w in my_workspaces.items: + if self.name == w.link_to: + frappe.delete_doc("Workspace Sidebar Item", w.name) def after_delete(self): if disable_saving_as_public():