mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-19 07:53:02 +00:00
[CST-4633] fix issue with view mode when not in params
This commit is contained in:
@@ -2,14 +2,14 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } fro
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { distinctUntilChanged, filter, map } from 'rxjs/operators';
|
import { distinctUntilChanged, map } from 'rxjs/operators';
|
||||||
|
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
|
||||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
||||||
import { ListableObject } from './shared/listable-object.model';
|
import { ListableObject } from './shared/listable-object.model';
|
||||||
import { isEmpty, isNotEmpty } from '../empty.util';
|
import { isEmpty } from '../empty.util';
|
||||||
import { ViewMode } from '../../core/shared/view-mode.model';
|
import { ViewMode } from '../../core/shared/view-mode.model';
|
||||||
import { CollectionElementLinkType } from './collection-element-link.type';
|
import { CollectionElementLinkType } from './collection-element-link.type';
|
||||||
import { PaginatedList } from '../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../core/data/paginated-list.model';
|
||||||
@@ -136,7 +136,6 @@ export class ObjectCollectionComponent implements OnInit {
|
|||||||
this.currentMode$ = this.route
|
this.currentMode$ = this.route
|
||||||
.queryParams
|
.queryParams
|
||||||
.pipe(
|
.pipe(
|
||||||
filter((params) => isNotEmpty(params.view)),
|
|
||||||
map((params) => isEmpty(params?.view) ? ViewMode.ListElement : params.view),
|
map((params) => isEmpty(params?.view) ? ViewMode.ListElement : params.view),
|
||||||
distinctUntilChanged()
|
distinctUntilChanged()
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user