From 6ce65aeb4e64dac8566f8b3c80eb1d709601ab48 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Thu, 26 Feb 2026 09:47:42 +0000 Subject: [PATCH] refactor: enhance breadcrumb component templates for improved readability and functionality - Updated breadcrumb.component.html and dropdown-breadcrumb.component.html to use structural directives for better readability and maintainability. - Simplified the rendering of previous nodes and last nodes in the breadcrumb, ensuring proper handling of optional values. - Removed unnecessary imports in dropdown-breadcrumb.component.ts to streamline the component's dependencies. --- .../lib/breadcrumb/breadcrumb.component.html | 101 +++++++++--------- .../dropdown-breadcrumb.component.html | 73 +++++++------ .../dropdown-breadcrumb.component.ts | 4 +- 3 files changed, 89 insertions(+), 89 deletions(-) diff --git a/lib/content-services/src/lib/breadcrumb/breadcrumb.component.html b/lib/content-services/src/lib/breadcrumb/breadcrumb.component.html index f3c44b5e38..cf5b4bcf29 100644 --- a/lib/content-services/src/lib/breadcrumb/breadcrumb.component.html +++ b/lib/content-services/src/lib/breadcrumb/breadcrumb.component.html @@ -5,59 +5,60 @@ role="navigation" [attr.aria-label]="'BREADCRUMB.ARIA-LABEL.BREADCRUMB' | translate" > - - - - - {{ node.name | translate }} - - - -
- + + +
+ + - {{ item.name | translate }} - + @for (node of previousNodes; track node.id) { + + {{ node.name ?? '' | translate }} + + } + + } -
- {{ (selectedRowItemsCount < 1 ? item.name : 'BREADCRUMB.HEADER.SELECTED') | translate: { count: selectedRowItemsCount } }} + @for (item of lastNodes; track item.id; let last = $last) { +
+ + {{ item.name ?? '' | translate }} + + +
+ {{ (selectedRowItemsCount < 1 ? item.name : 'BREADCRUMB.HEADER.SELECTED') | translate: { count: selectedRowItemsCount } }} +
+ +
- - -
+ } diff --git a/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.html b/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.html index 27d46ffaa6..3184f88e13 100644 --- a/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.html +++ b/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.html @@ -1,48 +1,47 @@ - +} diff --git a/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.ts b/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.ts index 8046cb139c..aee685b288 100644 --- a/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.ts +++ b/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.ts @@ -19,13 +19,13 @@ import { Component, OnChanges, ViewChild, ViewEncapsulation } from '@angular/cor import { MatSelect, MatSelectModule } from '@angular/material/select'; import { PathElement, Node } from '@alfresco/js-api'; import { BreadcrumbComponent } from './breadcrumb.component'; -import { CommonModule } from '@angular/common'; + import { TranslatePipe } from '@ngx-translate/core'; import { IconModule } from '@alfresco/adf-core'; @Component({ selector: 'adf-dropdown-breadcrumb', - imports: [CommonModule, IconModule, MatSelectModule, TranslatePipe], + imports: [IconModule, MatSelectModule, TranslatePipe], templateUrl: './dropdown-breadcrumb.component.html', styleUrls: ['./dropdown-breadcrumb.component.scss'], encapsulation: ViewEncapsulation.None,