mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 21:43:04 +00:00
renamed dspaceObject to indexableObject
This commit is contained in:
@@ -9,7 +9,7 @@ export class MyDSpaceResult<T extends DSpaceObject> implements ListableObject {
|
|||||||
/**
|
/**
|
||||||
* The DSpaceObject that was found
|
* The DSpaceObject that was found
|
||||||
*/
|
*/
|
||||||
dspaceObject: T;
|
indexableObject: T;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The metadata that was used to find this item, hithighlighted
|
* The metadata that was used to find this item, hithighlighted
|
||||||
|
@@ -9,8 +9,8 @@ export class NormalizedSearchResult implements ListableObject {
|
|||||||
/**
|
/**
|
||||||
* The UUID of the DSpaceObject that was found
|
* The UUID of the DSpaceObject that was found
|
||||||
*/
|
*/
|
||||||
@autoserializeAs(String, 'resultObject')
|
@autoserialize
|
||||||
dspaceObject: string;
|
indexableObject: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The metadata that was used to find this item, hithighlighted
|
* The metadata that was used to find this item, hithighlighted
|
||||||
|
@@ -9,7 +9,7 @@ export class SearchResult<T extends DSpaceObject> implements ListableObject {
|
|||||||
/**
|
/**
|
||||||
* The DSpaceObject that was found
|
* The DSpaceObject that was found
|
||||||
*/
|
*/
|
||||||
dspaceObject: T;
|
indexableObject: T;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The metadata that was used to find this item, hithighlighted
|
* The metadata that was used to find this item, hithighlighted
|
||||||
|
@@ -133,9 +133,9 @@ export class SearchService implements OnDestroy {
|
|||||||
const dsoObs: Observable<RemoteData<DSpaceObject[]>> = sqrObs.pipe(
|
const dsoObs: Observable<RemoteData<DSpaceObject[]>> = sqrObs.pipe(
|
||||||
map((sqr: SearchQueryResponse) => {
|
map((sqr: SearchQueryResponse) => {
|
||||||
return sqr.objects
|
return sqr.objects
|
||||||
.filter((nsr: NormalizedSearchResult) => isNotUndefined(nsr.dspaceObject))
|
.filter((nsr: NormalizedSearchResult) => isNotUndefined(nsr.indexableObject))
|
||||||
.map((nsr: NormalizedSearchResult) => {
|
.map((nsr: NormalizedSearchResult) => {
|
||||||
return this.rdb.buildSingle(nsr.dspaceObject);
|
return this.rdb.buildSingle(nsr.indexableObject);
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
switchMap((input: Array<Observable<RemoteData<DSpaceObject>>>) => this.rdb.aggregate(input)),
|
switchMap((input: Array<Observable<RemoteData<DSpaceObject>>>) => this.rdb.aggregate(input)),
|
||||||
@@ -150,7 +150,7 @@ export class SearchService implements OnDestroy {
|
|||||||
const constructor: GenericConstructor<ListableObject> = dsos.payload[index].constructor as GenericConstructor<ListableObject>;
|
const constructor: GenericConstructor<ListableObject> = dsos.payload[index].constructor as GenericConstructor<ListableObject>;
|
||||||
co = getSearchResultFor(constructor, searchOptions.configuration);
|
co = getSearchResultFor(constructor, searchOptions.configuration);
|
||||||
return Object.assign(new co(), object, {
|
return Object.assign(new co(), object, {
|
||||||
dspaceObject: dsos.payload[index]
|
indexableObject: dsos.payload[index]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
@@ -40,7 +40,7 @@ export class MyDSpaceResponseParsingService implements ResponseParsingService {
|
|||||||
|
|
||||||
const dsoSelfLinks = payload._embedded.objects
|
const dsoSelfLinks = payload._embedded.objects
|
||||||
.filter((object) => hasValue(object._embedded))
|
.filter((object) => hasValue(object._embedded))
|
||||||
.map((object) => object._embedded.resultObject)
|
.map((object) => object._embedded.indexableObject)
|
||||||
.map((dso) => this.dsoParser.parse(request, {
|
.map((dso) => this.dsoParser.parse(request, {
|
||||||
payload: dso,
|
payload: dso,
|
||||||
statusCode: data.statusCode,
|
statusCode: data.statusCode,
|
||||||
@@ -52,7 +52,7 @@ export class MyDSpaceResponseParsingService implements ResponseParsingService {
|
|||||||
const objects = payload._embedded.objects
|
const objects = payload._embedded.objects
|
||||||
.filter((object) => hasValue(object._embedded))
|
.filter((object) => hasValue(object._embedded))
|
||||||
.map((object, index) => Object.assign({}, object, {
|
.map((object, index) => Object.assign({}, object, {
|
||||||
resultObject: dsoSelfLinks[index],
|
indexableObject: dsoSelfLinks[index],
|
||||||
hitHighlights: hitHighlights[index],
|
hitHighlights: hitHighlights[index],
|
||||||
_embedded: this.filterEmbeddedObjects(object)
|
_embedded: this.filterEmbeddedObjects(object)
|
||||||
}));
|
}));
|
||||||
@@ -63,13 +63,13 @@ export class MyDSpaceResponseParsingService implements ResponseParsingService {
|
|||||||
|
|
||||||
protected filterEmbeddedObjects(object) {
|
protected filterEmbeddedObjects(object) {
|
||||||
const allowedEmbeddedKeys = ['submitter', 'item', 'workspaceitem', 'workflowitem'];
|
const allowedEmbeddedKeys = ['submitter', 'item', 'workspaceitem', 'workflowitem'];
|
||||||
if (object._embedded.resultObject && object._embedded.resultObject._embedded) {
|
if (object._embedded.indexableObject && object._embedded.indexableObject._embedded) {
|
||||||
return Object.assign({}, object._embedded, {
|
return Object.assign({}, object._embedded, {
|
||||||
resultObject: Object.assign({}, object._embedded.resultObject, {
|
indexableObject: Object.assign({}, object._embedded.indexableObject, {
|
||||||
_embedded: Object.keys(object._embedded.resultObject._embedded)
|
_embedded: Object.keys(object._embedded.indexableObject._embedded)
|
||||||
.filter((key) => allowedEmbeddedKeys.includes(key))
|
.filter((key) => allowedEmbeddedKeys.includes(key))
|
||||||
.reduce((obj, key) => {
|
.reduce((obj, key) => {
|
||||||
obj[key] = object._embedded.resultObject._embedded[key];
|
obj[key] = object._embedded.indexableObject._embedded[key];
|
||||||
return obj;
|
return obj;
|
||||||
}, {})
|
}, {})
|
||||||
})
|
})
|
||||||
|
@@ -75,7 +75,7 @@ export const toDSpaceObjectListRD = () =>
|
|||||||
source.pipe(
|
source.pipe(
|
||||||
filter((rd: RemoteData<PaginatedList<SearchResult<T>>>) => rd.hasSucceeded),
|
filter((rd: RemoteData<PaginatedList<SearchResult<T>>>) => rd.hasSucceeded),
|
||||||
map((rd: RemoteData<PaginatedList<SearchResult<T>>>) => {
|
map((rd: RemoteData<PaginatedList<SearchResult<T>>>) => {
|
||||||
const dsoPage: T[] = rd.payload.page.map((searchResult: SearchResult<T>) => searchResult.dspaceObject);
|
const dsoPage: T[] = rd.payload.page.map((searchResult: SearchResult<T>) => searchResult.indexableObject);
|
||||||
const payload = Object.assign(rd.payload, { page: dsoPage }) as PaginatedList<T>;
|
const payload = Object.assign(rd.payload, { page: dsoPage }) as PaginatedList<T>;
|
||||||
return Object.assign(rd, { payload: payload });
|
return Object.assign(rd, { payload: payload });
|
||||||
})
|
})
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
</button>
|
</button>
|
||||||
<button *ngFor="let listEntry of (listEntries$ | async)?.payload.page"
|
<button *ngFor="let listEntry of (listEntries$ | async)?.payload.page"
|
||||||
class="list-group-item list-group-item-action border-0 list-entry"
|
class="list-group-item list-group-item-action border-0 list-entry"
|
||||||
title="{{ listEntry.dspaceObject.name }}"
|
title="{{ listEntry.indexableObject.name }}"
|
||||||
(click)="onSelect.emit(listEntry.dspaceObject)" #listEntryElement>
|
(click)="onSelect.emit(listEntry.indexableObject)" #listEntryElement>
|
||||||
<ds-wrapper-list-element [object]="listEntry"></ds-wrapper-list-element>
|
<ds-wrapper-list-element [object]="listEntry"></ds-wrapper-list-element>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -27,7 +27,7 @@ describe('DSOSelectorComponent', () => {
|
|||||||
language: undefined
|
language: undefined
|
||||||
})]
|
})]
|
||||||
};
|
};
|
||||||
searchResult.dspaceObject = item;
|
searchResult.indexableObject = item;
|
||||||
searchResult.hitHighlights = {};
|
searchResult.hitHighlights = {};
|
||||||
const searchService = jasmine.createSpyObj('searchService', {
|
const searchService = jasmine.createSpyObj('searchService', {
|
||||||
search: observableOf(new RemoteData(false, false, true, undefined, new PaginatedList(undefined, [searchResult])))
|
search: observableOf(new RemoteData(false, false, true, undefined, new PaginatedList(undefined, [searchResult])))
|
||||||
|
@@ -52,7 +52,7 @@ const item = Object.assign(new Item(), {
|
|||||||
const rdItem = new RemoteData(false, false, true, null, item);
|
const rdItem = new RemoteData(false, false, true, null, item);
|
||||||
const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) });
|
const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) });
|
||||||
const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem);
|
const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem);
|
||||||
mockResultObject.dspaceObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) });
|
mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) });
|
||||||
|
|
||||||
describe('ClaimedMyDSpaceResultDetailElementComponent', () => {
|
describe('ClaimedMyDSpaceResultDetailElementComponent', () => {
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -75,7 +75,7 @@ describe('ClaimedMyDSpaceResultDetailElementComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.dso = mockResultObject.dspaceObject;
|
component.dso = mockResultObject.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -24,4 +24,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ds-item-submitter *ngIf="showSubmitter" [object]="object.dspaceObject"></ds-item-submitter>
|
<ds-item-submitter *ngIf="showSubmitter" [object]="object.indexableObject"></ds-item-submitter>
|
||||||
|
@@ -17,7 +17,7 @@ const compIndex = 1;
|
|||||||
const mockResultObject: ItemMyDSpaceResult = new ItemMyDSpaceResult();
|
const mockResultObject: ItemMyDSpaceResult = new ItemMyDSpaceResult();
|
||||||
mockResultObject.hitHighlights = {};
|
mockResultObject.hitHighlights = {};
|
||||||
|
|
||||||
mockResultObject.dspaceObject = Object.assign(new Item(), {
|
mockResultObject.indexableObject = Object.assign(new Item(), {
|
||||||
bitstreams: observableOf({}),
|
bitstreams: observableOf({}),
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.title': [
|
'dc.title': [
|
||||||
@@ -68,7 +68,7 @@ describe('ItemMyDSpaceResultDetailElementComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.dso = mockResultObject.dspaceObject;
|
component.dso = mockResultObject.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ export class MyDSpaceResultDetailElementComponent<T extends MyDSpaceResult<K>, K
|
|||||||
*/
|
*/
|
||||||
public constructor(@Inject('objectElementProvider') public detailable: ListableObject) {
|
public constructor(@Inject('objectElementProvider') public detailable: ListableObject) {
|
||||||
super(detailable);
|
super(detailable);
|
||||||
this.dso = this.object.dspaceObject;
|
this.dso = this.object.indexableObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -52,7 +52,7 @@ const item = Object.assign(new Item(), {
|
|||||||
const rdItem = new RemoteData(false, false, true, null, item);
|
const rdItem = new RemoteData(false, false, true, null, item);
|
||||||
const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) });
|
const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) });
|
||||||
const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem);
|
const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem);
|
||||||
mockResultObject.dspaceObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) });
|
mockResultObject.indexableObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) });
|
||||||
|
|
||||||
describe('PoolMyDSpaceResultDetailElementComponent', () => {
|
describe('PoolMyDSpaceResultDetailElementComponent', () => {
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -75,7 +75,7 @@ describe('PoolMyDSpaceResultDetailElementComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.dso = mockResultObject.dspaceObject;
|
component.dso = mockResultObject.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ const item = Object.assign(new Item(), {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const rd = new RemoteData(false, false, true, null, item);
|
const rd = new RemoteData(false, false, true, null, item);
|
||||||
mockResultObject.dspaceObject = Object.assign(new Workflowitem(), { item: observableOf(rd) });
|
mockResultObject.indexableObject = Object.assign(new Workflowitem(), { item: observableOf(rd) });
|
||||||
|
|
||||||
describe('WorkflowitemMyDSpaceResultDetailElementComponent', () => {
|
describe('WorkflowitemMyDSpaceResultDetailElementComponent', () => {
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -72,7 +72,7 @@ describe('WorkflowitemMyDSpaceResultDetailElementComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.dso = mockResultObject.dspaceObject;
|
component.dso = mockResultObject.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ const item = Object.assign(new Item(), {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const rd = new RemoteData(false, false, true, null, item);
|
const rd = new RemoteData(false, false, true, null, item);
|
||||||
mockResultObject.dspaceObject = Object.assign(new Workspaceitem(), { item: observableOf(rd) });
|
mockResultObject.indexableObject = Object.assign(new Workspaceitem(), { item: observableOf(rd) });
|
||||||
|
|
||||||
describe('WorkspaceitemMyDSpaceResultDetailElementComponent', () => {
|
describe('WorkspaceitemMyDSpaceResultDetailElementComponent', () => {
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -72,7 +72,7 @@ describe('WorkspaceitemMyDSpaceResultDetailElementComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.dso = mockResultObject.dspaceObject;
|
component.dso = mockResultObject.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ const truncatableServiceStub: any = {
|
|||||||
|
|
||||||
const mockCollectionWithAbstract: CollectionSearchResult = new CollectionSearchResult();
|
const mockCollectionWithAbstract: CollectionSearchResult = new CollectionSearchResult();
|
||||||
mockCollectionWithAbstract.hitHighlights = {};
|
mockCollectionWithAbstract.hitHighlights = {};
|
||||||
mockCollectionWithAbstract.dspaceObject = Object.assign(new Collection(), {
|
mockCollectionWithAbstract.indexableObject = Object.assign(new Collection(), {
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.description.abstract': [
|
'dc.description.abstract': [
|
||||||
{
|
{
|
||||||
@@ -30,7 +30,7 @@ mockCollectionWithAbstract.dspaceObject = Object.assign(new Collection(), {
|
|||||||
|
|
||||||
const mockCollectionWithoutAbstract: CollectionSearchResult = new CollectionSearchResult();
|
const mockCollectionWithoutAbstract: CollectionSearchResult = new CollectionSearchResult();
|
||||||
mockCollectionWithoutAbstract.hitHighlights = {};
|
mockCollectionWithoutAbstract.hitHighlights = {};
|
||||||
mockCollectionWithoutAbstract.dspaceObject = Object.assign(new Collection(), {
|
mockCollectionWithoutAbstract.indexableObject = Object.assign(new Collection(), {
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.title': [
|
'dc.title': [
|
||||||
{
|
{
|
||||||
@@ -63,7 +63,7 @@ describe('CollectionSearchResultGridElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the collection has an abstract', () => {
|
describe('When the collection has an abstract', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
collectionSearchResultGridElementComponent.dso = mockCollectionWithAbstract.dspaceObject;
|
collectionSearchResultGridElementComponent.dso = mockCollectionWithAbstract.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ describe('CollectionSearchResultGridElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the collection has no abstract', () => {
|
describe('When the collection has no abstract', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
collectionSearchResultGridElementComponent.dso = mockCollectionWithoutAbstract.dspaceObject;
|
collectionSearchResultGridElementComponent.dso = mockCollectionWithoutAbstract.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ const truncatableServiceStub: any = {
|
|||||||
|
|
||||||
const mockCommunityWithAbstract: CommunitySearchResult = new CommunitySearchResult();
|
const mockCommunityWithAbstract: CommunitySearchResult = new CommunitySearchResult();
|
||||||
mockCommunityWithAbstract.hitHighlights = {};
|
mockCommunityWithAbstract.hitHighlights = {};
|
||||||
mockCommunityWithAbstract.dspaceObject = Object.assign(new Community(), {
|
mockCommunityWithAbstract.indexableObject = Object.assign(new Community(), {
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.description.abstract': [
|
'dc.description.abstract': [
|
||||||
{
|
{
|
||||||
@@ -30,7 +30,7 @@ mockCommunityWithAbstract.dspaceObject = Object.assign(new Community(), {
|
|||||||
|
|
||||||
const mockCommunityWithoutAbstract: CommunitySearchResult = new CommunitySearchResult();
|
const mockCommunityWithoutAbstract: CommunitySearchResult = new CommunitySearchResult();
|
||||||
mockCommunityWithoutAbstract.hitHighlights = {};
|
mockCommunityWithoutAbstract.hitHighlights = {};
|
||||||
mockCommunityWithoutAbstract.dspaceObject = Object.assign(new Community(), {
|
mockCommunityWithoutAbstract.indexableObject = Object.assign(new Community(), {
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.title': [
|
'dc.title': [
|
||||||
{
|
{
|
||||||
@@ -63,7 +63,7 @@ describe('CommunitySearchResultGridElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the community has an abstract', () => {
|
describe('When the community has an abstract', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
communitySearchResultGridElementComponent.dso = mockCommunityWithAbstract.dspaceObject;
|
communitySearchResultGridElementComponent.dso = mockCommunityWithAbstract.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ describe('CommunitySearchResultGridElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the community has no abstract', () => {
|
describe('When the community has no abstract', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
communitySearchResultGridElementComponent.dso = mockCommunityWithoutAbstract.dspaceObject;
|
communitySearchResultGridElementComponent.dso = mockCommunityWithoutAbstract.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ const truncatableServiceStub: any = {
|
|||||||
|
|
||||||
const mockItemWithAuthorAndDate: ItemSearchResult = new ItemSearchResult();
|
const mockItemWithAuthorAndDate: ItemSearchResult = new ItemSearchResult();
|
||||||
mockItemWithAuthorAndDate.hitHighlights = {};
|
mockItemWithAuthorAndDate.hitHighlights = {};
|
||||||
mockItemWithAuthorAndDate.dspaceObject = Object.assign(new Item(), {
|
mockItemWithAuthorAndDate.indexableObject = Object.assign(new Item(), {
|
||||||
bitstreams: observableOf({}),
|
bitstreams: observableOf({}),
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.contributor.author': [
|
'dc.contributor.author': [
|
||||||
@@ -38,7 +38,7 @@ mockItemWithAuthorAndDate.dspaceObject = Object.assign(new Item(), {
|
|||||||
|
|
||||||
const mockItemWithoutAuthorAndDate: ItemSearchResult = new ItemSearchResult();
|
const mockItemWithoutAuthorAndDate: ItemSearchResult = new ItemSearchResult();
|
||||||
mockItemWithoutAuthorAndDate.hitHighlights = {};
|
mockItemWithoutAuthorAndDate.hitHighlights = {};
|
||||||
mockItemWithoutAuthorAndDate.dspaceObject = Object.assign(new Item(), {
|
mockItemWithoutAuthorAndDate.indexableObject = Object.assign(new Item(), {
|
||||||
bitstreams: observableOf({}),
|
bitstreams: observableOf({}),
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.title': [
|
'dc.title': [
|
||||||
@@ -78,7 +78,7 @@ describe('ItemSearchResultGridElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the item has an author', () => {
|
describe('When the item has an author', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
itemSearchResultGridElementComponent.dso = mockItemWithAuthorAndDate.dspaceObject;
|
itemSearchResultGridElementComponent.dso = mockItemWithAuthorAndDate.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ describe('ItemSearchResultGridElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the item has no author', () => {
|
describe('When the item has no author', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
itemSearchResultGridElementComponent.dso = mockItemWithoutAuthorAndDate.dspaceObject;
|
itemSearchResultGridElementComponent.dso = mockItemWithoutAuthorAndDate.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ describe('ItemSearchResultGridElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the item has an issuedate', () => {
|
describe('When the item has an issuedate', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
itemSearchResultGridElementComponent.dso = mockItemWithAuthorAndDate.dspaceObject;
|
itemSearchResultGridElementComponent.dso = mockItemWithAuthorAndDate.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ describe('ItemSearchResultGridElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the item has no issuedate', () => {
|
describe('When the item has no issuedate', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
itemSearchResultGridElementComponent.dso = mockItemWithoutAuthorAndDate.dspaceObject;
|
itemSearchResultGridElementComponent.dso = mockItemWithoutAuthorAndDate.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ export class SearchResultGridElementComponent<T extends SearchResult<K>, K exten
|
|||||||
|
|
||||||
public constructor(@Inject('objectElementProvider') public listableObject: ListableObject, private truncatableService: TruncatableService) {
|
public constructor(@Inject('objectElementProvider') public listableObject: ListableObject, private truncatableService: TruncatableService) {
|
||||||
super(listableObject);
|
super(listableObject);
|
||||||
this.dso = this.object.dspaceObject;
|
this.dso = this.object.indexableObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -52,7 +52,7 @@ const item = Object.assign(new Item(), {
|
|||||||
const rdItem = new RemoteData(false, false, true, null, item);
|
const rdItem = new RemoteData(false, false, true, null, item);
|
||||||
const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) });
|
const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) });
|
||||||
const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem);
|
const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem);
|
||||||
mockResultObject.dspaceObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) });
|
mockResultObject.indexableObject = Object.assign(new ClaimedTask(), { workflowitem: observableOf(rdWorkflowitem) });
|
||||||
|
|
||||||
describe('ClaimedMyDSpaceResultListElementComponent', () => {
|
describe('ClaimedMyDSpaceResultListElementComponent', () => {
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -75,7 +75,7 @@ describe('ClaimedMyDSpaceResultListElementComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.dso = mockResultObject.dspaceObject;
|
component.dso = mockResultObject.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -28,5 +28,5 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</ds-truncatable>
|
</ds-truncatable>
|
||||||
<ds-item-submitter *ngIf="showSubmitter" [object]="object.dspaceObject"></ds-item-submitter>
|
<ds-item-submitter *ngIf="showSubmitter" [object]="object.indexableObject"></ds-item-submitter>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@@ -17,7 +17,7 @@ const compIndex = 1;
|
|||||||
const mockResultObject: ItemMyDSpaceResult = new ItemMyDSpaceResult();
|
const mockResultObject: ItemMyDSpaceResult = new ItemMyDSpaceResult();
|
||||||
mockResultObject.hitHighlights = {};
|
mockResultObject.hitHighlights = {};
|
||||||
|
|
||||||
mockResultObject.dspaceObject = Object.assign(new Item(), {
|
mockResultObject.indexableObject = Object.assign(new Item(), {
|
||||||
bitstreams: observableOf({}),
|
bitstreams: observableOf({}),
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.title': [
|
'dc.title': [
|
||||||
@@ -68,7 +68,7 @@ describe('ItemMyDSpaceResultListElementComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.dso = mockResultObject.dspaceObject;
|
component.dso = mockResultObject.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@ export class MyDSpaceResultListElementComponent<T extends MyDSpaceResult<K>, K e
|
|||||||
public constructor(@Inject('objectElementProvider') public listable: ListableObject,
|
public constructor(@Inject('objectElementProvider') public listable: ListableObject,
|
||||||
@Inject('indexElementProvider') public index: number) {
|
@Inject('indexElementProvider') public index: number) {
|
||||||
super(listable);
|
super(listable);
|
||||||
this.dso = this.object.dspaceObject;
|
this.dso = this.object.indexableObject;
|
||||||
this.dsoIndex = this.index;
|
this.dsoIndex = this.index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ const item = Object.assign(new Item(), {
|
|||||||
const rdItem = new RemoteData(false, false, true, null, item);
|
const rdItem = new RemoteData(false, false, true, null, item);
|
||||||
const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) });
|
const workflowitem = Object.assign(new Workflowitem(), { item: observableOf(rdItem) });
|
||||||
const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem);
|
const rdWorkflowitem = new RemoteData(false, false, true, null, workflowitem);
|
||||||
mockResultObject.dspaceObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) });
|
mockResultObject.indexableObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rdWorkflowitem) });
|
||||||
|
|
||||||
describe('PoolMyDSpaceResultListElementComponent', () => {
|
describe('PoolMyDSpaceResultListElementComponent', () => {
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -75,7 +75,7 @@ describe('PoolMyDSpaceResultListElementComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.dso = mockResultObject.dspaceObject;
|
component.dso = mockResultObject.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ const item = Object.assign(new Item(), {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const rd = new RemoteData(false, false, true, null, item);
|
const rd = new RemoteData(false, false, true, null, item);
|
||||||
mockResultObject.dspaceObject = Object.assign(new Workflowitem(), { item: observableOf(rd) });
|
mockResultObject.indexableObject = Object.assign(new Workflowitem(), { item: observableOf(rd) });
|
||||||
|
|
||||||
describe('WorkflowitemMyDSpaceResultListElementComponent', () => {
|
describe('WorkflowitemMyDSpaceResultListElementComponent', () => {
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -72,7 +72,7 @@ describe('WorkflowitemMyDSpaceResultListElementComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.dso = mockResultObject.dspaceObject;
|
component.dso = mockResultObject.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ const item = Object.assign(new Item(), {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const rd = new RemoteData(false, false, true, null, item);
|
const rd = new RemoteData(false, false, true, null, item);
|
||||||
mockResultObject.dspaceObject = Object.assign(new Workspaceitem(), { item: observableOf(rd) });
|
mockResultObject.indexableObject = Object.assign(new Workspaceitem(), { item: observableOf(rd) });
|
||||||
|
|
||||||
describe('WorkspaceitemMyDSpaceResultListElementComponent', () => {
|
describe('WorkspaceitemMyDSpaceResultListElementComponent', () => {
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -72,7 +72,7 @@ describe('WorkspaceitemMyDSpaceResultListElementComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.dso = mockResultObject.dspaceObject;
|
component.dso = mockResultObject.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ const truncatableServiceStub: any = {
|
|||||||
|
|
||||||
const mockCollectionWithAbstract: CollectionSearchResult = new CollectionSearchResult();
|
const mockCollectionWithAbstract: CollectionSearchResult = new CollectionSearchResult();
|
||||||
mockCollectionWithAbstract.hitHighlights = {};
|
mockCollectionWithAbstract.hitHighlights = {};
|
||||||
mockCollectionWithAbstract.dspaceObject = Object.assign(new Collection(), {
|
mockCollectionWithAbstract.indexableObject = Object.assign(new Collection(), {
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.description.abstract': [
|
'dc.description.abstract': [
|
||||||
{
|
{
|
||||||
@@ -30,7 +30,7 @@ mockCollectionWithAbstract.dspaceObject = Object.assign(new Collection(), {
|
|||||||
|
|
||||||
const mockCollectionWithoutAbstract: CollectionSearchResult = new CollectionSearchResult();
|
const mockCollectionWithoutAbstract: CollectionSearchResult = new CollectionSearchResult();
|
||||||
mockCollectionWithoutAbstract.hitHighlights = {};
|
mockCollectionWithoutAbstract.hitHighlights = {};
|
||||||
mockCollectionWithoutAbstract.dspaceObject = Object.assign(new Collection(), {
|
mockCollectionWithoutAbstract.indexableObject = Object.assign(new Collection(), {
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.title': [
|
'dc.title': [
|
||||||
{
|
{
|
||||||
@@ -63,7 +63,7 @@ describe('CollectionSearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the collection has an abstract', () => {
|
describe('When the collection has an abstract', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
collectionSearchResultListElementComponent.dso = mockCollectionWithAbstract.dspaceObject;
|
collectionSearchResultListElementComponent.dso = mockCollectionWithAbstract.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ describe('CollectionSearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the collection has no abstract', () => {
|
describe('When the collection has no abstract', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
collectionSearchResultListElementComponent.dso = mockCollectionWithoutAbstract.dspaceObject;
|
collectionSearchResultListElementComponent.dso = mockCollectionWithoutAbstract.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ const truncatableServiceStub: any = {
|
|||||||
|
|
||||||
const mockCommunityWithAbstract: CommunitySearchResult = new CommunitySearchResult();
|
const mockCommunityWithAbstract: CommunitySearchResult = new CommunitySearchResult();
|
||||||
mockCommunityWithAbstract.hitHighlights = {};
|
mockCommunityWithAbstract.hitHighlights = {};
|
||||||
mockCommunityWithAbstract.dspaceObject = Object.assign(new Community(), {
|
mockCommunityWithAbstract.indexableObject = Object.assign(new Community(), {
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.description.abstract': [
|
'dc.description.abstract': [
|
||||||
{
|
{
|
||||||
@@ -30,7 +30,7 @@ mockCommunityWithAbstract.dspaceObject = Object.assign(new Community(), {
|
|||||||
|
|
||||||
const mockCommunityWithoutAbstract: CommunitySearchResult = new CommunitySearchResult();
|
const mockCommunityWithoutAbstract: CommunitySearchResult = new CommunitySearchResult();
|
||||||
mockCommunityWithoutAbstract.hitHighlights = {};
|
mockCommunityWithoutAbstract.hitHighlights = {};
|
||||||
mockCommunityWithoutAbstract.dspaceObject = Object.assign(new Community(), {
|
mockCommunityWithoutAbstract.indexableObject = Object.assign(new Community(), {
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.title': [
|
'dc.title': [
|
||||||
{
|
{
|
||||||
@@ -63,7 +63,7 @@ describe('CommunitySearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the community has an abstract', () => {
|
describe('When the community has an abstract', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
communitySearchResultListElementComponent.dso = mockCommunityWithAbstract.dspaceObject;
|
communitySearchResultListElementComponent.dso = mockCommunityWithAbstract.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ describe('CommunitySearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the community has no abstract', () => {
|
describe('When the community has no abstract', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
communitySearchResultListElementComponent.dso = mockCommunityWithoutAbstract.dspaceObject;
|
communitySearchResultListElementComponent.dso = mockCommunityWithoutAbstract.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ const truncatableServiceStub: any = {
|
|||||||
|
|
||||||
const mockItemWithAuthorAndDate: ItemSearchResult = new ItemSearchResult();
|
const mockItemWithAuthorAndDate: ItemSearchResult = new ItemSearchResult();
|
||||||
mockItemWithAuthorAndDate.hitHighlights = {};
|
mockItemWithAuthorAndDate.hitHighlights = {};
|
||||||
mockItemWithAuthorAndDate.dspaceObject = Object.assign(new Item(), {
|
mockItemWithAuthorAndDate.indexableObject = Object.assign(new Item(), {
|
||||||
bitstreams: observableOf({}),
|
bitstreams: observableOf({}),
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.contributor.author': [
|
'dc.contributor.author': [
|
||||||
@@ -38,7 +38,7 @@ mockItemWithAuthorAndDate.dspaceObject = Object.assign(new Item(), {
|
|||||||
|
|
||||||
const mockItemWithoutAuthorAndDate: ItemSearchResult = new ItemSearchResult();
|
const mockItemWithoutAuthorAndDate: ItemSearchResult = new ItemSearchResult();
|
||||||
mockItemWithoutAuthorAndDate.hitHighlights = {};
|
mockItemWithoutAuthorAndDate.hitHighlights = {};
|
||||||
mockItemWithoutAuthorAndDate.dspaceObject = Object.assign(new Item(), {
|
mockItemWithoutAuthorAndDate.indexableObject = Object.assign(new Item(), {
|
||||||
bitstreams: observableOf({}),
|
bitstreams: observableOf({}),
|
||||||
metadata: {
|
metadata: {
|
||||||
'dc.title': [
|
'dc.title': [
|
||||||
@@ -78,7 +78,7 @@ describe('ItemSearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the item has an author', () => {
|
describe('When the item has an author', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
itemSearchResultListElementComponent.dso = mockItemWithAuthorAndDate.dspaceObject;
|
itemSearchResultListElementComponent.dso = mockItemWithAuthorAndDate.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ describe('ItemSearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the item has no author', () => {
|
describe('When the item has no author', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
itemSearchResultListElementComponent.dso = mockItemWithoutAuthorAndDate.dspaceObject;
|
itemSearchResultListElementComponent.dso = mockItemWithoutAuthorAndDate.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ describe('ItemSearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the item has an issuedate', () => {
|
describe('When the item has an issuedate', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
itemSearchResultListElementComponent.dso = mockItemWithAuthorAndDate.dspaceObject;
|
itemSearchResultListElementComponent.dso = mockItemWithAuthorAndDate.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ describe('ItemSearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
describe('When the item has no issuedate', () => {
|
describe('When the item has no issuedate', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
itemSearchResultListElementComponent.dso = mockItemWithoutAuthorAndDate.dspaceObject;
|
itemSearchResultListElementComponent.dso = mockItemWithoutAuthorAndDate.indexableObject;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ export class SearchResultListElementComponent<T extends SearchResult<K>, K exten
|
|||||||
|
|
||||||
public constructor(@Inject('objectElementProvider') public listable: ListableObject, private truncatableService: TruncatableService) {
|
public constructor(@Inject('objectElementProvider') public listable: ListableObject, private truncatableService: TruncatableService) {
|
||||||
super(listable);
|
super(listable);
|
||||||
this.dso = this.object.dspaceObject;
|
this.dso = this.object.indexableObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user