diff --git a/alfa-client/libs/collaboration-shared/src/lib/collaboration.model.ts b/alfa-client/libs/collaboration-shared/src/lib/collaboration.model.ts index 5cb0cb4409c1bf54e9447410b2e7bc02b54f1b30..73bc3b334e89a941faf5085cd7a8c402d61c9ba7 100644 --- a/alfa-client/libs/collaboration-shared/src/lib/collaboration.model.ts +++ b/alfa-client/libs/collaboration-shared/src/lib/collaboration.model.ts @@ -5,7 +5,7 @@ export interface Collaboration { titel: string; anfrage: string; zustaendigeStelle: ResourceUri; - collaborationLevel?: number; + collaborationLevel: number; } export interface CollaborationResource extends Collaboration, Resource, ListItemResource {} diff --git a/alfa-client/libs/organisations-einheit/.eslintrc.json b/alfa-client/libs/organisations-einheit/.eslintrc.json new file mode 100644 index 0000000000000000000000000000000000000000..b953e5d37d40148217ab14a01859ea0cb43d9ebc --- /dev/null +++ b/alfa-client/libs/organisations-einheit/.eslintrc.json @@ -0,0 +1,33 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + } + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/alfa-client/libs/organisations-einheit/README.md b/alfa-client/libs/organisations-einheit/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b9448bd56f8ab68884bf1b91f12b11efbc3125b0 --- /dev/null +++ b/alfa-client/libs/organisations-einheit/README.md @@ -0,0 +1,7 @@ +# organisations-einheit + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test organisations-einheit` to execute the unit tests. diff --git a/alfa-client/libs/organisations-einheit/jest.config.ts b/alfa-client/libs/organisations-einheit/jest.config.ts new file mode 100644 index 0000000000000000000000000000000000000000..e6c9a97beadf6ca3349773fad970e6d5b10595de --- /dev/null +++ b/alfa-client/libs/organisations-einheit/jest.config.ts @@ -0,0 +1,21 @@ +export default { + displayName: 'organisations-einheit', + preset: '../../jest.preset.js', + setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], + coverageDirectory: '../../coverage/libs/organisations-einheit', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '<rootDir>/tsconfig.spec.json', + stringifyContentPathRegex: '\\.(html|svg)$', + }, + ], + }, + transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], + snapshotSerializers: [ + 'jest-preset-angular/build/serializers/no-ng-attributes', + 'jest-preset-angular/build/serializers/ng-snapshot', + 'jest-preset-angular/build/serializers/html-comment', + ], +}; diff --git a/alfa-client/libs/organisations-einheit/project.json b/alfa-client/libs/organisations-einheit/project.json new file mode 100644 index 0000000000000000000000000000000000000000..9fdc22773ddc51c57a9f84e937fdedbb76fabb80 --- /dev/null +++ b/alfa-client/libs/organisations-einheit/project.json @@ -0,0 +1,22 @@ +{ + "name": "organisations-einheit", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/organisations-einheit/src", + "prefix": "alfa", + "projectType": "library", + "tags": [], + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "tsConfig": "libs/organisations-einheit/tsconfig.spec.json", + "jestConfig": "libs/organisations-einheit/jest.config.ts" + } + }, + "lint": { + "executor": "@nx/eslint:lint", + "outputs": ["{options.outputFile}"] + } + } +} diff --git a/alfa-client/libs/organisations-einheit/src/index.ts b/alfa-client/libs/organisations-einheit/src/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/alfa-client/libs/organisations-einheit/src/test-setup.ts b/alfa-client/libs/organisations-einheit/src/test-setup.ts new file mode 100644 index 0000000000000000000000000000000000000000..03a84127dca1b63fa485fc51d162cec76921b596 --- /dev/null +++ b/alfa-client/libs/organisations-einheit/src/test-setup.ts @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 Das Land Schleswig-Holstein vertreten durch den + * Ministerpräsidenten des Landes Schleswig-Holstein + * Staatskanzlei + * Abteilung Digitalisierung und zentrales IT-Management der Landesregierung + * + * Lizenziert unter der EUPL, Version 1.2 oder - sobald + * diese von der Europäischen Kommission genehmigt wurden - + * Folgeversionen der EUPL ("Lizenz"); + * Sie dürfen dieses Werk ausschließlich gemäß + * dieser Lizenz nutzen. + * Eine Kopie der Lizenz finden Sie hier: + * + * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * + * Sofern nicht durch anwendbare Rechtsvorschriften + * gefordert oder in schriftlicher Form vereinbart, wird + * die unter der Lizenz verbreitete Software "so wie sie + * ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN - + * ausdrücklich oder stillschweigend - verbreitet. + * Die sprachspezifischen Genehmigungen und Beschränkungen + * unter der Lizenz sind dem Lizenztext zu entnehmen. + */ +import '@testing-library/jest-dom'; +import 'jest-preset-angular/setup-jest'; + +import { getTestBed } from '@angular/core/testing'; +import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; + +getTestBed().resetTestEnvironment(); +getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { + teardown: { destroyAfterEach: false }, + errorOnUnknownProperties: true, + errorOnUnknownElements: true, +}); diff --git a/alfa-client/libs/organisations-einheit/tsconfig.json b/alfa-client/libs/organisations-einheit/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..7cc6baf2f58ed5ccfba098131996f579979e9f18 --- /dev/null +++ b/alfa-client/libs/organisations-einheit/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "compilerOptions": { + "target": "es2022" + } +} diff --git a/alfa-client/libs/organisations-einheit/tsconfig.lib.json b/alfa-client/libs/organisations-einheit/tsconfig.lib.json new file mode 100644 index 0000000000000000000000000000000000000000..464f01e6b2b218c0f70e15ac25dd8580bdc38f6e --- /dev/null +++ b/alfa-client/libs/organisations-einheit/tsconfig.lib.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "target": "es2015", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [], + "lib": ["dom", "es2018"] + }, + "angularCompilerOptions": { + "skipTemplateCodegen": true, + "strictMetadataEmit": true, + "enableResourceInlining": true + }, + "exclude": ["src/test-setup.ts", "**/*.spec.ts", "jest.config.ts"], + "include": ["**/*.ts"] +} diff --git a/alfa-client/libs/organisations-einheit/tsconfig.spec.json b/alfa-client/libs/organisations-einheit/tsconfig.spec.json new file mode 100644 index 0000000000000000000000000000000000000000..3a690070a7f5e48080dd36522d6a0db384d940aa --- /dev/null +++ b/alfa-client/libs/organisations-einheit/tsconfig.spec.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"], + "target": "ES2022", + "useDefineForClassFields": false + }, + "files": ["src/test-setup.ts"], + "include": ["**/*.spec.ts", "**/*.d.ts", "jest.config.ts"] +} diff --git a/alfa-client/tsconfig.base.json b/alfa-client/tsconfig.base.json index 63b6a42cd7681cb3f77bb8a38a1eea56cc5a527b..af0d5d6a44f869d3f783c69d2d45741471662239 100644 --- a/alfa-client/tsconfig.base.json +++ b/alfa-client/tsconfig.base.json @@ -40,6 +40,7 @@ "@alfa-client/loesch-anforderung-shared": ["libs/loesch-anforderung-shared/src/index.ts"], "@alfa-client/navigation": ["libs/navigation/src/index.ts"], "@alfa-client/navigation-shared": ["libs/navigation-shared/src/index.ts"], + "@alfa-client/organisations-einheit": ["libs/organisations-einheit/src/index.ts"], "@alfa-client/postfach": ["libs/postfach/src/index.ts"], "@alfa-client/postfach-shared": ["libs/postfach-shared/src/index.ts"], "@alfa-client/resource-redirect": ["libs/resource-redirect/src/index.ts"], @@ -62,7 +63,7 @@ "@alfa-client/zustaendige-stelle-shared": ["libs/zustaendige-stelle-shared/src/index.ts"], "@ods/component": ["libs/design-component/src/index.ts"], "@ods/system": ["libs/design-system/src/index.ts"], - "authentication": ["libs/authentication/src/index.ts"] + "authentication": ["libs/authentication/src/index.ts"], } }, "exclude": ["node_modules", "tmp"]