refactor: simplify breadcrumb component template syntax for clarity

- Replaced switch-case syntax with if-else statements in breadcrumb.component.html to enhance readability and maintainability of the template logic.
- Streamlined the rendering of breadcrumb items while preserving functionality.
This commit is contained in:
Denys Vuika
2026-02-26 11:05:49 +00:00
parent bdb197b520
commit beb00b22ec
@@ -41,27 +41,24 @@
[class.adf-active]="last" [class.adf-active]="last"
title="{{ item.name ?? '' | translate }}" title="{{ item.name ?? '' | translate }}"
class="adf-breadcrumb-item"> class="adf-breadcrumb-item">
@switch (breadcrumbItemIsAnchor(last)) { @if (breadcrumbItemIsAnchor(last)) {
@case (true) { <a
<a href="#"
href="#" [attr.data-automation-id]="'breadcrumb_' + item.name"
[attr.data-automation-id]="'breadcrumb_' + item.name" class="adf-breadcrumb-item-anchor"
class="adf-breadcrumb-item-anchor" (click)="onRoutePathClick(item, $event)"
(click)="onRoutePathClick(item, $event)" >
> {{ item.name ?? '' | translate }}
{{ item.name ?? '' | translate }} </a>
</a> } @else {
} <div class="adf-breadcrumb-item-current" aria-current="location">
@default { {{ (selectedRowItemsCount < 1 ? item.name ?? '' : 'BREADCRUMB.HEADER.SELECTED') | translate: { count: selectedRowItemsCount } }}
<div class="adf-breadcrumb-item-current" aria-current="location"> </div>
{{ (selectedRowItemsCount < 1 ? item.name ?? '' : 'BREADCRUMB.HEADER.SELECTED') | translate: { count: selectedRowItemsCount } }} }
</div>
}
}
@if (!last) { @if (!last) {
<mat-icon class="adf-breadcrumb-item-chevron" adf-icon="chevron_right" /> <mat-icon class="adf-breadcrumb-item-chevron" adf-icon="chevron_right" />
} }
</div> </div>
} }
</nav> </nav>