diff --git a/dockerconf/nginx.conf.template b/dockerconf/nginx.conf.template index f99df857e7..8d2d7a296e 100644 --- a/dockerconf/nginx.conf.template +++ b/dockerconf/nginx.conf.template @@ -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}"; diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000000..759d796865 --- /dev/null +++ b/jsconfig.json @@ -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"] +} diff --git a/src/components/administration/AdminMigrationSection.unit.ts b/src/components/administration/AdminMigrationSection.unit.ts index f126bba14b..24fef32d8a 100644 --- a/src/components/administration/AdminMigrationSection.unit.ts +++ b/src/components/administration/AdminMigrationSection.unit.ts @@ -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, @@ -44,6 +45,7 @@ describe("AdminMigrationSection", () => { envConfigModule = createModuleMocks(EnvConfigModule, { getAccessibilityReportEmail: "nbc-support@netz-21.de", + getEnv: {} as Envs, ...envConfigGetters, }); @@ -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(); + }); + }); + }); }); diff --git a/src/components/administration/AdminMigrationSection.vue b/src/components/administration/AdminMigrationSection.vue index 664cd894b4..aed8dd4090 100644 --- a/src/components/administration/AdminMigrationSection.vue +++ b/src/components/administration/AdminMigrationSection.vue @@ -137,6 +137,31 @@ data-testid="enable-sync-during-migration-switch" @change="setSchoolFeatures" /> + + + { expect(saveMatchButton.vm.disabled).toBe(true); }); + + it("should not display username when prop nbc is set", () => { + const wrapper = getWrapper({ ...testProps, isNbc: true }); + + const editedItemUsername = wrapper.find( + "[data-testid=edited-item-username]" + ); + + expect(editedItemUsername.exists()).toBe(false); + }); }); diff --git a/src/components/molecules/vImportUsersMatchSearch.vue b/src/components/molecules/vImportUsersMatchSearch.vue index 0e4878be3c..0644e11b25 100644 --- a/src/components/molecules/vImportUsersMatchSearch.vue +++ b/src/components/molecules/vImportUsersMatchSearch.vue @@ -48,6 +48,8 @@ }} {{ `${$t("components.organisms.importUsers.tableUserName")}: ${ editedItem.loginName @@ -92,9 +94,9 @@ }} - {{ - $t("components.molecules.importUsersMatch.unMatched") - }} + {{ $t("components.molecules.importUsersMatch.unMatched") }} + {{ $t("components.molecules.importUsersMatch.flag") - }}{{ $t("components.molecules.importUsersMatch.flag") }} + @@ -68,7 +69,7 @@ class="searchLastName" /> - + {{ mdiAccountPlus }} + >{{ mdiAccountPlus }} + {{ mdiAccountSwitch }} + >{{ mdiAccountSwitch }} + {{ mdiAccountSwitchOutline }} + >{{ mdiAccountSwitchOutline }} + @@ -201,9 +202,9 @@ :title="$t('components.organisms.importUsers.flagImportUser')" @click="saveFlag(item)" > - {{ - item.flagged ? mdiFlag : mdiFlagOutline - }} + {{ item.flagged ? mdiFlag : mdiFlagOutline }} + @@ -215,7 +216,7 @@ {{ $t("components.organisms.importUsers.legendUnMatched", { instance: $theme.name, - source: ldapSourceTranslation, + source: sourceSystemName, }) }} @@ -224,7 +225,7 @@ {{ $t("components.organisms.importUsers.legendAdminMatched", { instance: $theme.name, - source: ldapSourceTranslation, + source: sourceSystemName, }) }}
@@ -232,7 +233,7 @@ {{ $t("components.organisms.importUsers.legendAutoMatched", { instance: $theme.name, - source: ldapSourceTranslation, + source: sourceSystemName, }) }}
@@ -240,7 +241,7 @@ {{ $t("components.organisms.importUsers.legendFlag", { instance: $theme.name, - source: ldapSourceTranslation, + source: sourceSystemName, }) }}

@@ -252,7 +253,7 @@