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:
Marie Verdonck
2020-08-11 23:26:47 +02:00
parent e89d064934
commit e9d77c4d2c
5 changed files with 8 additions and 9 deletions

View File

@@ -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();
});
});

View File

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

View File

@@ -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', () => {

View File

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

View File

@@ -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 }}",