mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
65240: ComCol logo caching issue fix
This commit is contained in:
@@ -182,7 +182,7 @@ export class ComColFormComponent<T extends DSpaceObject> implements OnInit, OnDe
|
|||||||
});
|
});
|
||||||
this.submitForm.emit({
|
this.submitForm.emit({
|
||||||
dso: updatedDSO,
|
dso: updatedDSO,
|
||||||
uploader: this.uploaderComponent.uploader
|
uploader: hasValue(this.uploaderComponent) ? this.uploaderComponent.uploader : undefined
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ export class ComColFormComponent<T extends DSpaceObject> implements OnInit, OnDe
|
|||||||
errorResponse.errorMessage
|
errorResponse.errorMessage
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.refreshCache();
|
(this.dso as any).logo = undefined;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -230,7 +230,6 @@ export class ComColFormComponent<T extends DSpaceObject> implements OnInit, OnDe
|
|||||||
* Refresh the object's cache to ensure the latest version
|
* Refresh the object's cache to ensure the latest version
|
||||||
*/
|
*/
|
||||||
private refreshCache() {
|
private refreshCache() {
|
||||||
(this.dso as any).logo = undefined;
|
|
||||||
this.requestService.removeByHrefSubstring(this.dso.self);
|
this.requestService.removeByHrefSubstring(this.dso.self);
|
||||||
this.objectCache.remove(this.dso.self);
|
this.objectCache.remove(this.dso.self);
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@ import { RemoteData } from '../../../../core/data/remote-data';
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { first, map, take } from 'rxjs/operators';
|
import { first, map, take } from 'rxjs/operators';
|
||||||
import { getSucceededRemoteData } from '../../../../core/shared/operators';
|
import { getSucceededRemoteData } from '../../../../core/shared/operators';
|
||||||
import { isNotUndefined } from '../../../empty.util';
|
import { hasValue, isNotUndefined } from '../../../empty.util';
|
||||||
import { DataService } from '../../../../core/data/data.service';
|
import { DataService } from '../../../../core/data/data.service';
|
||||||
import { ResourceType } from '../../../../core/shared/resource-type';
|
import { ResourceType } from '../../../../core/shared/resource-type';
|
||||||
import { ComColDataService } from '../../../../core/data/comcol-data.service';
|
import { ComColDataService } from '../../../../core/data/comcol-data.service';
|
||||||
@@ -57,14 +57,14 @@ export class ComcolMetadataComponent<TDomain extends DSpaceObject> implements On
|
|||||||
.subscribe((dsoRD: RemoteData<TDomain>) => {
|
.subscribe((dsoRD: RemoteData<TDomain>) => {
|
||||||
if (isNotUndefined(dsoRD)) {
|
if (isNotUndefined(dsoRD)) {
|
||||||
const newUUID = dsoRD.payload.uuid;
|
const newUUID = dsoRD.payload.uuid;
|
||||||
if (uploader.queue.length > 0) {
|
if (hasValue(uploader) && uploader.queue.length > 0) {
|
||||||
this.dsoDataService.getLogoEndpoint(newUUID).pipe(take(1)).subscribe((href: string) => {
|
this.dsoDataService.getLogoEndpoint(newUUID).pipe(take(1)).subscribe((href: string) => {
|
||||||
uploader.options.url = href;
|
uploader.options.url = href;
|
||||||
uploader.uploadAll();
|
uploader.uploadAll();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate([this.frontendURL + newUUID]);
|
this.router.navigate([this.frontendURL + newUUID]);
|
||||||
}
|
}
|
||||||
this.notificationsService.success(null, this.translate.get(this.type.value + '.edit.notifications.success'));
|
this.notificationsService.success(null, this.translate.get(this.type.value + '.edit.notifications.success'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user