Skip to content

Commit

Permalink
fix: AASTreeComponent updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfaron committed Nov 25, 2024
1 parent f0844b8 commit a5dee67
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions projects/aas-lib/src/lib/aas-tree/aas-tree-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
import { resolveSemanticId, supportedSubmodelTemplates } from '../submodel-template/submodel-template';
import { Tree, TreeNode } from '../tree';
import { basename, normalize } from '../convert';
import { BehaviorSubject } from 'rxjs';
import { signal, WritableSignal } from '@angular/core';

export class AASTreeRow extends TreeNode<aas.Referable> {
public constructor(
Expand All @@ -53,7 +53,7 @@ export class AASTreeRow extends TreeNode<aas.Referable> {
public readonly abbreviation: string,
public readonly name: string,
public readonly typeInfo: string,
public readonly value: BehaviorSubject<string | boolean | undefined>,
public readonly value: WritableSignal<string | boolean | undefined>,
public readonly isLeaf: boolean,
public readonly canOpen: boolean,
parent: number,
Expand Down Expand Up @@ -146,7 +146,7 @@ class TreeInitialize {
getAbbreviation(element.modelType) ?? '',
element.idShort,
this.getTypeInfo(element),
new BehaviorSubject(this.getValue(element, this.language)),
signal(this.getValue(element, this.language)),
isLeaf,
canOpen,
parent,
Expand Down
4 changes: 2 additions & 2 deletions projects/aas-lib/src/lib/aas-tree/aas-tree.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</td>
<td class="text-end">
@if (node.canOpen) {
<a href="javascript:void(0);" class="text-nowrap me-2" (click)="open(node)">{{node.value | async}}</a>
<a href="javascript:void(0);" class="text-nowrap me-2" (click)="open(node)">{{node.value()}}</a>
} @else if (node.element.modelType === 'RelationshipElement') {
<div class="d-flex flex-column ts-x-small me-2">
<a href="javascript:void(0);" class="text-nowrap"
Expand All @@ -61,7 +61,7 @@
(click)="openReference(node.relationship?.second)">{{toString(node.relationship?.second)}}</a>
</div>
} @else {
<div class="text-nowrap me-2">{{node.value | async}}</div>
<div class="text-nowrap me-2">{{node.value()}}</div>
}
</td>
} @else {
Expand Down
6 changes: 3 additions & 3 deletions projects/aas-lib/src/lib/aas-tree/aas-tree.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
*****************************************************************************/

import { AsyncPipe, NgClass, NgStyle } from '@angular/common';
import { NgClass, NgStyle } from '@angular/common';
import { Router } from '@angular/router';
import { Subscription } from 'rxjs';
import { WebSocketSubject } from 'rxjs/webSocket';
Expand Down Expand Up @@ -72,7 +72,7 @@ import { AASTreeService } from './aas-tree.service';
templateUrl: './aas-tree.component.html',
styleUrls: ['./aas-tree.component.scss'],
standalone: true,
imports: [NgClass, NgStyle, TranslateModule, AsyncPipe],
imports: [NgClass, NgStyle, TranslateModule],
providers: [AASTreeSearch, AASTreeService, AASTreeApiService],
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down Expand Up @@ -537,7 +537,7 @@ export class AASTreeComponent implements OnInit, OnDestroy {
continue;
}

row.value.next(
row.value.set(
typeof node.value === 'boolean'
? node.value
: convertToString(node.value, this.translate.currentLang),
Expand Down

0 comments on commit a5dee67

Please sign in to comment.