Skip to content

Commit

Permalink
added PR review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoAlbano committed Apr 9, 2021
1 parent 41cd969 commit f97cd5b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
@@ -1,18 +1,18 @@
<div id="aspect-list-container" class="adf-aspect-list-container" *ngIf="aspects$ | async as aspects; else loading">
<mat-accordion class="adf-accordion-aspect-list">
<mat-expansion-panel *ngFor="let aspect of aspects; let colIndex = index" [id]="'aspect-list-'+(aspect?.entry?.title ? aspect?.entry?.title : aspect?.entry?.id.replace(':', '-'))">
<mat-expansion-panel-header [id]="'aspect-list-'+(aspect?.entry?.title ? aspect?.entry?.title : aspect?.entry?.id.replace(':', '-'))+'header'">
<mat-expansion-panel *ngFor="let aspect of aspects; let colIndex = index" [id]="'aspect-list-'+getId(aspect)">
<mat-expansion-panel-header [id]="'aspect-list-'+(getId(aspect))+'header'">
<mat-panel-title>
<mat-checkbox class="adf-aspect-list-check-button" [id]="'aspect-list-'+colIndex+'-check'"
[checked]="nodeAspects?.includes(aspect?.entry?.id)"
(click)="onCheckBoxClick($event)"
(change)="onChange($event, aspect?.entry?.id)">
</mat-checkbox>
<p class="adf-aspect-list-element-title">{{aspect?.entry?.title ? aspect?.entry?.title : aspect?.entry?.id}}</p>
<p class="adf-aspect-list-element-title">{{getTitle(aspect)}}</p>
</mat-panel-title>
<mat-panel-description [id]="'aspect-list-'+colIndex+'-title'"
[matTooltip]="(aspect?.entry?.title ? aspect?.entry?.title : aspect?.entry?.id)">
{{aspect?.entry?.title ? aspect?.entry?.title : aspect?.entry?.id}}
[matTooltip]="getTitle(aspect)">
{{getTitle(aspect)}}
</mat-panel-description>
</mat-expansion-panel-header>
<p class="adf-property-paragraph" [id]="'aspect-list-'+colIndex+'-description'"> {{aspect?.entry?.description}}</p>
Expand Down
Expand Up @@ -68,7 +68,7 @@ const aspectListMock: AspectEntry[] = [{

const customAspectListMock: AspectEntry[] = [{
entry: {
parentId: 'cst:customAspect',
parentId: 'cst:parentAspect',
id: 'cst:customAspect',
description: 'Custom Aspect with random description',
title: 'CustomAspect',
Expand All @@ -88,7 +88,7 @@ const customAspectListMock: AspectEntry[] = [{
},
{
entry: {
parentId: 'cst:nonamedAspect',
parentId: 'cst:commonaspect',
id: 'cst:nonamedAspect',
description: '',
title: '',
Expand Down
Expand Up @@ -101,4 +101,12 @@ export class AspectListComponent implements OnInit, OnDestroy {
this.nodeAspects = [];
this.valueChanged.emit(this.nodeAspects);
}

getId(aspect: any): string {
return aspect?.entry?.title ? aspect?.entry?.title : aspect?.entry?.id.replace(':', '-');
}

getTitle(aspect: any): string {
return aspect?.entry?.title ? aspect?.entry?.title : aspect?.entry?.id;
}
}

0 comments on commit f97cd5b

Please sign in to comment.