Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N21-2072 Prevent reload when navigating to media shelf from sidebar #3320

Merged
merged 7 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading