From 73da64f4f1aa586d76b4db372d2c235f5a5aa21e Mon Sep 17 00:00:00 2001 From: markuczy Date: Mon, 11 Mar 2024 10:24:44 +0100 Subject: [PATCH] feat: extracted AppStateService and UserService to angular-integration-interface lib --- .../mocks/app-state-service-mock.ts | 2 +- libs/angular-accelerator/package.json | 1 + libs/angular-accelerator/src/index.ts | 2 - .../src/lib/angular-accelerator.module.ts | 2 +- .../data-list-grid.component.ts | 4 +- .../interactive-data-view.component.spec.ts | 2 +- .../page-header/page-header.component.ts | 4 +- .../lib/directives/if-permission.directive.ts | 2 +- .../.eslintrc.json | 46 +++++++++++++++ libs/angular-integration-interface/README.md | 7 +++ .../jest.config.ts | 22 +++++++ .../ng-package.json | 9 +++ .../package.json | 13 +++++ .../project.json | 58 +++++++++++++++++++ .../src/index.ts | 3 + .../src/lib/api/constants.ts | 0 .../src/lib/services/app-state.service.ts | 0 .../src/lib/services/user.service.ts | 0 .../src/test-setup.ts | 15 +++++ .../tsconfig.json | 31 ++++++++++ .../tsconfig.lib.json | 14 +++++ .../tsconfig.lib.prod.json | 13 +++++ .../tsconfig.spec.json | 11 ++++ libs/portal-integration-angular/package.json | 1 + libs/portal-integration-angular/src/index.ts | 4 +- .../announcement-banner.component.ts | 2 +- .../inline-profile.component.ts | 2 +- .../mfe-debug/mfe-debug.component.ts | 2 +- .../portal-footer/portal-footer.component.ts | 2 +- .../portal-header/header.component.ts | 4 +- .../portal-page/portal-page.component.ts | 4 +- .../portal-viewport.component.ts | 4 +- .../search-criteria.component.ts | 4 +- .../initializer/standalone.initializer.ts | 4 +- .../src/lib/core/portal-core.module.ts | 4 +- .../add-initialize-module-guard.utils.spec.ts | 4 +- .../utils/create-translate-loader.utils.ts | 2 +- .../utils/portal-api-configuration.utils.ts | 2 +- .../translate-service-initializer.utils.ts | 2 +- .../src/lib/services/app.menu.service.ts | 2 +- .../initialize-module-guard.service.ts | 4 +- tsconfig.base.json | 1 + 42 files changed, 279 insertions(+), 36 deletions(-) create mode 100644 libs/angular-integration-interface/.eslintrc.json create mode 100644 libs/angular-integration-interface/README.md create mode 100644 libs/angular-integration-interface/jest.config.ts create mode 100644 libs/angular-integration-interface/ng-package.json create mode 100644 libs/angular-integration-interface/package.json create mode 100644 libs/angular-integration-interface/project.json create mode 100644 libs/angular-integration-interface/src/index.ts rename libs/{angular-accelerator => angular-integration-interface}/src/lib/api/constants.ts (100%) rename libs/{angular-accelerator => angular-integration-interface}/src/lib/services/app-state.service.ts (100%) rename libs/{angular-accelerator => angular-integration-interface}/src/lib/services/user.service.ts (100%) create mode 100644 libs/angular-integration-interface/src/test-setup.ts create mode 100644 libs/angular-integration-interface/tsconfig.json create mode 100644 libs/angular-integration-interface/tsconfig.lib.json create mode 100644 libs/angular-integration-interface/tsconfig.lib.prod.json create mode 100644 libs/angular-integration-interface/tsconfig.spec.json diff --git a/libs/angular-accelerator/mocks/app-state-service-mock.ts b/libs/angular-accelerator/mocks/app-state-service-mock.ts index 0ab05f6e..bb5e4b35 100644 --- a/libs/angular-accelerator/mocks/app-state-service-mock.ts +++ b/libs/angular-accelerator/mocks/app-state-service-mock.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core' import { PageInfo, Portal } from '@onecx/integration-interface' // eslint-disable-next-line -import { AppStateService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' import { FakeTopic } from './fake-topic' /** diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index 64b69be9..ab6d96a3 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -10,6 +10,7 @@ "@angular/router": "^15.2.7", "@ngx-translate/core": "^14.0.0", "@onecx/integration-interface": "~4", + "@onecx/angular-integration-interface": "~4", "chart.js": "^4.4.0", "d3-scale-chromatic": "^3.0.0", "rxjs": "~7.8.0", diff --git a/libs/angular-accelerator/src/index.ts b/libs/angular-accelerator/src/index.ts index 71056b03..319fc537 100644 --- a/libs/angular-accelerator/src/index.ts +++ b/libs/angular-accelerator/src/index.ts @@ -17,9 +17,7 @@ export * from './lib/components/search-config/search-config.component' export * from './lib/components/search-header/search-header.component' // services -export * from './lib/services/app-state.service' export * from './lib/services/breadcrumb.service' -export * from './lib/services/user.service' // pipes export * from './lib/pipes/dynamic.pipe' diff --git a/libs/angular-accelerator/src/lib/angular-accelerator.module.ts b/libs/angular-accelerator/src/lib/angular-accelerator.module.ts index 6919e552..853346ed 100644 --- a/libs/angular-accelerator/src/lib/angular-accelerator.module.ts +++ b/libs/angular-accelerator/src/lib/angular-accelerator.module.ts @@ -21,7 +21,7 @@ import { DynamicPipe } from './pipes/dynamic.pipe' import { RelativeDatePipe } from './pipes/relative-date.pipe' import { IfPermissionDirective } from './directives/if-permission.directive' -import { UserService } from './services/user.service' +import { UserService } from '@onecx/angular-integration-interface' export class AngularAcceleratorMissingTranslationHandler implements MissingTranslationHandler { handle(params: MissingTranslationHandlerParams) { diff --git a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts index 8e9a2482..e3ede141 100644 --- a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts @@ -19,8 +19,8 @@ import { DataAction } from '../../model/data-action' import { DataSortDirection } from '../../model/data-sort-direction' import { DataTableColumn } from '../../model/data-table-column.model' import { MfeInfo } from '@onecx/integration-interface' -import { AppStateService } from '../../services/app-state.service' -import { UserService } from '../../services/user.service' +import { AppStateService } from '@onecx/angular-integration-interface' +import { UserService } from '@onecx/angular-integration-interface' import { ObjectUtils } from '../../utils/objectutils' import { DataSortBase } from '../data-sort-base/data-sort-base' import { Filter, Row } from '../data-table/data-table.component' diff --git a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.spec.ts b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.spec.ts index c72b8682..cc1e7bc4 100644 --- a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.spec.ts +++ b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.spec.ts @@ -39,7 +39,7 @@ import { TranslateTestingModule } from 'ngx-translate-testing' import { NoopAnimationsModule } from '@angular/platform-browser/animations' import { DateUtils } from '../../utils/dateutils' import { HttpClientModule } from '@angular/common/http' -import { UserService } from '../../services/user.service' +import { UserService } from '@onecx/angular-integration-interface' import { MockUserService } from '../../../../mocks/mock-user-service' describe('InteractiveDataViewComponent', () => { diff --git a/libs/angular-accelerator/src/lib/components/page-header/page-header.component.ts b/libs/angular-accelerator/src/lib/components/page-header/page-header.component.ts index b78b128a..de6da00b 100644 --- a/libs/angular-accelerator/src/lib/components/page-header/page-header.component.ts +++ b/libs/angular-accelerator/src/lib/components/page-header/page-header.component.ts @@ -15,8 +15,8 @@ import { MenuItem, PrimeIcons } from 'primeng/api' import { concat, map, Observable, of } from 'rxjs' import { BreadcrumbService } from '../../services/breadcrumb.service' import { TranslateService } from '@ngx-translate/core' -import { AppStateService } from '../../services/app-state.service' -import { UserService } from '../../services/user.service' +import { AppStateService } from '@onecx/angular-integration-interface' +import { UserService } from '@onecx/angular-integration-interface' import { PrimeIcon } from '../../utils/primeicon.utils' /** diff --git a/libs/angular-accelerator/src/lib/directives/if-permission.directive.ts b/libs/angular-accelerator/src/lib/directives/if-permission.directive.ts index 8fdf132b..14c136c1 100644 --- a/libs/angular-accelerator/src/lib/directives/if-permission.directive.ts +++ b/libs/angular-accelerator/src/lib/directives/if-permission.directive.ts @@ -1,5 +1,5 @@ import { Directive, ElementRef, Input, OnInit, Optional, Renderer2, TemplateRef, ViewContainerRef } from '@angular/core' -import { UserService } from '../services/user.service' +import { UserService } from '@onecx/angular-integration-interface' @Directive({ selector: '[ocxIfPermission], [ocxIfNotPermission]' }) export class IfPermissionDirective implements OnInit { diff --git a/libs/angular-integration-interface/.eslintrc.json b/libs/angular-integration-interface/.eslintrc.json new file mode 100644 index 00000000..d4c0a6b0 --- /dev/null +++ b/libs/angular-integration-interface/.eslintrc.json @@ -0,0 +1,46 @@ +{ + "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": "ocx", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "ocx", + "style": "kebab-case" + } + ], + "no-restricted-syntax": [ + "off", + { + "selector": "CallExpression[callee.object.name=\"console\"][callee.property.name=/^(debug|info|time|timeEnd|trace)$/]" + } + ] + } + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + }, + { + "files": ["*.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/dependency-checks": "error" + } + } + ] +} diff --git a/libs/angular-integration-interface/README.md b/libs/angular-integration-interface/README.md new file mode 100644 index 00000000..57a75841 --- /dev/null +++ b/libs/angular-integration-interface/README.md @@ -0,0 +1,7 @@ +# angular-integration-interface + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test angular-integration-interface` to execute the unit tests. diff --git a/libs/angular-integration-interface/jest.config.ts b/libs/angular-integration-interface/jest.config.ts new file mode 100644 index 00000000..d48f7825 --- /dev/null +++ b/libs/angular-integration-interface/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'angular-integration-interface', + preset: '../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: '../../coverage/libs/angular-integration-interface', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/angular-integration-interface/ng-package.json b/libs/angular-integration-interface/ng-package.json new file mode 100644 index 00000000..33ac01ff --- /dev/null +++ b/libs/angular-integration-interface/ng-package.json @@ -0,0 +1,9 @@ +{ + "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../dist/libs/angular-integration-interface", + "lib": { + "entryFile": "src/index.ts" + }, + "assets": ["./assets/**"] + } + \ No newline at end of file diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json new file mode 100644 index 00000000..e2560ff8 --- /dev/null +++ b/libs/angular-integration-interface/package.json @@ -0,0 +1,13 @@ +{ + "name": "@onecx/angular-integration-interface", + "version": "4.9.0", + "peerDependencies": { + "@angular/core": "^15.2.7", + "@onecx/integration-interface": "~4", + "rxjs": "~7.8.0" + }, + "dependencies": {}, + "publishConfig": { + "access": "public" + } +} \ No newline at end of file diff --git a/libs/angular-integration-interface/project.json b/libs/angular-integration-interface/project.json new file mode 100644 index 00000000..d12d83c7 --- /dev/null +++ b/libs/angular-integration-interface/project.json @@ -0,0 +1,58 @@ +{ + "name": "angular-integration-interface", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/angular-integration-interface/src", + "prefix": "onecx", + "tags": [], + "projectType": "library", + "targets": { + "build": { + "executor": "@nx/angular:package", + "outputs": [ + "{workspaceRoot}/dist/{projectRoot}" + ], + "options": { + "project": "libs/angular-integration-interface/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "libs/angular-integration-interface/tsconfig.lib.prod.json" + }, + "development": { + "tsConfig": "libs/angular-integration-interface/tsconfig.lib.json" + } + }, + "defaultConfiguration": "production" + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/angular-integration-interface/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/angular-integration-interface/**/*.ts", + "libs/angular-integration-interface/**/*.html" + ] + } + }, + "release": { + "executor": "nx-release:build-update-publish", + "options": { + "libName": "angular-integration-interface" + } + } + } +} diff --git a/libs/angular-integration-interface/src/index.ts b/libs/angular-integration-interface/src/index.ts new file mode 100644 index 00000000..2db372f6 --- /dev/null +++ b/libs/angular-integration-interface/src/index.ts @@ -0,0 +1,3 @@ +// services +export * from './lib/services/app-state.service' +export * from './lib/services/user.service' diff --git a/libs/angular-accelerator/src/lib/api/constants.ts b/libs/angular-integration-interface/src/lib/api/constants.ts similarity index 100% rename from libs/angular-accelerator/src/lib/api/constants.ts rename to libs/angular-integration-interface/src/lib/api/constants.ts diff --git a/libs/angular-accelerator/src/lib/services/app-state.service.ts b/libs/angular-integration-interface/src/lib/services/app-state.service.ts similarity index 100% rename from libs/angular-accelerator/src/lib/services/app-state.service.ts rename to libs/angular-integration-interface/src/lib/services/app-state.service.ts diff --git a/libs/angular-accelerator/src/lib/services/user.service.ts b/libs/angular-integration-interface/src/lib/services/user.service.ts similarity index 100% rename from libs/angular-accelerator/src/lib/services/user.service.ts rename to libs/angular-integration-interface/src/lib/services/user.service.ts diff --git a/libs/angular-integration-interface/src/test-setup.ts b/libs/angular-integration-interface/src/test-setup.ts new file mode 100644 index 00000000..37e27774 --- /dev/null +++ b/libs/angular-integration-interface/src/test-setup.ts @@ -0,0 +1,15 @@ +import 'jest-preset-angular/setup-jest' + +Object.defineProperty(window, 'matchMedia', { + writable: true, + value: jest.fn().mockImplementation((query) => ({ + matches: false, + media: query, + onchange: null, + addListener: jest.fn(), // deprecated + removeListener: jest.fn(), // deprecated + addEventListener: jest.fn(), + removeEventListener: jest.fn(), + dispatchEvent: jest.fn(), + })), +}) diff --git a/libs/angular-integration-interface/tsconfig.json b/libs/angular-integration-interface/tsconfig.json new file mode 100644 index 00000000..cd40c79f --- /dev/null +++ b/libs/angular-integration-interface/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "target": "es2022", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "esModuleInterop": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.lib.prod.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "extends": "../../tsconfig.base.json", + "angularCompilerOptions": { + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/libs/angular-integration-interface/tsconfig.lib.json b/libs/angular-integration-interface/tsconfig.lib.json new file mode 100644 index 00000000..b9561ca9 --- /dev/null +++ b/libs/angular-integration-interface/tsconfig.lib.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [], + "target": "es2022", + "useDefineForClassFields": false + }, + "exclude": ["**/*.spec.ts", "src/test-setup.ts", "jest.config.ts", "**/*.test.ts", "**/*.stories.ts", "jest.config.ts"], + "include": ["**/*.ts"] +} diff --git a/libs/angular-integration-interface/tsconfig.lib.prod.json b/libs/angular-integration-interface/tsconfig.lib.prod.json new file mode 100644 index 00000000..3a838333 --- /dev/null +++ b/libs/angular-integration-interface/tsconfig.lib.prod.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false, + "target": "es2022", + "useDefineForClassFields": false + }, + "angularCompilerOptions": { + "compilationMode": "partial" + }, + "exclude": ["jest.config.ts"] + } + \ No newline at end of file diff --git a/libs/angular-integration-interface/tsconfig.spec.json b/libs/angular-integration-interface/tsconfig.spec.json new file mode 100644 index 00000000..4251c922 --- /dev/null +++ b/libs/angular-integration-interface/tsconfig.spec.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "target": "es2016", + "types": ["jest", "node"] + }, + "files": ["src/test-setup.ts"], + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index 2396e551..4f776ab3 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -19,6 +19,7 @@ "@onecx/accelerator": "~4", "@onecx/integration-interface": "~4", "@onecx/angular-accelerator": "~4", + "@onecx/angular-integration-interface": "~4", "fast-deep-equal": "^3.1.3", "msw": "^1.3.2", "rxjs": "~7.8.0", diff --git a/libs/portal-integration-angular/src/index.ts b/libs/portal-integration-angular/src/index.ts index ea3fc705..7cf87071 100644 --- a/libs/portal-integration-angular/src/index.ts +++ b/libs/portal-integration-angular/src/index.ts @@ -95,12 +95,12 @@ export * from './lib/core/utils/caching-translate-loader.utils' export { BreadcrumbService, - UserService, SearchConfig, Action, DataAction, DataTableColumn, ColumnType, - AppStateService, ObjectDetailItem, } from '@onecx/angular-accelerator' + +export { AppStateService, UserService } from '@onecx/angular-integration-interface' diff --git a/libs/portal-integration-angular/src/lib/core/components/announcement-banner/announcement-banner.component.ts b/libs/portal-integration-angular/src/lib/core/components/announcement-banner/announcement-banner.component.ts index 4290889f..1edb27d3 100644 --- a/libs/portal-integration-angular/src/lib/core/components/announcement-banner/announcement-banner.component.ts +++ b/libs/portal-integration-angular/src/lib/core/components/announcement-banner/announcement-banner.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core' import { catchError, map, Observable, of, switchMap, tap, throwError, EMPTY, mergeMap } from 'rxjs' import { AnnouncementItem, AnnouncementPriorityType } from '../../../model/announcement-item' import { AnnouncementsApiService } from '../../../services/announcements-api.service' -import { AppStateService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' import { ConfigurationService } from '../../../services/configuration.service' @Component({ diff --git a/libs/portal-integration-angular/src/lib/core/components/inline-profile/inline-profile.component.ts b/libs/portal-integration-angular/src/lib/core/components/inline-profile/inline-profile.component.ts index fb35dcfc..75872e7c 100644 --- a/libs/portal-integration-angular/src/lib/core/components/inline-profile/inline-profile.component.ts +++ b/libs/portal-integration-angular/src/lib/core/components/inline-profile/inline-profile.component.ts @@ -5,7 +5,7 @@ import { AUTH_SERVICE } from '../../../api/injection-tokens' import { MenuService } from '../../../services/app.menu.service' import { MenuItem } from 'primeng/api' import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy' -import { UserService } from '@onecx/angular-accelerator' +import { UserService } from '@onecx/angular-integration-interface' import { map, Observable } from 'rxjs' import { UserProfile } from '../../../model/user-profile.model' diff --git a/libs/portal-integration-angular/src/lib/core/components/mfe-debug/mfe-debug.component.ts b/libs/portal-integration-angular/src/lib/core/components/mfe-debug/mfe-debug.component.ts index 8dc08903..9429dbc8 100644 --- a/libs/portal-integration-angular/src/lib/core/components/mfe-debug/mfe-debug.component.ts +++ b/libs/portal-integration-angular/src/lib/core/components/mfe-debug/mfe-debug.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core' import { map, Observable } from 'rxjs' import { MfeInfo } from '../../../model/mfe-info.model' -import { AppStateService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' @Component({ selector: 'ocx-mfe-debug', diff --git a/libs/portal-integration-angular/src/lib/core/components/portal-footer/portal-footer.component.ts b/libs/portal-integration-angular/src/lib/core/components/portal-footer/portal-footer.component.ts index 5130a00e..c96661fb 100644 --- a/libs/portal-integration-angular/src/lib/core/components/portal-footer/portal-footer.component.ts +++ b/libs/portal-integration-angular/src/lib/core/components/portal-footer/portal-footer.component.ts @@ -3,7 +3,7 @@ import { ConfigurationService } from '../../../services/configuration.service' import { Router } from '@angular/router' import { MenuItem } from 'primeng/api' import { MenuService } from '../../../services/app.menu.service' -import { AppStateService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' import { combineLatest, concat, map, Observable, of, withLatestFrom } from 'rxjs' import { ThemeService } from '../../../services/theme.service' import { API_PREFIX } from '../../../api/constants' diff --git a/libs/portal-integration-angular/src/lib/core/components/portal-header/header.component.ts b/libs/portal-integration-angular/src/lib/core/components/portal-header/header.component.ts index dec39312..e022ad80 100644 --- a/libs/portal-integration-angular/src/lib/core/components/portal-header/header.component.ts +++ b/libs/portal-integration-angular/src/lib/core/components/portal-header/header.component.ts @@ -12,8 +12,8 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy' import { CONFIG_KEY } from '../../../model/config-key.model' import { ThemeService } from '../../../services/theme.service' import { ImageLogoUrlUtils } from '../../utils/image-logo-url.utils' -import { UserService } from '@onecx/angular-accelerator' -import { AppStateService } from '@onecx/angular-accelerator' +import { UserService } from '@onecx/angular-integration-interface' +import { AppStateService } from '@onecx/angular-integration-interface' import { PrimeIcons } from 'primeng/api' type MenuItemPerm = MenuItem & { permission: string } diff --git a/libs/portal-integration-angular/src/lib/core/components/portal-page/portal-page.component.ts b/libs/portal-integration-angular/src/lib/core/components/portal-page/portal-page.component.ts index 71fbd6a7..eb92a861 100644 --- a/libs/portal-integration-angular/src/lib/core/components/portal-page/portal-page.component.ts +++ b/libs/portal-integration-angular/src/lib/core/components/portal-page/portal-page.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core' -import { AppStateService } from '@onecx/angular-accelerator' -import { UserService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' +import { UserService } from '@onecx/angular-integration-interface' @Component({ selector: 'ocx-portal-page', diff --git a/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.ts b/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.ts index b841983e..3039431b 100644 --- a/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.ts +++ b/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.ts @@ -4,7 +4,7 @@ import { MenuItem, MessageService, PrimeNGConfig } from 'primeng/api' import { PortalUIService } from '../../../services/portal-ui.service' import { catchError, combineLatest, filter, first, map, mergeMap, Observable, of, withLatestFrom } from 'rxjs' import { ThemeService } from '../../../services/theme.service' -import { AppStateService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' import { SupportTicket } from '../../../model/support-ticket' import { HelpData } from '../../../model/help-data' import { DialogService } from 'primeng/dynamicdialog' @@ -13,7 +13,7 @@ import { NavigationEnd, Router } from '@angular/router' import { HelpPageAPIService } from '../../../services/help-api-service' import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy' import { HttpResponse } from '@angular/common/http' -import { UserService } from '@onecx/angular-accelerator' +import { UserService } from '@onecx/angular-integration-interface' import { PortalMessageService } from '../../../services/portal-message.service' @Component({ diff --git a/libs/portal-integration-angular/src/lib/core/components/search-criteria/search-criteria.component.ts b/libs/portal-integration-angular/src/lib/core/components/search-criteria/search-criteria.component.ts index b60bbb61..314465ff 100644 --- a/libs/portal-integration-angular/src/lib/core/components/search-criteria/search-criteria.component.ts +++ b/libs/portal-integration-angular/src/lib/core/components/search-criteria/search-criteria.component.ts @@ -3,8 +3,8 @@ import { BreadcrumbService } from '@onecx/angular-accelerator' import { Action, PageHeaderComponent } from '@onecx/angular-accelerator' import { PortalSearchPage } from './search-page' import { TranslateService } from '@ngx-translate/core' -import { AppStateService } from '@onecx/angular-accelerator' -import { UserService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' +import { UserService } from '@onecx/angular-integration-interface' /** * @deprecated Will be replaced by ocx-search-header diff --git a/libs/portal-integration-angular/src/lib/core/initializer/standalone.initializer.ts b/libs/portal-integration-angular/src/lib/core/initializer/standalone.initializer.ts index f91083af..e3bc91ee 100644 --- a/libs/portal-integration-angular/src/lib/core/initializer/standalone.initializer.ts +++ b/libs/portal-integration-angular/src/lib/core/initializer/standalone.initializer.ts @@ -3,9 +3,9 @@ import { IAuthService } from '../../api/iauth.service' import { ConfigurationService } from '../../services/configuration.service' import { PortalApiService } from '../../services/portal-api.service' import { ThemeService } from '../../services/theme.service' -import { AppStateService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' import { CONFIG_KEY } from '../../model/config-key.model' -import { UserService } from '@onecx/angular-accelerator' +import { UserService } from '@onecx/angular-integration-interface' import { UserProfileAPIService } from '../../services/userprofile-api.service' import { MfeInfo } from '@onecx/integration-interface' diff --git a/libs/portal-integration-angular/src/lib/core/portal-core.module.ts b/libs/portal-integration-angular/src/lib/core/portal-core.module.ts index 65eddf50..1ae47ccc 100644 --- a/libs/portal-integration-angular/src/lib/core/portal-core.module.ts +++ b/libs/portal-integration-angular/src/lib/core/portal-core.module.ts @@ -44,8 +44,8 @@ import { PortalApiService } from '../services/portal-api.service' import { CriteriaTemplateComponent } from './components/search-criteria/criteria-template/criteria-template.component' import { ThemeService } from '../services/theme.service' import { GlobalErrorComponent } from './components/error-component/global-error.component' -import { AngularAcceleratorModule, AppStateService } from '@onecx/angular-accelerator' -import { UserService } from '@onecx/angular-accelerator' +import { AngularAcceleratorModule } from '@onecx/angular-accelerator' +import { UserService, AppStateService } from '@onecx/angular-integration-interface' import { AnnouncementBannerComponent } from './components/announcement-banner/announcement-banner.component' import { ViewTemplatePickerComponent } from './components/data-view-controls/view-template-picker/view-template-picker.component' import { SupportTicketComponent } from './components/support-ticket/support-ticket.component' diff --git a/libs/portal-integration-angular/src/lib/core/utils/add-initialize-module-guard.utils.spec.ts b/libs/portal-integration-angular/src/lib/core/utils/add-initialize-module-guard.utils.spec.ts index 50dd8029..96a68403 100644 --- a/libs/portal-integration-angular/src/lib/core/utils/add-initialize-module-guard.utils.spec.ts +++ b/libs/portal-integration-angular/src/lib/core/utils/add-initialize-module-guard.utils.spec.ts @@ -1,8 +1,8 @@ import { TranslateService } from '@ngx-translate/core' -import { AppStateService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' import { ConfigurationService } from '../../services/configuration.service' import { InitializeModuleGuard } from '../../services/initialize-module-guard.service' -import { UserService } from '@onecx/angular-accelerator' +import { UserService } from '@onecx/angular-integration-interface' import { addInitializeModuleGuard } from './add-initialize-module-guard.utils' class MockInitializeModuleGuard extends InitializeModuleGuard { diff --git a/libs/portal-integration-angular/src/lib/core/utils/create-translate-loader.utils.ts b/libs/portal-integration-angular/src/lib/core/utils/create-translate-loader.utils.ts index 0c730b54..a8bf6cf0 100644 --- a/libs/portal-integration-angular/src/lib/core/utils/create-translate-loader.utils.ts +++ b/libs/portal-integration-angular/src/lib/core/utils/create-translate-loader.utils.ts @@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http' import { inject } from '@angular/core' import { TranslateLoader } from '@ngx-translate/core' import { combineLatest, filter, map, tap } from 'rxjs' -import { AppStateService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' import { TranslationCacheService } from '../../services/translation-cache.service' import { AsyncTranslateLoader } from './async-translate-loader.utils' import { CachingTranslateLoader } from './caching-translate-loader.utils' diff --git a/libs/portal-integration-angular/src/lib/core/utils/portal-api-configuration.utils.ts b/libs/portal-integration-angular/src/lib/core/utils/portal-api-configuration.utils.ts index 94e71b25..3df2e0d8 100644 --- a/libs/portal-integration-angular/src/lib/core/utils/portal-api-configuration.utils.ts +++ b/libs/portal-integration-angular/src/lib/core/utils/portal-api-configuration.utils.ts @@ -1,6 +1,6 @@ import { Location } from '@angular/common' import { BehaviorSubject, first, map } from 'rxjs' -import { AppStateService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' import { ConfigurationService } from '../../services/configuration.service' type Config = { diff --git a/libs/portal-integration-angular/src/lib/core/utils/translate-service-initializer.utils.ts b/libs/portal-integration-angular/src/lib/core/utils/translate-service-initializer.utils.ts index 167ffa84..1e1b50ab 100644 --- a/libs/portal-integration-angular/src/lib/core/utils/translate-service-initializer.utils.ts +++ b/libs/portal-integration-angular/src/lib/core/utils/translate-service-initializer.utils.ts @@ -1,6 +1,6 @@ import { TranslateService } from '@ngx-translate/core' import { firstValueFrom, mergeMap } from 'rxjs' -import { UserService } from '@onecx/angular-accelerator' +import { UserService } from '@onecx/angular-integration-interface' export function translateServiceInitializer( userService: UserService, diff --git a/libs/portal-integration-angular/src/lib/services/app.menu.service.ts b/libs/portal-integration-angular/src/lib/services/app.menu.service.ts index 011a459f..5e7ee77f 100644 --- a/libs/portal-integration-angular/src/lib/services/app.menu.service.ts +++ b/libs/portal-integration-angular/src/lib/services/app.menu.service.ts @@ -7,7 +7,7 @@ import { ConfigurationService } from './configuration.service' import { MenuApiService } from './menu-api.service' import { APP_BASE_HREF, PlatformLocation } from '@angular/common' import { CONFIG_KEY } from '../model/config-key.model' -import { UserService } from '@onecx/angular-accelerator' +import { UserService } from '@onecx/angular-integration-interface' @Injectable({ providedIn: 'root' }) export class MenuService { diff --git a/libs/portal-integration-angular/src/lib/services/initialize-module-guard.service.ts b/libs/portal-integration-angular/src/lib/services/initialize-module-guard.service.ts index 713a37c6..c195bc82 100644 --- a/libs/portal-integration-angular/src/lib/services/initialize-module-guard.service.ts +++ b/libs/portal-integration-angular/src/lib/services/initialize-module-guard.service.ts @@ -2,9 +2,9 @@ import { Injectable } from '@angular/core' import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree } from '@angular/router' import { TranslateService } from '@ngx-translate/core' import { filter, from, isObservable, map, mergeMap, Observable, of, tap, zip } from 'rxjs' -import { AppStateService } from '@onecx/angular-accelerator' +import { AppStateService } from '@onecx/angular-integration-interface' import { ConfigurationService } from './configuration.service' -import { UserService } from '@onecx/angular-accelerator' +import { UserService } from '@onecx/angular-integration-interface' @Injectable({ providedIn: 'any' }) export class InitializeModuleGuard implements CanActivate { diff --git a/tsconfig.base.json b/tsconfig.base.json index ac8f5e48..b13917e9 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -17,6 +17,7 @@ "paths": { "@onecx/accelerator": ["libs/accelerator/src/index.ts"], "@onecx/angular-accelerator": ["libs/angular-accelerator/src/index.ts"], + "@onecx/angular-integration-interface": ["libs/angular-integration-interface/src/index.ts"], "@onecx/angular-testing": ["libs/angular-testing/src/index.ts"], "@onecx/integration-interface": ["libs/integration-interface/src/index.ts"], "@onecx/keycloak-auth": ["libs/keycloak-auth/src/index.ts"],