mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
57557: Renamed EntityPageFieldsComponents to EntityComponents
This commit is contained in:
@@ -2,7 +2,6 @@ import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { SharedModule } from './../shared/shared.module';
|
||||
import { EntityPageFieldsComponent } from './simple/entity-types/shared/entity-page-fields.component';
|
||||
import { GenericItemPageFieldComponent } from './simple/field-components/specific-field/generic/generic-item-page-field.component';
|
||||
|
||||
import { ItemPageComponent } from './simple/item-page.component';
|
||||
@@ -20,15 +19,16 @@ import { FileSectionComponent } from './simple/field-components/file-section/fil
|
||||
import { CollectionsComponent } from './field-components/collections/collections.component';
|
||||
import { FullItemPageComponent } from './full/full-item-page.component';
|
||||
import { FullFileSectionComponent } from './full/field-components/file-section/full-file-section.component';
|
||||
import { PublicationPageFieldsComponent } from './simple/entity-types/publication/publication-page-fields.component';
|
||||
import { OrgUnitPageFieldsComponent } from './simple/entity-types/orgunit/orgunit-page-fields.component';
|
||||
import { PersonPageFieldsComponent } from './simple/entity-types/person/person-page-fields.component';
|
||||
import { ProjectPageFieldsComponent } from './simple/entity-types/project/project-page-fields.component';
|
||||
import { RelatedEntitiesComponent } from './simple/related-entities/related-entities-component';
|
||||
import { JournalPageFieldsComponent } from './simple/entity-types/journal/journal-page-fields.component';
|
||||
import { JournalIssuePageFieldsComponent } from './simple/entity-types/journal-issue/journal-issue-page-fields.component';
|
||||
import { JournalVolumePageFieldsComponent } from './simple/entity-types/journal-volume/journal-volume-page-fields.component';
|
||||
import { SearchPageModule } from '../+search-page/search-page.module';
|
||||
import { PublicationComponent } from './simple/entity-types/publication/publication.component';
|
||||
import { PersonComponent } from './simple/entity-types/person/person.component';
|
||||
import { OrgunitComponent } from './simple/entity-types/orgunit/orgunit.component';
|
||||
import { ProjectComponent } from './simple/entity-types/project/project.component';
|
||||
import { JournalComponent } from './simple/entity-types/journal/journal.component';
|
||||
import { JournalVolumeComponent } from './simple/entity-types/journal-volume/journal-volume.component';
|
||||
import { JournalIssueComponent } from './simple/entity-types/journal-issue/journal-issue.component';
|
||||
import { EntityComponent } from './simple/entity-types/shared/entity.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -52,25 +52,25 @@ import { SearchPageModule } from '../+search-page/search-page.module';
|
||||
FileSectionComponent,
|
||||
CollectionsComponent,
|
||||
FullFileSectionComponent,
|
||||
PublicationPageFieldsComponent,
|
||||
ProjectPageFieldsComponent,
|
||||
OrgUnitPageFieldsComponent,
|
||||
PersonPageFieldsComponent,
|
||||
PublicationComponent,
|
||||
ProjectComponent,
|
||||
OrgunitComponent,
|
||||
PersonComponent,
|
||||
RelatedEntitiesComponent,
|
||||
EntityPageFieldsComponent,
|
||||
EntityComponent,
|
||||
GenericItemPageFieldComponent,
|
||||
JournalPageFieldsComponent,
|
||||
JournalIssuePageFieldsComponent,
|
||||
JournalVolumePageFieldsComponent
|
||||
JournalComponent,
|
||||
JournalIssueComponent,
|
||||
JournalVolumeComponent
|
||||
],
|
||||
entryComponents: [
|
||||
PublicationPageFieldsComponent,
|
||||
ProjectPageFieldsComponent,
|
||||
OrgUnitPageFieldsComponent,
|
||||
PersonPageFieldsComponent,
|
||||
JournalPageFieldsComponent,
|
||||
JournalIssuePageFieldsComponent,
|
||||
JournalVolumePageFieldsComponent
|
||||
PublicationComponent,
|
||||
ProjectComponent,
|
||||
OrgunitComponent,
|
||||
PersonComponent,
|
||||
JournalComponent,
|
||||
JournalIssueComponent,
|
||||
JournalVolumeComponent
|
||||
]
|
||||
})
|
||||
export class ItemPageModule {
|
||||
|
@@ -1,10 +1,10 @@
|
||||
import { JournalIssuePageFieldsComponent } from './journal-issue-page-fields.component';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { createRelationshipsObservable, getEntityPageFieldsTest } from '../shared/entity-page-fields.component.spec';
|
||||
import { createRelationshipsObservable, getEntityPageFieldsTest } from '../shared/entity.component.spec';
|
||||
import { JournalIssueComponent } from './journal-issue.component';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
@@ -32,4 +32,4 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
relationships: createRelationshipsObservable()
|
||||
});
|
||||
|
||||
describe('JournalIssuePageFieldsComponent', getEntityPageFieldsTest(mockItem, JournalIssuePageFieldsComponent));
|
||||
describe('JournalIssueComponent', getEntityPageFieldsTest(mockItem, JournalIssueComponent));
|
@@ -5,22 +5,19 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { rendersEntityType } from '../../../../shared/entities/entity-type-decorator';
|
||||
import { ITEM } from '../../../../shared/entities/switcher/entity-type-switcher.component';
|
||||
import { ElementViewMode } from '../../../../shared/view-mode';
|
||||
import {
|
||||
EntityPageFieldsComponent, filterRelationsByTypeLabel,
|
||||
relationsToItems
|
||||
} from '../shared/entity-page-fields.component';
|
||||
import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { EntityComponent, filterRelationsByTypeLabel, relationsToItems } from '../shared/entity.component';
|
||||
|
||||
@rendersEntityType('JournalIssue', ElementViewMode.Full)
|
||||
@Component({
|
||||
selector: 'ds-journal-issue-page-fields',
|
||||
styleUrls: ['./journal-issue-page-fields.component.scss'],
|
||||
templateUrl: './journal-issue-page-fields.component.html'
|
||||
selector: 'ds-journal-issue',
|
||||
styleUrls: ['./journal-issue.component.scss'],
|
||||
templateUrl: './journal-issue.component.html'
|
||||
})
|
||||
/**
|
||||
* The component for displaying metadata and relations of an item with entity type Journal Issue
|
||||
*/
|
||||
export class JournalIssuePageFieldsComponent extends EntityPageFieldsComponent {
|
||||
export class JournalIssueComponent extends EntityComponent {
|
||||
/**
|
||||
* The volumes related to this journal issue
|
||||
*/
|
@@ -3,8 +3,8 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { JournalVolumePageFieldsComponent } from './journal-volume-page-fields.component';
|
||||
import { createRelationshipsObservable, getEntityPageFieldsTest } from '../shared/entity-page-fields.component.spec';
|
||||
import { createRelationshipsObservable, getEntityPageFieldsTest } from '../shared/entity.component.spec';
|
||||
import { JournalVolumeComponent } from './journal-volume.component';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
@@ -27,4 +27,4 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
relationships: createRelationshipsObservable()
|
||||
});
|
||||
|
||||
describe('JournalVolumePageFieldsComponent', getEntityPageFieldsTest(mockItem, JournalVolumePageFieldsComponent));
|
||||
describe('JournalVolumeComponent', getEntityPageFieldsTest(mockItem, JournalVolumeComponent));
|
@@ -5,22 +5,19 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { rendersEntityType } from '../../../../shared/entities/entity-type-decorator';
|
||||
import { ITEM } from '../../../../shared/entities/switcher/entity-type-switcher.component';
|
||||
import { ElementViewMode } from '../../../../shared/view-mode';
|
||||
import {
|
||||
EntityPageFieldsComponent, filterRelationsByTypeLabel,
|
||||
relationsToItems
|
||||
} from '../shared/entity-page-fields.component';
|
||||
import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { EntityComponent, filterRelationsByTypeLabel, relationsToItems } from '../shared/entity.component';
|
||||
|
||||
@rendersEntityType('JournalVolume', ElementViewMode.Full)
|
||||
@Component({
|
||||
selector: 'ds-journal-volume-page-fields',
|
||||
styleUrls: ['./journal-volume-page-fields.component.scss'],
|
||||
templateUrl: './journal-volume-page-fields.component.html'
|
||||
selector: 'ds-journal-volume',
|
||||
styleUrls: ['./journal-volume.component.scss'],
|
||||
templateUrl: './journal-volume.component.html'
|
||||
})
|
||||
/**
|
||||
* The component for displaying metadata and relations of an item with entity type Journal Volume
|
||||
*/
|
||||
export class JournalVolumePageFieldsComponent extends EntityPageFieldsComponent {
|
||||
export class JournalVolumeComponent extends EntityComponent {
|
||||
/**
|
||||
* The journals related to this journal volume
|
||||
*/
|
@@ -14,10 +14,10 @@ import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { JournalPageFieldsComponent } from './journal-page-fields.component';
|
||||
import { JournalComponent } from './journal.component';
|
||||
|
||||
let comp: JournalPageFieldsComponent;
|
||||
let fixture: ComponentFixture<JournalPageFieldsComponent>;
|
||||
let comp: JournalComponent;
|
||||
let fixture: ComponentFixture<JournalComponent>;
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
@@ -39,7 +39,7 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
}]
|
||||
});
|
||||
|
||||
describe('JournalPageFieldsComponent', () => {
|
||||
describe('JournalComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot({
|
||||
@@ -48,7 +48,7 @@ describe('JournalPageFieldsComponent', () => {
|
||||
useClass: MockTranslateLoader
|
||||
}
|
||||
})],
|
||||
declarations: [JournalPageFieldsComponent, GenericItemPageFieldComponent, TruncatePipe],
|
||||
declarations: [JournalComponent, GenericItemPageFieldComponent, TruncatePipe],
|
||||
providers: [
|
||||
{provide: ITEM, useValue: mockItem},
|
||||
{provide: ItemDataService, useValue: {}},
|
||||
@@ -56,13 +56,13 @@ describe('JournalPageFieldsComponent', () => {
|
||||
],
|
||||
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(JournalPageFieldsComponent, {
|
||||
}).overrideComponent(JournalComponent, {
|
||||
set: {changeDetection: ChangeDetectionStrategy.Default}
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(JournalPageFieldsComponent);
|
||||
fixture = TestBed.createComponent(JournalComponent);
|
||||
comp = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
@@ -5,22 +5,19 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { rendersEntityType } from '../../../../shared/entities/entity-type-decorator';
|
||||
import { ITEM } from '../../../../shared/entities/switcher/entity-type-switcher.component';
|
||||
import { ElementViewMode } from '../../../../shared/view-mode';
|
||||
import {
|
||||
EntityPageFieldsComponent, filterRelationsByTypeLabel,
|
||||
relationsToItems
|
||||
} from '../shared/entity-page-fields.component';
|
||||
import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { EntityComponent, filterRelationsByTypeLabel, relationsToItems } from '../shared/entity.component';
|
||||
|
||||
@rendersEntityType('Journal', ElementViewMode.Full)
|
||||
@Component({
|
||||
selector: 'ds-journal-page-fields',
|
||||
styleUrls: ['./journal-page-fields.component.scss'],
|
||||
templateUrl: './journal-page-fields.component.html'
|
||||
selector: 'ds-journal',
|
||||
styleUrls: ['./journal.component.scss'],
|
||||
templateUrl: './journal.component.html'
|
||||
})
|
||||
/**
|
||||
* The component for displaying metadata and relations of an item with entity type Journal
|
||||
*/
|
||||
export class JournalPageFieldsComponent extends EntityPageFieldsComponent {
|
||||
export class JournalComponent extends EntityComponent {
|
||||
/**
|
||||
* The volumes related to this journal
|
||||
*/
|
@@ -3,8 +3,8 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { OrgUnitPageFieldsComponent } from './orgunit-page-fields.component';
|
||||
import { createRelationshipsObservable, getEntityPageFieldsTest } from '../shared/entity-page-fields.component.spec';
|
||||
import { createRelationshipsObservable, getEntityPageFieldsTest } from '../shared/entity.component.spec';
|
||||
import { OrgunitComponent } from './orgunit.component';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
@@ -37,4 +37,4 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
relationships: createRelationshipsObservable()
|
||||
});
|
||||
|
||||
describe('OrgUnitPageFieldsComponent', getEntityPageFieldsTest(mockItem, OrgUnitPageFieldsComponent));
|
||||
describe('OrgUnitComponent', getEntityPageFieldsTest(mockItem, OrgunitComponent));
|
@@ -5,22 +5,19 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { rendersEntityType } from '../../../../shared/entities/entity-type-decorator';
|
||||
import { ElementViewMode } from '../../../../shared/view-mode';
|
||||
import { ITEM } from '../../../../shared/entities/switcher/entity-type-switcher.component';
|
||||
import {
|
||||
EntityPageFieldsComponent, filterRelationsByTypeLabel,
|
||||
relationsToItems
|
||||
} from '../shared/entity-page-fields.component';
|
||||
import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { EntityComponent, filterRelationsByTypeLabel, relationsToItems } from '../shared/entity.component';
|
||||
|
||||
@rendersEntityType('OrgUnit', ElementViewMode.Full)
|
||||
@Component({
|
||||
selector: 'ds-orgunit-page-fields',
|
||||
styleUrls: ['./orgunit-page-fields.component.scss'],
|
||||
templateUrl: './orgunit-page-fields.component.html'
|
||||
selector: 'ds-orgunit',
|
||||
styleUrls: ['./orgunit.component.scss'],
|
||||
templateUrl: './orgunit.component.html'
|
||||
})
|
||||
/**
|
||||
* The component for displaying metadata and relations of an item with entity type Organisation Unit
|
||||
*/
|
||||
export class OrgUnitPageFieldsComponent extends EntityPageFieldsComponent implements OnInit {
|
||||
export class OrgunitComponent extends EntityComponent implements OnInit {
|
||||
/**
|
||||
* The people related to this organisation unit
|
||||
*/
|
@@ -3,8 +3,8 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { PersonPageFieldsComponent } from './person-page-fields.component';
|
||||
import { createRelationshipsObservable, getEntityPageFieldsTest } from '../shared/entity-page-fields.component.spec';
|
||||
import { createRelationshipsObservable, getEntityPageFieldsTest } from '../shared/entity.component.spec';
|
||||
import { PersonComponent } from './person.component';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
@@ -47,4 +47,4 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
relationships: createRelationshipsObservable()
|
||||
});
|
||||
|
||||
describe('PersonPageFieldsComponent', getEntityPageFieldsTest(mockItem, PersonPageFieldsComponent));
|
||||
describe('PersonComponent', getEntityPageFieldsTest(mockItem, PersonComponent));
|
@@ -5,23 +5,20 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { rendersEntityType } from '../../../../shared/entities/entity-type-decorator';
|
||||
import { ITEM } from '../../../../shared/entities/switcher/entity-type-switcher.component';
|
||||
import { ElementViewMode } from '../../../../shared/view-mode';
|
||||
import {
|
||||
EntityPageFieldsComponent, filterRelationsByTypeLabel,
|
||||
relationsToItems
|
||||
} from '../shared/entity-page-fields.component';
|
||||
import { SearchFixedFilterService } from '../../../../+search-page/search-filters/search-filter/search-fixed-filter.service';
|
||||
import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { EntityComponent, filterRelationsByTypeLabel, relationsToItems } from '../shared/entity.component';
|
||||
|
||||
@rendersEntityType('Person', ElementViewMode.Full)
|
||||
@Component({
|
||||
selector: 'ds-person-page-fields',
|
||||
styleUrls: ['./person-page-fields.component.scss'],
|
||||
templateUrl: './person-page-fields.component.html'
|
||||
selector: 'ds-person',
|
||||
styleUrls: ['./person.component.scss'],
|
||||
templateUrl: './person.component.html'
|
||||
})
|
||||
/**
|
||||
* The component for displaying metadata and relations of an item with entity type Person
|
||||
*/
|
||||
export class PersonPageFieldsComponent extends EntityPageFieldsComponent {
|
||||
export class PersonComponent extends EntityComponent {
|
||||
/**
|
||||
* The publications related to this person
|
||||
*/
|
@@ -3,8 +3,8 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { ProjectPageFieldsComponent } from './project-page-fields.component';
|
||||
import { createRelationshipsObservable, getEntityPageFieldsTest } from '../shared/entity-page-fields.component.spec';
|
||||
import { createRelationshipsObservable, getEntityPageFieldsTest } from '../shared/entity.component.spec';
|
||||
import { ProjectComponent } from './project.component';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
@@ -37,4 +37,4 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
relationships: createRelationshipsObservable()
|
||||
});
|
||||
|
||||
describe('ProjectPageFieldsComponent', getEntityPageFieldsTest(mockItem, ProjectPageFieldsComponent));
|
||||
describe('ProjectComponent', getEntityPageFieldsTest(mockItem, ProjectComponent));
|
@@ -5,22 +5,19 @@ import { Item } from '../../../../core/shared/item.model';
|
||||
import { rendersEntityType } from '../../../../shared/entities/entity-type-decorator';
|
||||
import { ElementViewMode } from '../../../../shared/view-mode';
|
||||
import { ITEM } from '../../../../shared/entities/switcher/entity-type-switcher.component';
|
||||
import {
|
||||
EntityPageFieldsComponent, filterRelationsByTypeLabel,
|
||||
relationsToItems
|
||||
} from '../shared/entity-page-fields.component';
|
||||
import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
import { EntityComponent, filterRelationsByTypeLabel, relationsToItems } from '../shared/entity.component';
|
||||
|
||||
@rendersEntityType('Project', ElementViewMode.Full)
|
||||
@Component({
|
||||
selector: 'ds-project-page-fields',
|
||||
styleUrls: ['./project-page-fields.component.scss'],
|
||||
templateUrl: './project-page-fields.component.html'
|
||||
selector: 'ds-project',
|
||||
styleUrls: ['./project.component.scss'],
|
||||
templateUrl: './project.component.html'
|
||||
})
|
||||
/**
|
||||
* The component for displaying metadata and relations of an item with entity type Project
|
||||
*/
|
||||
export class ProjectPageFieldsComponent extends EntityPageFieldsComponent implements OnInit {
|
||||
export class ProjectComponent extends EntityComponent implements OnInit {
|
||||
/**
|
||||
* The people related to this project
|
||||
*/
|
@@ -8,14 +8,14 @@ import { ItemDataService } from '../../../../core/data/item-data.service';
|
||||
import { SearchFixedFilterService } from '../../../../+search-page/search-filters/search-filter/search-fixed-filter.service';
|
||||
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { PublicationPageFieldsComponent } from './publication-page-fields.component';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { createRelationshipsObservable } from '../shared/entity-page-fields.component.spec';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { createRelationshipsObservable } from '../shared/entity.component.spec';
|
||||
import { PublicationComponent } from './publication.component';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
@@ -23,9 +23,9 @@ const mockItem: Item = Object.assign(new Item(), {
|
||||
relationships: createRelationshipsObservable()
|
||||
});
|
||||
|
||||
describe('PublicationPageFieldsComponent', () => {
|
||||
let comp: PublicationPageFieldsComponent;
|
||||
let fixture: ComponentFixture<PublicationPageFieldsComponent>;
|
||||
describe('PublicationComponent', () => {
|
||||
let comp: PublicationComponent;
|
||||
let fixture: ComponentFixture<PublicationComponent>;
|
||||
|
||||
const searchFixedFilterServiceStub = {
|
||||
/* tslint:disable:no-empty */
|
||||
@@ -41,7 +41,7 @@ describe('PublicationPageFieldsComponent', () => {
|
||||
useClass: MockTranslateLoader
|
||||
}
|
||||
})],
|
||||
declarations: [PublicationPageFieldsComponent, GenericItemPageFieldComponent, TruncatePipe],
|
||||
declarations: [PublicationComponent, GenericItemPageFieldComponent, TruncatePipe],
|
||||
providers: [
|
||||
{provide: ITEM, useValue: mockItem},
|
||||
{provide: ItemDataService, useValue: {}},
|
||||
@@ -50,13 +50,13 @@ describe('PublicationPageFieldsComponent', () => {
|
||||
],
|
||||
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).overrideComponent(PublicationPageFieldsComponent, {
|
||||
}).overrideComponent(PublicationComponent, {
|
||||
set: {changeDetection: ChangeDetectionStrategy.Default}
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(PublicationPageFieldsComponent);
|
||||
fixture = TestBed.createComponent(PublicationComponent);
|
||||
comp = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
@@ -8,20 +8,17 @@ import {
|
||||
} from '../../../../shared/entities/entity-type-decorator';
|
||||
import { ITEM } from '../../../../shared/entities/switcher/entity-type-switcher.component';
|
||||
import { ElementViewMode } from '../../../../shared/view-mode';
|
||||
import {
|
||||
EntityPageFieldsComponent,
|
||||
filterRelationsByTypeLabel, relationsToItems
|
||||
} from '../shared/entity-page-fields.component';
|
||||
import { EntityComponent, filterRelationsByTypeLabel, relationsToItems } from '../shared/entity.component';
|
||||
|
||||
@rendersEntityType('Publication', ElementViewMode.Full)
|
||||
@rendersEntityType(DEFAULT_ENTITY_TYPE, ElementViewMode.Full)
|
||||
@Component({
|
||||
selector: 'ds-publication-page-fields',
|
||||
styleUrls: ['./publication-page-fields.component.scss'],
|
||||
templateUrl: './publication-page-fields.component.html',
|
||||
selector: 'ds-publication',
|
||||
styleUrls: ['./publication.component.scss'],
|
||||
templateUrl: './publication.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class PublicationPageFieldsComponent extends EntityPageFieldsComponent implements OnInit {
|
||||
export class PublicationComponent extends EntityComponent implements OnInit {
|
||||
/**
|
||||
* The authors related to this publication
|
||||
*/
|
@@ -17,7 +17,7 @@ import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { Relationship } from '../../../../core/shared/entities/relationship.model';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { compareArraysUsing, compareArraysUsingIds } from './entity-page-fields.component';
|
||||
import { compareArraysUsing, compareArraysUsingIds } from './entity.component';
|
||||
|
||||
/**
|
||||
* Create a generic test for an entity-page-fields component using a mockItem and the type of component
|
||||
@@ -100,7 +100,7 @@ export function createRelationshipsObservable() {
|
||||
})
|
||||
])));
|
||||
}
|
||||
describe('EntityPageFieldsComponent', () => {
|
||||
describe('EntityComponent', () => {
|
||||
const arr1 = [
|
||||
{
|
||||
id: 1,
|
@@ -83,13 +83,13 @@ export const relationsToItems = (thisId: string, ids: ItemDataService) =>
|
||||
);
|
||||
|
||||
@Component({
|
||||
selector: 'ds-entity-page-fields',
|
||||
selector: 'ds-entity',
|
||||
template: ''
|
||||
})
|
||||
/**
|
||||
* A generic component for displaying metadata and relations of an item
|
||||
*/
|
||||
export class EntityPageFieldsComponent implements OnInit {
|
||||
export class EntityComponent implements OnInit {
|
||||
/**
|
||||
* Resolved relationships and types together in one observable
|
||||
*/
|
@@ -1,7 +1,6 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { MockTranslateLoader } from '../../shared/mocks/mock-translate-loader';
|
||||
import { TruncatePipe } from '../../shared/utils/truncate.pipe';
|
||||
import { ItemDataService } from '../../core/data/item-data.service';
|
||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ItemPageComponent } from './item-page.component';
|
||||
@@ -14,9 +13,9 @@ import { RemoteData } from '../../core/data/remote-data';
|
||||
import { Item } from '../../core/shared/item.model';
|
||||
import { PaginatedList } from '../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { createRelationshipsObservable } from './entity-types/shared/entity-page-fields.component.spec';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { createRelationshipsObservable } from './entity-types/shared/entity.component.spec';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
|
@@ -6,8 +6,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { createRelationshipsObservable } from '../entity-types/shared/entity-page-fields.component.spec';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { createRelationshipsObservable } from '../entity-types/shared/entity.component.spec';
|
||||
|
||||
const mockItem1: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
|
@@ -6,8 +6,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { createRelationshipsObservable } from '../../../+item-page/simple/entity-types/shared/entity-page-fields.component.spec';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { createRelationshipsObservable } from '../../../+item-page/simple/entity-types/shared/entity.component.spec';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
|
@@ -8,9 +8,9 @@ import { Observable } from 'rxjs/Observable';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { createRelationshipsObservable } from '../../../../+item-page/simple/entity-types/shared/entity-page-fields.component.spec';
|
||||
import { ITEM } from '../../../entities/switcher/entity-type-switcher.component';
|
||||
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
||||
import { createRelationshipsObservable } from '../../../../+item-page/simple/entity-types/shared/entity.component.spec';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
|
@@ -3,13 +3,13 @@ import { Observable } from 'rxjs/Observable';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { createRelationshipsObservable } from '../../../../+item-page/simple/entity-types/shared/entity-page-fields.component.spec';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ItemSearchResultListElementComponent } from './item-search-result-list-element.component';
|
||||
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
||||
import { TruncatePipe } from '../../../utils/truncate.pipe';
|
||||
import { createRelationshipsObservable } from '../../../../+item-page/simple/entity-types/shared/entity.component.spec';
|
||||
|
||||
const mockItem: Item = Object.assign(new Item(), {
|
||||
bitstreams: Observable.of(new RemoteData(false, false, true, null, new PaginatedList(new PageInfo(), []))),
|
||||
|
Reference in New Issue
Block a user