Merge pull request #4495 from FinnStutzenstein/viewItemTitle

ViewItem title (fixes #4464)
This commit is contained in:
Emanuel Schütze 2019-03-11 12:21:21 +01:00 committed by GitHub
commit 3684701ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 14 deletions

View File

@ -78,16 +78,6 @@ export class ItemRepositoryService extends BaseRepository<ViewItem, Item> {
const viewItem = new ViewItem(item, contentObject); const viewItem = new ViewItem(item, contentObject);
viewItem.getVerboseName = this.getVerboseName; viewItem.getVerboseName = this.getVerboseName;
viewItem.getTitle = () => { viewItem.getTitle = () => {
if (viewItem.contentObject) {
return viewItem.contentObject.getAgendaTitle();
} else {
const repo = this.collectionStringMapperService.getRepository(
viewItem.item.content_object.collection
) as BaseAgendaContentObjectRepository<any, any>;
return repo.getAgendaTitle(viewItem);
}
};
viewItem.getListTitle = () => {
const numberPrefix = viewItem.itemNumber ? `${viewItem.itemNumber} · ` : ''; const numberPrefix = viewItem.itemNumber ? `${viewItem.itemNumber} · ` : '';
if (viewItem.contentObject) { if (viewItem.contentObject) {
@ -99,6 +89,7 @@ export class ItemRepositoryService extends BaseRepository<ViewItem, Item> {
return numberPrefix + repo.getAgendaTitleWithType(viewItem); return numberPrefix + repo.getAgendaTitleWithType(viewItem);
} }
}; };
viewItem.getListTitle = viewItem.getTitle;
return viewItem; return viewItem;
} }

View File

@ -11,7 +11,7 @@
</div> </div>
</os-head-bar> </os-head-bar>
<h1 class="title on-transition-fade" *ngIf="viewItem">{{ viewItem.contentObject.getTitle() }}</h1> <h1 class="title on-transition-fade" *ngIf="viewItem">{{ viewItem.getTitle() }}</h1>
<mat-card class="speaker-card" *ngIf="viewItem"> <mat-card class="speaker-card" *ngIf="viewItem">
<!-- List of finished speakers --> <!-- List of finished speakers -->

View File

@ -111,9 +111,9 @@ export class ViewItem extends BaseViewModel {
/** /**
* This is set by the repository * This is set by the repository
*/ */
public getVerboseName; public getVerboseName: () => string;
public getTitle; public getTitle: () => string;
public getListTitle; public getListTitle: () => string;
public listOfSpeakersSlide: ProjectorElementBuildDeskriptor = { public listOfSpeakersSlide: ProjectorElementBuildDeskriptor = {
getBasicProjectorElement: options => ({ getBasicProjectorElement: options => ({