mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
72444: statistics searchevent.dsoTypes changed until backend changes
& error on export modal dso selector for item removed, only returns comcols, not items now & test fixes
This commit is contained in:
@@ -130,9 +130,8 @@ describe('ExportMetadataSelectorComponent', () => {
|
||||
done()
|
||||
});
|
||||
});
|
||||
it('should show error notification', () => {
|
||||
expect(notificationService.error).toHaveBeenCalled();
|
||||
expect(scriptRequestSucceeded).toBeFalse();
|
||||
it('should not invoke metadata-export script', () => {
|
||||
expect(scriptService.invoke).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -66,7 +66,6 @@ export class ExportMetadataSelectorComponent extends DSOSelectorModalWrapperComp
|
||||
resp$.subscribe();
|
||||
return resp$;
|
||||
} else {
|
||||
this.notificationsService.error(this.translationService.get('dso-selector.export-metadata.notValidDSO'));
|
||||
return observableOf(false);
|
||||
}
|
||||
}
|
||||
|
@@ -112,7 +112,9 @@ describe('StatisticsService', () => {
|
||||
const body = JSON.parse(request.body);
|
||||
|
||||
it('should specify the dsoType', () => {
|
||||
expect(body.dsoTypes).toBe('item');
|
||||
// TODO: change when backend statistics search even can handle multiple dsoTypes in body
|
||||
// expect(body.dsoTypes).toBe(['item']);
|
||||
expect(body.dsoType).toBe('item');
|
||||
});
|
||||
|
||||
it('should specify the scope', () => {
|
||||
|
@@ -69,8 +69,9 @@ export class StatisticsService {
|
||||
Object.assign(body, { configuration: searchOptions.configuration })
|
||||
}
|
||||
if (isNotEmpty(searchOptions.dsoTypes)) {
|
||||
// TODO: check if backend statistics search even can handle multiple dsoTypes in body
|
||||
Object.assign(body, { dsoTypes: searchOptions.dsoTypes.map( dsoType => dsoType.toLowerCase() ) })
|
||||
// TODO: change when backend statistics search even can handle multiple dsoTypes in body
|
||||
// Object.assign(body, { dsoTypes: searchOptions.dsoTypes.map( dsoType => dsoType.toLowerCase() ) })
|
||||
Object.assign(body, { dsoType: searchOptions.dsoTypes[0].toLowerCase() })
|
||||
}
|
||||
if (hasValue(searchOptions.scope)) {
|
||||
Object.assign(body, { scope: searchOptions.scope })
|
||||
|
@@ -989,8 +989,6 @@
|
||||
|
||||
"dso-selector.export-metadata.dspaceobject.head": "Export metadata from",
|
||||
|
||||
"dso-selector.export-metadata.notValidDSO": "You can only export metadata for collections and communities",
|
||||
|
||||
"dso-selector.no-results": "No {{ type }} found",
|
||||
|
||||
"dso-selector.placeholder": "Search for a {{ type }}",
|
||||
|
Reference in New Issue
Block a user