]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/breadcrumbs/breadcrumbs.component.ts
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / core / navigation / breadcrumbs / breadcrumbs.component.ts
index 52a1c2ded1c08a9b5ff7076b45f8c10f9a4d409c..d933081ab9cf5c408a4d50b7f2bdb76401e9cbbc 100644 (file)
@@ -25,10 +25,10 @@ THE SOFTWARE.
 import { Component, Injector, OnDestroy } from '@angular/core';
 import { ActivatedRouteSnapshot, NavigationEnd, NavigationStart, Router } from '@angular/router';
 
-import { from, Observable, of, Subscription } from 'rxjs';
-import { concat, distinct, filter, first, flatMap, toArray } from 'rxjs/operators';
+import { concat, from, Observable, of, Subscription } from 'rxjs';
+import { distinct, filter, first, mergeMap, toArray } from 'rxjs/operators';
 
-import { BreadcrumbsResolver, IBreadcrumb } from '../../../shared/models/breadcrumbs';
+import { BreadcrumbsResolver, IBreadcrumb } from '~/app/shared/models/breadcrumbs';
 
 @Component({
   selector: 'cd-breadcrumbs',
@@ -38,7 +38,7 @@ import { BreadcrumbsResolver, IBreadcrumb } from '../../../shared/models/breadcr
 export class BreadcrumbsComponent implements OnDestroy {
   crumbs: IBreadcrumb[] = [];
   /**
-   * Usefull for e2e tests.
+   * Useful for e2e tests.
    * This allow us to mark the breadcrumb as pending during the navigation from
    * one page to another.
    * This resolves the problem of validating the breadcrumb of a new page and
@@ -62,10 +62,10 @@ export class BreadcrumbsComponent implements OnDestroy {
 
         this._resolveCrumbs(currentRoot)
           .pipe(
-            flatMap((x) => x),
+            mergeMap((x) => x),
             distinct((x) => x.text),
             toArray(),
-            flatMap((x) => {
+            mergeMap((x) => {
               const y = this.postProcess(x);
               return this.wrapIntoObservable<IBreadcrumb[]>(y).pipe(first());
             })
@@ -90,7 +90,7 @@ export class BreadcrumbsComponent implements OnDestroy {
       let resolver: BreadcrumbsResolver;
 
       if (data.breadcrumbs.prototype instanceof BreadcrumbsResolver) {
-        resolver = this.injector.get(data.breadcrumbs);
+        resolver = this.injector.get<BreadcrumbsResolver>(data.breadcrumbs);
       } else {
         resolver = this.defaultResolver;
       }
@@ -102,7 +102,7 @@ export class BreadcrumbsComponent implements OnDestroy {
     }
 
     if (route.firstChild) {
-      crumbs$ = crumbs$.pipe(concat(this._resolveCrumbs(route.firstChild)));
+      crumbs$ = concat<IBreadcrumb[]>(crumbs$, this._resolveCrumbs(route.firstChild));
     }
 
     return crumbs$;