Skip to content

Commit

Permalink
Merge branch 'main' into N21-2320-link-board-card
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/modules/feature/board/card/CardHost.unit.ts
#	src/modules/feature/board/card/CardHost.vue
#	src/modules/ui/board/index.ts
  • Loading branch information
MarvinOehlerkingCap committed Jan 17, 2025
2 parents 5074d88 + 0c3ced2 commit 422aa6f
Show file tree
Hide file tree
Showing 105 changed files with 2,686 additions and 2,847 deletions.
3 changes: 3 additions & 0 deletions config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ module.exports = {
"@ui-skip-link": getDir("src/modules/ui/skip-link"),
"@ui-speed-dial-menu": getDir("src/modules/ui/speed-dial-menu"),
"@ui-qr-code": getDir("src/modules/ui/qr-code"),
"@ui-video-conference-configuration-dialog": getDir(
"src/modules/ui/video-conference-configuration-dialog"
),
"@util-board": getDir("src/modules/util/board"),
"@util-validators": getDir("src/modules/util/validators"),
"@util-vue": getDir("src/modules/util/vue"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { computed, ComputedRef, PropType, Ref, ref } from "vue";
const props = defineProps({
configId: String,
contextId: {
type: String,
type: [String, null],
required: true,
},
contextType: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/icons/material/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ import {
mdiTune,
mdiUndo,
mdiUndoVariant,
mdiVideo,
mdiVideoOutline,
mdiViewAgendaOutline,
mdiViewDashboard,
mdiViewDashboardOutline,
Expand Down Expand Up @@ -283,7 +283,7 @@ export {
mdiTune,
mdiUndo,
mdiUndoVariant,
mdiVideo,
mdiVideoOutline,
mdiViewAgendaOutline,
mdiViewDashboard,
mdiViewDashboardOutline,
Expand Down
6 changes: 3 additions & 3 deletions src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1571,11 +1571,11 @@ export default {
"pages.common.tools.configureVideoconferenceDialog.title":
"Videokonferenz erstellen",
"pages.common.tools.configureVideoconferenceDialog.text.allModeratorPermission":
"Alle Nutzer:innen nehmen als Moderator:in teil",
"Moderationsrechte für alle Teilnehmenden",
"pages.common.tools.configureVideoconferenceDialog.text.mute":
"Teilnehmer:innen beim Betreten stummschalten",
"Teilnehmende beim Betreten stummschalten",
"pages.common.tools.configureVideoconferenceDialog.text.waitingRoom":
"Freigabe durch Moderator:in, bevor der Raum betreten werden kann",
"Warteraum für Teilnehmende aktivieren",
"pages.content._id.addToTopic": "Hinzufügen zu",
"pages.content._id.collection.selectElements":
"Wählen Sie die Elemente, die Sie zum Thema hinzufügen möchten",
Expand Down
6 changes: 3 additions & 3 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1548,11 +1548,11 @@ export default {
"pages.common.tools.configureVideoconferenceDialog.title":
"Create video conference",
"pages.common.tools.configureVideoconferenceDialog.text.allModeratorPermission":
"All users participate as moderators",
"Moderation rights for all participants",
"pages.common.tools.configureVideoconferenceDialog.text.mute":
"Mute participants when entering",
"Mute participants on entering",
"pages.common.tools.configureVideoconferenceDialog.text.waitingRoom":
"Approval by the moderator before the room can be entered",
"Activate waiting room for participants",
"pages.content._id.addToTopic": "To be added to",
"pages.content._id.collection.selectElements":
"Select the items you want to add to the topic",
Expand Down
6 changes: 3 additions & 3 deletions src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1594,11 +1594,11 @@ export default {
"pages.common.tools.configureVideoconferenceDialog.title":
"Crear videoconferencia",
"pages.common.tools.configureVideoconferenceDialog.text.allModeratorPermission":
"Todas las usuarias participan como moderadoras",
"Derechos de moderación para todos los participantes",
"pages.common.tools.configureVideoconferenceDialog.text.mute":
"Silenciar a las participantes al entrar",
"Silenciar a los participantes al entrar",
"pages.common.tools.configureVideoconferenceDialog.text.waitingRoom":
"Aprobación del moderador antes de poder ingresar a la sala",
"Activar la sala de espera para los participantes",
"pages.content._id.addToTopic": "Para ser añadido a",
"pages.content._id.collection.selectElements":
"Selecciona los elementos que deses añadir al tema",
Expand Down
6 changes: 3 additions & 3 deletions src/locales/uk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1578,11 +1578,11 @@ export default {
"pages.common.tools.configureVideoconferenceDialog.title":
"Створити відеоконференцію",
"pages.common.tools.configureVideoconferenceDialog.text.allModeratorPermission":
"Усі користувачі беруть участь як модератори",
"Права модерації для всіх учасників",
"pages.common.tools.configureVideoconferenceDialog.text.mute":
"Вимкнення звуку учасників при вході",
"Вимкнути звук учасникам при вході",
"pages.common.tools.configureVideoconferenceDialog.text.waitingRoom":
"Схвалення модератором перед входом до кімнати",
"Активуйте кімнату очікування для учасників",
"pages.content._id.addToTopic": "Для додавання в",
"pages.content._id.collection.selectElements":
"Виберіть елементи, які треба додати до теми",
Expand Down
11 changes: 9 additions & 2 deletions src/modules/data/board/Board.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { applicationErrorModule, envConfigModule } from "@/store";
import { Board } from "@/types/board/Board";
import { useSharedEditMode } from "@util-board";
import { defineStore } from "pinia";
import { nextTick, ref } from "vue";
import { computed, nextTick, ref } from "vue";
import {
CreateCardRequestPayload,
CreateCardSuccessPayload,
Expand All @@ -12,7 +12,6 @@ import {
DeleteBoardSuccessPayload,
DeleteColumnRequestPayload,
DeleteColumnSuccessPayload,
DisconnectSocketRequestPayload,
FetchBoardRequestPayload,
FetchBoardSuccessPayload,
MoveCardRequestPayload,
Expand All @@ -35,6 +34,7 @@ import { createApplicationError } from "@/utils/create-application-error.factory
import { HttpStatusCode } from "@/store/types/http-status-code.enum";
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
import { BoardFeature } from "@/serverApi/v3";

export const useBoardStore = defineStore("boardStore", () => {
const cardStore = useCardStore();
Expand Down Expand Up @@ -364,12 +364,19 @@ export const useBoardStore = defineStore("boardStore", () => {
: board.value.columns[columnIndex - 1].id;
};

const getFeatures = computed((): BoardFeature[] | [] => {
if (!board.value) return [];

return board.value.features;
});

return {
board,
isLoading,
getCardLocation,
getColumnIndex,
getColumnId,
getFeatures,
getLastColumnIndex,
setBoard,
setLoading,
Expand Down
111 changes: 86 additions & 25 deletions src/modules/data/board/BoardApi.composable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,23 @@ import {
CourseRoomsApiFactory,
CreateCardBodyParamsRequiredEmptyElementsEnum,
CreateContentElementBodyParams,
DrawingElementContent,
DrawingElementContentBody,
DrawingElementResponse,
ExternalToolContentBody,
ExternalToolElementContentBody,
ExternalToolElementResponse,
FileElementContentBody,
FileElementResponse,
LinkContentBody,
LinkElementContentBody,
LinkElementResponse,
RichTextElementContentBody,
RichTextElementResponse,
RoomApiFactory,
SubmissionContainerElementContentBody,
SubmissionContainerElementResponse,
VideoConferenceElementContentBody,
VideoConferenceElementResponse,
} from "@/serverApi/v3";
import { BoardContextType } from "@/types/board/BoardContext";
import { AnyContentElement } from "@/types/board/ContentElement";
Expand Down Expand Up @@ -84,54 +93,106 @@ export const useBoardApi = () => {
};

const generateDataProp = (element: AnyContentElement) => {
if (element.type === ContentElementType.RichText) {
return {
const isRichTextElement = (
element: AnyContentElement
): element is RichTextElementResponse => {
return element.type === ContentElementType.RichText;
};

if (isRichTextElement(element)) {
const body: RichTextElementContentBody = {
content: element.content,
type: element.type,
} as RichTextElementContentBody;
type: ContentElementType.RichText,
};
return body;
}

if (element.type === ContentElementType.File) {
return {
const isFileElement = (
element: AnyContentElement
): element is FileElementResponse => {
return element.type === ContentElementType.File;
};

if (isFileElement(element)) {
const body: FileElementContentBody = {
content: element.content,
type: ContentElementType.File,
} as FileElementContentBody;
};
return body;
}

if (element.type === ContentElementType.SubmissionContainer) {
return {
const isSubmissionContainerElement = (
element: AnyContentElement
): element is SubmissionContainerElementResponse => {
return element.type === ContentElementType.SubmissionContainer;
};

if (isSubmissionContainerElement(element)) {
const body: SubmissionContainerElementContentBody = {
content: element.content,
type: ContentElementType.SubmissionContainer,
} as SubmissionContainerElementContentBody;
};
return body;
}

if (element.type === ContentElementType.Link) {
return {
content: element.content,
const isLinkElement = (
element: AnyContentElement
): element is LinkElementResponse => {
return element.type === ContentElementType.Link;
};

if (isLinkElement(element)) {
const body: LinkElementContentBody = {
// LinkElementContent is not type equal with LinkContentBody
content: element.content as LinkContentBody,
type: ContentElementType.Link,
} as LinkElementContentBody;
};
return body;
}

if (element.type === ContentElementType.ExternalTool) {
return {
content: element.content,
const isExternalToolElement = (
element: AnyContentElement
): element is ExternalToolElementResponse => {
return element.type === ContentElementType.ExternalTool;
};

if (isExternalToolElement(element)) {
const body: ExternalToolElementContentBody = {
// ExternalToolElementContent is not type equal with ExternalToolContentBody
content: element.content as ExternalToolContentBody,
type: ContentElementType.ExternalTool,
} as ExternalToolElementContentBody;
};
return body;
}

if (element.type === ContentElementType.Drawing) {
return {
content: element.content as DrawingElementContent,
const isDrawingElement = (
element: AnyContentElement
): element is DrawingElementResponse => {
return element.type === ContentElementType.Drawing;
};

if (isDrawingElement(element)) {
const body: DrawingElementContentBody = {
content: element.content,
type: ContentElementType.Drawing,
};
return body;
}

if (element.type === ContentElementType.VideoConference) {
return {
const isVideoConferenceElement = (
element: AnyContentElement
): element is VideoConferenceElementResponse => {
return element.type === ContentElementType.VideoConference;
};

if (isVideoConferenceElement(element)) {
const body: VideoConferenceElementContentBody = {
content: element.content,
type: ContentElementType.VideoConference,
} as VideoConferenceElementContentBody;
};
return body;
}

throw new Error("element.type mapping is undefined for updateElementCall");
};

Expand Down
16 changes: 16 additions & 0 deletions src/modules/data/board/BoardFeatures.composable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { BoardFeature } from "@/serverApi/v3";
import { useBoardStore } from "@data-board";

export const useBoardFeatures = () => {
const { getFeatures } = useBoardStore();

const features: BoardFeature[] = getFeatures;

const isFeatureEnabled = (feature: BoardFeature) => {
return features.includes(feature);
};

return {
isFeatureEnabled,
};
};
2 changes: 2 additions & 0 deletions src/modules/data/board/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useBoardStore } from "./Board.store";
import * as boardActions from "./boardActions/boardActions";
import { useBoardFeatures } from "./BoardFeatures.composable";
import { useBoardFocusHandler } from "./BoardFocusHandler.composable";
import { useBoardInactivity } from "./boardInactivity.composable";
import { useSharedBoardPageInformation } from "./BoardPageInformation.composable";
Expand All @@ -14,6 +15,7 @@ export {
boardActions,
cardActions,
useBoardStore,
useBoardFeatures,
useBoardFocusHandler,
useBoardInactivity,
useBoardPermissions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
<v-img :src="image" alt="" cover />
</template>
<template #title>
{{ $t("components.cardElement.collaborativeTextEditorElement") }}
{{ t("components.cardElement.collaborativeTextEditorElement") }}
</template>
<template #menu>
<CollaborativeTextEditorElementMenu
v-if="isEditMode"
:column-index="columnIndex"
:is-not-first-element="isNotFirstElement"
:is-not-last-element="isNotLastElement"
:row-index="rowIndex"
:element-index="elementIndex"
@move-down:element="onMoveDown"
Expand Down Expand Up @@ -62,6 +64,8 @@ const props = defineProps({
required: true,
},
isEditMode: { type: Boolean, required: true },
isNotFirstElement: { type: Boolean, requried: false },
isNotLastElement: { type: Boolean, requried: false },
columnIndex: { type: Number, required: true },
rowIndex: { type: Number, required: true },
elementIndex: { type: Number, required: true },
Expand Down
Loading

0 comments on commit 422aa6f

Please sign in to comment.