Commits

Tim Donohue authored and GitHub committed 09bdc7a0e3d Merge
Merge pull request #891 from atmire/DSO-404-fix

Fix DSO 404 pages
No tags
gidlmaster

src/app/+collection-page/collection-page.component.ts

Modified
10 10 import { RemoteData } from '../core/data/remote-data';
11 11
12 12 import { MetadataService } from '../core/metadata/metadata.service';
13 13 import { Bitstream } from '../core/shared/bitstream.model';
14 14
15 15 import { Collection } from '../core/shared/collection.model';
16 16 import { DSpaceObjectType } from '../core/shared/dspace-object-type.model';
17 17 import { Item } from '../core/shared/item.model';
18 18 import {
19 19 getSucceededRemoteData,
20 - redirectToPageNotFoundOn404,
20 + redirectOn404Or401,
21 21 toDSpaceObjectListRD
22 22 } from '../core/shared/operators';
23 23
24 24 import { fadeIn, fadeInOut } from '../shared/animations/fade';
25 25 import { hasNoValue, hasValue, isNotEmpty } from '../shared/empty.util';
26 26 import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
27 27
28 28 @Component({
29 29 selector: 'ds-collection-page',
30 30 styleUrls: ['./collection-page.component.scss'],
56 56 this.paginationConfig = new PaginationComponentOptions();
57 57 this.paginationConfig.id = 'collection-page-pagination';
58 58 this.paginationConfig.pageSize = 5;
59 59 this.paginationConfig.currentPage = 1;
60 60 this.sortConfig = new SortOptions('dc.date.accessioned', SortDirection.DESC);
61 61 }
62 62
63 63 ngOnInit(): void {
64 64 this.collectionRD$ = this.route.data.pipe(
65 65 map((data) => data.dso as RemoteData<Collection>),
66 - redirectToPageNotFoundOn404(this.router),
66 + redirectOn404Or401(this.router),
67 67 take(1)
68 68 );
69 69 this.logoRD$ = this.collectionRD$.pipe(
70 70 map((rd: RemoteData<Collection>) => rd.payload),
71 71 filter((collection: Collection) => hasValue(collection)),
72 72 flatMap((collection: Collection) => collection.logo)
73 73 );
74 74
75 75 this.paginationChanges$ = new BehaviorSubject({
76 76 paginationConfig: this.paginationConfig,

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut