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,8 +41,7 @@
[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"
@@ -51,13 +50,11 @@
> >
{{ item.name ?? '' | translate }} {{ item.name ?? '' | translate }}
</a> </a>
} } @else {
@default {
<div class="adf-breadcrumb-item-current" aria-current="location"> <div class="adf-breadcrumb-item-current" aria-current="location">
{{ (selectedRowItemsCount < 1 ? item.name ?? '' : 'BREADCRUMB.HEADER.SELECTED') | translate: { count: selectedRowItemsCount } }} {{ (selectedRowItemsCount < 1 ? item.name ?? '' : 'BREADCRUMB.HEADER.SELECTED') | translate: { count: selectedRowItemsCount } }}
</div> </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" />