mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
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:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user