fixed css and html for abstract types and selected tree nodes

This commit is contained in:
Maria Teresa Paratore 2024-01-16 16:49:27 +01:00
parent 55410749be
commit d60db6f0f0
4 changed files with 21 additions and 27 deletions

View File

@ -100,6 +100,7 @@ public class InformationSystemResource {
return ResponseEntity.ok().body(sc);
} catch (Exception e) {
log.error("****ERROR*************");
e.printStackTrace();
log.error(e.getLocalizedMessage(), e);
return ResponseEntity.noContent()
.headers(HeaderUtil.createAlert(applicationName, e.getLocalizedMessage(), "")).build();

View File

@ -1,11 +1,10 @@
<mat-tree [dataSource]="nestedDataSource" [treeControl]="nestedTreeControl" class="example-tree">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle>
<button mat-button (click)="onClickNodeTree(node)">
<span [ngClass]="{'abstr':'node.astratto===true'}">
{{ node.name }} - {{ node.astratto }}
</span>
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle
(click)="activeNode = node" [ngClass]="{ 'background-highlight': activeNode === node }">
<button mat-button (click)="activeNode = node; onClickNodeTree(node);">
<span>{{ node.name }}</span>
</button>
<sup *ngIf="node.astratto">a</sup>
<sup *ngIf="node.astratto">A</sup>
</mat-tree-node>
<mat-nested-tree-node *matTreeNodeDef="let node; when: hasNestedChild">
@ -15,8 +14,10 @@
{{ nestedTreeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}
</mat-icon>
</button>
<button mat-button (click)="onClickNodeTree(node)">
<button mat-button [ngClass]="{ 'background-highlight': activeNode === node }"
(click)="activeNode = node; onClickNodeTree(node);">
{{ node.name }}
<sup *ngIf="node.astratto">A</sup>
</button>
</div>

View File

@ -16,9 +16,16 @@
.example-tree .mat-tree-node :hover {
background-color: bisque;
color: cadetblue;
cursor: pointer;
}
.background-highlight{
background: lightcyan;
}
/*
* This padding sets alignment of the nested nodes.
*/
@ -37,12 +44,3 @@
}
.abstr{
background: teal;
}
/*
.not-active{
background-color: transparent;
}
*/

View File

@ -17,7 +17,7 @@ import { IResourceType } from 'app/services/i-resource-type';
export class RscTreeComponent implements OnInit{
nestedTreeControl = new NestedTreeControl<IResource>(node => node.children);
nestedDataSource = new MatTreeNestedDataSource<IResource>();
statusClass = 'not-active';
activeNode: any;
@Output() public resourceTypeEm = new EventEmitter<string>();
@Output() public typeObjectEm = new EventEmitter<IResourceType>();
@ -47,16 +47,10 @@ hasNestedChild(_: number, node: IResource): boolean {
const obj: IResourceType = {
name: node.name,
id: node.id,
astratto:node.astratto,
astratto: Boolean(node.astratto),
description:node.description,
};
this.typeObjectEm.emit(obj);
}
setActiveClass():void{
this.statusClass = 'active';
}
}
}