mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
Cache redesign part 1, and add support for alternative links
This commit is contained in:
@@ -27,7 +27,7 @@ import { FieldUpdate, FieldUpdates } from '../../../core/data/object-updates/obj
|
||||
import { Subscription } from 'rxjs/internal/Subscription';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { CollectionDataService } from '../../../core/data/collection-data.service';
|
||||
import { getSucceededRemoteData } from '../../../core/shared/operators';
|
||||
import { getFirstSucceededRemoteData, getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||
import { MetadataConfig } from '../../../core/shared/metadata-config.model';
|
||||
import { INotification } from '../../../shared/notifications/models/notification.model';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
@@ -255,12 +255,12 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
||||
this.collectionRD$ = this.route.parent.data.pipe(first(), map((data) => data.dso));
|
||||
|
||||
this.collectionRD$.pipe(
|
||||
getSucceededRemoteData(),
|
||||
getFirstSucceededRemoteData(),
|
||||
map((col) => col.payload.uuid),
|
||||
switchMap((uuid) => this.collectionService.getContentSource(uuid)),
|
||||
take(1)
|
||||
).subscribe((contentSource: ContentSource) => {
|
||||
this.initializeOriginalContentSource(contentSource);
|
||||
getFirstCompletedRemoteData(),
|
||||
).subscribe((rd: RemoteData<ContentSource>) => {
|
||||
this.initializeOriginalContentSource(rd.payload);
|
||||
});
|
||||
|
||||
this.updateFieldTranslations();
|
||||
@@ -376,7 +376,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
||||
onSubmit() {
|
||||
// Remove cached harvester request to allow for latest harvester to be displayed when switching tabs
|
||||
this.collectionRD$.pipe(
|
||||
getSucceededRemoteData(),
|
||||
getFirstSucceededRemoteData(),
|
||||
map((col) => col.payload.uuid),
|
||||
switchMap((uuid) => this.collectionService.getHarvesterEndpoint(uuid)),
|
||||
take(1)
|
||||
@@ -384,7 +384,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
||||
|
||||
// Update harvester
|
||||
this.collectionRD$.pipe(
|
||||
getSucceededRemoteData(),
|
||||
getFirstSucceededRemoteData(),
|
||||
map((col) => col.payload.uuid),
|
||||
switchMap((uuid) => this.collectionService.updateContentSource(uuid, this.contentSource)),
|
||||
take(1)
|
||||
|
Reference in New Issue
Block a user