Skip to content
Snippets Groups Projects
Commit 69aaa18e authored by Kristof De Langhe's avatar Kristof De Langhe
Browse files

57557: Renamed EntityPageFieldsComponents to EntityComponents

parent d32ec117
No related branches found
No related tags found
No related merge requests found
Showing
with 62 additions and 74 deletions
......@@ -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 {
......
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));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment