mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34: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()
|
done()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should show error notification', () => {
|
it('should not invoke metadata-export script', () => {
|
||||||
expect(notificationService.error).toHaveBeenCalled();
|
expect(scriptService.invoke).not.toHaveBeenCalled();
|
||||||
expect(scriptRequestSucceeded).toBeFalse();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -66,7 +66,6 @@ export class ExportMetadataSelectorComponent extends DSOSelectorModalWrapperComp
|
|||||||
resp$.subscribe();
|
resp$.subscribe();
|
||||||
return resp$;
|
return resp$;
|
||||||
} else {
|
} else {
|
||||||
this.notificationsService.error(this.translationService.get('dso-selector.export-metadata.notValidDSO'));
|
|
||||||
return observableOf(false);
|
return observableOf(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -112,7 +112,9 @@ describe('StatisticsService', () => {
|
|||||||
const body = JSON.parse(request.body);
|
const body = JSON.parse(request.body);
|
||||||
|
|
||||||
it('should specify the dsoType', () => {
|
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', () => {
|
it('should specify the scope', () => {
|
||||||
|
@@ -69,8 +69,9 @@ export class StatisticsService {
|
|||||||
Object.assign(body, { configuration: searchOptions.configuration })
|
Object.assign(body, { configuration: searchOptions.configuration })
|
||||||
}
|
}
|
||||||
if (isNotEmpty(searchOptions.dsoTypes)) {
|
if (isNotEmpty(searchOptions.dsoTypes)) {
|
||||||
// TODO: check if backend statistics search even can handle multiple dsoTypes in body
|
// 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, { dsoTypes: searchOptions.dsoTypes.map( dsoType => dsoType.toLowerCase() ) })
|
||||||
|
Object.assign(body, { dsoType: searchOptions.dsoTypes[0].toLowerCase() })
|
||||||
}
|
}
|
||||||
if (hasValue(searchOptions.scope)) {
|
if (hasValue(searchOptions.scope)) {
|
||||||
Object.assign(body, { scope: 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.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.no-results": "No {{ type }} found",
|
||||||
|
|
||||||
"dso-selector.placeholder": "Search for a {{ type }}",
|
"dso-selector.placeholder": "Search for a {{ type }}",
|
||||||
|
Reference in New Issue
Block a user