Merge pull request #5613 from tsiegleauq/invisible-agenda-item-issue

Fix hidden motions in agenda list
This commit is contained in:
Sean 2020-10-07 10:29:31 +02:00 committed by GitHub
commit de474e9eae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 7 deletions

View File

@ -82,9 +82,12 @@ export class ProjectorService {
*/ */
public isProjected(obj: Projectable | ProjectorElementBuildDeskriptor | IdentifiableProjectorElement): boolean { public isProjected(obj: Projectable | ProjectorElementBuildDeskriptor | IdentifiableProjectorElement): boolean {
const element = this.getProjectorElement(obj); const element = this.getProjectorElement(obj);
return this.DS.getAll<Projector>('core/projector').some(projector => { if (element.getIdentifiers) {
return projector.isElementShown(element); return this.DS.getAll<Projector>('core/projector').some(projector => {
}); return projector.isElementShown(element);
});
}
return false;
} }
/** /**

View File

@ -81,8 +81,12 @@ export abstract class BaseIsAgendaItemContentObjectRepository<
*/ */
public getAgendaListTitle(titleInformation: T): AgendaListTitle { public getAgendaListTitle(titleInformation: T): AgendaListTitle {
// Return the agenda title with the model's verbose name appended // Return the agenda title with the model's verbose name appended
const numberPrefix = titleInformation.agenda_item_number() ? `${titleInformation.agenda_item_number()} · ` : ''; let numberPrefix = '';
const title = numberPrefix + this.getTitle(titleInformation) + ' (' + this.getVerboseName() + ')'; if (titleInformation.agenda_item_number && titleInformation.agenda_item_number()) {
numberPrefix = `${titleInformation.agenda_item_number()} · `;
}
const title = `${numberPrefix}${this.getTitle(titleInformation)} (${this.getVerboseName()})`;
return { title }; return { title };
} }

View File

@ -271,7 +271,15 @@ export class MotionRepositoryService extends BaseIsAgendaItemAndListOfSpeakersCo
}; };
public getAgendaListTitle = (titleInformation: MotionTitleInformation) => { public getAgendaListTitle = (titleInformation: MotionTitleInformation) => {
const numberPrefix = titleInformation.agenda_item_number() ? `${titleInformation.agenda_item_number()} · ` : ''; let numberPrefix = '';
/**
* after reloading, titleInformation.agenda_item_number is undefined. It gets defined after
* an autoupdate
*/
if (titleInformation.agenda_item_number && titleInformation.agenda_item_number()) {
numberPrefix = `${titleInformation.agenda_item_number()} · `;
}
// Append the verbose name only, if not the special format 'Motion <identifier>' is used. // Append the verbose name only, if not the special format 'Motion <identifier>' is used.
let title; let title;
if (titleInformation.identifier) { if (titleInformation.identifier) {

View File

@ -458,7 +458,8 @@ export class ListViewTableComponent<V extends BaseViewModel | BaseViewModelWithC
} }
public isElementProjected = (context: PblNgridRowContext<V>) => { public isElementProjected = (context: PblNgridRowContext<V>) => {
if (this.allowProjector && this.projectorService.isProjected(this.getProjectable(context.$implicit as V))) { const model = context.$implicit as V;
if (this.allowProjector && this.projectorService.isProjected(this.getProjectable(model))) {
return 'projected'; return 'projected';
} }
}; };