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