diff --git a/src/modules/data/board/boardActions/boardActionPayload.ts b/src/modules/data/board/boardActions/boardActionPayload.ts index bc5a442f80..e56a553ddc 100644 --- a/src/modules/data/board/boardActions/boardActionPayload.ts +++ b/src/modules/data/board/boardActions/boardActionPayload.ts @@ -1,8 +1,14 @@ -import { BoardResponse, CardResponse, ColumnResponse } from "@/serverApi/v3"; +import { + BoardResponse, + CardResponse, + ColumnResponse, + CreateCardBodyParamsRequiredEmptyElementsEnum, +} from "@/serverApi/v3"; import { ColumnMove } from "@/types/board/DragAndDrop"; export type CreateCardRequestPayload = { columnId: string; + requiredEmptyElements?: CreateCardBodyParamsRequiredEmptyElementsEnum[]; }; export type CreateCardSuccessPayload = { newCard: CardResponse; diff --git a/src/modules/data/board/boardActions/boardSocketApi.composable.ts b/src/modules/data/board/boardActions/boardSocketApi.composable.ts index 1547f25a66..16eac25a8a 100644 --- a/src/modules/data/board/boardActions/boardSocketApi.composable.ts +++ b/src/modules/data/board/boardActions/boardSocketApi.composable.ts @@ -17,6 +17,7 @@ import { import { PermittedStoreActions, handle, on } from "@/types/board/ActionFactory"; import { useErrorHandler } from "@/components/error-handling/ErrorHandler.composable"; import { useBoardAriaNotification } from "../ariaNotification/ariaLiveNotificationHandler"; +import { CreateCardBodyParamsRequiredEmptyElementsEnum } from "@/serverApi/v3"; export const useBoardSocketApi = () => { const boardStore = useBoardStore(); @@ -102,7 +103,12 @@ export const useBoardSocketApi = () => { useSocketConnection(dispatch); const createCardRequest = async (payload: CreateCardRequestPayload) => { - emitOnSocket("create-card-request", payload); + emitOnSocket("create-card-request", { + ...payload, + requiredEmptyElements: [ + CreateCardBodyParamsRequiredEmptyElementsEnum.RichText, + ], + }); }; const fetchBoardRequest = async ( diff --git a/src/modules/data/board/boardActions/boardSocketApi.composable.unit.ts b/src/modules/data/board/boardActions/boardSocketApi.composable.unit.ts index 29b00b914b..dfa5d562e1 100644 --- a/src/modules/data/board/boardActions/boardSocketApi.composable.unit.ts +++ b/src/modules/data/board/boardActions/boardSocketApi.composable.unit.ts @@ -405,7 +405,7 @@ describe("useBoardSocketApi", () => { expect(mockedSocketConnectionHandler.emitOnSocket).toHaveBeenCalledWith( "create-card-request", - { columnId: "test" } + { columnId: "test", requiredEmptyElements: ["richText"] } ); }); }); diff --git a/src/modules/feature/board/card/CardHost.vue b/src/modules/feature/board/card/CardHost.vue index 3fd987e5cd..1eb6ffdc65 100644 --- a/src/modules/feature/board/card/CardHost.vue +++ b/src/modules/feature/board/card/CardHost.vue @@ -29,7 +29,7 @@ scope="card" @update:value="onUpdateCardTitle($event, cardId)" :isFocused="isFocusedById" - @enter="addTextAfterTitle" + @enter="onEnter" />