Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix projection of LoS #3439

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export interface SlideSpeaker {
speech_state: SpeechState;
note: string;
point_of_order: boolean;
begin_time: number;
pause_time: number;
}

interface TitleInformation extends TitleInformationWithAgendaItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,27 @@ <h2>

<!-- Current speaker -->
<div *ngIf="data.data.current" class="currentSpeaker">
<mat-icon class="micicon">mic</mat-icon>
<mat-icon class="micicon" *ngIf="!data.data.current.pause_time">mic</mat-icon>
<ng-container *ngTemplateOutlet="speakerTemplate; context: { speaker: data.data.current }"></ng-container>
</div>

<!-- Interposed questions -->
<div class="interposed-questions" *ngIf="interposedQuestions && interposedQuestions">
<ol>
<li
*ngFor="let speaker of interposedQuestions"
[ngClass]="{ currentSpeaker: speaker.begin_time && !speaker.pause_time }"
>
<mat-icon *ngIf="speaker.begin_time && !speaker.pause_time" class="micicon">mic</mat-icon>
<ng-container *ngTemplateOutlet="speakerTemplate; context: { speaker: speaker }"></ng-container>
</li>
</ol>
</div>

<!-- Next speakers -->
<div *ngIf="data.data.waiting && data.data.waiting.length">
<div *ngIf="otherWaitingSpeakers && otherWaitingSpeakers.length">
<ol class="nextSpeakers">
<li *ngFor="let speaker of data.data.waiting">
<li *ngFor="let speaker of otherWaitingSpeakers">
<ng-container *ngTemplateOutlet="speakerTemplate; context: { speaker: speaker }"></ng-container>
</li>
</ol>
Expand All @@ -40,21 +53,41 @@ <h2>
<h3>{{ 'List of speakers' | translate }}</h3>

<div *ngIf="data.data.current" class="currentSpeaker one-line">
<mat-icon>mic</mat-icon>
<mat-icon *ngIf="!data.data.current.pause_time">mic</mat-icon>
<ng-container *ngTemplateOutlet="speakerTemplate; context: { speaker: data.data.current }"></ng-container>
</div>

<ol *ngIf="data.data.waiting && data.data.waiting.length" class="nextSpeakers">
<li *ngFor="let speaker of data.data.waiting" class="one-line">
<!-- Interposed questions -->
<div class="interposed-questions">
<ol *ngIf="interposedQuestions && interposedQuestions.length">
<li
*ngFor="let speaker of interposedQuestions"
class="one-line"
[ngClass]="{ currentSpeaker: speaker.begin_time && !speaker.pause_time }"
>
<mat-icon *ngIf="speaker.begin_time && !speaker.pause_time" class="micicon">mic</mat-icon>
<ng-container *ngTemplateOutlet="speakerTemplate; context: { speaker: speaker }"></ng-container>
</li>
</ol>
</div>

<!-- Next speakers -->
<ol *ngIf="otherWaitingSpeakers && otherWaitingSpeakers.length" class="nextSpeakers">
<li *ngFor="let speaker of otherWaitingSpeakers" class="one-line">
<ng-container *ngTemplateOutlet="speakerTemplate; context: { speaker: speaker }"></ng-container>
</li>
</ol>
</div>

<ng-template let-speaker="speaker" #speakerTemplate>
{{ speaker.user }}
<ng-container *ngIf="speaker.user">{{ speaker.user }}</ng-container>
<i *ngIf="!speaker.user && speaker.speech_state === SpeechState.INTERPOSED_QUESTION">
{{ 'Unknown user' | translate }}
</i>
<mat-icon *ngIf="speaker.speech_state === SpeechState.CONTRIBUTION">star</mat-icon>
<mat-icon *ngIf="speaker.speech_state === SpeechState.PRO" class="green-text">add_circle</mat-icon>
<mat-icon *ngIf="speaker.speech_state === SpeechState.CONTRA" class="red-warning-text">remove_circle</mat-icon>
<mat-icon *ngIf="speaker.point_of_order" color="warn">warning</mat-icon>
<mat-icon *ngIf="speaker.speech_state === SpeechState.INTERPOSED_QUESTION">help</mat-icon>
<mat-icon *ngIf="speaker.speech_state === SpeechState.INTERVENTION">error</mat-icon>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,31 @@

.currentSpeaker {
font-weight: bold;
margin: 20px 0 16px;
margin: 20px 0 0;

.micicon {
vertical-align: middle;
}
}

.interposed-questions {
padding-left: 50px;

ol {
list-style-type: none;
margin: 0;
padding-left: 6px;

li {
list-style-position: inside;
line-height: 150%;
}
}
.currentSpeaker {
margin: 0;
}
}

.nextSpeakers {
margin: 0;
padding-left: 6px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CollectionMapperService } from 'src/app/site/services/collection-mapper

import { BaseSlideComponent } from '../../../../../base/base-slide-component';
import { modifyAgendaItemNumber } from '../../../../../definitions';
import { CommonListOfSpeakersSlideData } from '../common-list-of-speakers-slide-data';
import { CommonListOfSpeakersSlideData, SlideSpeaker } from '../common-list-of-speakers-slide-data';

@Component({
selector: `os-common-list-of-speakers-slide`,
Expand All @@ -26,6 +26,17 @@ export class CommonListOfSpeakersSlideComponent extends BaseSlideComponent<Commo
}
}

public get interposedQuestions(): SlideSpeaker[] {
return this._interposedQuestions;
}

public get otherWaitingSpeakers(): SlideSpeaker[] {
return this._otherWaitingSpeakers;
}

private _interposedQuestions: SlideSpeaker[] = [];
private _otherWaitingSpeakers: SlideSpeaker[] = [];

public constructor(private collectionMapperService: CollectionMapperService) {
super();
}
Expand All @@ -36,6 +47,12 @@ export class CommonListOfSpeakersSlideComponent extends BaseSlideComponent<Commo
modifyAgendaItemNumber(value.data.title_information);
}
super.setData(value);
this._interposedQuestions = (this.data.data.waiting ?? []).filter(
speaker => speaker.speech_state === SpeechState.INTERPOSED_QUESTION
);
this._otherWaitingSpeakers = (this.data.data.waiting ?? []).filter(
speaker => speaker.speech_state !== SpeechState.INTERPOSED_QUESTION
);

if (hasData && this.data.data.title_information) {
const repo = this.collectionMapperService.getRepository(this.data.data.title_information.collection);
Expand Down
Loading