diff --git a/src/app/+item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.html b/src/app/+item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.html
index e25c3c204f..03040ce8e0 100644
--- a/src/app/+item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.html
+++ b/src/app/+item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.html
@@ -1,6 +1,6 @@
-
+
diff --git a/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts b/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts
index bb1272f076..e1e9d18c8f 100644
--- a/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts
+++ b/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts
@@ -2,6 +2,7 @@ import { Component, forwardRef, Input } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { InputSuggestionsComponent } from '../input-suggestions.component';
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
+import { ViewMode } from '../../../core/shared/view-mode.model';
@Component({
selector: 'ds-dso-input-suggestions',
@@ -22,6 +23,7 @@ import { DSpaceObject } from '../../../core/shared/dspace-object.model';
* Component representing a form with a autocomplete functionality for DSpaceObjects
*/
export class DsoInputSuggestionsComponent extends InputSuggestionsComponent {
+ viewMode = ViewMode.ListElement;
/**
* The suggestions that should be shown
*/
diff --git a/src/app/shared/object-collection/shared/item-my-dspace-result.model.ts b/src/app/shared/object-collection/shared/item-my-dspace-result.model.ts
index 92724a762f..e77b9295df 100644
--- a/src/app/shared/object-collection/shared/item-my-dspace-result.model.ts
+++ b/src/app/shared/object-collection/shared/item-my-dspace-result.model.ts
@@ -8,4 +8,7 @@ import { MyDSpaceConfigurationValueType } from '../../../+my-dspace-page/my-dspa
*/
@searchResultFor(Item, MyDSpaceConfigurationValueType.Workspace)
export class ItemMyDSpaceResult extends SearchResult
- {
+ getRenderType(): string {
+ return ItemMyDSpaceResult.name;
+ }
}
diff --git a/src/app/shared/object-collection/shared/listable-object.model.ts b/src/app/shared/object-collection/shared/listable-object.model.ts
index 07c626cda2..62ab24ae33 100644
--- a/src/app/shared/object-collection/shared/listable-object.model.ts
+++ b/src/app/shared/object-collection/shared/listable-object.model.ts
@@ -1 +1,5 @@
-export interface ListableObject {}
+import { TypedObject } from '../../../core/cache/object-cache.reducer';
+
+export interface ListableObject extends TypedObject {
+ getRenderType(): string;
+}
diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.html b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.html
index d41303d462..ef9a817424 100644
--- a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.html
+++ b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.html
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts
index 149425c157..4651a342ac 100644
--- a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts
+++ b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts
@@ -5,24 +5,23 @@ import { Context } from '../../../../core/shared/context.model';
import { getListableObjectComponent } from './listable-object.decorator';
import { GenericConstructor } from '../../../../core/shared/generic-constructor';
import { ListableObjectDirective } from './listable-object.directive';
-import { hasValue, isNotEmpty } from '../../../empty.util';
@Component({
selector: 'ds-listable-object-component-loader',
- styleUrls: ['./listable-object-component-loader.component.scss'],
+ // styleUrls: ['./listable-object-component-loader.component.scss'],
templateUrl: './listable-object-component-loader.component.html'
})
/**
* Component for determining what component to use depending on the item's relationship type (relationship.type)
*/
export class ListableObjectComponentLoaderComponent implements OnInit {
-
- @Input() type?: string;
/**
* The item or metadata to determine the component for
*/
@Input() object: ListableObject;
+ //TODO DO SOMETHING WITH THIS
+ @Input() index: number;
/**
* The preferred view-mode to display
*/
@@ -49,9 +48,6 @@ export class ListableObjectComponentLoaderComponent implements OnInit {
* @returns {string}
*/
private getComponent(): GenericConstructor {
- if (isNotEmpty(this.type)) {
- return getListableObjectComponent(this.type, this.viewMode)
- }
- return getListableObjectComponent(this.object.constructor as GenericConstructor, this.viewMode);
+ return getListableObjectComponent(this.object.getRenderType(), this.viewMode)
}
}
diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.ts b/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.ts
index 2e30c0b761..092bf8068f 100644
--- a/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.ts
+++ b/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.ts
@@ -16,7 +16,7 @@ const listElementMap = new Map();
* @param type
* @param viewMode
*/
-export function listableObjectComponent(objectType: GenericConstructor | string, viewMode: ViewMode, context: Context = DEFAULT_CONTEXT) {
+export function listableObjectComponent(objectType: string, viewMode: ViewMode, context: Context = DEFAULT_CONTEXT) {
return function decorator(component: any) {
if (hasNoValue(objectType)) {
return;
diff --git a/src/app/shared/object-collection/shared/object-collection-element/abstract-listable-element.component.ts b/src/app/shared/object-collection/shared/object-collection-element/abstract-listable-element.component.ts
index f72d1c9e51..d6819b04da 100644
--- a/src/app/shared/object-collection/shared/object-collection-element/abstract-listable-element.component.ts
+++ b/src/app/shared/object-collection/shared/object-collection-element/abstract-listable-element.component.ts
@@ -1,10 +1,11 @@
import { Component, Inject, Input } from '@angular/core';
import { ListableObject } from '../listable-object.model';
+import { ViewMode } from '../../../../core/shared/view-mode.model';
@Component({
selector: 'ds-abstract-object-element',
template: ``,
})
-export class AbstractListableElementComponent {
+export class AbstractListableElementComponent {
@Input() object: T;
}
diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.ts
index 0c47a239cc..91ddbaf09a 100644
--- a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.ts
+++ b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-my-dspace-result/claimed-my-dspace-result-detail-element.component.ts
@@ -13,6 +13,7 @@ import { ClaimedTaskMyDSpaceResult } from '../../../object-collection/shared/cla
import { MyDSpaceResultDetailElementComponent } from '../my-dspace-result-detail-element.component';
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
+import { Context } from '../../../../core/shared/context.model';
/**
* This component renders claimed task object for the mydspace result in the detail view.
@@ -23,8 +24,8 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: './claimed-my-dspace-result-detail-element.component.html'
})
-@listableObjectComponent(ClaimedTaskMyDSpaceResult, ViewMode.DetailedListElement)
-@listableObjectComponent(ClaimedTask, ViewMode.DetailedListElement)
+@listableObjectComponent(ClaimedTaskMyDSpaceResult.name, ViewMode.DetailedListElement)
+@listableObjectComponent(ClaimedTask.name, ViewMode.DetailedListElement)
export class ClaimedMyDSpaceResultDetailElementComponent extends MyDSpaceResultDetailElementComponent {
/**
diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-my-dspace-result/item-my-dspace-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-my-dspace-result/item-my-dspace-result-detail-element.component.ts
index 2b50dd0819..3788a0da4c 100644
--- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-my-dspace-result/item-my-dspace-result-detail-element.component.ts
+++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-my-dspace-result/item-my-dspace-result-detail-element.component.ts
@@ -16,7 +16,7 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: './item-my-dspace-result-detail-element.component.html'
})
-@listableObjectComponent(ItemMyDSpaceResult, ViewMode.DetailedListElement)
+@listableObjectComponent(ItemMyDSpaceResult.name, ViewMode.DetailedListElement)
export class ItemMyDSpaceResultDetailElementComponent extends MyDSpaceResultDetailElementComponent {
/**
diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.ts
index 20fe3dcb2c..e9ff84b7cf 100644
--- a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.ts
+++ b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-my-dspace-result/pool-my-dspace-result-detail-element.component.ts
@@ -22,8 +22,8 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: './pool-my-dspace-result-detail-element.component.html',
})
-@listableObjectComponent(PoolTaskMyDSpaceResult, ViewMode.DetailedListElement)
-@listableObjectComponent(PoolTask, ViewMode.DetailedListElement)
+@listableObjectComponent(PoolTaskMyDSpaceResult.name, ViewMode.DetailedListElement)
+@listableObjectComponent(PoolTask.name, ViewMode.DetailedListElement)
export class PoolMyDSpaceResultDetailElementComponent extends MyDSpaceResultDetailElementComponent {
/**
diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.ts
index ec83c7f6d0..4d6b047f56 100644
--- a/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.ts
+++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-detail-element.component.ts
@@ -22,8 +22,8 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: './workflowitem-my-dspace-result-detail-element.component.html',
})
-@listableObjectComponent(WorkflowitemMyDSpaceResult, ViewMode.DetailedListElement)
-@listableObjectComponent(WorkflowItem, ViewMode.DetailedListElement)
+@listableObjectComponent(WorkflowitemMyDSpaceResult.name, ViewMode.DetailedListElement)
+@listableObjectComponent(WorkflowItem.name, ViewMode.DetailedListElement)
export class WorkflowitemMyDSpaceResultDetailElementComponent extends MyDSpaceResultDetailElementComponent {
/**
diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.ts
index afb3107fa4..e9cc6967e6 100644
--- a/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.ts
+++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-detail-element.component.ts
@@ -10,7 +10,6 @@ import { WorkspaceitemMyDSpaceResult } from '../../../object-collection/shared/w
import { Item } from '../../../../core/shared/item.model';
import { RemoteData } from '../../../../core/data/remote-data';
import { isNotUndefined } from '../../../empty.util';
-import { ListableObject } from '../../../object-collection/shared/listable-object.model';
import { MyDSpaceResultDetailElementComponent } from '../my-dspace-result-detail-element.component';
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
import { ViewMode } from '../../../../core/shared/view-mode.model';
@@ -25,8 +24,8 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: './workspaceitem-my-dspace-result-detail-element.component.html',
})
-@listableObjectComponent(WorkspaceitemMyDSpaceResult, ViewMode.DetailedListElement)
-@listableObjectComponent(WorkspaceItem, ViewMode.DetailedListElement)
+@listableObjectComponent(WorkspaceitemMyDSpaceResult.name, ViewMode.DetailedListElement)
+@listableObjectComponent(WorkspaceItem.name, ViewMode.DetailedListElement)
export class WorkspaceitemMyDSpaceResultDetailElementComponent extends MyDSpaceResultDetailElementComponent {
/**
diff --git a/src/app/shared/object-detail/object-detail.component.html b/src/app/shared/object-detail/object-detail.component.html
index a57a23027e..400781b6d2 100644
--- a/src/app/shared/object-detail/object-detail.component.html
+++ b/src/app/shared/object-detail/object-detail.component.html
@@ -14,7 +14,7 @@
diff --git a/src/app/shared/object-detail/object-detail.component.ts b/src/app/shared/object-detail/object-detail.component.ts
index 3187a2cd1b..24df1bf504 100644
--- a/src/app/shared/object-detail/object-detail.component.ts
+++ b/src/app/shared/object-detail/object-detail.component.ts
@@ -15,6 +15,7 @@ import { fadeIn } from '../animations/fade';
import { ListableObject } from '../object-collection/shared/listable-object.model';
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
+import { ViewMode } from '../../core/shared/view-mode.model';
/**
* This component renders a paginated set of results in the detail view.
@@ -28,6 +29,7 @@ import { PaginationComponentOptions } from '../pagination/pagination-component-o
animations: [fadeIn]
})
export class ObjectDetailComponent {
+ viewMode = ViewMode.DetailedListElement;
/**
* Pagination options object
diff --git a/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts b/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts
index 1261cd6dfd..a113e0dffd 100644
--- a/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts
+++ b/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts
@@ -11,5 +11,5 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
templateUrl: './collection-grid-element.component.html'
})
-@listableObjectComponent(Collection, ViewMode.GridElement)
+@listableObjectComponent(Collection.name, ViewMode.GridElement)
export class CollectionGridElementComponent extends AbstractListableElementComponent {}
diff --git a/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts b/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts
index 67d4ac663c..498222466d 100644
--- a/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts
+++ b/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts
@@ -11,5 +11,5 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
templateUrl: './community-grid-element.component.html'
})
-@listableObjectComponent(Community, ViewMode.GridElement)
+@listableObjectComponent(Community.name, ViewMode.GridElement)
export class CommunityGridElementComponent extends AbstractListableElementComponent {}
diff --git a/src/app/shared/object-grid/item-grid-element/item-grid-element.component.html b/src/app/shared/object-grid/item-grid-element/item-grid-element.component.html
deleted file mode 100644
index 21ee7968ca..0000000000
--- a/src/app/shared/object-grid/item-grid-element/item-grid-element.component.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/app/shared/object-grid/item-grid-element/item-grid-element.component.scss b/src/app/shared/object-grid/item-grid-element/item-grid-element.component.scss
deleted file mode 100644
index 8b13789179..0000000000
--- a/src/app/shared/object-grid/item-grid-element/item-grid-element.component.scss
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/app/shared/object-grid/item-grid-element/item-grid-element.component.spec.ts b/src/app/shared/object-grid/item-grid-element/item-grid-element.component.spec.ts
deleted file mode 100644
index 7b286cc415..0000000000
--- a/src/app/shared/object-grid/item-grid-element/item-grid-element.component.spec.ts
+++ /dev/null
@@ -1,114 +0,0 @@
-import { ItemGridElementComponent } from './item-grid-element.component';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
-import { By } from '@angular/platform-browser';
-import { TruncatePipe } from '../../utils/truncate.pipe';
-import { Item } from '../../../core/shared/item.model';
-import { of as observableOf } from 'rxjs';
-
-let itemGridElementComponent: ItemGridElementComponent;
-let fixture: ComponentFixture;
-
-const mockItemWithAuthorAndDate: Item = Object.assign(new Item(), {
- bitstreams: observableOf({}),
- metadata: {
- 'dc.contributor.author': [
- {
- language: 'en_US',
- value: 'Smith, Donald'
- }
- ],
- 'dc.date.issued': [
- {
- language: null,
- value: '2015-06-26'
- }
- ]
- }
-});
-const mockItemWithoutAuthorAndDate: Item = Object.assign(new Item(), {
- bitstreams: observableOf({}),
- metadata: {
- 'dc.title': [
- {
- language: 'en_US',
- value: 'This is just another title'
- }
- ],
- 'dc.type': [
- {
- language: null,
- value: 'Article'
- }
- ]
- }
-});
-
-describe('ItemGridElementComponent', () => {
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [ ItemGridElementComponent , TruncatePipe],
- providers: [
- { provide: 'objectElementProvider', useValue: {mockItemWithAuthorAndDate}}
- ],
-
- schemas: [ NO_ERRORS_SCHEMA ]
- }).overrideComponent(ItemGridElementComponent, {
- set: { changeDetection: ChangeDetectionStrategy.Default }
- }).compileComponents();
- }));
-
- beforeEach(async(() => {
- fixture = TestBed.createComponent(ItemGridElementComponent);
- itemGridElementComponent = fixture.componentInstance;
-
- }));
-
- describe('When the item has an author', () => {
- beforeEach(() => {
- itemGridElementComponent.object = mockItemWithAuthorAndDate;
- fixture.detectChanges();
- });
-
- it('should show the author paragraph', () => {
- const itemAuthorField = fixture.debugElement.query(By.css('p.item-authors'));
- expect(itemAuthorField).not.toBeNull();
- });
- });
-
- describe('When the item has no author', () => {
- beforeEach(() => {
- itemGridElementComponent.object = mockItemWithoutAuthorAndDate;
- fixture.detectChanges();
- });
-
- it('should not show the author paragraph', () => {
- const itemAuthorField = fixture.debugElement.query(By.css('p.item-authors'));
- expect(itemAuthorField).toBeNull();
- });
- });
-
- describe('When the item has an issuedate', () => {
- beforeEach(() => {
- itemGridElementComponent.object = mockItemWithAuthorAndDate;
- fixture.detectChanges();
- });
-
- it('should show the issuedate span', () => {
- const itemAuthorField = fixture.debugElement.query(By.css('span.item-date'));
- expect(itemAuthorField).not.toBeNull();
- });
- });
-
- describe('When the item has no issuedate', () => {
- beforeEach(() => {
- itemGridElementComponent.object = mockItemWithoutAuthorAndDate;
- fixture.detectChanges();
- });
-
- it('should not show the issuedate span', () => {
- const dateField = fixture.debugElement.query(By.css('span.item-date'));
- expect(dateField).toBeNull();
- });
- });
-});
diff --git a/src/app/shared/object-grid/item-grid-element/item-grid-element.component.ts b/src/app/shared/object-grid/item-grid-element/item-grid-element.component.ts
deleted file mode 100644
index e146370752..0000000000
--- a/src/app/shared/object-grid/item-grid-element/item-grid-element.component.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Component } from '@angular/core';
-
-import { Item } from '../../../core/shared/item.model';
-import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component';
-import { ViewMode } from '../../../core/shared/view-mode.model';
-import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator';
-
-@Component({
- selector: 'ds-item-grid-element',
- styleUrls: ['./item-grid-element.component.scss'],
- templateUrl: './item-grid-element.component.html'
-})
-
-@listableObjectComponent(Item, ViewMode.GridElement)
-export class ItemGridElementComponent extends AbstractListableElementComponent
- {}
diff --git a/src/app/shared/object-grid/object-grid.component.html b/src/app/shared/object-grid/object-grid.component.html
index 9d1f8f5ea2..c5cd34608f 100644
--- a/src/app/shared/object-grid/object-grid.component.html
+++ b/src/app/shared/object-grid/object-grid.component.html
@@ -13,7 +13,7 @@
diff --git a/src/app/shared/object-grid/object-grid.component.ts b/src/app/shared/object-grid/object-grid.component.ts
index e539ca5714..d3bfbb8e58 100644
--- a/src/app/shared/object-grid/object-grid.component.ts
+++ b/src/app/shared/object-grid/object-grid.component.ts
@@ -20,6 +20,7 @@ import { HostWindowService, WidthCategory } from '../host-window.service';
import { ListableObject } from '../object-collection/shared/listable-object.model';
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
+import { ViewMode } from '../../core/shared/view-mode.model';
@Component({
changeDetection: ChangeDetectionStrategy.Default,
@@ -31,6 +32,7 @@ import { PaginationComponentOptions } from '../pagination/pagination-component-o
})
export class ObjectGridComponent implements OnInit {
+ viewMode = ViewMode.ListElement;
@Input() config: PaginationComponentOptions;
@Input() sortConfig: SortOptions;
diff --git a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts
index 1d0f47b70b..983b895e9c 100644
--- a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts
+++ b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts
@@ -12,5 +12,5 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: 'collection-search-result-grid-element.component.html'
})
-@listableObjectComponent(CollectionSearchResult, ViewMode.GridElement)
+@listableObjectComponent(CollectionSearchResult.name, ViewMode.GridElement)
export class CollectionSearchResultGridElementComponent extends SearchResultGridElementComponent {}
diff --git a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts
index 806e6a44e3..e8e19c27d8 100644
--- a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts
+++ b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts
@@ -11,7 +11,7 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: 'community-search-result-grid-element.component.html'
})
-@listableObjectComponent(CommunitySearchResult, ViewMode.GridElement)
+@listableObjectComponent(CommunitySearchResult.name, ViewMode.GridElement)
export class CommunitySearchResultGridElementComponent extends SearchResultGridElementComponent {
}
diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.html b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.html
deleted file mode 100644
index 36740cf48f..0000000000
--- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.scss b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.scss
deleted file mode 100644
index d61f3ccf55..0000000000
--- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-.card {
- a > div {
- position: relative;
- .thumbnail-overlay {
- height: 100%;
- position: absolute;
- top: 0;
- width: 100%;
- background-color: map-get($theme-colors, primary);
- }
- }
-}
diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.spec.ts
deleted file mode 100644
index d757e87583..0000000000
--- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.spec.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-import { ItemSearchResultGridElementComponent } from './item-search-result-grid-element.component';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import { of as observableOf } from 'rxjs';
-import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
-import { By } from '@angular/platform-browser';
-import { TruncatePipe } from '../../../utils/truncate.pipe';
-import { Item } from '../../../../core/shared/item.model';
-import { TruncatableService } from '../../../truncatable/truncatable.service';
-import { NoopAnimationsModule } from '@angular/platform-browser/animations';
-import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
-import { ViewMode } from '../../../../core/shared/view-mode.model';
-
-let itemSearchResultGridElementComponent: ItemSearchResultGridElementComponent;
-let fixture: ComponentFixture;
-
-const truncatableServiceStub: any = {
- isCollapsed: (id: number) => observableOf(true),
-};
-
-const type = 'authorOfPublication';
-
-const mockItemWithRelationshipType: ItemSearchResult = new ItemSearchResult();
-mockItemWithRelationshipType.hitHighlights = {};
-mockItemWithRelationshipType.indexableObject = Object.assign(new Item(), {
- bitstreams: observableOf({}),
- metadata: {
- 'relationship.type': [
- {
- language: 'en_US',
- value: type
- }
- ]
- }
-});
-
-describe('ItemSearchResultGridElementComponent', () => {
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- imports: [NoopAnimationsModule],
- declarations: [ItemSearchResultGridElementComponent, TruncatePipe],
- providers: [
- { provide: TruncatableService, useValue: truncatableServiceStub },
- { provide: 'objectElementProvider', useValue: (mockItemWithRelationshipType) }
- ],
- schemas: [NO_ERRORS_SCHEMA]
- }).overrideComponent(ItemSearchResultGridElementComponent, {
- set: { changeDetection: ChangeDetectionStrategy.Default }
- }).compileComponents();
- }));
-
- beforeEach(async(() => {
- fixture = TestBed.createComponent(ItemSearchResultGridElementComponent);
- itemSearchResultGridElementComponent = fixture.componentInstance;
- }));
-
- it('should show send the object to item-type-switcher using viewMode "Card"', () => {
- const itemTypeSwitcherComp = fixture.debugElement.query(By.css('ds-item-type-switcher')).componentInstance;
- expect(itemTypeSwitcherComp.object).toBe(mockItemWithRelationshipType);
- expect(itemTypeSwitcherComp.viewMode).toEqual(ViewMode.GridElement);
- });
-});
diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.ts
deleted file mode 100644
index f90a9f6799..0000000000
--- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item-search-result-grid-element.component.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { Component } from '@angular/core';
-
-import { SearchResultGridElementComponent } from '../search-result-grid-element.component';
-import { Item } from '../../../../core/shared/item.model';
-import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
-import { focusShadow } from '../../../animations/focus';
-import { ViewMode } from '../../../../core/shared/view-mode.model';
-import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
-
-@Component({
- selector: 'ds-item-search-result-grid-element',
- styleUrls: ['../search-result-grid-element.component.scss', 'item-search-result-grid-element.component.scss'],
- templateUrl: 'item-search-result-grid-element.component.html',
- animations: [focusShadow],
-})
-
-@listableObjectComponent(ItemSearchResult, ViewMode.GridElement)
-export class ItemSearchResultGridElementComponent extends SearchResultGridElementComponent {
- viewMode = ViewMode.GridElement;
-}
\ No newline at end of file
diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component.spec.ts
index 0245e0699e..63ee848aa0 100644
--- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component.spec.ts
+++ b/src/app/shared/object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component.spec.ts
@@ -4,14 +4,13 @@ import { TruncatePipe } from '../../../../utils/truncate.pipe';
import { TruncatableService } from '../../../../truncatable/truncatable.service';
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';
-import { PublicationSearchResultGridElementComponent } from './publication-grid-element.component';
import { of as observableOf } from 'rxjs/internal/observable/of';
import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model';
import { Item } from '../../../../../core/shared/item.model';
-import { ITEM } from '../../../../items/switcher/listable-object-component-loader.component';
import { createSuccessfulRemoteDataObject$ } from '../../../../testing/utils';
import { PaginatedList } from '../../../../../core/data/paginated-list';
import { PageInfo } from '../../../../../core/shared/page-info.model';
+import { PublicationSearchResultGridElementComponent } from './publication-search-result-grid-element.component';
const mockItemWithMetadata: ItemSearchResult = new ItemSearchResult();
mockItemWithMetadata.hitHighlights = {};
@@ -85,7 +84,6 @@ export function getEntityGridElementTestComponent(component, searchResultWithMet
declarations: [component, TruncatePipe],
providers: [
{ provide: TruncatableService, useValue: truncatableServiceStub },
- {provide: ITEM, useValue: searchResultWithoutMetadata}
],
schemas: [NO_ERRORS_SCHEMA]
}).overrideComponent(component, {
diff --git a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts
index 2ebfc2713e..ed61badbbd 100644
--- a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts
+++ b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts
@@ -14,5 +14,5 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
/**
* This component is automatically used to create a list view for BrowseEntry objects when used in ObjectCollectionComponent
*/
-@listableObjectComponent(BrowseEntry, ViewMode.ListElement)
+@listableObjectComponent(BrowseEntry.name, ViewMode.ListElement)
export class BrowseEntryListElementComponent extends AbstractListableElementComponent {}
diff --git a/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts b/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts
index 685a990409..7d57044ba4 100644
--- a/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts
+++ b/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts
@@ -11,5 +11,5 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
templateUrl: './collection-list-element.component.html'
})
-@listableObjectComponent(Collection, ViewMode.ListElement)
+@listableObjectComponent(Collection.name, ViewMode.ListElement)
export class CollectionListElementComponent extends AbstractListableElementComponent {}
diff --git a/src/app/shared/object-list/community-list-element/community-list-element.component.ts b/src/app/shared/object-list/community-list-element/community-list-element.component.ts
index 4581c2c0da..4c3e8bbd6f 100644
--- a/src/app/shared/object-list/community-list-element/community-list-element.component.ts
+++ b/src/app/shared/object-list/community-list-element/community-list-element.component.ts
@@ -11,5 +11,5 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
templateUrl: './community-list-element.component.html'
})
-@listableObjectComponent(Community, ViewMode.ListElement)
+@listableObjectComponent(Community.name, ViewMode.ListElement)
export class CommunityListElementComponent extends AbstractListableElementComponent {}
diff --git a/src/app/shared/object-list/item-list-element/item-list-element.component.html b/src/app/shared/object-list/item-list-element/item-list-element.component.html
deleted file mode 100644
index 21ee7968ca..0000000000
--- a/src/app/shared/object-list/item-list-element/item-list-element.component.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/app/shared/object-list/item-list-element/item-list-element.component.scss b/src/app/shared/object-list/item-list-element/item-list-element.component.scss
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/app/shared/object-list/item-list-element/item-list-element.component.spec.ts b/src/app/shared/object-list/item-list-element/item-list-element.component.spec.ts
deleted file mode 100644
index 2c0c8b0aa2..0000000000
--- a/src/app/shared/object-list/item-list-element/item-list-element.component.spec.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
-import { ItemListElementComponent } from './item-list-element.component';
-import { Item } from '../../../core/shared/item.model';
-import { RemoteData } from '../../../core/data/remote-data';
-import { PaginatedList } from '../../../core/data/paginated-list';
-import { PageInfo } from '../../../core/shared/page-info.model';
-import { By } from '@angular/platform-browser';
-import { createRelationshipsObservable } from '../../../+item-page/simple/item-types/shared/item.component.spec';
-import { of as observableOf } from 'rxjs';
-import { createSuccessfulRemoteDataObject$ } from '../../testing/utils';
-
-const mockItem: Item = Object.assign(new Item(), {
- bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])),
- metadata: [],
- relationships: createRelationshipsObservable()
-});
-
-describe('ItemListElementComponent', () => {
- let comp: ItemListElementComponent;
- let fixture: ComponentFixture;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- imports: [],
- declarations: [ItemListElementComponent],
- providers: [
- { provide: 'objectElementProvider', useValue: mockItem }
- ],
- schemas: [NO_ERRORS_SCHEMA]
- }).overrideComponent(ItemListElementComponent, {
- set: {changeDetection: ChangeDetectionStrategy.Default}
- }).compileComponents();
- }));
-
- beforeEach(async(() => {
- fixture = TestBed.createComponent(ItemListElementComponent);
- comp = fixture.componentInstance;
- fixture.detectChanges();
- }));
-
- it('should call an item-type-switcher component and pass the item', () => {
- const itemTypeSwitcher = fixture.debugElement.query(By.css('ds-item-type-switcher')).componentInstance;
- expect(itemTypeSwitcher.object).toBe(mockItem);
- });
-
-});
diff --git a/src/app/shared/object-list/item-list-element/item-list-element.component.ts b/src/app/shared/object-list/item-list-element/item-list-element.component.ts
deleted file mode 100644
index e41a92f36d..0000000000
--- a/src/app/shared/object-list/item-list-element/item-list-element.component.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Component } from '@angular/core';
-
-import { Item } from '../../../core/shared/item.model';
-import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component';
-import { ViewMode } from '../../../core/shared/view-mode.model';
-import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator';
-
-@Component({
- selector: 'ds-item-list-element',
- styleUrls: ['./item-list-element.component.scss'],
- templateUrl: './item-list-element.component.html'
-})
-
-/**
- * The component used to list items depending on type
- * Uses item-type-switcher to determine which components to use for displaying the list
- */
-@listableObjectComponent(Item, ViewMode.ListElement)
-export class ItemListElementComponent extends AbstractListableElementComponent
- {
- viewMode = ViewMode.ListElement;
-}
diff --git a/src/app/shared/object-list/item-type-badge/item-type-badge.component.ts b/src/app/shared/object-list/item-type-badge/item-type-badge.component.ts
index 9ffba33758..a4e12959f4 100644
--- a/src/app/shared/object-list/item-type-badge/item-type-badge.component.ts
+++ b/src/app/shared/object-list/item-type-badge/item-type-badge.component.ts
@@ -8,5 +8,5 @@ import { DSpaceObject } from '../../../core/shared/dspace-object.model';
templateUrl: './item-type-badge.component.html'
})
export class ItemTypeBadgeComponent {
- @Input() object: SearchResult;
+ @Input() object: DSpaceObject;
}
diff --git a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.html b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.html
index 764fdc1064..4ecb8c0c51 100644
--- a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.html
+++ b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.html
@@ -1,2 +1,2 @@
-
-
+
+
diff --git a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.spec.ts b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.spec.ts
index 2aa54bae64..e89602775e 100644
--- a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.spec.ts
+++ b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.spec.ts
@@ -31,7 +31,7 @@ describe('ItemMetadataListElementComponent', () => {
}));
it('should call an item-type-switcher component and pass the item-metadata-representation', () => {
- const itemTypeSwitcher = fixture.debugElement.query(By.css('ds-item-type-switcher')).nativeElement;
+ const itemTypeSwitcher = fixture.debugElement.query(By.css('ds-listable-object-component-loader')).nativeElement;
expect(itemTypeSwitcher.object).toBe(mockItemMetadataRepresentation);
});
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.ts
index 68eb27c93a..bef18a5c1a 100644
--- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.ts
+++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-my-dspace-result/claimed-my-dspace-result-list-element.component.ts
@@ -24,8 +24,8 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
providers: [Location, { provide: LocationStrategy, useClass: PathLocationStrategy }]
})
-@listableObjectComponent(ClaimedTaskMyDSpaceResult, ViewMode.ListElement)
-@listableObjectComponent(ClaimedTask, ViewMode.ListElement)
+@listableObjectComponent(ClaimedTaskMyDSpaceResult.name, ViewMode.ListElement)
+@listableObjectComponent(ClaimedTask.name, ViewMode.ListElement)
export class ClaimedMyDSpaceResultListElementComponent extends MyDSpaceResultListElementComponent {
/**
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-my-dspace-result/item-my-dspace-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-my-dspace-result/item-my-dspace-result-list-element.component.ts
index 8d3fd00eaa..5304138587 100644
--- a/src/app/shared/object-list/my-dspace-result-list-element/item-my-dspace-result/item-my-dspace-result-list-element.component.ts
+++ b/src/app/shared/object-list/my-dspace-result-list-element/item-my-dspace-result/item-my-dspace-result-list-element.component.ts
@@ -6,6 +6,7 @@ import { ItemMyDSpaceResult } from '../../../object-collection/shared/item-my-ds
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
import { ViewMode } from '../../../../core/shared/view-mode.model';
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
+import { Context } from '../../../../core/shared/context.model';
/**
* This component renders item object for the mydspace result in the list view.
@@ -16,7 +17,7 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: './item-my-dspace-result-list-element.component.html'
})
-@listableObjectComponent(ItemMyDSpaceResult, ViewMode.ListElement)
+@listableObjectComponent('PublicationSearchResult', ViewMode.ListElement, Context.Submission)
export class ItemMyDSpaceResultListElementComponent extends MyDSpaceResultListElementComponent {
/**
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.ts
index 1f9499f6aa..46dfd583e0 100644
--- a/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.ts
+++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-my-dspace-result/pool-my-dspace-result-list-element.component.ts
@@ -13,6 +13,7 @@ import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model';
import { PoolTaskMyDSpaceResult } from '../../../object-collection/shared/pool-task-my-dspace-result.model';
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
+import { ClaimedTaskMyDSpaceResult } from '../../../object-collection/shared/claimed-task-my-dspace-result.model';
/**
* This component renders pool task object for the mydspace result in the list view.
@@ -23,8 +24,8 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: './pool-my-dspace-result-list-element.component.html',
})
-@listableObjectComponent(PoolTaskMyDSpaceResult, ViewMode.ListElement)
-@listableObjectComponent(PoolTask, ViewMode.ListElement)
+@listableObjectComponent(PoolTaskMyDSpaceResult.name, ViewMode.ListElement)
+@listableObjectComponent(PoolTask.name, ViewMode.ListElement)
export class PoolMyDSpaceResultListElementComponent extends MyDSpaceResultListElementComponent implements OnInit {
/**
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.ts
index 5ec7572984..97c1695c29 100644
--- a/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.ts
+++ b/src/app/shared/object-list/my-dspace-result-list-element/workflowitem-my-dspace-result/workflowitem-my-dspace-result-list-element.component.ts
@@ -22,8 +22,8 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: './workflowitem-my-dspace-result-list-element.component.html',
})
-@listableObjectComponent(WorkflowitemMyDSpaceResult, ViewMode.ListElement)
-@listableObjectComponent(WorkflowItem, ViewMode.ListElement)
+@listableObjectComponent(WorkflowitemMyDSpaceResult.name, ViewMode.ListElement)
+@listableObjectComponent(WorkflowItem.name, ViewMode.ListElement)
export class WorkflowitemMyDSpaceResultListElementComponent extends MyDSpaceResultListElementComponent {
/**
diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.ts
index e88ea54703..a886e90737 100644
--- a/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.ts
+++ b/src/app/shared/object-list/my-dspace-result-list-element/workspaceitem-my-dspace-result/workspaceitem-my-dspace-result-list-element.component.ts
@@ -22,7 +22,7 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: './workspaceitem-my-dspace-result-list-element.component.html',
})
-@listableObjectComponent(WorkspaceitemMyDSpaceResult, ViewMode.ListElement)
+@listableObjectComponent(WorkspaceitemMyDSpaceResult.name, ViewMode.ListElement)
export class WorkspaceitemMyDSpaceResultListElementComponent extends MyDSpaceResultListElementComponent {
/**
diff --git a/src/app/shared/object-list/object-list.component.html b/src/app/shared/object-list/object-list.component.html
index 1fdc06d5bf..b19daa035a 100644
--- a/src/app/shared/object-list/object-list.component.html
+++ b/src/app/shared/object-list/object-list.component.html
@@ -12,7 +12,7 @@
(paginationChange)="onPaginationChange($event)">
diff --git a/src/app/shared/object-list/object-list.component.ts b/src/app/shared/object-list/object-list.component.ts
index afc376034f..cf4728464a 100644
--- a/src/app/shared/object-list/object-list.component.ts
+++ b/src/app/shared/object-list/object-list.component.ts
@@ -12,6 +12,7 @@ import { RemoteData } from '../../core/data/remote-data';
import { fadeIn } from '../animations/fade';
import { ListableObject } from '../object-collection/shared/listable-object.model';
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
+import { ViewMode } from '../../core/shared/view-mode.model';
@Component({
changeDetection: ChangeDetectionStrategy.Default,
@@ -22,7 +23,7 @@ import { PaginationComponentOptions } from '../pagination/pagination-component-o
animations: [fadeIn]
})
export class ObjectListComponent {
-
+ viewMode = ViewMode.ListElement;
@Input() config: PaginationComponentOptions;
@Input() sortConfig: SortOptions;
@Input() hasBorder = false;
diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts
index 384e1c1f81..1a678dddb7 100644
--- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts
+++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts
@@ -6,6 +6,7 @@ import { Collection } from '../../../../core/shared/collection.model';
import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model';
import { ViewMode } from '../../../../core/shared/view-mode.model';
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
+import { BrowseEntry } from '../../../../core/shared/browse-entry.model';
@Component({
selector: 'ds-collection-search-result-list-element',
@@ -13,5 +14,5 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: 'collection-search-result-list-element.component.html'
})
-@listableObjectComponent(CollectionSearchResult, ViewMode.ListElement)
+@listableObjectComponent(CollectionSearchResult.name, ViewMode.ListElement)
export class CollectionSearchResultListElementComponent extends SearchResultListElementComponent {}
diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts
index 3281e380e4..fd3bba85e9 100644
--- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts
+++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts
@@ -6,6 +6,7 @@ import { Community } from '../../../../core/shared/community.model';
import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model';
import { ViewMode } from '../../../../core/shared/view-mode.model';
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
+import { BrowseEntry } from '../../../../core/shared/browse-entry.model';
@Component({
selector: 'ds-community-search-result-list-element',
@@ -13,7 +14,7 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
templateUrl: 'community-search-result-list-element.component.html'
})
-@listableObjectComponent(CommunitySearchResult, ViewMode.ListElement)
+@listableObjectComponent(CommunitySearchResult.name, ViewMode.ListElement)
export class CommunitySearchResultListElementComponent extends SearchResultListElementComponent {
}
diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.html
deleted file mode 100644
index 901ce441bf..0000000000
--- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.scss b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.scss
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.spec.ts
deleted file mode 100644
index 8f41018404..0000000000
--- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.spec.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import { ItemSearchResultListElementComponent } from './item-search-result-list-element.component';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import { of as observableOf } from 'rxjs';
-import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
-import { By } from '@angular/platform-browser';
-import { TruncatePipe } from '../../../utils/truncate.pipe';
-import { Item } from '../../../../core/shared/item.model';
-import { TruncatableService } from '../../../truncatable/truncatable.service';
-import { NoopAnimationsModule } from '@angular/platform-browser/animations';
-import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
-import { TranslateModule } from '@ngx-translate/core';
-
-let itemSearchResultListElementComponent: ItemSearchResultListElementComponent;
-let fixture: ComponentFixture;
-
-const truncatableServiceStub: any = {
- isCollapsed: (id: number) => observableOf(true),
-};
-
-const type = 'authorOfPublication';
-
-const mockItemWithRelationshipType: ItemSearchResult = new ItemSearchResult();
-mockItemWithRelationshipType.hitHighlights = {};
-mockItemWithRelationshipType.indexableObject = Object.assign(new Item(), {
- bitstreams: observableOf({}),
- metadata: {
- 'relationship.type': [
- {
- language: 'en_US',
- value: type
- }
- ]
- }
-});
-
-describe('ItemSearchResultListElementComponent', () => {
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- imports: [TranslateModule.forRoot(), NoopAnimationsModule],
- declarations: [ItemSearchResultListElementComponent, TruncatePipe],
- providers: [
- { provide: TruncatableService, useValue: truncatableServiceStub },
- { provide: 'objectElementProvider', useValue: (mockItemWithRelationshipType) }
- ],
- schemas: [NO_ERRORS_SCHEMA]
- }).overrideComponent(ItemSearchResultListElementComponent, {
- set: { changeDetection: ChangeDetectionStrategy.Default }
- }).compileComponents();
- }));
-
- beforeEach(async(() => {
- fixture = TestBed.createComponent(ItemSearchResultListElementComponent);
- itemSearchResultListElementComponent = fixture.componentInstance;
- }));
-
- it('should show a badge on top of the list element', () => {
- const badge = fixture.debugElement.query(By.css('ds-item-type-badge')).componentInstance;
- expect(badge.object).toBe(mockItemWithRelationshipType);
- });
-});
diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.ts
deleted file mode 100644
index 0b25443454..0000000000
--- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-search-result-list-element.component.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Component } from '@angular/core';
-import { Item } from '../../../../core/shared/item.model';
-import { focusBackground } from '../../../animations/focus';
-
-import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
-import { SearchResultListElementComponent } from '../search-result-list-element.component';
-import { ViewMode } from '../../../../core/shared/view-mode.model';
-import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
-
-@Component({
- selector: 'ds-item-search-result-list-element',
- styleUrls: ['../search-result-list-element.component.scss', 'item-search-result-list-element.component.scss'],
- templateUrl: 'item-search-result-list-element.component.html',
- animations: [focusBackground],
-
-})
-
-@listableObjectComponent(ItemSearchResult, ViewMode.ListElement)
-export class ItemSearchResultListElementComponent extends SearchResultListElementComponent {
- viewMode = ViewMode.ListElement;
-
-}
diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/publication/publication-search-result-list-element.component.html b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/publication/publication-search-result-list-element.component.html
index 2d42fb611d..7fbb2c3c79 100644
--- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/publication/publication-search-result-list-element.component.html
+++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/publication/publication-search-result-list-element.component.html
@@ -1,12 +1,14 @@
-
-
-
+
+
+
+
+
(, , )
0"
@@ -18,10 +20,10 @@
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts
index 8aa5bf0fdd..187de7726c 100644
--- a/src/app/shared/shared.module.ts
+++ b/src/app/shared/shared.module.ts
@@ -22,12 +22,10 @@ import { ConsolePipe } from './utils/console.pipe';
import { CollectionListElementComponent } from './object-list/collection-list-element/collection-list-element.component';
import { CommunityListElementComponent } from './object-list/community-list-element/community-list-element.component';
-import { ItemListElementComponent } from './object-list/item-list-element/item-list-element.component';
import { SearchResultListElementComponent } from './object-list/search-result-list-element/search-result-list-element.component';
import { ObjectListComponent } from './object-list/object-list.component';
import { CollectionGridElementComponent } from './object-grid/collection-grid-element/collection-grid-element.component';
import { CommunityGridElementComponent } from './object-grid/community-grid-element/community-grid-element.component';
-import { ItemGridElementComponent } from './object-grid/item-grid-element/item-grid-element.component';
import { AbstractListableElementComponent } from './object-collection/shared/object-collection-element/abstract-listable-element.component';
import { ObjectGridComponent } from './object-grid/object-grid.component';
import { ObjectCollectionComponent } from './object-collection/object-collection.component';
@@ -122,7 +120,6 @@ import { CreateItemParentSelectorComponent } from './dso-selector/modal-wrappers
import { CreateCollectionParentSelectorComponent } from './dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component';
import { CommunitySearchResultListElementComponent } from './object-list/search-result-list-element/community-search-result/community-search-result-list-element.component';
import { CollectionSearchResultListElementComponent } from './object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component';
-import { ItemSearchResultListElementComponent } from './object-list/search-result-list-element/item-search-result/item-search-result-list-element.component';
import { EditItemSelectorComponent } from './dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component';
import { EditCommunitySelectorComponent } from './dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component';
import { EditCollectionSelectorComponent } from './dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component';
@@ -142,6 +139,7 @@ import { MetadataRepresentationDirective } from './metadata-representation/metad
import { ListableObjectComponentLoaderComponent } from './object-collection/shared/listable-object/listable-object-component-loader.component';
import { PublicationSearchResultListElementComponent } from './object-list/search-result-list-element/item-search-result/item-types/publication/publication-search-result-list-element.component';
import { PublicationSearchResultGridElementComponent } from './object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component';
+import { ListableObjectDirective } from './object-collection/shared/listable-object/listable-object.directive';
const MODULES = [
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
@@ -256,7 +254,6 @@ const COMPONENTS = [
EditItemSelectorComponent,
CommunitySearchResultListElementComponent,
CollectionSearchResultListElementComponent,
- ItemSearchResultListElementComponent,
ListableObjectComponentLoaderComponent,
BrowseByComponent,
ItemTypeBadgeComponent,
@@ -265,15 +262,12 @@ const COMPONENTS = [
const ENTRY_COMPONENTS = [
// put shared entry components (components that are created dynamically) here
- ItemListElementComponent,
CollectionListElementComponent,
CommunityListElementComponent,
MyDSpaceResultListElementComponent,
SearchResultListElementComponent,
CommunitySearchResultListElementComponent,
CollectionSearchResultListElementComponent,
- ItemSearchResultListElementComponent,
- ItemGridElementComponent,
CollectionGridElementComponent,
CommunityGridElementComponent,
SearchResultGridElementComponent,
@@ -332,7 +326,8 @@ const DIRECTIVES = [
InListValidator,
AutoFocusDirective,
RoleDirective,
- MetadataRepresentationDirective
+ MetadataRepresentationDirective,
+ ListableObjectDirective
];
@NgModule({
diff --git a/themes/mantis/app/+item-page/simple/item-page.component.html b/themes/mantis/app/+item-page/simple/item-page.component.html
index 472df7c78e..83f910e0cd 100644
--- a/themes/mantis/app/+item-page/simple/item-page.component.html
+++ b/themes/mantis/app/+item-page/simple/item-page.component.html
@@ -1,7 +1,7 @@