diff --git a/package-lock.json b/package-lock.json index e83a813..516a59f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,7 +76,6 @@ "@angular/compiler-cli": "^17.3.4", "@babel/plugin-syntax-import-attributes": "^7.24.1", "@jest/globals": "^29.7.0", - "@ngrx/eslint-plugin": "^17.2.0", "@semantic-release/git": "^10.0.1", "@semantic-release/github": "^10.0.3", "@types/bcryptjs": "^2.4.6", @@ -4987,22 +4986,6 @@ "rxjs": "^6.5.3 || ^7.5.0" } }, - "node_modules/@ngrx/eslint-plugin": { - "version": "17.2.0", - "resolved": "https://registry.npmjs.org/@ngrx/eslint-plugin/-/eslint-plugin-17.2.0.tgz", - "integrity": "sha512-fkbv98Pch92R0AYj5pzU9YWicn5JZWVex3BqSdfV1xsuTk53QDhZZ0yIDSqjvjubv4J6GGxm5dnpEjceE4Wx/g==", - "dev": true, - "dependencies": { - "@typescript-eslint/experimental-utils": "^5.4.0", - "eslint-etc": "^5.1.0", - "semver": "^7.3.5", - "strip-json-comments": "3.1.1" - }, - "peerDependencies": { - "eslint": ">=8.0.0", - "typescript": "*" - } - }, "node_modules/@ngrx/operators": { "version": "17.0.0-beta.0", "resolved": "https://registry.npmjs.org/@ngrx/operators/-/operators-17.0.0-beta.0.tgz", @@ -7560,176 +7543,6 @@ "eslint": "^8.56.0" } }, - "node_modules/@typescript-eslint/experimental-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.62.0.tgz", - "integrity": "sha512-RTXpeB3eMkpoclG3ZHft6vG/Z30azNHuqY6wKPBHlVMZFuEvrtlEDe8gMqDb+SO+9hjC/pLekeSCryf9vMZlCw==", - "dev": true, - "dependencies": { - "@typescript-eslint/utils": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/@typescript-eslint/parser": { "version": "7.7.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.7.0.tgz", @@ -12135,21 +11948,6 @@ "eslint": ">=7.0.0" } }, - "node_modules/eslint-etc": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/eslint-etc/-/eslint-etc-5.2.1.tgz", - "integrity": "sha512-lFJBSiIURdqQKq9xJhvSJFyPA+VeTh5xvk24e8pxVL7bwLBtGF60C/KRkLTMrvCZ6DA3kbPuYhLWY0TZMlqTsg==", - "dev": true, - "dependencies": { - "@typescript-eslint/experimental-utils": "^5.0.0", - "tsutils": "^3.17.1", - "tsutils-etc": "^1.4.1" - }, - "peerDependencies": { - "eslint": "^8.0.0", - "typescript": ">=4.0.0" - } - }, "node_modules/eslint-plugin-prettier": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", @@ -28965,45 +28763,6 @@ "yarn": ">=1.9.4" } }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils-etc": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/tsutils-etc/-/tsutils-etc-1.4.2.tgz", - "integrity": "sha512-2Dn5SxTDOu6YWDNKcx1xu2YUy6PUeKrWZB/x2cQ8vY2+iz3JRembKn/iZ0JLT1ZudGNwQQvtFX9AwvRHbXuPUg==", - "dev": true, - "dependencies": { - "@types/yargs": "^17.0.0", - "yargs": "^17.0.0" - }, - "bin": { - "ts-flags": "bin/ts-flags", - "ts-kind": "bin/ts-kind" - }, - "peerDependencies": { - "tsutils": "^3.0.0", - "typescript": ">=4.0.0" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/tsyringe": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/tsyringe/-/tsyringe-4.8.0.tgz", diff --git a/package.json b/package.json index 59cd0d1..38249f8 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,6 @@ "@angular/compiler-cli": "^17.3.4", "@babel/plugin-syntax-import-attributes": "^7.24.1", "@jest/globals": "^29.7.0", - "@ngrx/eslint-plugin": "^17.2.0", "@semantic-release/git": "^10.0.1", "@semantic-release/github": "^10.0.3", "@types/bcryptjs": "^2.4.6", diff --git a/projects/aas-lib/.eslintrc.json b/projects/aas-lib/.eslintrc.json index b493e9b..9e81a3f 100644 --- a/projects/aas-lib/.eslintrc.json +++ b/projects/aas-lib/.eslintrc.json @@ -44,9 +44,6 @@ { "files": [ "*.ts" - ], - "extends": [ - "plugin:@ngrx/recommended" ] } ] diff --git a/projects/aas-lib/src/lib/aas-lib.module.ts b/projects/aas-lib/src/lib/aas-lib.module.ts deleted file mode 100644 index b85d7e8..0000000 --- a/projects/aas-lib/src/lib/aas-lib.module.ts +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** - * - * Copyright (c) 2019-2024 Fraunhofer IOSB-INA Lemgo, - * eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - * zur Foerderung der angewandten Forschung e.V. - * - *****************************************************************************/ - -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { FormsModule } from '@angular/forms'; - -import { NotifyComponent } from './notify/notify.component'; -import { LocalizeComponent } from './localize/localize.component'; -import { LoginFormComponent } from './auth/login-form/login-form.component'; -import { RegisterFormComponent } from './auth/register-form/register-form.component'; -import { ProfileFormComponent } from './auth/profile-form/profile-form.component'; -import { AuthComponent } from './auth/auth.component'; -import { LibraryTableComponent } from './library-table/library-table.component'; -import { HttpClientModule } from '@angular/common/http'; -import { MaxLengthPipe } from './max-length.pipe'; -import { AASTableComponent } from './aas-table/aas-table.component'; -import { SortableHeaderDirective } from './sortable-header.directive'; -import { AASTreeComponent } from './aas-tree/aas-tree.component'; -import { OperationCallFormComponent } from './aas-tree/operation-call-form/operation-call-form.component'; -import { ShowImageFormComponent } from './aas-tree/show-image-form/show-image-form.component'; -import { ShowVideoFormComponent } from './aas-tree/show-video-form/show-video-form.component'; -import { CustomerFeedbackComponent } from './customer-feedback/customer-feedback.component'; -import { ScoreComponent } from './score/score.component'; -import { DigitalNameplateComponent } from './digital-nameplate/digital-nameplate.component'; -import { MessageTableComponent } from './message-table/message-table.component'; -import { SecuredImageComponent } from './secured-image/secured-image.component'; -import { ClipboardService } from './clipboard.service'; -import { TemplateService } from './template.service'; -import { IndexChangeService } from './index-change.service'; - -@NgModule({ - declarations: [ - NotifyComponent, - LocalizeComponent, - LoginFormComponent, - RegisterFormComponent, - ProfileFormComponent, - AuthComponent, - LibraryTableComponent, - MaxLengthPipe, - SortableHeaderDirective, - AASTableComponent, - AASTreeComponent, - OperationCallFormComponent, - ShowImageFormComponent, - ShowVideoFormComponent, - CustomerFeedbackComponent, - ScoreComponent, - DigitalNameplateComponent, - MessageTableComponent, - SecuredImageComponent, - ], - imports: [CommonModule, FormsModule, TranslateModule, NgbModule, HttpClientModule], - exports: [ - NotifyComponent, - LocalizeComponent, - LoginFormComponent, - RegisterFormComponent, - ProfileFormComponent, - AuthComponent, - LibraryTableComponent, - MaxLengthPipe, - SortableHeaderDirective, - AASTableComponent, - AASTreeComponent, - CustomerFeedbackComponent, - ScoreComponent, - DigitalNameplateComponent, - MessageTableComponent, - SecuredImageComponent, - ], - providers: [ClipboardService, TemplateService, IndexChangeService], -}) -export class AASLibModule {} diff --git a/projects/aas-lib/src/lib/aas-table/aas-table.component.html b/projects/aas-lib/src/lib/aas-table/aas-table.component.html index e2d8074..adb4eb1 100644 --- a/projects/aas-lib/src/lib/aas-table/aas-table.component.html +++ b/projects/aas-lib/src/lib/aas-table/aas-table.component.html @@ -6,6 +6,7 @@ ! !----------------------------------------------------------------------------> +@if (rows.length > 0) { @if (viewMode === 'list') { @@ -137,4 +138,7 @@ }
+} +} @else { + } \ No newline at end of file diff --git a/projects/aas-lib/src/lib/aas-table/aas-table.component.ts b/projects/aas-lib/src/lib/aas-table/aas-table.component.ts index cf78a43..7508f63 100644 --- a/projects/aas-lib/src/lib/aas-table/aas-table.component.ts +++ b/projects/aas-lib/src/lib/aas-table/aas-table.component.ts @@ -15,13 +15,17 @@ import { AASTableRow } from './aas-table-row'; import { ClipboardService } from '../clipboard.service'; import { WindowService } from '../window.service'; import { ViewMode } from '../types/view-mode'; -import { TranslateService } from '@ngx-translate/core'; import { AASTableStore } from './aas-table.store'; +import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; +import { MaxLengthPipe } from '../max-length.pipe'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'fhg-aas-table', templateUrl: './aas-table.component.html', styleUrls: ['./aas-table.component.scss'], + standalone: true, + imports: [NgbTooltip, MaxLengthPipe, TranslateModule], providers: [AASTableStore], }) export class AASTableComponent implements OnInit, OnDestroy { @@ -31,7 +35,6 @@ export class AASTableComponent implements OnInit, OnDestroy { public constructor( private readonly router: Router, - private readonly translate: TranslateService, private readonly store: AASTableStore, private readonly clipboard: ClipboardService, private readonly window: WindowService, diff --git a/projects/aas-lib/src/lib/aas-tree/aas-tree-search.ts b/projects/aas-lib/src/lib/aas-tree/aas-tree-search.ts index e6a6a3a..87663f7 100644 --- a/projects/aas-lib/src/lib/aas-tree/aas-tree-search.ts +++ b/projects/aas-lib/src/lib/aas-tree/aas-tree-search.ts @@ -8,7 +8,7 @@ import { Injectable } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { trim } from 'lodash-es'; +import trim from 'lodash-es/trim'; import { Subscription } from 'rxjs'; import { aas, @@ -27,7 +27,7 @@ import { AASTreeStore, Operator, SearchQuery, SearchTerm } from './aas-tree.stor @Injectable() export class AASTreeSearch { private readonly loop = true; - private subscription = new Subscription(); + private readonly subscription = new Subscription(); public constructor( private readonly store: AASTreeStore, diff --git a/projects/aas-lib/src/lib/aas-tree/aas-tree.component.html b/projects/aas-lib/src/lib/aas-tree/aas-tree.component.html index 448574d..53c5d3b 100644 --- a/projects/aas-lib/src/lib/aas-tree/aas-tree.component.html +++ b/projects/aas-lib/src/lib/aas-tree/aas-tree.component.html @@ -127,7 +127,5 @@ } @else { -
-
{{message}}
-
+ } \ No newline at end of file diff --git a/projects/aas-lib/src/lib/aas-tree/aas-tree.component.ts b/projects/aas-lib/src/lib/aas-tree/aas-tree.component.ts index 92aaf09..65e02e9 100644 --- a/projects/aas-lib/src/lib/aas-tree/aas-tree.component.ts +++ b/projects/aas-lib/src/lib/aas-tree/aas-tree.component.ts @@ -7,12 +7,13 @@ *****************************************************************************/ import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; +import { NgClass, NgStyle } from '@angular/common'; import { BehaviorSubject, Subscription, Observable } from 'rxjs'; import { WebSocketSubject } from 'rxjs/webSocket'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { Router } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { isEqual } from 'lodash-es'; +import isEqual from 'lodash-es/isEqual'; import { aas, LiveNode, @@ -60,6 +61,8 @@ interface PropertyValue { selector: 'fhg-aas-tree', templateUrl: './aas-tree.component.html', styleUrls: ['./aas-tree.component.scss'], + standalone: true, + imports: [NgClass, NgStyle, TranslateModule], providers: [AASTreeSearch, AASTreeStore], }) export class AASTreeComponent implements OnInit, OnChanges, OnDestroy { @@ -140,6 +143,14 @@ export class AASTreeComponent implements OnInit, OnChanges, OnDestroy { return this.store.nodes; } + public readonly selectMatchIndex = this.store.selectMatchIndex; + + public readonly selectMatchRow = this.store.selectMatchRow; + + public get rows(): AASTreeRow[] { + return this.store.rows; + } + public ngOnInit(): void { this.subscription.add( this.store.selectSelectedElements.pipe().subscribe(elements => { diff --git a/projects/aas-lib/src/lib/aas-tree/operation-call-form/operation-call-form.component.ts b/projects/aas-lib/src/lib/aas-tree/operation-call-form/operation-call-form.component.ts index f83b9ad..861b97d 100644 --- a/projects/aas-lib/src/lib/aas-tree/operation-call-form/operation-call-form.component.ts +++ b/projects/aas-lib/src/lib/aas-tree/operation-call-form/operation-call-form.component.ts @@ -6,9 +6,10 @@ * *****************************************************************************/ -import { cloneDeep } from 'lodash-es'; +import cloneDeep from 'lodash-es/cloneDeep'; import { Component } from '@angular/core'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { FormsModule } from '@angular/forms'; +import { NgbActiveModal, NgbToast } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; import { AASTreeApiService } from '../aas-tree-api.service'; import { messageToString } from '../../convert'; @@ -40,6 +41,8 @@ export interface Bla { selector: 'fhg-operation-call', templateUrl: './operation-call-form.component.html', styleUrls: ['./operation-call-form.component.scss'], + standalone: true, + imports: [NgbToast, FormsModule], }) export class OperationCallFormComponent { private _operation!: aas.Operation; diff --git a/projects/aas-lib/src/lib/aas-tree/show-image-form/show-image-form.component.ts b/projects/aas-lib/src/lib/aas-tree/show-image-form/show-image-form.component.ts index 54b4210..32f43a9 100644 --- a/projects/aas-lib/src/lib/aas-tree/show-image-form/show-image-form.component.ts +++ b/projects/aas-lib/src/lib/aas-tree/show-image-form/show-image-form.component.ts @@ -8,11 +8,14 @@ import { Component } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { SecuredImageComponent } from '../../secured-image/secured-image.component'; @Component({ selector: 'fhg-show-image', templateUrl: './show-image-form.component.html', styleUrls: ['./show-image-form.component.scss'], + standalone: true, + imports: [SecuredImageComponent], }) export class ShowImageFormComponent { private readonly _modal: NgbActiveModal; diff --git a/projects/aas-lib/src/lib/aas-tree/show-video-form/show-video-form.component.ts b/projects/aas-lib/src/lib/aas-tree/show-video-form/show-video-form.component.ts index e41f25b..2ca1991 100644 --- a/projects/aas-lib/src/lib/aas-tree/show-video-form/show-video-form.component.ts +++ b/projects/aas-lib/src/lib/aas-tree/show-video-form/show-video-form.component.ts @@ -13,6 +13,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; selector: 'fhg-show-video', templateUrl: './show-video-form.component.html', styleUrls: ['./show-video-form.component.scss'], + standalone: true, }) export class ShowVideoFormComponent { private readonly _modal: NgbActiveModal; diff --git a/projects/aas-lib/src/lib/auth/auth.component.html b/projects/aas-lib/src/lib/auth/auth.component.html index 09faa4a..89eff8c 100644 --- a/projects/aas-lib/src/lib/auth/auth.component.html +++ b/projects/aas-lib/src/lib/auth/auth.component.html @@ -17,16 +17,12 @@ @if (!userAuthenticated) { CMD_LOGIN - } - @if (!userAuthenticated) { CMD_REGISTER_USER - } - @if (userAuthenticated) { CMD_UPDATE_PROFILE } - @if (userAuthenticated) { + @else { CMD_LOGOUT } diff --git a/projects/aas-lib/src/lib/auth/auth.component.ts b/projects/aas-lib/src/lib/auth/auth.component.ts index daa48ec..3907a85 100644 --- a/projects/aas-lib/src/lib/auth/auth.component.ts +++ b/projects/aas-lib/src/lib/auth/auth.component.ts @@ -9,11 +9,15 @@ import { Component } from '@angular/core'; import { NotifyService } from '../notify/notify.service'; import { AuthService } from './auth.service'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'fhg-auth', templateUrl: './auth.component.html', styleUrls: ['./auth.component.scss'], + standalone: true, + imports: [NgbModule, TranslateModule], }) export class AuthComponent { public constructor( diff --git a/projects/aas-lib/src/lib/auth/auth.service.ts b/projects/aas-lib/src/lib/auth/auth.service.ts index 66e5ae4..16eced5 100644 --- a/projects/aas-lib/src/lib/auth/auth.service.ts +++ b/projects/aas-lib/src/lib/auth/auth.service.ts @@ -9,7 +9,7 @@ import { Injectable } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; -import { BehaviorSubject, catchError, first, from, map, mergeMap, Observable, of, throwError } from 'rxjs'; +import { BehaviorSubject, catchError, from, map, mergeMap, Observable, of, throwError } from 'rxjs'; import { jwtDecode } from 'jwt-decode'; import { ApplicationError, @@ -255,18 +255,12 @@ export class AuthService { * @returns The cookie value. */ public getCookie(name: string): Observable { - return this.ready.pipe( - first(ready => ready === true), - mergeMap(() => this.payload), - first(), - mergeMap(payload => { - if (payload && payload.sub) { - return this.api.getCookie(payload.sub, name).pipe(map(cookie => cookie?.data)); - } + const payload = this.payload$.getValue(); + if (payload && payload.sub) { + return this.api.getCookie(payload.sub, name).pipe(map(cookie => cookie?.data)); + } - return of(this.window.getLocalStorageItem(name) ?? undefined); - }), - ); + return of(this.window.getLocalStorageItem(name) ?? undefined); } /** diff --git a/projects/aas-lib/src/lib/auth/login-form/login-form.component.html b/projects/aas-lib/src/lib/auth/login-form/login-form.component.html index 7032d32..b3f9aa5 100644 --- a/projects/aas-lib/src/lib/auth/login-form/login-form.component.html +++ b/projects/aas-lib/src/lib/auth/login-form/login-form.component.html @@ -37,7 +37,7 @@