Angular 14 (#1420)
* Updated to Angular 14 * Fixed all new tslint issues * Fixed a routing bug for Angular 14 * Updated ngBootstrap and bootstrap. Fixed side nav item not highlighting on route change * Refactored how default dark styles are done * Migrated everything to a typed form * Bump versions by dotnet-bump-version. * Fixed a regression where click areas need an explicit z-index * Cleanup some css * Bumped docnet back to the alpha which has our downstream fixes * Updated dependencies to later versions. Mainly just NetVips with some archive fixes. * Fixed broken unit tests (due to some fixes in SharpCompress that changed byte arrays, but not visible quality)
This commit is contained in:
parent
01e874150e
commit
b38a26f92b
71 changed files with 4638 additions and 835 deletions
|
|
@ -1,11 +1,11 @@
|
|||
<ng-container *ngIf="link === undefined || link.length === 0; else useLink">
|
||||
<div class="side-nav-item" [ngClass]="{'closed': (navService?.sideNavCollapsed$ | async), 'active': highlighted}">
|
||||
<div class="side-nav-item" [ngClass]="{'closed': (navService.sideNavCollapsed$ | async), 'active': highlighted}">
|
||||
<ng-container [ngTemplateOutlet]="inner"></ng-container>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-template #useLink>
|
||||
<a class="side-nav-item" href="javascript:void(0);" [ngClass]="{'closed': (navService?.sideNavCollapsed$ | async), 'active': highlighted}" [routerLink]="link">
|
||||
<a class="side-nav-item" href="javascript:void(0);" [ngClass]="{'closed': (navService.sideNavCollapsed$ | async), 'active': highlighted}" [routerLink]="link">
|
||||
<ng-container [ngTemplateOutlet]="inner"></ng-container>
|
||||
</a>
|
||||
</ng-template>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { filter, map, Subject, takeUntil } from 'rxjs';
|
||||
import { NavService } from '../../_services/nav.service';
|
||||
|
|
@ -6,7 +6,8 @@ import { NavService } from '../../_services/nav.service';
|
|||
@Component({
|
||||
selector: 'app-side-nav-item',
|
||||
templateUrl: './side-nav-item.component.html',
|
||||
styleUrls: ['./side-nav-item.component.scss']
|
||||
styleUrls: ['./side-nav-item.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class SideNavItemComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
|
|
@ -29,7 +30,7 @@ export class SideNavItemComponent implements OnInit, OnDestroy {
|
|||
highlighted = false;
|
||||
private onDestroy: Subject<void> = new Subject();
|
||||
|
||||
constructor(public navService: NavService, private router: Router) {
|
||||
constructor(public navService: NavService, private router: Router, private readonly cdRef: ChangeDetectorRef) {
|
||||
router.events
|
||||
.pipe(filter(event => event instanceof NavigationEnd),
|
||||
takeUntil(this.onDestroy),
|
||||
|
|
@ -54,6 +55,7 @@ export class SideNavItemComponent implements OnInit, OnDestroy {
|
|||
updateHightlight(page: string) {
|
||||
if (this.link === undefined) {
|
||||
this.highlighted = false;
|
||||
this.cdRef.markForCheck();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -63,14 +65,17 @@ export class SideNavItemComponent implements OnInit, OnDestroy {
|
|||
|
||||
if (this.comparisonMethod === 'equals' && page === this.link) {
|
||||
this.highlighted = true;
|
||||
this.cdRef.markForCheck();
|
||||
return;
|
||||
}
|
||||
if (this.comparisonMethod === 'startsWith' && page.startsWith(this.link)) {
|
||||
this.highlighted = true;
|
||||
this.cdRef.markForCheck();
|
||||
return;
|
||||
}
|
||||
|
||||
this.highlighted = false;
|
||||
this.cdRef.markForCheck();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue