mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
[EC-678] [EC-673] Fix active tab not showing selected while in child route (#3964)
* [PS-1114] hide reporting sidebar if only events * [PS-1114] add orgRedirectGuard * [PS-1114] highlight tabs based on route subset * [PS-1114] redirect to correct child route on tab - Use new OrgRedirectGuard * [PS-1114] add settings redirect using guard - refactored guard to accept array of strings * [EC-678] [EC-673] remove remaining methods * [EC-678][EC-673] address PR feedback - change switch to if statements - remove ternary
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
bitTabListItem
|
||||
[routerLink]="disabled ? null : route"
|
||||
routerLinkActive
|
||||
[routerLinkActiveOptions]="routerLinkMatchOptions"
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive"
|
||||
[disabled]="disabled"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FocusableOption } from "@angular/cdk/a11y";
|
||||
import { AfterViewInit, Component, HostListener, Input, OnDestroy, ViewChild } from "@angular/core";
|
||||
import { RouterLinkActive } from "@angular/router";
|
||||
import { IsActiveMatchOptions, RouterLinkActive } from "@angular/router";
|
||||
import { Subject, takeUntil } from "rxjs";
|
||||
|
||||
import { TabListItemDirective } from "../shared/tab-list-item.directive";
|
||||
@@ -17,6 +17,13 @@ export class TabLinkComponent implements FocusableOption, AfterViewInit, OnDestr
|
||||
@ViewChild(TabListItemDirective) tabItem: TabListItemDirective;
|
||||
@ViewChild("rla") routerLinkActive: RouterLinkActive;
|
||||
|
||||
readonly routerLinkMatchOptions: IsActiveMatchOptions = {
|
||||
queryParams: "ignored",
|
||||
matrixParams: "ignored",
|
||||
paths: "subset",
|
||||
fragment: "ignored",
|
||||
};
|
||||
|
||||
@Input() route: string;
|
||||
@Input() disabled = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user