Skip to content

Commit

Permalink
change sanis to schulconnex/moin.schule
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinOehlerkingCap committed Feb 26, 2025
1 parent 0c18e34 commit fa2e68c
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 93 deletions.
32 changes: 17 additions & 15 deletions src/pages/administration/SchoolSettings.page.unit.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import SchoolSettings from "./SchoolSettings.page.vue";
import { useApplicationError } from "@/composables/application-error.composable";
import { ConfigResponse, SchoolSystemResponse } from "@/serverApi/v3";
import EnvConfigModule from "@/store/env-config";
import SchoolsModule from "@/store/schools";
import { createModuleMocks } from "@@/tests/test-utils/mock-store-module";
import { shallowMount } from "@vue/test-utils";
import { FederalState } from "@/store/types/schools";
import { mockSchool } from "@@/tests/test-utils/mockObjects";
import { ENV_CONFIG_MODULE_KEY, SCHOOLS_MODULE_KEY } from "@/utils/inject";
import { useApplicationError } from "@/composables/application-error.composable";
import { RouteLocationNormalizedLoaded, useRoute } from "vue-router";
import { createModuleMocks } from "@@/tests/test-utils/mock-store-module";
import { mockSchool } from "@@/tests/test-utils/mockObjects";
import {
createTestingI18n,
createTestingVuetify,
} from "@@/tests/test-utils/setup";
import { shallowMount } from "@vue/test-utils";
import { nextTick, reactive } from "vue";
import { SchoolSystemResponse } from "@/serverApi/v3";
import { RouteLocationNormalizedLoaded, useRoute } from "vue-router";
import { envsFactory } from "../../../tests/test-utils";
import SchoolSettings from "./SchoolSettings.page.vue";

jest.mock("vue-router");

const useRouteMock = <jest.Mock<Partial<RouteLocationNormalizedLoaded>>>(
Expand Down Expand Up @@ -55,10 +57,10 @@ describe("SchoolSettingsPage", () => {
];

const setup = (
envConfigGetters: Partial<EnvConfigModule> = {
getFeatureSchoolSanisUserMigrationEnabled: true,
getSchoolPolicyEnabled: true,
getSchoolTermsOfUseEnabled: true,
envConfig: Partial<ConfigResponse> = {
FEATURE_USER_LOGIN_MIGRATION_ENABLED: true,
FEATURE_SCHOOL_POLICY_ENABLED_NEW: true,
FEATURE_SCHOOL_TERMS_OF_USE_ENABLED: true,
},
schoolGetters: Partial<SchoolsModule> = {}
) => {
Expand All @@ -76,7 +78,7 @@ describe("SchoolSettingsPage", () => {
});

envConfigModule = createModuleMocks(EnvConfigModule, {
...envConfigGetters,
getEnv: envsFactory.build(envConfig),
});

useRouteMock.mockImplementation(() =>
Expand Down Expand Up @@ -107,7 +109,7 @@ describe("SchoolSettingsPage", () => {
describe("when feature school policy is disabled", () => {
it("should not render privacy policy expansion panel", () => {
const { wrapper } = setup({
getSchoolPolicyEnabled: false,
FEATURE_SCHOOL_POLICY_ENABLED_NEW: false,
});

expect(wrapper.find('[data-testid="policy-panel"]').exists()).toBe(false);
Expand All @@ -125,7 +127,7 @@ describe("SchoolSettingsPage", () => {
describe("when feature school terms of use is disabled", () => {
it("should not render terms of use expansion panel", () => {
const { wrapper } = setup({
getSchoolTermsOfUseEnabled: false,
FEATURE_SCHOOL_TERMS_OF_USE_ENABLED: false,
});

expect(wrapper.find('[data-testid="terms-panel"]').exists()).toBe(false);
Expand All @@ -145,7 +147,7 @@ describe("SchoolSettingsPage", () => {
describe("when feature admin migration is disabled", () => {
it("should not render admin migration expansion panel", () => {
const { wrapper } = setup({
getFeatureSchoolSanisUserMigrationEnabled: false,
FEATURE_USER_LOGIN_MIGRATION_ENABLED: false,
});

expect(wrapper.find('[data-testid="migration-panel"]').exists()).toBe(
Expand Down
12 changes: 8 additions & 4 deletions src/pages/administration/SchoolSettings.page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@
<script lang="ts">
import AdminMigrationSection from "@/components/administration/AdminMigrationSection.vue";
import ExternalToolsSection from "@/components/administration/ExternalToolSection.vue";
import { mdiAlertCircle, mdiMinus, mdiPlus } from "@icons/material";
import AuthSystems from "@/components/organisms/administration/AuthSystems.vue";
import GeneralSettings from "@/components/organisms/administration/GeneralSettings.vue";
import SchoolPolicy from "@/components/organisms/administration/SchoolPolicy.vue";
Expand All @@ -169,6 +168,7 @@ import {
SCHOOLS_MODULE_KEY,
} from "@/utils/inject";
import { buildPageTitle } from "@/utils/pageTitle";
import { mdiAlertCircle, mdiMinus, mdiPlus } from "@icons/material";
import { useTitle } from "@vueuse/core";
import { computed, ComputedRef, defineComponent, ref, Ref, watch } from "vue";
import { useI18n } from "vue-i18n";
Expand Down Expand Up @@ -239,11 +239,15 @@ export default defineComponent({
() => schoolsModule.getError
);
const isFeatureOauthMigrationEnabled: ComputedRef<boolean | undefined> =
computed(() => envConfigModule.getFeatureSchoolSanisUserMigrationEnabled);
computed(
() => envConfigModule.getEnv.FEATURE_USER_LOGIN_MIGRATION_ENABLED
);
const isFeatureSchoolPolicyEnabled: ComputedRef<boolean | undefined> =
computed(() => envConfigModule.getSchoolPolicyEnabled);
computed(() => envConfigModule.getEnv.FEATURE_SCHOOL_POLICY_ENABLED_NEW);
const isFeatureSchoolTermsOfUseEnabled: ComputedRef<boolean | undefined> =
computed(() => envConfigModule.getSchoolTermsOfUseEnabled);
computed(
() => envConfigModule.getEnv.FEATURE_SCHOOL_TERMS_OF_USE_ENABLED
);
const instituteTitle: ComputedRef<string> = computed(() => {
switch (envConfigModule.getTheme) {
case SchulcloudTheme.N21:
Expand Down
8 changes: 4 additions & 4 deletions src/pages/administration/StudentOverview.page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ export default {
qrLinks: "getQrLinks",
registrationLinks: "getRegistrationLinks",
}),
getFeatureSchoolSanisUserMigrationEnabled() {
return envConfigModule.getFeatureSchoolSanisUserMigrationEnabled;
getFeatureUserLoginMigrationEnabled() {
return envConfigModule.getEnv.FEATURE_USER_LOGIN_MIGRATION_ENABLED;
},
schoolIsExternallyManaged() {
return schoolsModule.schoolIsExternallyManaged;
Expand Down Expand Up @@ -393,8 +393,8 @@ export default {
);
}
// filters out the lastLoginSystemChange and outdatedSince columns if FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED env is disabled
if (!this.getFeatureSchoolSanisUserMigrationEnabled) {
// filters out the lastLoginSystemChange and outdatedSince columns if FEATURE_USER_LOGIN_MIGRATION_ENABLED env is disabled
if (!this.getFeatureUserLoginMigrationEnabled) {
editedColumns = editedColumns
.filter((col) => col.field !== "lastLoginSystemChange")
.filter((col) => col.field !== "outdatedSince");
Expand Down
6 changes: 3 additions & 3 deletions src/pages/administration/TeacherOverview.page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ export default {
schoolIsExternallyManaged() {
return schoolsModule.schoolIsExternallyManaged;
},
getFeatureSchoolSanisUserMigrationEnabled() {
return envConfigModule.getFeatureSchoolSanisUserMigrationEnabled;
getFeatureUserLoginMigrationEnabled() {
return envConfigModule.getEnv.FEATURE_USER_LOGIN_MIGRATION_ENABLED;
},
env() {
return envConfigModule.getEnv;
Expand Down Expand Up @@ -387,7 +387,7 @@ export default {
);
}
if (!this.getFeatureSchoolSanisUserMigrationEnabled) {
if (!this.getFeatureUserLoginMigrationEnabled) {
editedColumns = editedColumns
.filter((col) => col.field !== "lastLoginSystemChange")
.filter((col) => col.field !== "outdatedSince");
Expand Down
16 changes: 8 additions & 8 deletions src/pages/administration/student-overview.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,33 +372,33 @@ describe("students/index", () => {
it("should display the columns behind the migration feature flag", () => {
const envBuild = envsFactory.build({
...envs,
FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED: true,
FEATURE_USER_LOGIN_MIGRATION_ENABLED: true,
});
envConfigModule.setEnvs(envBuild);
const { wrapper } = setup();
const column1 = wrapper.find(`[data-testid="lastLoginSystemChange"]`);
const column2 = wrapper.find(`[data-testid="outdatedSince"]`);

expect(
envConfigModule.getEnv.FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED
).toBe(true);
expect(envConfigModule.getEnv.FEATURE_USER_LOGIN_MIGRATION_ENABLED).toBe(
true
);
expect(column1.exists()).toBe(true);
expect(column2.exists()).toBe(true);
});

it("should not display the columns behind the migration feature flag", () => {
const envBuild = envsFactory.build({
...envs,
FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED: false,
FEATURE_USER_LOGIN_MIGRATION_ENABLED: false,
});
envConfigModule.setEnvs(envBuild);
const { wrapper } = setup();
const column1 = wrapper.find(`[data-testid="lastLoginSystemChange"]`);
const column2 = wrapper.find(`[data-testid="outdatedSince"]`);

expect(
envConfigModule.getEnv.FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED
).toBe(false);
expect(envConfigModule.getEnv.FEATURE_USER_LOGIN_MIGRATION_ENABLED).toBe(
false
);
expect(column1.exists()).toBe(false);
expect(column2.exists()).toBe(false);
});
Expand Down
16 changes: 8 additions & 8 deletions src/pages/administration/teacher-overview.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,35 +370,35 @@ describe("teachers/index", () => {
it("should display the columns behind the migration feature flag", () => {
const envBuild = envsFactory.build({
...envs,
FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED: true,
FEATURE_USER_LOGIN_MIGRATION_ENABLED: true,
});
envConfigModule.setEnvs(envBuild);
const { wrapper } = setup();

const column1 = wrapper.find(`[data-testid="lastLoginSystemChange"]`);
const column2 = wrapper.find(`[data-testid="outdatedSince"]`);

expect(
envConfigModule.getEnv.FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED
).toBe(true);
expect(envConfigModule.getEnv.FEATURE_USER_LOGIN_MIGRATION_ENABLED).toBe(
true
);
expect(column1.exists()).toBe(true);
expect(column2.exists()).toBe(true);
});

it("should not display the columns behind the migration feature flag", () => {
const envBuild = envsFactory.build({
...envs,
FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED: false,
FEATURE_USER_LOGIN_MIGRATION_ENABLED: false,
});
envConfigModule.setEnvs(envBuild);
const { wrapper } = setup();

const column1 = wrapper.find(`[data-testid="lastLoginSystemChange"]`);
const column2 = wrapper.find(`[data-testid="outdatedSince"]`);

expect(
envConfigModule.getEnv.FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED
).toBe(false);
expect(envConfigModule.getEnv.FEATURE_USER_LOGIN_MIGRATION_ENABLED).toBe(
false
);
expect(column1.exists()).toBe(false);
expect(column2.exists()).toBe(false);
});
Expand Down
61 changes: 52 additions & 9 deletions src/serverApi/v3/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1249,10 +1249,10 @@ export interface ComponentInternalPropsImpl {
export interface ComponentLernstorePropsImpl {
/**
* resources of a Lernstore component
* @type {Array<string>}
* @type {Array<LernstoreResources>}
* @memberof ComponentLernstorePropsImpl
*/
resources: Array<string>;
resources: Array<LernstoreResources>;
}
/**
*
Expand Down Expand Up @@ -1554,7 +1554,7 @@ export interface ConfigResponse {
* @type {boolean}
* @memberof ConfigResponse
*/
FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED: boolean;
FEATURE_USER_LOGIN_MIGRATION_ENABLED: boolean;
/**
*
* @type {boolean}
Expand Down Expand Up @@ -1693,6 +1693,12 @@ export interface ConfigResponse {
* @memberof ConfigResponse
*/
FEATURE_VIDIS_MEDIA_ACTIVATIONS_ENABLED: boolean;
/**
*
* @type {string}
* @memberof ConfigResponse
*/
LICENSE_SUMMARY_URL?: string;
}
/**
*
Expand Down Expand Up @@ -4256,6 +4262,43 @@ export interface LdapAuthorizationBodyParams {
*/
schoolId: string;
}
/**
*
* @export
* @interface LernstoreResources
*/
export interface LernstoreResources {
/**
* client
* @type {string}
* @memberof LernstoreResources
*/
client: string;
/**
* description
* @type {string}
* @memberof LernstoreResources
*/
description: string;
/**
* merlinReference
* @type {string}
* @memberof LernstoreResources
*/
merlinReference?: string;
/**
* title
* @type {string}
* @memberof LernstoreResources
*/
title: string;
/**
* url
* @type {string}
* @memberof LernstoreResources
*/
url?: string;
}
/**
*
* @export
Expand Down Expand Up @@ -6784,7 +6827,7 @@ export interface ParentConsentResponse {
*/
export interface PassOwnershipBodyParams {
/**
* The IDs of the users
* The ID of the user
* @type {string}
* @memberof PassOwnershipBodyParams
*/
Expand Down Expand Up @@ -21177,7 +21220,7 @@ export const RoomApiAxiosParamCreator = function (configuration?: Configuration)
*
* @summary Get a list of rooms.
* @param {number} [skip] Number of elements (not pages) to be skipped
* @param {number} [limit] Page limit, defaults to 10.
* @param {number} [limit] Page limit, defaults to 1000.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
Expand Down Expand Up @@ -21448,7 +21491,7 @@ export const RoomApiFp = function(configuration?: Configuration) {
*
* @summary Get a list of rooms.
* @param {number} [skip] Number of elements (not pages) to be skipped
* @param {number} [limit] Page limit, defaults to 10.
* @param {number} [limit] Page limit, defaults to 1000.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
Expand Down Expand Up @@ -21588,7 +21631,7 @@ export const RoomApiFactory = function (configuration?: Configuration, basePath?
*
* @summary Get a list of rooms.
* @param {number} [skip] Number of elements (not pages) to be skipped
* @param {number} [limit] Page limit, defaults to 10.
* @param {number} [limit] Page limit, defaults to 1000.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
Expand Down Expand Up @@ -21723,7 +21766,7 @@ export interface RoomApiInterface {
*
* @summary Get a list of rooms.
* @param {number} [skip] Number of elements (not pages) to be skipped
* @param {number} [limit] Page limit, defaults to 10.
* @param {number} [limit] Page limit, defaults to 1000.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RoomApiInterface
Expand Down Expand Up @@ -21874,7 +21917,7 @@ export class RoomApi extends BaseAPI implements RoomApiInterface {
*
* @summary Get a list of rooms.
* @param {number} [skip] Number of elements (not pages) to be skipped
* @param {number} [limit] Page limit, defaults to 10.
* @param {number} [limit] Page limit, defaults to 1000.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RoomApi
Expand Down
2 changes: 1 addition & 1 deletion src/store/env-config-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const defaultConfigEnvs: ConfigResponse = {
ADMIN_TABLES_DISPLAY_CONSENT_COLUMN: false,
DOCUMENT_BASE_DIR: "",
FEATURE_CONSENT_NECESSARY: false,
FEATURE_SCHOOL_SANIS_USER_MIGRATION_ENABLED: false,
FEATURE_USER_LOGIN_MIGRATION_ENABLED: false,
GHOST_BASE_URL: "",
I18N__AVAILABLE_LANGUAGES: [],
I18N__FALLBACK_LANGUAGE: LanguageType.De,
Expand Down
Loading

0 comments on commit fa2e68c

Please sign in to comment.