diff --git a/frontend/components/MainNav.vue b/frontend/components/MainNav.vue index 2a8d034..a857111 100644 --- a/frontend/components/MainNav.vue +++ b/frontend/components/MainNav.vue @@ -80,11 +80,6 @@ const links = computed(() => { to: "/communication/chat", icon: "i-heroicons-chat-bubble-left-right" }, - { - label: "Matrix-Setup", - to: "/communication", - icon: "i-heroicons-cog-6-tooth" - }, featureEnabled("helpdesk") ? { label: "Helpdesk", to: "/helpdesk", @@ -332,6 +327,11 @@ const links = computed(() => { to: "/settings/tenant", icon: "i-heroicons-building-office", } : null, + { + label: "Matrix-Setup", + to: "/communication", + icon: "i-heroicons-chat-bubble-left-right", + }, featureEnabled("export") ? { label: "Export", to: "/export", diff --git a/frontend/pages/communication/chat.vue b/frontend/pages/communication/chat.vue index 8ad0ae6..f9eb212 100644 --- a/frontend/pages/communication/chat.vue +++ b/frontend/pages/communication/chat.vue @@ -112,6 +112,10 @@ const roomCreateKeyPreview = computed(() => normalizeRoomKey(roomCreateForm.value.key || roomCreateForm.value.name) ) +const sortRoomsByName = (roomList) => [...roomList].sort((first, second) => + String(first.name || "").localeCompare(String(second.name || ""), "de", { sensitivity: "base" }) +) + const rooms = computed(() => { const baseRooms = matrixRooms.value .filter((room) => !["project", "direct"].includes(room.type)) @@ -138,9 +142,31 @@ const rooms = computed(() => { provisionEndpoint: `/api/communication/matrix/direct-rooms/${encodeURIComponent(room.userId)}/provision` })) - return [...baseRooms, ...projectRooms, ...directRooms] + return [ + ...sortRoomsByName(baseRooms), + ...sortRoomsByName(projectRooms), + ...sortRoomsByName(directRooms) + ] }) +const groupedRooms = computed(() => [ + { + key: "rooms", + label: "Räume", + rooms: rooms.value.filter((room) => room.group === "Räume") + }, + { + key: "projects", + label: "Projekte", + rooms: rooms.value.filter((room) => room.group === "Projekte") + }, + { + key: "direct", + label: "Direktnachrichten", + rooms: rooms.value.filter((room) => room.group === "Direkt") + } +].filter((group) => group.rooms.length > 0)) + const normalizeRoomKey = (value) => { const normalized = String(value || "") .toLowerCase() @@ -919,63 +945,63 @@ onBeforeUnmount(() => { -