Angular 16 (#2007)
* Removed adv, which isn't needed. * Updated zone * Updated to angular 16 * Updated to angular 16 (partially) * Updated to angular 16 * Package update for Angular 16 (and other dependencies) is complete. * Replaced all takeUntil(this.onDestroy) with new takeUntilDestroyed() * Updated all inputs that have ! to be required and deleted all unit tests. * Corrected how takeUntilDestroyed() is supposed to be implemented.
This commit is contained in:
parent
9bc8361381
commit
9c06cccd35
87 changed files with 3964 additions and 20426 deletions
|
@ -1,9 +1,20 @@
|
|||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
DestroyRef,
|
||||
EventEmitter,
|
||||
inject,
|
||||
Input,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
Output,
|
||||
TemplateRef
|
||||
} from '@angular/core';
|
||||
import { NgbOffcanvas } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { Subject, takeUntil } from 'rxjs';
|
||||
import { Breakpoint, UtilityService } from 'src/app/shared/_services/utility.service';
|
||||
import { NavService } from 'src/app/_services/nav.service';
|
||||
import { ToggleService } from 'src/app/_services/toggle.service';
|
||||
import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
|
||||
|
||||
/**
|
||||
* This should go on all pages which have the side nav present and is not Settings related.
|
||||
|
@ -14,7 +25,7 @@ import { ToggleService } from 'src/app/_services/toggle.service';
|
|||
templateUrl: './side-nav-companion-bar.component.html',
|
||||
styleUrls: ['./side-nav-companion-bar.component.scss']
|
||||
})
|
||||
export class SideNavCompanionBarComponent implements OnInit, OnDestroy {
|
||||
export class SideNavCompanionBarComponent implements OnInit {
|
||||
/**
|
||||
* If the page should show a filter
|
||||
*/
|
||||
|
@ -34,7 +45,7 @@ export class SideNavCompanionBarComponent implements OnInit, OnDestroy {
|
|||
*/
|
||||
@Input() filterActive: boolean = false;
|
||||
|
||||
@Input() extraDrawer!: TemplateRef<any>;
|
||||
@Input() extraDrawer!: TemplateRef<any>;
|
||||
|
||||
|
||||
@Output() filterOpen: EventEmitter<boolean> = new EventEmitter();
|
||||
|
@ -42,9 +53,9 @@ export class SideNavCompanionBarComponent implements OnInit, OnDestroy {
|
|||
isFilterOpen = false;
|
||||
isExtrasOpen = false;
|
||||
|
||||
private onDestroy: Subject<void> = new Subject();
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
constructor(private navService: NavService, private utilityService: UtilityService, public toggleService: ToggleService,
|
||||
constructor(private navService: NavService, private utilityService: UtilityService, public toggleService: ToggleService,
|
||||
private offcanvasService: NgbOffcanvas) {
|
||||
}
|
||||
|
||||
|
@ -52,7 +63,7 @@ export class SideNavCompanionBarComponent implements OnInit, OnDestroy {
|
|||
this.isFilterOpen = this.filterOpenByDefault;
|
||||
|
||||
// If user opens side nav while filter is open on mobile, then collapse filter (as it doesn't render well) TODO: Change this when we have new drawer
|
||||
this.navService.sideNavCollapsed$.pipe(takeUntil(this.onDestroy)).subscribe(sideNavCollapsed => {
|
||||
this.navService.sideNavCollapsed$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(sideNavCollapsed => {
|
||||
if (this.isFilterOpen && sideNavCollapsed && this.utilityService.getActiveBreakpoint() < Breakpoint.Tablet) {
|
||||
this.isFilterOpen = false;
|
||||
this.filterOpen.emit(this.isFilterOpen);
|
||||
|
@ -60,11 +71,6 @@ export class SideNavCompanionBarComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.onDestroy.next();
|
||||
this.onDestroy.complete();
|
||||
}
|
||||
|
||||
toggleFilter() {
|
||||
this.isFilterOpen = !this.isFilterOpen;
|
||||
this.filterOpen.emit(this.isFilterOpen);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue