diff --git a/src/app/shared/entities/switcher/entity-type-switcher.component.ts b/src/app/shared/entities/switcher/entity-type-switcher.component.ts index a981f2665c..4b910ebebc 100644 --- a/src/app/shared/entities/switcher/entity-type-switcher.component.ts +++ b/src/app/shared/entities/switcher/entity-type-switcher.component.ts @@ -13,9 +13,23 @@ export const ITEM: InjectionToken = new InjectionToken('item'); styleUrls: ['./entity-type-switcher.component.scss'], templateUrl: './entity-type-switcher.component.html' }) +/** + * Component for determining what component to use depending on the item's relationship type (relationship.type) + */ export class EntityTypeSwitcherComponent implements OnInit { + /** + * The item to determine the component for + */ @Input() object: Item | SearchResult; + + /** + * The preferred view-mode to display + */ @Input() viewMode: ElementViewMode; + + /** + * The object injector used to inject the item into the child component + */ objectInjector: Injector; constructor(private injector: Injector) { @@ -29,6 +43,10 @@ export class EntityTypeSwitcherComponent implements OnInit { } + /** + * Fetch the component depending on the item's relationship type + * @returns {string} + */ getComponent(): string { let item: Item; if (hasValue((this.object as any).dspaceObject)) {