Cache redesign part 1, and add support for alternative links

This commit is contained in:
Art Lowel
2020-12-11 14:18:44 +01:00
parent f4853972cc
commit 4e18fa35ca
522 changed files with 7537 additions and 6933 deletions

View File

@@ -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)