Skip to content

Commit

Permalink
fix(ui): mobile breadcrumb for group service
Browse files Browse the repository at this point in the history
EBS-1147 STPA-268
  • Loading branch information
keit.jarve committed Oct 26, 2023
1 parent 61dacfa commit d39c32e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/ui/src/lib/breadcrumbs/breadcrumbs.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export class BreadcrumbsComponent {
/** Name of an icon in front of breadcrumb */
@Input() iconName: CviIconName | null = null;

@Input() isGroupService = false;

@Output() breadcrumbChange = new EventEmitter<number>();

mobileBreadcrumbIndex!: number;
Expand All @@ -26,7 +28,10 @@ export class BreadcrumbsComponent {
// Finds the index of last element starting from penultimate element in the list that has a href.
// If no such elements exist, returns index of last element.
public getMobileBreadcrumbIndex(): number {
const lastElementIndex = this.breadcrumbs.length - 1;
let lastElementIndex = this.breadcrumbs.length - 1;
if (this.isGroupService) {
lastElementIndex -= 1;
}
for (let index = lastElementIndex - 1; index >= 0; index--) {
if (index !== lastElementIndex && this.breadcrumbs[index].href) {
return index;
Expand Down

0 comments on commit d39c32e

Please sign in to comment.