mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
added tests, aot fixes, lint fixes
This commit is contained in:
@@ -117,7 +117,7 @@ describe('EditRelationshipListComponent', () => {
|
||||
fixture = TestBed.createComponent(EditRelationshipListComponent);
|
||||
comp = fixture.componentInstance;
|
||||
de = fixture.debugElement;
|
||||
comp.object = item;
|
||||
comp.item = item;
|
||||
comp.url = url;
|
||||
comp.relationshipLabel = relationshipType.leftLabel;
|
||||
fixture.detectChanges();
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<ds-metadata-field-wrapper>
|
||||
<ds-thumbnail [thumbnail]="this.object.getThumbnail() | async"></ds-thumbnail>
|
||||
<ds-thumbnail [thumbnail]="object.getThumbnail() | async"></ds-thumbnail>
|
||||
</ds-metadata-field-wrapper>
|
||||
<ds-item-page-file-section [item]="object"></ds-item-page-file-section>
|
||||
<ds-item-page-date-field [item]="object"></ds-item-page-date-field>
|
||||
|
@@ -8,7 +8,7 @@ import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||
import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||
|
||||
@listableObjectComponent('Publication', ViewMode.StandalonePage)
|
||||
@listableObjectComponent(Item.name, ViewMode.StandalonePage)
|
||||
@listableObjectComponent(Item, ViewMode.StandalonePage)
|
||||
@Component({
|
||||
selector: 'ds-publication',
|
||||
styleUrls: ['./publication.component.scss'],
|
||||
|
@@ -66,9 +66,6 @@ export class ItemComponent implements OnInit {
|
||||
resolvedRelsAndTypes$: Observable<[Relationship[], RelationshipType[]]>;
|
||||
@Input() object: Item;
|
||||
|
||||
constructor(
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
const relationships$ = this.object.relationships;
|
||||
if (relationships$) {
|
||||
|
@@ -20,10 +20,4 @@ export class MetadataRepresentationListComponent {
|
||||
* An i18n label to use as a title for the list
|
||||
*/
|
||||
@Input() label: string;
|
||||
|
||||
/**
|
||||
* The view-mode we're currently on
|
||||
* @type {ElementViewMode}
|
||||
*/
|
||||
viewMode = ViewMode.MetadataField;
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { DSpaceObject } from '../core/shared/dspace-object.model';
|
||||
import { MetadataMap } from '../core/shared/metadata.models';
|
||||
import { ListableObject } from '../shared/object-collection/shared/listable-object.model';
|
||||
import { GenericConstructor } from '../core/shared/generic-constructor';
|
||||
|
||||
/**
|
||||
* Represents a search result object of a certain (<T>) DSpaceObject
|
||||
@@ -16,7 +17,7 @@ export class SearchResult<T extends DSpaceObject> implements ListableObject {
|
||||
*/
|
||||
hitHighlights: MetadataMap;
|
||||
|
||||
getRenderTypes(): string[] {
|
||||
return this.indexableObject.getRenderTypes().map((type) => type +'SearchResult');
|
||||
getRenderTypes(): Array<string | GenericConstructor<ListableObject>> {
|
||||
return [this.constructor as GenericConstructor<ListableObject>];
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ import { ListableObject } from '../../shared/object-collection/shared/listable-o
|
||||
import { isNotEmpty } from '../../shared/empty.util';
|
||||
import { MetadataSchema } from './metadata-schema.model';
|
||||
import { ResourceType } from '../shared/resource-type';
|
||||
import { GenericConstructor } from '../shared/generic-constructor';
|
||||
|
||||
/**
|
||||
* Class the represents a metadata field
|
||||
@@ -51,7 +52,7 @@ export class MetadataField implements ListableObject {
|
||||
return key;
|
||||
}
|
||||
|
||||
getRenderTypes(): string[] {
|
||||
return [this.constructor.name];
|
||||
getRenderTypes(): Array<string | GenericConstructor<ListableObject>> {
|
||||
return [this.constructor as GenericConstructor<ListableObject>];
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { ResourceType } from '../shared/resource-type';
|
||||
import { GenericConstructor } from '../shared/generic-constructor';
|
||||
|
||||
/**
|
||||
* Class that represents a metadata schema
|
||||
@@ -27,7 +28,7 @@ export class MetadataSchema implements ListableObject {
|
||||
*/
|
||||
namespace: string;
|
||||
|
||||
getRenderTypes(): string[] {
|
||||
return [this.constructor.name];
|
||||
getRenderTypes(): Array<string | GenericConstructor<ListableObject>> {
|
||||
return [this.constructor as GenericConstructor<ListableObject>];
|
||||
}
|
||||
}
|
||||
|
@@ -55,22 +55,24 @@ describe('RegistryService', () => {
|
||||
});
|
||||
|
||||
const mockSchemasList = [
|
||||
{
|
||||
Object.assign(new MetadataSchema(), {
|
||||
id: 1,
|
||||
self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadataschemas/1',
|
||||
prefix: 'dc',
|
||||
namespace: 'http://dublincore.org/documents/dcmi-terms/',
|
||||
type: MetadataSchema.type
|
||||
},
|
||||
{
|
||||
}),
|
||||
Object.assign(new MetadataSchema(), {
|
||||
|
||||
id: 2,
|
||||
self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadataschemas/2',
|
||||
prefix: 'mock',
|
||||
namespace: 'http://dspace.org/mockschema',
|
||||
type: MetadataSchema.type
|
||||
}
|
||||
})
|
||||
];
|
||||
const mockFieldsList = [
|
||||
Object.assign(new MetadataField(),
|
||||
{
|
||||
id: 1,
|
||||
self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadatafields/8',
|
||||
@@ -79,8 +81,9 @@ describe('RegistryService', () => {
|
||||
scopeNote: null,
|
||||
schema: mockSchemasList[0],
|
||||
type: MetadataField.type
|
||||
},
|
||||
{
|
||||
}),
|
||||
Object.assign(new MetadataField(),
|
||||
{
|
||||
id: 2,
|
||||
self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadatafields/9',
|
||||
element: 'contributor',
|
||||
@@ -88,8 +91,9 @@ describe('RegistryService', () => {
|
||||
scopeNote: null,
|
||||
schema: mockSchemasList[0],
|
||||
type: MetadataField.type
|
||||
},
|
||||
{
|
||||
}),
|
||||
Object.assign(new MetadataField(),
|
||||
{
|
||||
id: 3,
|
||||
self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadatafields/10',
|
||||
element: 'contributor',
|
||||
@@ -97,8 +101,9 @@ describe('RegistryService', () => {
|
||||
scopeNote: 'test scope note',
|
||||
schema: mockSchemasList[1],
|
||||
type: MetadataField.type
|
||||
},
|
||||
{
|
||||
}),
|
||||
Object.assign(new MetadataField(),
|
||||
{
|
||||
id: 4,
|
||||
self: 'https://dspace7.4science.it/dspace-spring-rest/api/core/metadatafields/11',
|
||||
element: 'contributor',
|
||||
@@ -106,7 +111,7 @@ describe('RegistryService', () => {
|
||||
scopeNote: null,
|
||||
schema: mockSchemasList[1],
|
||||
type: MetadataField.type
|
||||
}
|
||||
})
|
||||
];
|
||||
|
||||
const pageInfo = new PageInfo();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { TypedObject } from '../cache/object-cache.reducer';
|
||||
import { ResourceType } from './resource-type';
|
||||
import { GenericConstructor } from './generic-constructor';
|
||||
|
||||
/**
|
||||
* Class object representing a browse entry
|
||||
@@ -29,7 +30,7 @@ export class BrowseEntry implements ListableObject {
|
||||
*/
|
||||
count: number;
|
||||
|
||||
getRenderTypes(): string[] {
|
||||
return [this.constructor.name];
|
||||
getRenderTypes(): Array<string | GenericConstructor<ListableObject>> {
|
||||
return [this.constructor as GenericConstructor<ListableObject>];
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ import { CacheableObject } from '../cache/object-cache.reducer';
|
||||
import { RemoteData } from '../data/remote-data';
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { ResourceType } from './resource-type';
|
||||
import { GenericConstructor } from './generic-constructor';
|
||||
|
||||
/**
|
||||
* An abstract model class for a DSpaceObject.
|
||||
@@ -146,7 +147,7 @@ export class DSpaceObject implements CacheableObject, ListableObject {
|
||||
});
|
||||
}
|
||||
|
||||
getRenderTypes(): string[] {
|
||||
return [this.constructor.name];
|
||||
getRenderTypes(): Array<string | GenericConstructor<ListableObject>> {
|
||||
return [this.constructor as GenericConstructor<ListableObject>];
|
||||
}
|
||||
}
|
||||
|
@@ -10,6 +10,9 @@ import { PaginatedList } from '../data/paginated-list';
|
||||
import { Relationship } from './item-relationships/relationship.model';
|
||||
import { ResourceType } from './resource-type';
|
||||
import { getSucceededRemoteData } from './operators';
|
||||
import { GenericConstructor } from './generic-constructor';
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { DEFAULT_ENTITY_TYPE } from '../../shared/metadata-representation/metadata-representation.decorator';
|
||||
|
||||
export class Item extends DSpaceObject {
|
||||
static type = new ResourceType('item');
|
||||
@@ -110,10 +113,10 @@ export class Item extends DSpaceObject {
|
||||
}));
|
||||
}
|
||||
|
||||
getRenderTypes(): string[] {
|
||||
getRenderTypes(): Array<string | GenericConstructor<ListableObject>> {
|
||||
let entityType = this.firstMetadataValue('relationship.type');
|
||||
if (isEmpty(entityType)) {
|
||||
entityType = 'Publication';
|
||||
entityType = DEFAULT_ENTITY_TYPE;
|
||||
}
|
||||
return [entityType, ...super.getRenderTypes()];
|
||||
}
|
||||
|
@@ -7,5 +7,4 @@ export enum ViewMode {
|
||||
GridElement = 'gridElement',
|
||||
DetailedListElement = 'detailedListElement',
|
||||
StandalonePage = 'standalonePage',
|
||||
MetadataField = 'metadataField'
|
||||
}
|
||||
|
@@ -1,6 +1,4 @@
|
||||
import { ItemSearchResult } from '../../../../shared/object-collection/shared/item-search-result.model';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { getEntityGridElementTestComponent } from '../../../../shared/object-grid/item-grid-element/item-types/publication/publication-grid-element.component.spec';
|
||||
import { JournalIssueGridElementComponent } from './journal-issue-grid-element.component';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
@@ -37,43 +35,41 @@ const mockItem = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('JournalIssueGridElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('JournalIssueGridElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [JournalIssueGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalIssueGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [JournalIssueGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalIssueGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalIssueGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalIssueGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the journal issue is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalIssueSearchResultGridElementComponent`, () => {
|
||||
const journalIssueGridElement = fixture.debugElement.query(By.css(`ds-journal-issue-search-result-grid-element`));
|
||||
expect(journalIssueGridElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
describe(`when the journal issue is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalIssueSearchResultGridElementComponent`, () => {
|
||||
const journalIssueGridElement = fixture.debugElement.query(By.css(`ds-journal-issue-search-result-grid-element`));
|
||||
expect(journalIssueGridElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import { ItemSearchResult } from '../../../../shared/object-collection/shared/item-search-result.model';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { JournalVolumeGridElementComponent } from './journal-volume-grid-element.component';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils';
|
||||
@@ -7,7 +6,6 @@ import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { JournalIssueGridElementComponent } from '../journal-issue/journal-issue-grid-element.component';
|
||||
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
||||
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
@@ -37,43 +35,41 @@ const mockItem = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('JournalVolumeGridElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('JournalVolumeGridElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [JournalVolumeGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalVolumeGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [JournalVolumeGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalVolumeGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalVolumeGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalVolumeGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the journal volume is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalVolumeSearchResultGridElementComponent`, () => {
|
||||
const journalVolumeGridElement = fixture.debugElement.query(By.css(`ds-journal-volume-search-result-grid-element`));
|
||||
expect(journalVolumeGridElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the journal volume is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalVolumeSearchResultGridElementComponent`, () => {
|
||||
const journalVolumeGridElement = fixture.debugElement.query(By.css(`ds-journal-volume-search-result-grid-element`));
|
||||
expect(journalVolumeGridElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import { ItemSearchResult } from '../../../../shared/object-collection/shared/item-search-result.model';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { of as observableOf } from 'rxjs/internal/observable/of';
|
||||
import { JournalGridElementComponent } from './journal-grid-element.component';
|
||||
@@ -42,43 +41,41 @@ const mockItem = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('JournalGridElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('JournalGridElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [JournalGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [JournalGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the journal is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalGridElementComponent`, () => {
|
||||
const journalGridElement = fixture.debugElement.query(By.css(`ds-journal-search-result-grid-element`));
|
||||
expect(journalGridElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the journal is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalGridElementComponent`, () => {
|
||||
const journalGridElement = fixture.debugElement.query(By.css(`ds-journal-search-result-grid-element`));
|
||||
expect(journalGridElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -31,42 +31,41 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('JournalIssueListElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('JournalIssueListElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [JournalIssueListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalIssueListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [JournalIssueListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalIssueListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalIssueListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalIssueListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the journal issue is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalIssueListElementComponent`, () => {
|
||||
const journalIssueListElement = fixture.debugElement.query(By.css(`ds-journal-issue-search-result-list-element`));
|
||||
expect(journalIssueListElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the journal issue is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalIssueListElementComponent`, () => {
|
||||
const journalIssueListElement = fixture.debugElement.query(By.css(`ds-journal-issue-search-result-list-element`));
|
||||
expect(journalIssueListElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -30,42 +30,41 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
]
|
||||
}
|
||||
});
|
||||
describe('JournalVolumeListElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
describe('JournalVolumeListElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [JournalVolumeListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalVolumeListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalVolumeListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [JournalVolumeListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalVolumeListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
describe(`when the journal volume is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalVolumeListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
it(`should contain a JournalVolumeListElementComponent`, () => {
|
||||
const journalVolumeListElement = fixture.debugElement.query(By.css(`ds-journal-volume-search-result-list-element`));
|
||||
expect(journalVolumeListElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the journal volume is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalVolumeListElementComponent`, () => {
|
||||
const journalVolumeListElement = fixture.debugElement.query(By.css(`ds-journal-volume-search-result-list-element`));
|
||||
expect(journalVolumeListElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -25,43 +25,40 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('JournalListElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
describe('JournalListElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [JournalListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [JournalListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the journal is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalListElementComponent`, () => {
|
||||
const journalListElement = fixture.debugElement.query(By.css(`ds-journal-search-result-list-element`));
|
||||
expect(journalListElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the journal is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a JournalListElementComponent`, () => {
|
||||
const journalListElement = fixture.debugElement.query(By.css(`ds-journal-search-result-list-element`));
|
||||
expect(journalListElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -41,43 +41,41 @@ const mockItem = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('OrgunitGridElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('OrgunitGridElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [OrgunitGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(OrgunitGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [OrgunitGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(OrgunitGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(OrgunitGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(OrgunitGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the org unit is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a OrgunitGridElementComponent`, () => {
|
||||
const orgunitGridElement = fixture.debugElement.query(By.css(`ds-orgunit-search-result-grid-element`));
|
||||
expect(orgunitGridElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the org unit is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a OrgunitGridElementComponent`, () => {
|
||||
const orgunitGridElement = fixture.debugElement.query(By.css(`ds-orgunit-search-result-grid-element`));
|
||||
expect(orgunitGridElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -35,43 +35,41 @@ const mockItem = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('PersonGridElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('PersonGridElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [PersonGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(PersonGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [PersonGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(PersonGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(PersonGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(PersonGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the person is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a PersonGridElementComponent`, () => {
|
||||
const personGridElement = fixture.debugElement.query(By.css(`ds-person-search-result-grid-element`));
|
||||
expect(personGridElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the person is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a PersonGridElementComponent`, () => {
|
||||
const personGridElement = fixture.debugElement.query(By.css(`ds-person-search-result-grid-element`));
|
||||
expect(personGridElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -1,14 +1,11 @@
|
||||
import { ItemSearchResult } from '../../../../shared/object-collection/shared/item-search-result.model';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { of as observableOf } from 'rxjs/internal/observable/of';
|
||||
import { getEntityGridElementTestComponent } from '../../../../shared/object-grid/item-grid-element/item-types/publication/publication-grid-element.component.spec';
|
||||
import { ProjectGridElementComponent } from './project-grid-element.component';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { PersonGridElementComponent } from '../person/person-grid-element.component';
|
||||
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
||||
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
@@ -32,43 +29,41 @@ const mockItem = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('ProjectGridElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('ProjectGridElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [ProjectGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(ProjectGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [ProjectGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(ProjectGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(ProjectGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(ProjectGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the project is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a ProjectGridElementComponent`, () => {
|
||||
const projectGridElement = fixture.debugElement.query(By.css(`ds-project-search-result-grid-element`));
|
||||
expect(projectGridElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the project is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a ProjectGridElementComponent`, () => {
|
||||
const projectGridElement = fixture.debugElement.query(By.css(`ds-project-search-result-grid-element`));
|
||||
expect(projectGridElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -3,8 +3,8 @@ import { Item } from '../../../../../core/shared/item.model';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/testing/utils';
|
||||
import { PaginatedList } from '../../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../../core/shared/page-info.model';
|
||||
import { getEntityGridElementTestComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component.spec';
|
||||
import { ProjectSearchResultGridElementComponent } from './project-search-result-grid-element.component';
|
||||
import { getEntityGridElementTestComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/publication/publication-search-result-grid-element.component.spec';
|
||||
|
||||
const mockItemWithMetadata: ItemSearchResult = new ItemSearchResult();
|
||||
mockItemWithMetadata.hitHighlights = {};
|
||||
|
@@ -25,42 +25,40 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('OrgunitListElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('OrgunitListElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [OrgUnitListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(OrgUnitListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [OrgUnitListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(OrgUnitListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(OrgUnitListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(OrgUnitListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the orgunit is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a OrgUnitListElementComponent`, () => {
|
||||
const orgunitListElement = fixture.debugElement.query(By.css(`ds-orgunit-search-result-list-element`));
|
||||
expect(orgunitListElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the orgunit is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a OrgUnitListElementComponent`, () => {
|
||||
const orgunitListElement = fixture.debugElement.query(By.css(`ds-orgunit-search-result-list-element`));
|
||||
expect(orgunitListElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -6,7 +6,6 @@ import { of as observableOf } from 'rxjs';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
||||
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
||||
import { OrgUnitListElementComponent } from '../orgunit/orgunit-list-element.component';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: observableOf({}),
|
||||
@@ -26,42 +25,40 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('PersonListElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('PersonListElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [PersonListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(PersonListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [PersonListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(PersonListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(PersonListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(PersonListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the person is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a PersonListElementComponent`, () => {
|
||||
const personListElement = fixture.debugElement.query(By.css(`ds-person-search-result-list-element`));
|
||||
expect(personListElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the person is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a PersonListElementComponent`, () => {
|
||||
const personListElement = fixture.debugElement.query(By.css(`ds-person-search-result-list-element`));
|
||||
expect(personListElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -5,7 +5,6 @@ import { of as observableOf } from 'rxjs';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
||||
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
||||
import { PersonListElementComponent } from '../person/person-list-element.component';
|
||||
import { ProjectListElementComponent } from './project-list-element.component';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
@@ -25,42 +24,41 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
// ]
|
||||
}
|
||||
});
|
||||
describe('ProjectListElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
describe('ProjectListElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ProjectListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(ProjectListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(ProjectListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ProjectListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(ProjectListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
describe(`when the project is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(ProjectListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
it(`should contain a ProjectListElementComponent`, () => {
|
||||
const projectListElement = fixture.debugElement.query(By.css(`ds-project-search-result-list-element`));
|
||||
expect(projectListElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the project is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a ProjectListElementComponent`, () => {
|
||||
const projectListElement = fixture.debugElement.query(By.css(`ds-project-search-result-list-element`));
|
||||
expect(projectListElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -32,7 +32,7 @@ export class MetadataRepresentationLoaderComponent implements OnInit {
|
||||
viewContainerRef.clear();
|
||||
|
||||
const componentRef = viewContainerRef.createComponent(componentFactory);
|
||||
(<MetadataRepresentationListElementComponent>componentRef.instance).metadataRepresentation = this.mdRepresentation;
|
||||
(componentRef.instance as MetadataRepresentationListElementComponent).metadataRepresentation = this.mdRepresentation;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -0,0 +1,63 @@
|
||||
import { DEFAULT_ENTITY_TYPE, DEFAULT_REPRESENTATION_TYPE, getMetadataRepresentationComponent, metadataRepresentationComponent } from './metadata-representation.decorator';
|
||||
import { MetadataRepresentationType } from '../../core/shared/metadata-representation/metadata-representation.model';
|
||||
import { Context } from '../../core/shared/context.model';
|
||||
import * as uuidv4 from 'uuid/v4';
|
||||
|
||||
describe('MetadataRepresentation decorator function', () => {
|
||||
const type1 = 'TestType';
|
||||
const type2 = 'TestType2';
|
||||
const type3 = 'TestType3';
|
||||
const type4 = 'RandomType';
|
||||
let prefix;
|
||||
/* tslint:disable:max-classes-per-file */
|
||||
class Test1PlainText {};
|
||||
class Test1Authority {};
|
||||
class Test2Item {};
|
||||
class Test2ItemSubmission {};
|
||||
class Test3ItemSubmission {};
|
||||
/* tslint:enable:max-classes-per-file */
|
||||
|
||||
beforeEach(() => {
|
||||
prefix = uuidv4();
|
||||
init(prefix);
|
||||
});
|
||||
|
||||
function init(key) {
|
||||
metadataRepresentationComponent(key + type1, MetadataRepresentationType.PlainText)(Test1PlainText);
|
||||
metadataRepresentationComponent(key + type1, MetadataRepresentationType.AuthorityControlled)(Test1Authority);
|
||||
|
||||
metadataRepresentationComponent(key + type2, MetadataRepresentationType.Item)(Test2Item);
|
||||
metadataRepresentationComponent(key + type2, MetadataRepresentationType.Item, Context.Submission)(Test2ItemSubmission);
|
||||
|
||||
metadataRepresentationComponent(key + type3, MetadataRepresentationType.Item, Context.Submission)(Test3ItemSubmission);
|
||||
}
|
||||
|
||||
describe('If there\'s an exact match', () => {
|
||||
it('should return the matching class', () => {
|
||||
const component = getMetadataRepresentationComponent(prefix + type3, MetadataRepresentationType.Item, Context.Submission);
|
||||
expect(component).toEqual(Test3ItemSubmission);
|
||||
});
|
||||
});
|
||||
|
||||
describe('If there isn\'nt an exact match', () => {
|
||||
describe('If there is a match for the entity type and representation type', () => {
|
||||
it('should return the class with the matching entity type and representation type and default context', () => {
|
||||
const component = getMetadataRepresentationComponent(prefix + type1, MetadataRepresentationType.AuthorityControlled, Context.Submission);
|
||||
expect(component).toEqual(Test1Authority);
|
||||
});
|
||||
});
|
||||
describe('If there isn\'t a match for the representation type', () => {
|
||||
it('should return the class with the matching entity type and the default representation type and default context', () => {
|
||||
const component = getMetadataRepresentationComponent(prefix + type1, MetadataRepresentationType.Item);
|
||||
expect(component).toEqual(Test1PlainText);
|
||||
});
|
||||
describe('If there isn\'t a match for the entity type', () => {
|
||||
it('should return the class with the default entity type and the default representation type and default context', () => {
|
||||
const defaultComponent = getMetadataRepresentationComponent(DEFAULT_ENTITY_TYPE, DEFAULT_REPRESENTATION_TYPE);
|
||||
const component = getMetadataRepresentationComponent(prefix + type4, MetadataRepresentationType.AuthorityControlled);
|
||||
expect(component).toEqual(defaultComponent);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,10 +1,10 @@
|
||||
import { MetadataRepresentationType } from '../../core/shared/metadata-representation/metadata-representation.model';
|
||||
import { hasNoValue, hasValue } from '../empty.util';
|
||||
import { Context } from '../../core/shared/context.model';
|
||||
import { Item } from '../../core/shared/item.model';
|
||||
|
||||
const map = new Map();
|
||||
export const map = new Map();
|
||||
|
||||
export const DEFAULT_ENTITY_TYPE = 'Publication';
|
||||
export const DEFAULT_REPRESENTATION_TYPE = MetadataRepresentationType.PlainText;
|
||||
export const DEFAULT_CONTEXT = Context.Undefined;
|
||||
|
||||
@@ -13,7 +13,6 @@ export function metadataRepresentationComponent(entityType: string, mdRepresenta
|
||||
if (hasNoValue(map.get(entityType))) {
|
||||
map.set(entityType, new Map());
|
||||
}
|
||||
|
||||
if (hasNoValue(map.get(entityType).get(mdRepresentationType))) {
|
||||
map.get(entityType).set(mdRepresentationType, new Map());
|
||||
}
|
||||
@@ -37,7 +36,9 @@ export function getMetadataRepresentationComponent(entityType: string, mdReprese
|
||||
return entityAndMDRepMap.get(DEFAULT_CONTEXT);
|
||||
}
|
||||
}
|
||||
return mapForEntity.get(DEFAULT_REPRESENTATION_TYPE).get(DEFAULT_CONTEXT);
|
||||
if (hasValue(mapForEntity.get(DEFAULT_REPRESENTATION_TYPE))) {
|
||||
return mapForEntity.get(DEFAULT_REPRESENTATION_TYPE).get(DEFAULT_CONTEXT);
|
||||
}
|
||||
}
|
||||
return map.get(Item.name).get(DEFAULT_REPRESENTATION_TYPE).get(DEFAULT_CONTEXT);
|
||||
return map.get(DEFAULT_ENTITY_TYPE).get(DEFAULT_REPRESENTATION_TYPE).get(DEFAULT_CONTEXT);
|
||||
}
|
@@ -1,7 +1,19 @@
|
||||
import { SearchResult } from '../../../+search-page/search-result.model';
|
||||
import { Item } from '../../../core/shared/item.model';
|
||||
import { searchResultFor } from '../../../+search-page/search-service/search-result-element-decorator';
|
||||
import { GenericConstructor } from '../../../core/shared/generic-constructor';
|
||||
import { ListableObject } from './listable-object.model';
|
||||
import { isEmpty } from '../../empty.util';
|
||||
|
||||
@searchResultFor(Item)
|
||||
export class ItemSearchResult extends SearchResult<Item> {
|
||||
getRenderTypes(): Array<string | GenericConstructor<ListableObject>> {
|
||||
return this.indexableObject.getRenderTypes().map((type) => {
|
||||
if (typeof type === 'string') {
|
||||
return type + 'SearchResult'
|
||||
} else {
|
||||
return this.constructor as GenericConstructor<ListableObject>;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { TypedObject } from '../../../core/cache/object-cache.reducer';
|
||||
import { GenericConstructor } from '../../../core/shared/generic-constructor';
|
||||
|
||||
export interface ListableObject extends TypedObject {
|
||||
getRenderTypes(): string[];
|
||||
getRenderTypes(): Array<string | GenericConstructor<ListableObject>>;
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ export class ListableObjectComponentLoaderComponent implements OnInit {
|
||||
*/
|
||||
@Input() object: ListableObject;
|
||||
|
||||
//TODO DO SOMETHING WITH THIS
|
||||
// TODO DO SOMETHING WITH THIS
|
||||
@Input() index: number;
|
||||
/**
|
||||
* The preferred view-mode to display
|
||||
@@ -42,9 +42,9 @@ export class ListableObjectComponentLoaderComponent implements OnInit {
|
||||
viewContainerRef.clear();
|
||||
|
||||
const componentRef = viewContainerRef.createComponent(componentFactory);
|
||||
(<Component>componentRef.instance as any).object = this.object;
|
||||
(<Component>componentRef.instance as any).index = this.index;
|
||||
(<Component>componentRef.instance as any).linkType = this.linkType;
|
||||
(componentRef.instance as any).object = this.object;
|
||||
(componentRef.instance as any).index = this.index;
|
||||
(componentRef.instance as any).linkType = this.linkType;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,10 +1,35 @@
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||
import { listableObjectComponent } from './listable-object.decorator';
|
||||
import { getListableObjectComponent, listableObjectComponent } from './listable-object.decorator';
|
||||
import { Context } from '../../../../core/shared/context.model';
|
||||
|
||||
describe('ElementDecorator', () => {
|
||||
const gridDecorator = listableObjectComponent(Item, ViewMode.GridElement);
|
||||
const listDecorator = listableObjectComponent(Item, ViewMode.ListElement);
|
||||
describe('ListableObject decorator function', () => {
|
||||
const type1 = 'TestType';
|
||||
const type2 = 'TestType2';
|
||||
const type3 = 'TestType3';
|
||||
|
||||
/* tslint:disable:max-classes-per-file */
|
||||
class Test1List {};
|
||||
class Test1Grid {};
|
||||
class Test2List {};
|
||||
class Test2ListSubmission {};
|
||||
class Test3List {};
|
||||
class Test3DetailedSubmission {};
|
||||
/* tslint:enable:max-classes-per-file */
|
||||
|
||||
beforeEach(() => {
|
||||
listableObjectComponent(type1, ViewMode.ListElement)(Test1List);
|
||||
listableObjectComponent(type1, ViewMode.GridElement)(Test1Grid);
|
||||
|
||||
listableObjectComponent(type2, ViewMode.ListElement)(Test2List);
|
||||
listableObjectComponent(type2, ViewMode.ListElement, Context.Submission)(Test2ListSubmission);
|
||||
|
||||
listableObjectComponent(type3, ViewMode.ListElement)(Test3List);
|
||||
listableObjectComponent(type3, ViewMode.DetailedListElement, Context.Submission)(Test3DetailedSubmission);
|
||||
});
|
||||
|
||||
const gridDecorator = listableObjectComponent('Item', ViewMode.GridElement);
|
||||
const listDecorator = listableObjectComponent('Item', ViewMode.ListElement);
|
||||
it('should have a decorator for both list and grid', () => {
|
||||
expect(listDecorator.length).not.toBeNull();
|
||||
expect(gridDecorator.length).not.toBeNull();
|
||||
@@ -13,4 +38,34 @@ describe('ElementDecorator', () => {
|
||||
expect(listDecorator).not.toEqual(gridDecorator);
|
||||
});
|
||||
|
||||
describe('If there\'s an exact match', () => {
|
||||
it('should return the matching class', () => {
|
||||
const component = getListableObjectComponent([type3], ViewMode.DetailedListElement, Context.Submission);
|
||||
expect(component).toEqual(Test3DetailedSubmission);
|
||||
|
||||
const component2 = getListableObjectComponent([type3, type2], ViewMode.ListElement, Context.Submission);
|
||||
expect(component2).toEqual(Test2ListSubmission);
|
||||
});
|
||||
});
|
||||
|
||||
describe('If there isn\'nt an exact match', () => {
|
||||
describe('If there is a match for one of the entity types and the view mode', () => {
|
||||
it('should return the class with the matching entity type and view mode and default context', () => {
|
||||
const component = getListableObjectComponent([type3], ViewMode.ListElement, Context.Submission);
|
||||
expect(component).toEqual(Test3List);
|
||||
|
||||
const component2 = getListableObjectComponent([type3, type1], ViewMode.GridElement, Context.Submission);
|
||||
expect(component2).toEqual(Test1Grid);
|
||||
});
|
||||
});
|
||||
describe('If there isn\'t a match for the representation type', () => {
|
||||
it('should return the class with the matching entity type and the default view mode and default context', () => {
|
||||
const component = getListableObjectComponent([type1], ViewMode.DetailedListElement);
|
||||
expect(component).toEqual(Test1List);
|
||||
|
||||
const component2 = getListableObjectComponent([type2, type1], ViewMode.DetailedListElement);
|
||||
expect(component2).toEqual(Test2List);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -2,10 +2,11 @@ import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||
import { Context } from '../../../../core/shared/context.model';
|
||||
import { hasNoValue, hasValue } from '../../../empty.util';
|
||||
import { DEFAULT_CONTEXT } from '../../../metadata-representation/metadata-representation.decorator';
|
||||
import { GenericConstructor } from '../../../../core/shared/generic-constructor';
|
||||
import { ListableObject } from '../listable-object.model';
|
||||
|
||||
export const DEFAULT_VIEW_MODE = ViewMode.ListElement;
|
||||
|
||||
|
||||
const map = new Map();
|
||||
|
||||
/**
|
||||
@@ -13,7 +14,7 @@ const map = new Map();
|
||||
* @param type
|
||||
* @param viewMode
|
||||
*/
|
||||
export function listableObjectComponent(objectType: string, viewMode: ViewMode, context: Context = DEFAULT_CONTEXT) {
|
||||
export function listableObjectComponent(objectType: string | GenericConstructor<ListableObject>, viewMode: ViewMode, context: Context = DEFAULT_CONTEXT) {
|
||||
return function decorator(component: any) {
|
||||
if (hasNoValue(objectType)) {
|
||||
return;
|
||||
@@ -28,12 +29,11 @@ export function listableObjectComponent(objectType: string, viewMode: ViewMode,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export function getListableObjectComponent(types: string[], viewMode: ViewMode, context: Context = DEFAULT_CONTEXT) {
|
||||
let bestMatch = undefined;
|
||||
export function getListableObjectComponent(types: Array<string | GenericConstructor<ListableObject>>, viewMode: ViewMode, context: Context = DEFAULT_CONTEXT) {
|
||||
let bestMatch;
|
||||
let bestMatchValue = 0;
|
||||
for (let i = 0; i < types.length; i++) {
|
||||
const typeMap = map.get(types[i]);
|
||||
for (const type of types) {
|
||||
const typeMap = map.get(type);
|
||||
if (hasValue(typeMap)) {
|
||||
const typeModeMap = typeMap.get(viewMode);
|
||||
if (hasValue(typeModeMap)) {
|
||||
|
@@ -12,6 +12,7 @@ import { SearchResultDetailElementComponent } from '../search-result-detail-elem
|
||||
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 { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
|
||||
/**
|
||||
* This component renders claimed task object for the mydspace result in the detail view.
|
||||
@@ -22,7 +23,7 @@ import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claim
|
||||
templateUrl: './claimed-task-search-result-detail-element.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(ClaimedTaskSearchResult.name, ViewMode.DetailedListElement)
|
||||
@listableObjectComponent(ClaimedTaskSearchResult, ViewMode.DetailedListElement)
|
||||
export class ClaimedTaskSearchResultDetailElementComponent extends SearchResultDetailElementComponent<ClaimedTaskSearchResult, ClaimedTask> {
|
||||
|
||||
/**
|
||||
|
@@ -11,6 +11,7 @@ import { WorkflowItem } from '../../../../core/submission/models/workflowitem.mo
|
||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||
import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-task-search-result.model';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
|
||||
/**
|
||||
* This component renders pool task object for the mydspace result in the detail view.
|
||||
@@ -21,7 +22,7 @@ import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-tas
|
||||
templateUrl: './pool-search-result-detail-element.component.html',
|
||||
})
|
||||
|
||||
@listableObjectComponent(PoolTaskSearchResult.name, ViewMode.DetailedListElement)
|
||||
@listableObjectComponent(PoolTaskSearchResult, ViewMode.DetailedListElement)
|
||||
export class PoolSearchResultDetailElementComponent extends SearchResultDetailElementComponent<PoolTaskSearchResult, PoolTask> {
|
||||
|
||||
/**
|
||||
|
@@ -21,7 +21,7 @@ import { WorkflowItemSearchResult } from '../../../object-collection/shared/work
|
||||
templateUrl: './workflow-item-search-result-detail-element.component.html',
|
||||
})
|
||||
|
||||
@listableObjectComponent(WorkflowItemSearchResult.name, ViewMode.DetailedListElement)
|
||||
@listableObjectComponent(WorkflowItemSearchResult, ViewMode.DetailedListElement)
|
||||
export class WorkflowItemSearchResultDetailElementComponent extends SearchResultDetailElementComponent<WorkflowItemSearchResult, WorkflowItem> {
|
||||
|
||||
/**
|
||||
|
@@ -22,7 +22,7 @@ import { WorkspaceItemSearchResult } from '../../../object-collection/shared/wor
|
||||
templateUrl: './workspace-item-search-result-detail-element.component.html',
|
||||
})
|
||||
|
||||
@listableObjectComponent(WorkspaceItemSearchResult.name, ViewMode.DetailedListElement)
|
||||
@listableObjectComponent(WorkspaceItemSearchResult, ViewMode.DetailedListElement)
|
||||
export class WorkspaceItemSearchResultDetailElementComponent extends SearchResultDetailElementComponent<WorkspaceItemSearchResult, WorkspaceItem> {
|
||||
|
||||
/**
|
||||
|
@@ -9,6 +9,7 @@ import { PaginatedList } from '../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { createSuccessfulRemoteDataObject } from '../testing/utils';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
|
||||
describe('ObjectDetailComponent', () => {
|
||||
let comp: ObjectDetailComponent;
|
||||
@@ -16,16 +17,16 @@ describe('ObjectDetailComponent', () => {
|
||||
const testEvent = {test: 'test'};
|
||||
|
||||
const testObjects = [
|
||||
{ one: 1 },
|
||||
{ two: 2 },
|
||||
{ three: 3 },
|
||||
{ four: 4 },
|
||||
{ five: 5 },
|
||||
{ six: 6 },
|
||||
{ seven: 7 },
|
||||
{ eight: 8 },
|
||||
{ nine: 9 },
|
||||
{ ten: 10 }
|
||||
Object.assign (new DSpaceObject(), { one: 1 }),
|
||||
Object.assign (new DSpaceObject(), { two: 2 }),
|
||||
Object.assign (new DSpaceObject(), { three: 3 }),
|
||||
Object.assign (new DSpaceObject(), { four: 4 }),
|
||||
Object.assign (new DSpaceObject(), { five: 5 }),
|
||||
Object.assign (new DSpaceObject(), { six: 6 }),
|
||||
Object.assign (new DSpaceObject(), { seven: 7 }),
|
||||
Object.assign (new DSpaceObject(), { eight: 8 }),
|
||||
Object.assign (new DSpaceObject(), { nine: 9 }),
|
||||
Object.assign (new DSpaceObject(), { ten: 10 }),
|
||||
];
|
||||
const pageInfo = Object.assign(new PageInfo(), {elementsPerPage: 1, totalElements: 10, totalPages: 10, currentPage: 1})
|
||||
const mockRD = createSuccessfulRemoteDataObject(new PaginatedList(pageInfo, testObjects));
|
||||
|
@@ -11,5 +11,5 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
|
||||
templateUrl: './collection-grid-element.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(Collection.name, ViewMode.GridElement)
|
||||
@listableObjectComponent(Collection, ViewMode.GridElement)
|
||||
export class CollectionGridElementComponent extends AbstractListableElementComponent<Collection> {}
|
||||
|
@@ -11,5 +11,5 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
|
||||
templateUrl: './community-grid-element.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(Community.name, ViewMode.GridElement)
|
||||
@listableObjectComponent(Community, ViewMode.GridElement)
|
||||
export class CommunityGridElementComponent extends AbstractListableElementComponent<Community> {}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TruncatePipe } from '../../../../utils/truncate.pipe';
|
||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||
@@ -6,12 +6,10 @@ import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { PublicationGridElementComponent } 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 { createSuccessfulRemoteDataObject$ } from '../../../../testing/utils';
|
||||
import { PaginatedList } from '../../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../../core/shared/page-info.model';
|
||||
import { JournalGridElementComponent } from '../../../../../entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component';
|
||||
|
||||
const mockItem = Object.assign(new Item(), {
|
||||
bitstreams: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])),
|
||||
@@ -43,43 +41,41 @@ const mockItem = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('PublicationGridElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('PublicationGridElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [PublicationGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(PublicationGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule],
|
||||
declarations: [PublicationGridElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(PublicationGridElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(PublicationGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(PublicationGridElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the publication is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a PublicationGridElementComponent`, () => {
|
||||
const publicationGridElement = fixture.debugElement.query(By.css(`ds-publication-search-result-grid-element`));
|
||||
expect(publicationGridElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the publication is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a PublicationGridElementComponent`, () => {
|
||||
const publicationGridElement = fixture.debugElement.query(By.css(`ds-publication-search-result-grid-element`));
|
||||
expect(publicationGridElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -6,7 +6,7 @@ import { AbstractListableElementComponent } from '../../../../object-collection/
|
||||
import { Item } from '../../../../../core/shared/item.model';
|
||||
|
||||
@listableObjectComponent('Publication', ViewMode.GridElement)
|
||||
@listableObjectComponent(Item.name, ViewMode.GridElement)
|
||||
@listableObjectComponent(Item, ViewMode.GridElement)
|
||||
@Component({
|
||||
selector: 'ds-publication-grid-element',
|
||||
styleUrls: ['./publication-grid-element.component.scss'],
|
||||
|
@@ -12,5 +12,5 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
|
||||
templateUrl: 'collection-search-result-grid-element.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(CollectionSearchResult.name, ViewMode.GridElement)
|
||||
@listableObjectComponent(CollectionSearchResult, ViewMode.GridElement)
|
||||
export class CollectionSearchResultGridElementComponent extends SearchResultGridElementComponent<CollectionSearchResult, Collection> {}
|
||||
|
@@ -11,7 +11,7 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
|
||||
templateUrl: 'community-search-result-grid-element.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(CommunitySearchResult.name, ViewMode.GridElement)
|
||||
@listableObjectComponent(CommunitySearchResult, ViewMode.GridElement)
|
||||
export class CommunitySearchResultGridElementComponent extends SearchResultGridElementComponent<CommunitySearchResult, Community> {
|
||||
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import { AbstractListableElementComponent } from '../../object-collection/shared
|
||||
import { BrowseEntry } from '../../../core/shared/browse-entry.model';
|
||||
import { ViewMode } from '../../../core/shared/view-mode.model';
|
||||
import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator';
|
||||
import { Collection } from '../../../core/shared/collection.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-browse-entry-list-element',
|
||||
@@ -14,5 +15,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.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(BrowseEntry, ViewMode.ListElement)
|
||||
export class BrowseEntryListElementComponent extends AbstractListableElementComponent<BrowseEntry> {}
|
||||
|
@@ -11,5 +11,5 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
|
||||
templateUrl: './collection-list-element.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(Collection.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(Collection, ViewMode.ListElement)
|
||||
export class CollectionListElementComponent extends AbstractListableElementComponent<Collection> {}
|
||||
|
@@ -11,5 +11,5 @@ import { listableObjectComponent } from '../../object-collection/shared/listable
|
||||
templateUrl: './community-list-element.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(Community.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(Community, ViewMode.ListElement)
|
||||
export class CommunityListElementComponent extends AbstractListableElementComponent<Community> {}
|
||||
|
@@ -43,42 +43,40 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
}
|
||||
});
|
||||
|
||||
describe('PublicationListElementComponent',
|
||||
() => {
|
||||
let comp;
|
||||
let fixture;
|
||||
describe('PublicationListElementComponent', () => {
|
||||
let comp;
|
||||
let fixture;
|
||||
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
const truncatableServiceStub: any = {
|
||||
isCollapsed: (id: number) => observableOf(true),
|
||||
};
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [PublicationListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(PublicationListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [PublicationListElementComponent, TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(PublicationListElementComponent, {
|
||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(PublicationListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(PublicationListElementComponent);
|
||||
comp = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
describe(`when the publication is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a PublicationListElementComponent`, () => {
|
||||
const publicationListElement = fixture.debugElement.query(By.css(`ds-publication-search-result-list-element`));
|
||||
expect(publicationListElement).not.toBeNull();
|
||||
});
|
||||
describe(`when the publication is rendered`, () => {
|
||||
beforeEach(() => {
|
||||
comp.object = mockItem;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it(`should contain a PublicationListElementComponent`, () => {
|
||||
const publicationListElement = fixture.debugElement.query(By.css(`ds-publication-search-result-list-element`));
|
||||
expect(publicationListElement).not.toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -5,7 +5,7 @@ import { AbstractListableElementComponent } from '../../../../object-collection/
|
||||
import { Item } from '../../../../../core/shared/item.model';
|
||||
|
||||
@listableObjectComponent('Publication', ViewMode.ListElement)
|
||||
@listableObjectComponent(Item.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(Item, ViewMode.ListElement)
|
||||
@Component({
|
||||
selector: 'ds-publication-list-element',
|
||||
styleUrls: ['./publication-list-element.component.scss'],
|
||||
|
@@ -13,6 +13,7 @@ import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspa
|
||||
import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
||||
import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
|
||||
/**
|
||||
* This component renders claimed task object for the mydspace result in the list view.
|
||||
@@ -24,7 +25,7 @@ import { SearchResultListElementComponent } from '../../search-result-list-eleme
|
||||
providers: [Location, { provide: LocationStrategy, useClass: PathLocationStrategy }]
|
||||
})
|
||||
|
||||
@listableObjectComponent(ClaimedTaskSearchResult.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(ClaimedTaskSearchResult, ViewMode.ListElement)
|
||||
export class ClaimedSearchResultListElementComponent extends SearchResultListElementComponent<ClaimedTaskSearchResult, ClaimedTask> {
|
||||
|
||||
/**
|
||||
|
@@ -17,14 +17,14 @@ import { SearchResultListElementComponent } from '../../search-result-list-eleme
|
||||
templateUrl: './item-search-result-list-element-submission.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(ItemSearchResult.name, ViewMode.ListElement, Context.Submission)
|
||||
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.Submission)
|
||||
export class ItemSearchResultListElementSubmissionComponent extends SearchResultListElementComponent<ItemSearchResult, Item> implements OnInit {
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Represent item's status
|
||||
*/
|
||||
public status = MyDspaceItemStatusType.ARCHIVED;
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
}
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
|
||||
import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-task-search-result.model';
|
||||
import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component';
|
||||
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
|
||||
/**
|
||||
* This component renders pool task object for the mydspace result in the list view.
|
||||
@@ -23,7 +24,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
|
||||
templateUrl: './pool-search-result-list-element.component.html',
|
||||
})
|
||||
|
||||
@listableObjectComponent(PoolTaskSearchResult.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(PoolTaskSearchResult, ViewMode.ListElement)
|
||||
export class PoolSearchResultListElementComponent extends SearchResultListElementComponent<PoolTaskSearchResult, PoolTask> implements OnInit {
|
||||
|
||||
/**
|
||||
|
@@ -22,7 +22,7 @@ import { SearchResultListElementComponent } from '../../search-result-list-eleme
|
||||
templateUrl: './workflow-item-search-result-list-element.component.html',
|
||||
})
|
||||
|
||||
@listableObjectComponent(WorkflowItemSearchResult.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(WorkflowItemSearchResult, ViewMode.ListElement)
|
||||
export class WorkflowItemSearchResultListElementComponent extends SearchResultListElementComponent<WorkflowItemSearchResult, WorkflowItem> {
|
||||
|
||||
/**
|
||||
|
@@ -22,7 +22,7 @@ import { SearchResultListElementComponent } from '../../search-result-list-eleme
|
||||
templateUrl: './workspace-item-search-result-list-element.component.html',
|
||||
})
|
||||
|
||||
@listableObjectComponent(WorkspaceItemSearchResult.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(WorkspaceItemSearchResult, ViewMode.ListElement)
|
||||
export class WorkspaceItemSearchResultListElementComponent extends SearchResultListElementComponent<WorkspaceItemSearchResult, WorkspaceItem> {
|
||||
|
||||
/**
|
||||
|
@@ -1,6 +1,4 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
|
||||
import { SearchResultListElementComponent } from '../search-result-list-element.component';
|
||||
import { Collection } from '../../../../core/shared/collection.model';
|
||||
import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model';
|
||||
@@ -13,5 +11,5 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
|
||||
templateUrl: 'collection-search-result-list-element.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(CollectionSearchResult.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(CollectionSearchResult, ViewMode.ListElement)
|
||||
export class CollectionSearchResultListElementComponent extends SearchResultListElementComponent<CollectionSearchResult, Collection> {}
|
||||
|
@@ -1,12 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
|
||||
import { SearchResultListElementComponent } from '../search-result-list-element.component';
|
||||
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',
|
||||
@@ -14,7 +11,7 @@ import { BrowseEntry } from '../../../../core/shared/browse-entry.model';
|
||||
templateUrl: 'community-search-result-list-element.component.html'
|
||||
})
|
||||
|
||||
@listableObjectComponent(CommunitySearchResult.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(CommunitySearchResult, ViewMode.ListElement)
|
||||
export class CommunitySearchResultListElementComponent extends SearchResultListElementComponent<CommunitySearchResult, Community> {
|
||||
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ import { SearchResultListElementComponent } from '../../../search-result-list-el
|
||||
import { Item } from '../../../../../../core/shared/item.model';
|
||||
|
||||
@listableObjectComponent('PublicationSearchResult', ViewMode.ListElement)
|
||||
@listableObjectComponent(ItemSearchResult.name, ViewMode.ListElement)
|
||||
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement)
|
||||
@Component({
|
||||
selector: 'ds-publication-search-result-list-element',
|
||||
styleUrls: ['./publication-search-result-list-element.component.scss'],
|
||||
|
@@ -4,53 +4,53 @@
|
||||
|
||||
<div class="col-12 col-md-2 d-flex flex-md-column justify-content-between">
|
||||
<ds-metadata-field-wrapper>
|
||||
<ds-thumbnail [thumbnail]="this.item.getThumbnail() | async"></ds-thumbnail>
|
||||
<ds-thumbnail [thumbnail]="object.getThumbnail() | async"></ds-thumbnail>
|
||||
</ds-metadata-field-wrapper>
|
||||
<div>
|
||||
<a class="btn btn-secondary"
|
||||
[routerLink]="['/items/' + item.id + '/full']">
|
||||
[routerLink]="['/items/' + object.id + '/full']">
|
||||
{{"item.page.link.full" | translate}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-10">
|
||||
<ds-item-page-title-field [item]="item"></ds-item-page-title-field>
|
||||
<ds-item-page-title-field [item]="object"></ds-item-page-title-field>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-metadata-representation-list
|
||||
[label]="'relationships.isAuthorOf' | translate"
|
||||
[representations]="authors$ | async">
|
||||
</ds-metadata-representation-list>
|
||||
<ds-item-page-file-section [item]="item"></ds-item-page-file-section>
|
||||
<ds-item-page-date-field [item]="item"></ds-item-page-date-field>
|
||||
<ds-item-page-file-section [item]="object"></ds-item-page-file-section>
|
||||
<ds-item-page-date-field [item]="object"></ds-item-page-date-field>
|
||||
<ds-item-page-author-field *ngIf="!(authors$ | async)"
|
||||
[item]="item"></ds-item-page-author-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
[item]="object"></ds-item-page-author-field>
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journal.title']"
|
||||
[label]="'publication.page.journal-title'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journal.identifier.issn']"
|
||||
[label]="'publication.page.journal-issn'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journalvolume.identifier.name']"
|
||||
[label]="'publication.page.volume-title'">
|
||||
</ds-generic-item-page-field>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-item-page-abstract-field [item]="item"></ds-item-page-abstract-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-item-page-abstract-field [item]="object"></ds-item-page-abstract-field>
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['dc.subject']"
|
||||
[separator]="','"
|
||||
[label]="'item.page.subject'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['dc.identifier.citation']"
|
||||
[label]="'item.page.citation'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-item-page-uri-field [item]="item"></ds-item-page-uri-field>
|
||||
<ds-item-page-collections [item]="item"></ds-item-page-collections>
|
||||
<ds-item-page-uri-field [item]="object"></ds-item-page-uri-field>
|
||||
<ds-item-page-collections [item]="object"></ds-item-page-collections>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -4,11 +4,11 @@
|
||||
|
||||
<div class="col-12 col-md-2 d-flex flex-md-column justify-content-between">
|
||||
<ds-metadata-field-wrapper>
|
||||
<ds-thumbnail [thumbnail]="this.item.getThumbnail() | async"></ds-thumbnail>
|
||||
<ds-thumbnail [thumbnail]="object.getThumbnail() | async"></ds-thumbnail>
|
||||
</ds-metadata-field-wrapper>
|
||||
<div>
|
||||
<a class="btn btn-secondary"
|
||||
[routerLink]="['/items/' + item.id + '/full']">
|
||||
[routerLink]="['/items/' + object.id + '/full']">
|
||||
{{"item.page.link.full" | translate}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -17,33 +17,33 @@
|
||||
<h2 class="item-page-title-field">
|
||||
{{'journalissue.page.titleprefix' | translate}}
|
||||
<ds-metadata-values
|
||||
[mdValues]="item?.allMetadata(['dc.title'])"></ds-metadata-values>
|
||||
[mdValues]="object?.allMetadata(['dc.title'])"></ds-metadata-values>
|
||||
</h2>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journal.title']"
|
||||
[label]="'journalissue.page.journal-title'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journalissue.identifier.number']"
|
||||
[label]="'journalissue.page.number'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journal.identifier.issn']"
|
||||
[label]="'journalissue.page.journal-issn'">
|
||||
</ds-generic-item-page-field>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journalissue.issuedate']"
|
||||
[label]="'journalissue.page.issuedate'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journalissue.identifier.description']"
|
||||
[label]="'journalissue.page.description'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journalissue.identifier.keyword']"
|
||||
[label]="'journalissue.page.keyword'">
|
||||
</ds-generic-item-page-field>
|
||||
|
@@ -4,11 +4,11 @@
|
||||
|
||||
<div class="col-12 col-md-2 d-flex flex-md-column justify-content-between">
|
||||
<ds-metadata-field-wrapper>
|
||||
<ds-thumbnail [thumbnail]="this.item.getThumbnail() | async"></ds-thumbnail>
|
||||
<ds-thumbnail [thumbnail]="object.getThumbnail() | async"></ds-thumbnail>
|
||||
</ds-metadata-field-wrapper>
|
||||
<div>
|
||||
<a class="btn btn-secondary"
|
||||
[routerLink]="['/items/' + item.id + '/full']">
|
||||
[routerLink]="['/items/' + object.id + '/full']">
|
||||
{{"item.page.link.full" | translate}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -17,22 +17,22 @@
|
||||
<h2 class="item-page-title-field">
|
||||
{{'journalvolume.page.titleprefix' | translate}}
|
||||
<ds-metadata-values
|
||||
[mdValues]="item?.allMetadata(['dc.title'])"></ds-metadata-values>
|
||||
[mdValues]="object?.allMetadata(['dc.title'])"></ds-metadata-values>
|
||||
</h2>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journalvolume.identifier.volume']"
|
||||
[label]="'journalvolume.page.volume'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journalvolume.issuedate']"
|
||||
[label]="'journalvolume.page.issuedate'">
|
||||
</ds-generic-item-page-field>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journalvolume.identifier.description']"
|
||||
[label]="'journalvolume.page.description'">
|
||||
</ds-generic-item-page-field>
|
||||
|
@@ -3,11 +3,11 @@
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-2 d-flex flex-md-column justify-content-between">
|
||||
<ds-metadata-field-wrapper>
|
||||
<ds-thumbnail [thumbnail]="this.item.getThumbnail() | async"></ds-thumbnail>
|
||||
<ds-thumbnail [thumbnail]="object.getThumbnail() | async"></ds-thumbnail>
|
||||
</ds-metadata-field-wrapper>
|
||||
<div>
|
||||
<a class="btn btn-secondary"
|
||||
[routerLink]="['/items/' + item.id + '/full']">
|
||||
[routerLink]="['/items/' + object.id + '/full']">
|
||||
{{"item.page.link.full" | translate}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -16,26 +16,26 @@
|
||||
<h2 class="item-page-title-field">
|
||||
{{'journal.page.titleprefix' | translate}}
|
||||
<ds-metadata-values
|
||||
[mdValues]="item?.allMetadata(['dc.title'])"></ds-metadata-values>
|
||||
[mdValues]="object?.allMetadata(['dc.title'])"></ds-metadata-values>
|
||||
</h2>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
|
||||
<ds-generic-item-page-field class="item-page-fields" [item]="item"
|
||||
<ds-generic-item-page-field class="item-page-fields" [item]="object"
|
||||
[fields]="['journal.identifier.issn']"
|
||||
[label]="'journal.page.issn'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field class="item-page-fields" [item]="item"
|
||||
<ds-generic-item-page-field class="item-page-fields" [item]="object"
|
||||
[fields]="['journal.publisher']"
|
||||
[label]="'journal.page.publisher'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['journal.contributor.editor']"
|
||||
[label]="'journal.page.editor'">
|
||||
</ds-generic-item-page-field>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-generic-item-page-field class="item-page-fields" [item]="item"
|
||||
<ds-generic-item-page-field class="item-page-fields" [item]="object"
|
||||
[fields]="['journal.identifier.description']"
|
||||
[label]="'journal.page.description'">
|
||||
</ds-generic-item-page-field>
|
||||
@@ -61,7 +61,7 @@
|
||||
<div class="container search-container">
|
||||
<h3 class="h2">{{"item.page.journal.search.title" | translate}}</h3>
|
||||
</div>
|
||||
<ds-related-entities-search [item]="item"
|
||||
<ds-related-entities-search [item]="object"
|
||||
[relationType]="'isJournalOfPublication'">
|
||||
</ds-related-entities-search>
|
||||
</div>
|
||||
|
@@ -4,12 +4,12 @@
|
||||
|
||||
<div class="col-12 col-md-2 d-flex flex-md-column justify-content-between">
|
||||
<ds-metadata-field-wrapper>
|
||||
<ds-thumbnail [thumbnail]="this.item.getThumbnail() | async"
|
||||
<ds-thumbnail [thumbnail]="object.getThumbnail() | async"
|
||||
[defaultImage]="'assets/images/orgunit-placeholder.svg'"></ds-thumbnail>
|
||||
</ds-metadata-field-wrapper>
|
||||
<div>
|
||||
<a class="btn btn-secondary"
|
||||
[routerLink]="['/items/' + item.id + '/full']">
|
||||
[routerLink]="['/items/' + object.id + '/full']">
|
||||
{{"item.page.link.full" | translate}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -18,29 +18,29 @@
|
||||
<h2 class="item-page-title-field">
|
||||
{{'orgunit.page.titleprefix' | translate}}
|
||||
<ds-metadata-values
|
||||
[mdValues]="item?.allMetadata(['orgunit.identifier.name'])"></ds-metadata-values>
|
||||
[mdValues]="object?.allMetadata(['orgunit.identifier.name'])"></ds-metadata-values>
|
||||
</h2>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['orgunit.identifier.city']"
|
||||
[label]="'orgunit.page.city'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['orgunit.identifier.country']"
|
||||
[label]="'orgunit.page.country'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['orgunit.identifier.id']"
|
||||
[label]="'orgunit.page.id'">
|
||||
</ds-generic-item-page-field>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['orgunit.identifier.dateestablished']"
|
||||
[label]="'orgunit.page.dateestablished'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['orgunit.identifier.description']"
|
||||
[label]="'orgunit.page.description'">
|
||||
</ds-generic-item-page-field>
|
||||
|
@@ -4,12 +4,12 @@
|
||||
|
||||
<div class="col-12 col-md-2 d-flex flex-md-column justify-content-between">
|
||||
<ds-metadata-field-wrapper>
|
||||
<ds-thumbnail [thumbnail]="this.item.getThumbnail() | async"
|
||||
<ds-thumbnail [thumbnail]="object.getThumbnail() | async"
|
||||
[defaultImage]="'assets/images/person-placeholder.svg'"></ds-thumbnail>
|
||||
</ds-metadata-field-wrapper>
|
||||
<div>
|
||||
<a class="btn btn-secondary"
|
||||
[routerLink]="['/items/' + item.id + '/full']">
|
||||
[routerLink]="['/items/' + object.id + '/full']">
|
||||
{{"item.page.link.full" | translate}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -17,37 +17,37 @@
|
||||
<div class="col-12 col-md-10">
|
||||
<h2 class="item-page-title-field">
|
||||
{{'person.page.titleprefix' | translate}}<ds-metadata-values
|
||||
[mdValues]="item?.allMetadata(['dc.contributor.author'])"></ds-metadata-values>
|
||||
[mdValues]="object?.allMetadata(['dc.contributor.author'])"></ds-metadata-values>
|
||||
</h2>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['person.identifier.email']"
|
||||
[label]="'person.page.email'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['person.identifier.orcid']"
|
||||
[label]="'person.page.orcid'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['person.identifier.birthdate']"
|
||||
[label]="'person.page.birthdate'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['person.identifier.staffid']"
|
||||
[label]="'person.page.staffid'">
|
||||
</ds-generic-item-page-field>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['person.identifier.jobtitle']"
|
||||
[label]="'person.page.jobtitle'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['person.identifier.lastname']"
|
||||
[label]="'person.page.lastname'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['person.identifier.firstname']"
|
||||
[label]="'person.page.firstname'">
|
||||
</ds-generic-item-page-field>
|
||||
@@ -79,7 +79,7 @@
|
||||
<div class="container search-container">
|
||||
<h3 class="h2">{{"item.page.person.search.title" | translate}}</h3>
|
||||
</div>
|
||||
<ds-related-entities-search [item]="item"
|
||||
<ds-related-entities-search [item]="object"
|
||||
[relationType]="'isAuthorOfPublication'">
|
||||
</ds-related-entities-search>
|
||||
</div>
|
||||
|
@@ -4,12 +4,12 @@
|
||||
|
||||
<div class="col-12 col-md-2 d-flex flex-md-column justify-content-between">
|
||||
<ds-metadata-field-wrapper>
|
||||
<ds-thumbnail [thumbnail]="this.item.getThumbnail() | async"
|
||||
<ds-thumbnail [thumbnail]="object.getThumbnail() | async"
|
||||
[defaultImage]="'assets/images/project-placeholder.svg'"></ds-thumbnail>
|
||||
</ds-metadata-field-wrapper>
|
||||
<div>
|
||||
<a class="btn btn-secondary"
|
||||
[routerLink]="['/items/' + item.id + '/full']">
|
||||
[routerLink]="['/items/' + object.id + '/full']">
|
||||
{{"item.page.link.full" | translate}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -18,7 +18,7 @@
|
||||
<h2 class="item-page-title-field">
|
||||
{{'project.page.titleprefix' | translate}}
|
||||
<ds-metadata-values
|
||||
[mdValues]="item?.allMetadata(['project.identifier.name'])"></ds-metadata-values>
|
||||
[mdValues]="object?.allMetadata(['project.identifier.name'])"></ds-metadata-values>
|
||||
</h2>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
@@ -26,29 +26,29 @@
|
||||
[label]="'project.page.contributor' | translate"
|
||||
[representations]="contributors$ | async">
|
||||
</ds-metadata-representation-list>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['project.identifier.funder']"
|
||||
[label]="'project.page.funder'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['project.identifier.status']"
|
||||
[label]="'project.page.status'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['project.identifier.expectedcompletion']"
|
||||
[label]="'project.page.expectedcompletion'">
|
||||
</ds-generic-item-page-field>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['project.identifier.id']"
|
||||
[label]="'project.page.id'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['project.identifier.description']"
|
||||
[label]="'project.page.description'">
|
||||
</ds-generic-item-page-field>
|
||||
<ds-generic-item-page-field [item]="item"
|
||||
<ds-generic-item-page-field [item]="object"
|
||||
[fields]="['project.identifier.keyword']"
|
||||
[label]="'project.page.keyword'">
|
||||
</ds-generic-item-page-field>
|
||||
|
Reference in New Issue
Block a user