From ef0eb1813695e130c40f2dd4cf20b3e503309b4a Mon Sep 17 00:00:00 2001 From: davwas Date: Mon, 29 Jan 2024 15:13:22 +0100 Subject: [PATCH] Revert "BC-4121 - Replace old with new school adminstration page (#2701)" (#3053) This reverts commit ddc94d8bc1813f0a052b18a548621738e5c5649d. --- src/layouts/legacyLoggedIn.vue | 4 ++- .../administration/LDAPActivate.page.vue | 6 ++-- src/pages/administration/LDAPConfig.page.vue | 6 ++-- .../administration/SchoolSettings.page.vue | 8 +++++ src/store/env-config.ts | 7 ++++ src/store/types/env-config.ts | 1 + src/utils/sidebar-base-items.ts | 32 ++++++++++++++----- 7 files changed, 51 insertions(+), 13 deletions(-) diff --git a/src/layouts/legacyLoggedIn.vue b/src/layouts/legacyLoggedIn.vue index 6bf0456f33..bfe0cb34ca 100644 --- a/src/layouts/legacyLoggedIn.vue +++ b/src/layouts/legacyLoggedIn.vue @@ -85,7 +85,9 @@ export default defineComponent({ }); const sidebarItems = computed(() => { - let sidebarItems = getSidebarItems(); + let sidebarItems = getSidebarItems( + envConfigModule.getNewSchoolAdminPageAsDefault + ); const isSidebarCategoryItem = ( item: SidebarItem | SidebarCategoryItem diff --git a/src/pages/administration/LDAPActivate.page.vue b/src/pages/administration/LDAPActivate.page.vue index c755cb6b4d..39a648ec40 100644 --- a/src/pages/administration/LDAPActivate.page.vue +++ b/src/pages/administration/LDAPActivate.page.vue @@ -259,7 +259,9 @@ export default { }, { text: this.$t("pages.administration.school.index.title"), - href: "/administration/school-settings", + href: envConfigModule.getNewSchoolAdminPageAsDefault + ? "/administration/school-settings" + : "/administration/school", }, { text: this.$t("pages.administration.ldap.index.title"), @@ -317,7 +319,7 @@ export default { }, okButtonHandler() { this.$router.push({ - path: `/administration/school-settings`, + path: `/administration/school`, }); }, }, diff --git a/src/pages/administration/LDAPConfig.page.vue b/src/pages/administration/LDAPConfig.page.vue index fb12cd81a5..fabeff57de 100644 --- a/src/pages/administration/LDAPConfig.page.vue +++ b/src/pages/administration/LDAPConfig.page.vue @@ -95,7 +95,7 @@ import ConnectionSection from "@/components/organisms/Ldap/LdapConnectionSection import UsersSection from "@/components/organisms/Ldap/LdapUsersSection.vue"; import ClassesSection from "@/components/organisms/Ldap/LdapClassesSection.vue"; import InfoMessage from "@/components/atoms/InfoMessage"; -import { notifierModule } from "@/store"; +import { notifierModule, envConfigModule } from "@/store"; import { buildPageTitle } from "@/utils/pageTitle"; export default { @@ -116,7 +116,9 @@ export default { }, { text: this.$t("pages.administration.school.index.title"), - href: "/administration/school-settings", + href: envConfigModule.getNewSchoolAdminPageAsDefault + ? "/administration/school-settings" + : "/administration/school", }, { text: this.$t("pages.administration.ldap.index.title"), diff --git a/src/pages/administration/SchoolSettings.page.vue b/src/pages/administration/SchoolSettings.page.vue index e00c8fae09..49772f3298 100644 --- a/src/pages/administration/SchoolSettings.page.vue +++ b/src/pages/administration/SchoolSettings.page.vue @@ -10,6 +10,14 @@
+ +
+ {{ t("pages.administration.school.index.back") }} + + {{ t("pages.administration.school.index.backLink") }}. +
+
{{ t("pages.administration.school.index.info", { instituteTitle }) }} diff --git a/src/store/env-config.ts b/src/store/env-config.ts index 6683da5fd6..4bf1013a4e 100644 --- a/src/store/env-config.ts +++ b/src/store/env-config.ts @@ -154,6 +154,13 @@ export default class EnvConfigModule extends VuexModule { return this.env.ACCESSIBILITY_REPORT_EMAIL; } + get getNewSchoolAdminPageAsDefault(): boolean { + return ( + this.env.FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED ?? + false + ); + } + get getCtlToolsTabEnabled(): boolean { return this.env.FEATURE_CTL_TOOLS_TAB_ENABLED ?? false; } diff --git a/src/store/types/env-config.ts b/src/store/types/env-config.ts index 70e146680f..2d6cbf7859 100644 --- a/src/store/types/env-config.ts +++ b/src/store/types/env-config.ts @@ -40,6 +40,7 @@ export type Envs = { TEACHER_STUDENT_VISIBILITY__IS_CONFIGURABLE?: boolean; TEACHER_STUDENT_VISIBILITY__IS_ENABLED_BY_DEFAULT?: boolean; TEACHER_STUDENT_VISIBILITY__IS_VISIBLE?: boolean; + FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED?: boolean; FEATURE_CTL_TOOLS_TAB_ENABLED?: boolean; FEATURE_LTI_TOOLS_TAB_ENABLED?: boolean; FILES_STORAGE__MAX_FILE_SIZE: number; diff --git a/src/utils/sidebar-base-items.ts b/src/utils/sidebar-base-items.ts index 66573e5f6b..4b7a764792 100644 --- a/src/utils/sidebar-base-items.ts +++ b/src/utils/sidebar-base-items.ts @@ -28,7 +28,9 @@ export type SidebarCategoryItem = SidebarItem & { export type SidebarItemList = (SidebarItem | SidebarCategoryItem)[]; -const getSidebarItems = (): SidebarItemList => [ +const getSidebarItems = ( + isNewSchoolAdminPageDefault: boolean +): SidebarItemList => [ { title: "global.sidebar.overview", href: "/dashboard", @@ -240,13 +242,27 @@ const getSidebarItems = (): SidebarItemList => [ testId: "Teams", activeForUrls: ["^/administration/teams($|/.*)"], }, - { - title: "global.sidebar.school", - icon: "$school_outline", - to: "/administration/school-settings", - testId: "Schule", - activeForUrls: ["^/administration/school-settings($|/.*)"], - }, + isNewSchoolAdminPageDefault + ? { + title: "global.sidebar.school", + icon: "$school_outline", + to: "/administration/school-settings", + testId: "Schule", + activeForUrls: [ + "^/administration/school($|/.*)", + "^/administration/school-settings($|/.*)", + ], + } + : { + title: "global.sidebar.school", + icon: "$school_outline", + href: "/administration/school", + testId: "Schule", + activeForUrls: [ + "^/administration/school($|/.*)", + "^/administration/school-settings($|/.*)", + ], + }, ], }, {