Merge branch 'w2p-63945_Edit-bitstream-tab' into w2p-64387_Edit+Upload-bitstreams

Conflicts:
	resources/i18n/en.json
	src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.ts
	src/app/core/core.module.ts
	src/app/core/data/bitstream-data.service.ts
	src/app/core/data/item-data.service.ts
This commit is contained in:
Kristof De Langhe
2019-08-21 17:47:53 +02:00
21 changed files with 1196 additions and 150 deletions

View File

@@ -284,6 +284,34 @@ export abstract class DataService<T extends CacheableObject> {
* Return an observable that emits true when the deletion was successful, false when it failed
*/
delete(dso: T): Observable<boolean> {
const requestId = this.deleteAndReturnRequestId(dso);
return this.requestService.getByUUID(requestId).pipe(
find((request: RequestEntry) => request.completed),
map((request: RequestEntry) => request.response.isSuccessful)
);
}
/**
* Delete an existing DSpace Object on the server
* @param dso The DSpace Object to be removed
* Return an observable of the completed response
*/
deleteAndReturnResponse(dso: T): Observable<RestResponse> {
const requestId = this.deleteAndReturnRequestId(dso);
return this.requestService.getByUUID(requestId).pipe(
find((request: RequestEntry) => request.completed),
map((request: RequestEntry) => request.response)
);
}
/**
* Delete an existing DSpace Object on the server
* @param dso The DSpace Object to be removed
* Return the delete request's ID
*/
deleteAndReturnRequestId(dso: T): string {
const requestId = this.requestService.generateRequestId();
const hrefObs = this.halService.getEndpoint(this.linkPath).pipe(
@@ -297,10 +325,7 @@ export abstract class DataService<T extends CacheableObject> {
})
).subscribe();
return this.requestService.getByUUID(requestId).pipe(
find((request: RequestEntry) => request.completed),
map((request: RequestEntry) => request.response.isSuccessful)
);
return requestId;
}
/**