Skip to content

Commit

Permalink
Merge branch 'main' into BC-8147-eslint-flat-config
Browse files Browse the repository at this point in the history
  • Loading branch information
NFriedo authored Oct 23, 2024
2 parents 87040b5 + bca7ba5 commit 009d270
Show file tree
Hide file tree
Showing 52 changed files with 2,594 additions and 492 deletions.
222 changes: 105 additions & 117 deletions src/assets/img/NotFoundSvg.vue

Large diffs are not rendered by default.

76 changes: 52 additions & 24 deletions src/assets/img/PermissionErrorSvg.vue

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/components/icons/material/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import {
mdiMenu,
mdiMenuDown,
mdiMenuDownOutline,
mdiMenuUp,
mdiMenuOpen,
mdiMenuRight,
mdiMenuSwapOutline,
Expand Down Expand Up @@ -238,6 +239,7 @@ export {
mdiMenu,
mdiMenuDown,
mdiMenuDownOutline,
mdiMenuUp,
mdiMenuOpen,
mdiMenuRight,
mdiMenuSwapOutline,
Expand Down
15 changes: 15 additions & 0 deletions src/components/templates/DefaultWireframe.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,19 @@ describe("DefaultWireframe", () => {
const menu = wrapper.find(".menu");
expect(menu.text()).toBe("a custom menu or searchbar");
});

it("should emit 'fab:clicked' after click the fab button", async () => {
const wrapper = setup();
await wrapper.setProps({
fabItems: {
icon: "mdi-close",
title: "dummy title",
},
});

const fab = wrapper.findComponent({ name: "speed-dial-menu" });
await fab.vm.$emit("fab:clicked");

expect(wrapper.emitted("fab:clicked")).toHaveLength(1);
});
});
30 changes: 18 additions & 12 deletions src/components/templates/DefaultWireframe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Breadcrumbs v-if="breadcrumbs.length" :breadcrumbs="breadcrumbs" />
<div v-else class="breadcrumbs-placeholder" />
<slot name="header">
<h1 v-if="headline" class="text-h3 pl-2" :data-testid="dataTestid">
<h1 v-if="headline" class="text-h3" :data-testid="dataTestid">
{{ headline }}
</h1>
</slot>
Expand All @@ -29,6 +29,7 @@
:to="fabItems.to"
:aria-label="fabItems.ariaLabel"
:data-testid="fabItems.dataTestId"
@fab:clicked="onFabClicked"
>
{{ fabItems.title }}
<template #actions>
Expand All @@ -51,7 +52,7 @@
</speed-dial-menu>
</slot>
</div>
<div v-if="showBorder" class="border" />
<v-divider v-if="showDivider" class="mx-n6" />
</div>
<v-container
:fluid="maxWidth !== 'nativ'"
Expand Down Expand Up @@ -109,25 +110,29 @@ const props = defineProps({
},
});
defineEmits({
const emit = defineEmits({
onFabItemClick: (event: string) => (event ? true : false),
"fab:clicked": () => true,
});
const onFabClicked = () => {
emit("fab:clicked");
};
defineOptions({
inheritAttrs: false,
});
const slots = useSlots();
const isBelowLarge = useVuetifyBreakpoints().smallerOrEqual("lg");
const showBorder = computed(() => {
const showDivider = computed(() => {
return !props.hideBorder && !!(props.headline || slots.header);
});
</script>

<style lang="scss" scoped>
@import "@/styles/settings.scss";
.wireframe-container h1:first-of-type {
margin-bottom: var(--space-md);
}
Expand All @@ -138,14 +143,17 @@ const showBorder = computed(() => {
.wireframe-header {
padding: 0 var(--space-lg);
display: flex;
flex-direction: column;
}
:deep(.v-application__wrap) {
min-height: unset;
}
.main-content {
padding: 0 var(--space-lg);
padding: 0 var(--space-lg) var(--space-lg) var(--space-lg);
margin-top: var(--space-xl);
}
.container-short-width {
Expand All @@ -157,16 +165,14 @@ const showBorder = computed(() => {
margin: 0;
}
.border {
margin-right: calc(-1 * var(--space-lg));
margin-left: calc(-1 * var(--space-lg));
margin-bottom: var(--space-xl);
border-bottom: 2px solid rgba(0, 0, 0, 0.12);
.v-divider {
margin-right: -1.5rem;
margin-left: -1.5rem;
}
@media #{map-get($display-breakpoints, 'sm-and-up')} {
.breadcrumbs-placeholder {
height: 24px;
height: 22px;
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export default {
"common.words.learnContent": "Lerninhalte",
"common.words.export": "Kurs-Export wird heruntergeladen",
"common.words.lernstore": "Lern-Store",
"common.words.mainSchool": "Stammschule",
"common.words.no": "Nein",
"common.words.noChoice": "Keine Auswahl",
"common.words.otherGroups": "sonstige Gruppen",
Expand Down Expand Up @@ -342,6 +343,10 @@ export default {
"components.board.column.defaultTitle": "Neuer Abschnitt",
"components.board.column.ghost.column.placeholder": "Abschnitt hinzufügen",
"components.board.column.ghost.list.placeholder": "Abschnitt hinzufügen",
"components.board.error.404":
"Fehler 404 – Bereich mit diesem Namen wurde nicht gefunden",
"components.board.error.403":
"Fehler 403 – Leider fehlt die Berechtigung, diesen Inhalt zu sehen",
"components.board.menu.board": "Bereich-Einstellungen",
"components.board.menu.card": "Karten-Einstellungen",
"components.board.menu.column": "Abschnitt-Einstellungen",
Expand Down Expand Up @@ -1664,6 +1669,11 @@ export default {
"pages.rooms.title": "Räume",
"pages.rooms.fab.title": "Raum erstellen",
"pages.rooms.emptyState": "Aktuell gibt es hier noch keine Räume.",
"pages.rooms.participants.label": "Teilnehmende",
"pages.rooms.participants.addParticipants": "Teilnehmende hinzufügen",
"pages.rooms.participants.manageParticipants": "Teilnehmende verwalten",
"pages.rooms.participants.participantTable.itemsPerPage":
"Einträge pro Seite",
"pages.taskCard.addElement": "Element hinzufügen",
"pages.taskCard.deleteElement.text":
"Bist du dir sicher, dass du das Element löschen möchtest?",
Expand Down
9 changes: 9 additions & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export default {
"common.words.languages.uk": "Ukrainian",
"common.words.learnContent": "Learning content",
"common.words.lernstore": "Learning Store",
"common.words.mainSchool": "Main School",
"common.words.no": "No",
"common.words.noChoice": "No choice",
"common.words.otherGroups": "other groups",
Expand Down Expand Up @@ -340,6 +341,10 @@ export default {
"components.board.column.defaultTitle": "New column",
"components.board.column.ghost.column.placeholder": "Add column",
"components.board.column.ghost.list.placeholder": "Add section",
"components.board.error.404":
"Error 404 – Board with this name was not found",
"components.board.error.403":
"Error 403 – Unfortunately, you do not have permission to view this content",
"components.board.menu.board": "Board settings",
"components.board.menu.card": "Card settings",
"components.board.menu.column": "Column settings",
Expand Down Expand Up @@ -1636,6 +1641,10 @@ export default {
"pages.rooms.title": "Rooms",
"pages.rooms.fab.title": "Create room",
"pages.rooms.emptyState": "Currently there are no rooms here.",
"pages.rooms.participants.label": "Participants",
"pages.rooms.participants.addParticipants": "Add participants",
"pages.rooms.participants.manageParticipants": "Manage participants",
"pages.rooms.participants.participantTable.itemsPerPage": "Entries per page",
"pages.taskCard.addElement": "Add element",
"pages.taskCard.deleteElement.text":
"Are you sure, you want to remove this element?",
Expand Down
10 changes: 10 additions & 0 deletions src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export default {
"common.words.languages.uk": "Ucranio",
"common.words.learnContent": "Contenidos de aprendizaje",
"common.words.lernstore": "Lern-Store",
"common.words.mainSchool": "Escuela principal",
"common.words.no": "No",
"common.words.noChoice": "Sin elección",
"common.words.otherGroups": "otros grupos",
Expand Down Expand Up @@ -345,6 +346,10 @@ export default {
"components.board.column.defaultTitle": "Nueva columna",
"components.board.column.ghost.column.placeholder": "Añadir columna",
"components.board.column.ghost.list.placeholder": "Añadir sección",
"components.board.error.404":
"Error 404 – No se ha encontrado ningún tablero con este nombre",
"components.board.error.403":
"Error 403 – Lamentablemente, falta la autorización para ver este contenido",
"components.board.menu.board": "Configuración del tablero",
"components.board.menu.card": "Configuración de la tarjeta",
"components.board.menu.column": "Configuración del columna",
Expand Down Expand Up @@ -1680,6 +1685,11 @@ export default {
"pages.rooms.title": "Habitaciones",
"pages.rooms.fab.title": "Crear habitación",
"pages.rooms.emptyState": "Actualmente no hay habitaciones aquí.",
"pages.rooms.participants.label": "Participantes",
"pages.rooms.participants.addParticipants": "Añadir participantes",
"pages.rooms.participants.manageParticipants": "Administrar participantes",
"pages.rooms.participants.participantTable.itemsPerPage":
"Entradas por página",
"pages.taskCard.addElement": "Añadir artículo",
"pages.taskCard.deleteElement.text":
"¿Estás seguro de que deseas eliminar este elemento?",
Expand Down
10 changes: 10 additions & 0 deletions src/locales/uk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export default {
"common.words.languages.uk": "Українська",
"common.words.learnContent": "Зміст навчання",
"common.words.lernstore": "Навчальний магазин",
"common.words.mainSchool": "Основна школа",
"common.words.no": "Немає",
"common.words.noChoice": "Немає вибору",
"common.words.otherGroups": "інші групи",
Expand Down Expand Up @@ -346,6 +347,10 @@ export default {
"components.board.column.defaultTitle": "Нова колонка",
"components.board.column.ghost.column.placeholder": "Додати стовпець",
"components.board.column.ghost.list.placeholder": "Додати розділ",
"components.board.error.404":
"Помилка 404 – Дошки з такою назвою не знайдено",
"components.board.error.403":
"Помилка 403 – На жаль, у вас немає дозволу на перегляд цього контенту",
"components.board.menu.board": "Налаштування дошки",
"components.board.menu.card": "Налаштування картки",
"components.board.menu.column": "Налаштування колонки",
Expand Down Expand Up @@ -1658,6 +1663,11 @@ export default {
"pages.rooms.title": "Кімнати",
"pages.rooms.fab.title": "Створити кімнату",
"pages.rooms.emptyState": "Зараз тут немає кімнат",
"pages.rooms.participants.label": "Учасники",
"pages.rooms.participants.addParticipants": "Додайте учасників",
"pages.rooms.participants.manageParticipants": "Керувати учасниками",
"pages.rooms.participants.participantTable.itemsPerPage":
"Записи на сторінку",
"pages.taskCard.addElement": "Додати елемент",
"pages.taskCard.deleteElement.text":
"Ви впевнені, що хочете видалити цей елемент?",
Expand Down
38 changes: 37 additions & 1 deletion src/modules/data/board/Board.store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { envConfigModule } from "@/store";
import { applicationErrorModule, envConfigModule } from "@/store";
import { Board } from "@/types/board/Board";
import { useSharedEditMode } from "@util-board";
import { defineStore } from "pinia";
Expand All @@ -8,6 +8,8 @@ import {
CreateCardSuccessPayload,
CreateColumnRequestPayload,
CreateColumnSuccessPayload,
DeleteBoardRequestPayload,
DeleteBoardSuccessPayload,
DeleteColumnRequestPayload,
DeleteColumnSuccessPayload,
DisconnectSocketRequestPayload,
Expand All @@ -29,20 +31,28 @@ import { useBoardSocketApi } from "./boardActions/boardSocketApi.composable";
import { useBoardFocusHandler } from "./BoardFocusHandler.composable";
import { useCardStore } from "./Card.store";
import { DeleteCardSuccessPayload } from "./cardActions/cardActionPayload";
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";

export const useBoardStore = defineStore("boardStore", () => {
const cardStore = useCardStore();
const board = ref<Board | undefined>(undefined);
const isLoading = ref<boolean>(false);
const { setFocus, forceFocus } = useBoardFocusHandler();
const roomId = ref<string | undefined>(undefined);

const restApi = useBoardRestApi();
const isSocketEnabled =
envConfigModule.getEnv.FEATURE_COLUMN_BOARD_SOCKET_ENABLED;

const socketOrRest = isSocketEnabled ? useBoardSocketApi() : restApi;

const { t } = useI18n();

const { setEditModeId } = useSharedEditMode();
const router = useRouter();

const getLastColumnIndex = () => board.value!.columns.length - 1;

Expand Down Expand Up @@ -303,6 +313,30 @@ export const useBoardStore = defineStore("boardStore", () => {
setBoard(payload);
};

const deleteBoardRequest = async (
payload: DeleteBoardRequestPayload,
paramRoomId: string | undefined
) => {
if (paramRoomId) roomId.value = paramRoomId;
await socketOrRest.deleteBoardRequest(payload);
};

const deleteBoardSuccess = (payload: DeleteBoardSuccessPayload) => {
if (payload.isOwnAction === true) {
router.replace({
name: "rooms-id",
params: { id: roomId.value },
});
return;
}
applicationErrorModule.setError(
createApplicationError(
HttpStatusCode.NotFound,
t("components.board.error.404")
)
);
};

const reloadBoard = async () => {
if (!board.value) return;

Expand Down Expand Up @@ -343,6 +377,8 @@ export const useBoardStore = defineStore("boardStore", () => {
createCardSuccess,
createColumnRequest,
createColumnSuccess,
deleteBoardRequest,
deleteBoardSuccess,
deleteCardSuccess,
deleteColumnRequest,
deleteColumnSuccess,
Expand Down
Loading

0 comments on commit 009d270

Please sign in to comment.