Skip to content

Commit

Permalink
Merge branch 'main' into EW-694
Browse files Browse the repository at this point in the history
  • Loading branch information
psachmann authored Jan 29, 2024
2 parents 924c3d2 + 3cd1c5b commit 0e876cb
Show file tree
Hide file tree
Showing 18 changed files with 1,145 additions and 134 deletions.
2 changes: 1 addition & 1 deletion dockerconf/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ server {
listen 4000;
server_name localhost;

set $csp "default-src 'self'; base-uri 'self'; script-src 'nonce-$request_id' 'strict-dynamic' 'unsafe-inline' https:; object-src 'none'; font-src 'self' data:; img-src 'self' data:; style-src 'self' 'unsafe-inline'; frame-src 'self' ${H5P_FRAME_SRC_URLS}";
set $csp "default-src 'self'; base-uri 'self'; script-src 'nonce-$request_id' 'strict-dynamic' 'unsafe-inline' https:; object-src 'none'; font-src 'self' data:; img-src 'self' data:; style-src 'self' 'unsafe-inline'; frame-src 'self' ${H5P_FRAME_SRC_URLS} https://docs.dbildungscloud.de/";

set $h5pcsp "default-src 'self'; base-uri 'self'; script-src ${H5P_SCRIPT_SRC_URLS} 'unsafe-inline' https:; object-src 'none'; font-src 'self' data:; img-src 'self' ${H5P_IMG_SRC_URLS} data:; style-src 'self' 'unsafe-inline'; frame-src 'self' ${H5P_FRAME_SRC_URLS}";

Expand Down
176 changes: 176 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
{
"baseUrl": ".",
"include": ["src/**/*"],
"compilerOptions": {
"baseUrl": ".",
"target": "esnext",
"module": "es2015",
"paths": {
"@components/legacy/TheFooter/*": [
"./src/themes/default/components/legacy/TheFooter.vue/*"
],
"@components/legacy/TheFooter": [
"./src/themes/default/components/legacy/TheFooter.vue/index.js",
"./src/themes/default/components/legacy/TheFooter.vue/index.json",
"./src/themes/default/components/legacy/TheFooter.vue/index.vue",
"./src/themes/default/components/legacy/TheFooter.vue/index.scss",
"./src/themes/default/components/legacy/TheFooter.vue/index.css"
],
"@/*": ["src/*"],
"@": [
"src/index.js",
"src/index.json",
"src/index.vue",
"src/index.scss",
"src/index.css"
],
"@@/*": ["./*"],
"@@": [
"./index.js",
"./index.json",
"./index.vue",
"./index.scss",
"./index.css"
],
"@locale/*": ["locale/*"],
"@locale": [
"locale/index.js",
"locale/index.json",
"locale/index.vue",
"locale/index.scss",
"locale/index.css"
],
"@assets/*": ["src/assets/*"],
"@assets": [
"src/assets/index.js",
"src/assets/index.json",
"src/assets/index.vue",
"src/assets/index.scss",
"src/assets/index.css"
],
"@components/*": ["src/components/*"],
"@components": [
"src/components/index.js",
"src/components/index.json",
"src/components/index.vue",
"src/components/index.scss",
"src/components/index.css"
],
"@basecomponents/*": ["src/components/base/*"],
"@basecomponents": [
"src/components/base/index.js",
"src/components/base/index.json",
"src/components/base/index.vue",
"src/components/base/index.scss",
"src/components/base/index.css"
],
"@docs/*": ["docs/*"],
"@docs": [
"docs/index.js",
"docs/index.json",
"docs/index.vue",
"docs/index.scss",
"docs/index.css"
],
"@layouts/*": ["src/layouts/*"],
"@layouts": [
"src/layouts/index.js",
"src/layouts/index.json",
"src/layouts/index.vue",
"src/layouts/index.scss",
"src/layouts/index.css"
],
"@middleware/*": ["src/middleware/*"],
"@middleware": [
"src/middleware/index.js",
"src/middleware/index.json",
"src/middleware/index.vue",
"src/middleware/index.scss",
"src/middleware/index.css"
],
"@mixins/*": ["src/mixins/*"],
"@mixins": [
"src/mixins/index.js",
"src/mixins/index.json",
"src/mixins/index.vue",
"src/mixins/index.scss",
"src/mixins/index.css"
],
"@pages/*": ["src/pages/*"],
"@pages": [
"src/pages/index.js",
"src/pages/index.json",
"src/pages/index.vue",
"src/pages/index.scss",
"src/pages/index.css"
],
"@utils/*": ["src/utils/*"],
"@utils": [
"src/utils/index.js",
"src/utils/index.json",
"src/utils/index.vue",
"src/utils/index.scss",
"src/utils/index.css"
],
"@plugins/*": ["src/plugins/*"],
"@plugins": [
"src/plugins/index.js",
"src/plugins/index.json",
"src/plugins/index.vue",
"src/plugins/index.scss",
"src/plugins/index.css"
],
"@serverMiddleware/*": ["src/serverMiddleware/*"],
"@serverMiddleware": [
"src/serverMiddleware/index.js",
"src/serverMiddleware/index.json",
"src/serverMiddleware/index.vue",
"src/serverMiddleware/index.scss",
"src/serverMiddleware/index.css"
],
"@store/*": ["src/store/*"],
"@store": [
"src/store/index.js",
"src/store/index.json",
"src/store/index.vue",
"src/store/index.scss",
"src/store/index.css"
],
"@static/*": ["src/themes/default/static/*"],
"@static": [
"src/themes/default/static/index.js",
"src/themes/default/static/index.json",
"src/themes/default/static/index.vue",
"src/themes/default/static/index.scss",
"src/themes/default/static/index.css"
],
"@theme/*": ["src/themes/default/*"],
"@theme": [
"src/themes/default/index.js",
"src/themes/default/index.json",
"src/themes/default/index.vue",
"src/themes/default/index.scss",
"src/themes/default/index.css"
],
"@styles/*": ["src/themes/default/styles/index.scss/*"],
"@styles": ["src/themes/default/styles/index.scss"],
"@styles-base/*": ["src/themes/base/styles/*"],
"@styles-base": [
"src/themes/base/styles/index.js",
"src/themes/base/styles/index.json",
"src/themes/base/styles/index.vue",
"src/themes/base/styles/index.scss",
"src/themes/base/styles/index.css"
],
"@variables/*": ["src/themes/default/styles/variables.scss/*"],
"@variables": [
"src/themes/default/styles/variables.scss/index.js",
"src/themes/default/styles/variables.scss/index.json",
"src/themes/default/styles/variables.scss/index.vue",
"src/themes/default/styles/variables.scss/index.scss",
"src/themes/default/styles/variables.scss/index.css"
]
}
},
"exclude": ["node_modules", ".nuxt", "dist"]
}
139 changes: 139 additions & 0 deletions src/components/administration/AdminMigrationSection.unit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AdminMigrationSection from "@/components/administration/AdminMigrationSection.vue";
import EnvConfigModule from "@/store/env-config";
import SchoolsModule from "@/store/schools";
import { Envs } from "@/store/types/env-config";
import UserLoginMigrationModule from "@/store/user-login-migrations";
import {
ENV_CONFIG_MODULE_KEY,
Expand Down Expand Up @@ -44,6 +45,7 @@ describe("AdminMigrationSection", () => {

envConfigModule = createModuleMocks(EnvConfigModule, {
getAccessibilityReportEmail: "[email protected]",
getEnv: {} as Envs,
...envConfigGetters,
});

Expand Down Expand Up @@ -987,4 +989,141 @@ describe("AdminMigrationSection", () => {
});
});
});

describe("Migration wizard button", () => {
describe("when the migration wizard feature is enabled", () => {
describe("when the migration is running and the school is migrated", () => {
it("should be enabled", () => {
const { wrapper } = setup(
{
getSchool: {
...mockSchool,
systemIds: ["targetSystemId"],
},
},
{
getUserLoginMigration: {
sourceSystemId: "sourceSystemId",
targetSystemId: "targetSystemId",
startedAt: new Date(2023, 1, 1),
closedAt: undefined,
finishedAt: undefined,
mandatorySince: undefined,
},
},
{
getEnv: { FEATURE_SHOW_MIGRATION_WIZARD: true } as Envs,
}
);

const button = wrapper.find(
'[data-testid="migration-wizard-button"]'
);

expect(button.props("disabled")).toBeFalsy();
});

it("should redirect to the wizard", async () => {
const { wrapper } = setup(
{},
{
getUserLoginMigration: {
sourceSystemId: "sourceSystemId",
targetSystemId: "targetSystemId",
startedAt: new Date(2023, 1, 1),
closedAt: undefined,
finishedAt: undefined,
mandatorySince: undefined,
},
},
{
getEnv: { FEATURE_SHOW_MIGRATION_WIZARD: true } as Envs,
}
);

const button = wrapper.find(
'[data-testid="migration-wizard-button"]'
);

expect(button.props("to")).toEqual({
name: "administration-migration",
});
});
});

describe("when the migration has not been started", () => {
it("should be disabled", () => {
const { wrapper } = setup(
{},
{
getUserLoginMigration: undefined,
},
{
getEnv: { FEATURE_SHOW_MIGRATION_WIZARD: true } as Envs,
}
);

const button = wrapper.find(
'[data-testid="migration-wizard-button"]'
);

expect(button.props("disabled")).toBeTruthy();
});
});

describe("when the school has not been migrated", () => {
it("should be disabled", () => {
const { wrapper } = setup(
{
getSchool: {
...mockSchool,
systemIds: [],
},
},
{
getUserLoginMigration: {
sourceSystemId: "sourceSystemId",
targetSystemId: "targetSystemId",
startedAt: new Date(2023, 1, 1),
closedAt: undefined,
finishedAt: undefined,
mandatorySince: undefined,
},
},
{
getEnv: { FEATURE_SHOW_MIGRATION_WIZARD: true } as Envs,
}
);

const button = wrapper.find(
'[data-testid="migration-wizard-button"]'
);

expect(button.props("disabled")).toBeTruthy();
});
});
});

describe("when the migration wizard feature is disabled", () => {
it("should not exist", () => {
const { wrapper } = setup(
{},
{
getUserLoginMigration: {
sourceSystemId: "sourceSystemId",
targetSystemId: "targetSystemId",
startedAt: new Date(2023, 1, 1),
closedAt: undefined,
finishedAt: undefined,
mandatorySince: undefined,
},
}
);

const button = wrapper.find('[data-testid="migration-wizard-button"]');

expect(button.exists()).toBeFalsy();
});
});
});
});
Loading

0 comments on commit 0e876cb

Please sign in to comment.