From 6178f20330179074d1df5a93deec57669aa3e26c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marvin=20=C3=96hlerking?=
<103562092+MarvinOehlerkingCap@users.noreply.github.com>
Date: Thu, 22 Aug 2024 10:25:38 +0200
Subject: [PATCH] N21-2031 Placeholder element for deleted tools in boards
(#3363)
---
config/webpack/webpack.common.js | 3 +
.../ExternalToolSelectionRow.vue | 2 +-
src/locales/de.ts | 3 +
src/locales/en.ts | 3 +
src/locales/es.ts | 4 +
src/locales/uk.ts | 3 +
.../DeletedElement.unit.ts | 188 ++++++++++
.../board-deleted-element/DeletedElement.vue | 71 ++++
.../DeletedElementMenu.unit.ts | 47 +++
.../DeletedElementMenu.vue | 20 ++
.../feature/board-deleted-element/index.ts | 3 +
src/modules/feature/board/card/CardHost.vue | 8 +-
.../board/card/ContentElementList.unit.ts | 5 +
.../feature/board/card/ContentElementList.vue | 326 ++++++++----------
src/modules/ui/board/BoardMenu.vue | 7 +-
src/modules/ui/board/board-menu-scope.ts | 3 +-
src/serverApi/v3/api.ts | 67 +++-
tsconfig.json | 1 +
18 files changed, 573 insertions(+), 191 deletions(-)
create mode 100644 src/modules/feature/board-deleted-element/DeletedElement.unit.ts
create mode 100644 src/modules/feature/board-deleted-element/DeletedElement.vue
create mode 100644 src/modules/feature/board-deleted-element/DeletedElementMenu.unit.ts
create mode 100644 src/modules/feature/board-deleted-element/DeletedElementMenu.vue
create mode 100644 src/modules/feature/board-deleted-element/index.ts
diff --git a/config/webpack/webpack.common.js b/config/webpack/webpack.common.js
index 3aa8238d8d..72f1228b4c 100644
--- a/config/webpack/webpack.common.js
+++ b/config/webpack/webpack.common.js
@@ -144,6 +144,9 @@ module.exports = {
"@feature-board-collaborative-text-editor-element": getDir(
"src/modules/feature/board-collaborative-text-editor-element"
),
+ "@feature-board-deleted-element": getDir(
+ "src/modules/feature/board-deleted-element"
+ ),
"@feature-course-sync": getDir("src/modules/feature/course-sync"),
"@feature-board": getDir("src/modules/feature/board"),
"@feature-editor": getDir("src/modules/feature/editor"),
diff --git a/src/components/external-tools/configuration/ExternalToolSelectionRow.vue b/src/components/external-tools/configuration/ExternalToolSelectionRow.vue
index 2b2674d381..845d18aaf4 100644
--- a/src/components/external-tools/configuration/ExternalToolSelectionRow.vue
+++ b/src/components/external-tools/configuration/ExternalToolSelectionRow.vue
@@ -16,7 +16,7 @@
diff --git a/src/modules/feature/board-deleted-element/DeletedElementMenu.unit.ts b/src/modules/feature/board-deleted-element/DeletedElementMenu.unit.ts
new file mode 100644
index 0000000000..899868624b
--- /dev/null
+++ b/src/modules/feature/board-deleted-element/DeletedElementMenu.unit.ts
@@ -0,0 +1,47 @@
+import {
+ createTestingI18n,
+ createTestingVuetify,
+} from "@@/tests/test-utils/setup";
+import { BoardMenuActionDelete } from "@ui-board";
+import { shallowMount } from "@vue/test-utils";
+import DeletedElementMenu from "./DeletedElementMenu.vue";
+
+describe("DeletedElementMenu", () => {
+ const getWrapper = () => {
+ document.body.setAttribute("data-app", "true");
+
+ const wrapper = shallowMount(DeletedElementMenu, {
+ global: {
+ plugins: [createTestingVuetify(), createTestingI18n()],
+ },
+ });
+
+ return {
+ wrapper,
+ };
+ };
+
+ afterEach(() => {
+ jest.resetAllMocks();
+ });
+
+ describe("Delete Button", () => {
+ it("should have a menu option to delete", () => {
+ const { wrapper } = getWrapper();
+
+ const menuItem = wrapper.findComponent(BoardMenuActionDelete);
+
+ expect(menuItem.exists()).toEqual(true);
+ });
+
+ it("should emit the delete event on click", async () => {
+ const { wrapper } = getWrapper();
+
+ const menuItem = wrapper.findComponent(BoardMenuActionDelete);
+
+ await menuItem.trigger("click");
+
+ expect(wrapper.emitted("delete:element")).toBeDefined();
+ });
+ });
+});
diff --git a/src/modules/feature/board-deleted-element/DeletedElementMenu.vue b/src/modules/feature/board-deleted-element/DeletedElementMenu.vue
new file mode 100644
index 0000000000..6fb2174569
--- /dev/null
+++ b/src/modules/feature/board-deleted-element/DeletedElementMenu.vue
@@ -0,0 +1,20 @@
+
+