Skip to content

Commit

Permalink
Revert "BC-4121 - Replace old with new school adminstration page (#2701
Browse files Browse the repository at this point in the history
…)" (#3053)

This reverts commit ddc94d8.
  • Loading branch information
davwas authored Jan 29, 2024
1 parent 3cd1c5b commit ef0eb18
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/layouts/legacyLoggedIn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export default defineComponent({
});
const sidebarItems = computed(() => {
let sidebarItems = getSidebarItems();
let sidebarItems = getSidebarItems(
envConfigModule.getNewSchoolAdminPageAsDefault
);
const isSidebarCategoryItem = (
item: SidebarItem | SidebarCategoryItem
Expand Down
6 changes: 4 additions & 2 deletions src/pages/administration/LDAPActivate.page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -317,7 +319,7 @@ export default {
},
okButtonHandler() {
this.$router.push({
path: `/administration/school-settings`,
path: `/administration/school`,
});
},
},
Expand Down
6 changes: 4 additions & 2 deletions src/pages/administration/LDAPConfig.page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"),
Expand Down
8 changes: 8 additions & 0 deletions src/pages/administration/SchoolSettings.page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
</div>
</v-alert>
<div v-else data-testid="no-error">
<v-alert light text type="info" class="mb-4">
<div class="alert-text">
{{ t("pages.administration.school.index.back") }}
<a href="/administration/school/">
{{ t("pages.administration.school.index.backLink") }}</a
>.
</div>
</v-alert>
<v-alert light text type="info" class="mb-12">
<div class="alert-text">
{{ t("pages.administration.school.index.info", { instituteTitle }) }}
Expand Down
7 changes: 7 additions & 0 deletions src/store/env-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/store/types/env-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
32 changes: 24 additions & 8 deletions src/utils/sidebar-base-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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($|/.*)",
],
},
],
},
{
Expand Down

0 comments on commit ef0eb18

Please sign in to comment.