Skip to content

Commit

Permalink
N21-2072 Prevent reload when navigating to media shelf from sidebar (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinOehlerkingCap committed Jul 11, 2024
1 parent 6c1cff0 commit 6d935f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/modules/ui/layout/sidebar/SidebarItems.composable.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { SchulcloudTheme } from "@/serverApi/v3";
import {
ENV_CONFIG_MODULE_KEY,
FILE_PATHS_MODULE_KEY,
injectStrict,
} from "@/utils/inject";
import { SidebarGroupItem, SidebarItems, SidebarSingleItem } from "../types";
import { SchulcloudTheme } from "@/serverApi/v3";
import { ComputedRef, computed } from "vue";
import { mdiBookshelf } from "@mdi/js";
import { computed, ComputedRef } from "vue";
import { useI18n } from "vue-i18n";
import { SidebarGroupItem, SidebarItems, SidebarSingleItem } from "../types";

export const useSidebarItems = () => {
const envConfigModule = injectStrict(ENV_CONFIG_MODULE_KEY);
Expand Down Expand Up @@ -90,7 +90,7 @@ export const useSidebarItems = () => {
},
{
title: "feature.media-shelf.title",
href: "/media-shelf",
to: "/media-shelf",
icon: mdiBookshelf,
feature: "FEATURE_MEDIA_SHELF_ENABLED",
testId: "Media-shelf",
Expand Down Expand Up @@ -209,7 +209,7 @@ export const useSidebarItems = () => {
},
{
title: "global.sidebar.item.classes",
href: "/administration/groups/classes",
to: "/administration/groups/classes",
testId: "Klassen",
permissions: ["ADMIN_VIEW", "TEACHER_LIST"],
feature: "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED",
Expand Down
9 changes: 6 additions & 3 deletions src/utils/sidebar-base-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export type SidebarCategoryItem = SidebarItem & {

export type SidebarItemList = (SidebarItem | SidebarCategoryItem)[];

/**
* @deprecated use useSidebarItems composable
*/
const getSidebarItems = (): SidebarItemList => [
{
title: "global.sidebar.item.overview",
Expand Down Expand Up @@ -134,7 +137,7 @@ const getSidebarItems = (): SidebarItemList => [
},
{
title: "feature.media-shelf.title",
href: "/media-shelf",
to: "/media-shelf",
icon: mdiBookshelf,
testId: "Media-shelf",
activeForUrls: ["^/media-shelf($|/.*)"],
Expand Down Expand Up @@ -175,7 +178,7 @@ const getSidebarItems = (): SidebarItemList => [
{
title: "global.sidebar.item.classes",
icon: "$class",
href: "/administration/groups/classes",
to: "/administration/groups/classes",
testId: "Klassen",
activeForUrls: ["^/administration/groups/classes($|/.*)"],
feature: "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED",
Expand Down Expand Up @@ -223,7 +226,7 @@ const getSidebarItems = (): SidebarItemList => [
{
title: "global.sidebar.item.classes",
icon: "$class",
href: "/administration/groups/classes",
to: "/administration/groups/classes",
testId: "Klassen",
activeForUrls: ["^/administration/groups/classes($|/.*)"],
feature: "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED",
Expand Down

0 comments on commit 6d935f6

Please sign in to comment.