Skip to content

Commit

Permalink
Merge branch 'main' into EW-1060
Browse files Browse the repository at this point in the history
  • Loading branch information
Fshmit authored Nov 22, 2024
2 parents d325a89 + ab393d6 commit 08ef9af
Show file tree
Hide file tree
Showing 26 changed files with 253 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ describe("CollaborativeTextEditorElement", () => {
[BOARD_IS_LIST_LAYOUT as symbol]: isListBoard,
},
},
propsData: { isEditMode, element },
propsData: {
isEditMode,
element,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
},
});

const windowMock = createMock<Window>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<template #menu>
<CollaborativeTextEditorElementMenu
v-if="isEditMode"
:column-index="columnIndex"
:row-index="rowIndex"
:element-index="elementIndex"
@move-down:element="onMoveDown"
@move-up:element="onMoveUp"
@delete:element="onDelete"
Expand Down Expand Up @@ -59,6 +62,9 @@ const props = defineProps({
required: true,
},
isEditMode: { type: Boolean, required: true },
columnIndex: { type: Number, required: true },
rowIndex: { type: Number, required: true },
elementIndex: { type: Number, required: true },
});
const emit = defineEmits([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ describe("CollaborativeTextEditorElementMenu", () => {
isFirstElement: boolean;
isLastElement: boolean;
hasMultipleElements: boolean;
columnIndex: number;
rowIndex: number;
elementIndex: number;
}) => {
document.body.setAttribute("data-app", "true");

Expand Down Expand Up @@ -60,6 +63,9 @@ describe("CollaborativeTextEditorElementMenu", () => {
hasMultipleElements: true,
isFirstElement: false,
isLastElement: false,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<BoardMenu
:scope="BoardMenuScope.COLLABORATIVE_TEXT_EDITOR_ELEMENT"
has-background
:data-testid="`element-menu-button-${columnIndex}-${rowIndex}-${elementIndex}`"
>
<BoardMenuActionMoveUp @click="onMoveUp" />
<BoardMenuActionMoveDown @click="onMoveDown" />
Expand All @@ -18,6 +19,12 @@ import {
BoardMenuScope,
} from "@ui-board";
defineProps({
columnIndex: { type: Number, required: true },
rowIndex: { type: Number, required: true },
elementIndex: { type: Number, required: true },
});
const emit = defineEmits<{
(e: "delete:element"): void;
(e: "move-down:element"): void;
Expand Down
18 changes: 18 additions & 0 deletions src/modules/feature/board-deleted-element/DeletedElement.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ describe("DeletedElement", () => {
props: ComponentProps<typeof DeletedElement> = {
element: deletedElementResponseFactory.build(),
isEditMode: false,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
}
) => {
const wrapper = mount(DeletedElement, {
Expand All @@ -66,6 +69,9 @@ describe("DeletedElement", () => {
const { wrapper } = getWrapper({
element: deletedElementResponseFactory.build(),
isEditMode: true,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

return {
Expand All @@ -88,6 +94,9 @@ describe("DeletedElement", () => {
const { wrapper } = getWrapper({
element: deletedElementResponseFactory.build(),
isEditMode: true,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

return {
Expand All @@ -109,6 +118,9 @@ describe("DeletedElement", () => {
const { wrapper } = getWrapper({
element: deletedElementResponseFactory.build(),
isEditMode: false,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

return {
Expand All @@ -131,6 +143,9 @@ describe("DeletedElement", () => {
const { wrapper } = getWrapper({
element: deletedElement,
isEditMode: true,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

return {
Expand Down Expand Up @@ -158,6 +173,9 @@ describe("DeletedElement", () => {
const { wrapper } = getWrapper({
element: deletedElementResponseFactory.build(),
isEditMode: true,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

return {
Expand Down
6 changes: 6 additions & 0 deletions src/modules/feature/board-deleted-element/DeletedElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<template #menu>
<DeletedElementMenu
v-if="isEditMode"
:column-index="columnIndex"
:row-index="rowIndex"
:element-index="elementIndex"
@delete:element="onDeleteElement"
/>
</template>
Expand All @@ -51,6 +54,9 @@ const props = defineProps({
required: true,
},
isEditMode: { type: Boolean, required: true },
columnIndex: { type: Number, required: true },
rowIndex: { type: Number, required: true },
elementIndex: { type: Number, required: true },
});
const emit = defineEmits<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<BoardMenu
:scope="BoardMenuScope.DELETED_ELEMENT"
has-background
data-testid="deleted-element-menu-btn"
:data-testid="`element-menu-button-${columnIndex}-${rowIndex}-${elementIndex}`"
>
<BoardMenuActionDelete @click="onDelete" />
</BoardMenu>
Expand All @@ -11,6 +11,12 @@
<script setup lang="ts">
import { BoardMenu, BoardMenuActionDelete, BoardMenuScope } from "@ui-board";
defineProps({
columnIndex: { type: Number, required: true },
rowIndex: { type: Number, required: true },
elementIndex: { type: Number, required: true },
});
const emit = defineEmits<{
(e: "delete:element"): void;
}>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ describe("DrawingContentElement", () => {
const setup = (props: {
element: DrawingElementResponse;
isEditMode: boolean;
columnIndex: number;
rowIndex: number;
elementIndex: number;
}) => {
const wrapper = shallowMount(DrawingContentElement, {
global: {
Expand All @@ -66,6 +69,9 @@ describe("DrawingContentElement", () => {
const { wrapper } = setup({
element: DRAWING_ELEMENT,
isEditMode: false,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});
expect(wrapper.findComponent(InnerContent).exists()).toBe(true);
});
Expand All @@ -74,6 +80,9 @@ describe("DrawingContentElement", () => {
const { wrapper } = setup({
element: DRAWING_ELEMENT,
isEditMode: false,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

const elementCard = wrapper.findComponent({
Expand All @@ -90,6 +99,9 @@ describe("DrawingContentElement", () => {
const { wrapper } = setup({
element: DRAWING_ELEMENT,
isEditMode: false,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

const elementCard = wrapper.findComponent({
Expand All @@ -108,6 +120,9 @@ describe("DrawingContentElement", () => {
const { wrapper } = setup({
element: DRAWING_ELEMENT,
isEditMode: false,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

const elementCard = wrapper.findComponent({
Expand All @@ -124,6 +139,9 @@ describe("DrawingContentElement", () => {
const { wrapper } = setup({
element: DRAWING_ELEMENT,
isEditMode: false,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

const elementMenu = wrapper.findComponent(BoardMenu);
Expand All @@ -139,6 +157,9 @@ describe("DrawingContentElement", () => {
const { wrapper } = setup({
element: DRAWING_ELEMENT,
isEditMode: true,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

const elementCard = wrapper.findComponent({
Expand All @@ -155,6 +176,9 @@ describe("DrawingContentElement", () => {
const { wrapper } = setup({
element: DRAWING_ELEMENT,
isEditMode: true,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

const elementMenu = wrapper.findComponent(BoardMenu);
Expand All @@ -166,6 +190,9 @@ describe("DrawingContentElement", () => {
const { wrapper } = setup({
element: DRAWING_ELEMENT,
isEditMode: true,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

const menuItem = wrapper.findComponent(BoardMenuActionDelete);
Expand All @@ -179,6 +206,9 @@ describe("DrawingContentElement", () => {
const { wrapper } = setup({
element: DRAWING_ELEMENT,
isEditMode: true,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

const menuItem = wrapper.findComponent(BoardMenuActionMoveUp);
Expand All @@ -192,6 +222,9 @@ describe("DrawingContentElement", () => {
const { wrapper } = setup({
element: DRAWING_ELEMENT,
isEditMode: true,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

const menuItem = wrapper.findComponent(BoardMenuActionMoveDown);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
<div class="drawing-element-content">
<InnerContent :docName="element.id">
<template v-if="isEditMode">
<BoardMenu :scope="BoardMenuScope.DRAWING_ELEMENT" has-background>
<BoardMenu
:scope="BoardMenuScope.DRAWING_ELEMENT"
has-background
:data-testid="`element-menu-button-${columnIndex}-${rowIndex}-${elementIndex}`"
>
<BoardMenuActionMoveUp @click="onMoveDrawingElementEditUp" />
<BoardMenuActionMoveDown @click="onMoveDrawingElementEditDown" />
<BoardMenuActionDelete @click="onDeleteElement" />
Expand Down Expand Up @@ -46,6 +50,9 @@ const props = defineProps({
required: true,
},
isEditMode: { type: Boolean, required: true },
columnIndex: { type: Number, required: true },
rowIndex: { type: Number, required: true },
elementIndex: { type: Number, required: true },
});
const emit = defineEmits([
"delete:element",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ describe("ExternalToolElement", () => {
isLastElement: false,
hasMultipleElements: false,
cardId: "cardId",
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
...propsData,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
v-if="isEditMode"
ref="externalToolElementMenu"
:display-name="displayData?.name"
:column-index="columnIndex"
:row-index="rowIndex"
:element-index="elementIndex"
@move-down:element="onMoveElementDown"
@move-up:element="onMoveElementUp"
@delete:element="onDeleteElement"
Expand Down Expand Up @@ -86,6 +89,9 @@ const props = defineProps({
required: true,
},
isEditMode: { type: Boolean, required: true },
columnIndex: { type: Number, required: true },
rowIndex: { type: Number, required: true },
elementIndex: { type: Number, required: true },
});
const emit = defineEmits<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ describe("ExternalToolElementMenu", () => {
isFirstElement: boolean;
isLastElement: boolean;
hasMultipleElements: boolean;
columnIndex: number;
rowIndex: number;
elementIndex: number;
}) => {
document.body.setAttribute("data-app", "true");

Expand All @@ -36,6 +39,9 @@ describe("ExternalToolElementMenu", () => {
hasMultipleElements: true,
isFirstElement: false,
isLastElement: false,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

return {
Expand Down Expand Up @@ -68,6 +74,9 @@ describe("ExternalToolElementMenu", () => {
hasMultipleElements: true,
isFirstElement: false,
isLastElement: false,
columnIndex: 0,
rowIndex: 1,
elementIndex: 2,
});

return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<BoardMenu :scope="BoardMenuScope.EXTERNAL_TOOL_ELEMENT" has-background>
<BoardMenu
:scope="BoardMenuScope.EXTERNAL_TOOL_ELEMENT"
has-background
:data-testid="`element-menu-button-${columnIndex}-${rowIndex}-${elementIndex}`"
>
<BoardMenuActionMoveUp @click="onMoveUp" />
<BoardMenuActionMoveDown @click="onMoveDown" />
<BoardMenuAction :icon="mdiCogOutline" @click="onEdit">
Expand Down Expand Up @@ -43,6 +47,9 @@ export default defineComponent({
displayName: {
type: String,
},
columnIndex: { type: Number, required: true },
rowIndex: { type: Number, required: true },
elementIndex: { type: Number, required: true },
},
emits: [
"edit:element",
Expand Down
Loading

0 comments on commit 08ef9af

Please sign in to comment.