From aa81bf38c33d60d15eb135434cbc4eea7e148fe6 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Mon, 11 Mar 2019 11:21:34 +0100 Subject: [PATCH] ViewItem title (fixes #4464) --- .../repositories/agenda/item-repository.service.ts | 11 +---------- .../list-of-speakers/list-of-speakers.component.html | 2 +- client/src/app/site/agenda/models/view-item.ts | 6 +++--- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/client/src/app/core/repositories/agenda/item-repository.service.ts b/client/src/app/core/repositories/agenda/item-repository.service.ts index 48ba51a2f..453429b48 100644 --- a/client/src/app/core/repositories/agenda/item-repository.service.ts +++ b/client/src/app/core/repositories/agenda/item-repository.service.ts @@ -78,16 +78,6 @@ export class ItemRepositoryService extends BaseRepository { const viewItem = new ViewItem(item, contentObject); viewItem.getVerboseName = this.getVerboseName; viewItem.getTitle = () => { - if (viewItem.contentObject) { - return viewItem.contentObject.getAgendaTitle(); - } else { - const repo = this.collectionStringMapperService.getRepository( - viewItem.item.content_object.collection - ) as BaseAgendaContentObjectRepository; - return repo.getAgendaTitle(viewItem); - } - }; - viewItem.getListTitle = () => { const numberPrefix = viewItem.itemNumber ? `${viewItem.itemNumber} ยท ` : ''; if (viewItem.contentObject) { @@ -99,6 +89,7 @@ export class ItemRepositoryService extends BaseRepository { return numberPrefix + repo.getAgendaTitleWithType(viewItem); } }; + viewItem.getListTitle = viewItem.getTitle; return viewItem; } diff --git a/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.html b/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.html index 4857ec021..98ec8cdbc 100644 --- a/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.html +++ b/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.html @@ -11,7 +11,7 @@ -

{{ viewItem.contentObject.getTitle() }}

+

{{ viewItem.getTitle() }}

diff --git a/client/src/app/site/agenda/models/view-item.ts b/client/src/app/site/agenda/models/view-item.ts index 21cae2358..94cc0a760 100644 --- a/client/src/app/site/agenda/models/view-item.ts +++ b/client/src/app/site/agenda/models/view-item.ts @@ -111,9 +111,9 @@ export class ViewItem extends BaseViewModel { /** * This is set by the repository */ - public getVerboseName; - public getTitle; - public getListTitle; + public getVerboseName: () => string; + public getTitle: () => string; + public getListTitle: () => string; public listOfSpeakersSlide: ProjectorElementBuildDeskriptor = { getBasicProjectorElement: options => ({