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

update chyron, add agenda item and new chyron type #3691

Merged
merged 15 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 12 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
4 changes: 4 additions & 0 deletions client/src/app/domain/models/projector/projector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class Projector extends BaseModel<Projector> {
public header_h1_color!: string;
public chyron_background_color!: string;
public chyron_font_color!: string;
public chyron_background_color_2!: string;
public chyron_font_color_2!: string;
public show_header_footer!: boolean;
public show_title!: boolean;
public show_logo!: boolean;
Expand Down Expand Up @@ -87,7 +89,9 @@ export class Projector extends BaseModel<Projector> {
`header_font_color`,
`header_h1_color`,
`chyron_background_color`,
`chyron_background_color_2`,
`chyron_font_color`,
`chyron_font_color_2`,
`show_header_footer`,
`show_title`,
`show_logo`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export class ProjectorRepositoryService extends BaseMeetingRelatedRepository<Vie
header_h1_color: projector.header_h1_color,
chyron_background_color: projector.chyron_background_color,
chyron_font_color: projector.chyron_font_color,
chyron_background_color_2: projector.chyron_background_color_2,
chyron_font_color_2: projector.chyron_font_color_2,
show_header_footer: projector.show_header_footer,
show_title: projector.show_title,
show_logo: projector.show_logo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h2 mat-dialog-title>
<div class="element-name" *ngIf="descriptor">
{{ descriptor.getDialogTitle() }}
</div>
<div class="content-wrapper">
<div class="content-wrapper" *ngIf="!useHideAction">
<div
class="projectors"
*ngFor="let projector of projectors"
Expand Down Expand Up @@ -49,6 +49,7 @@ <h3>{{ option.displayName | translate }}</h3>

<mat-dialog-actions>
<button mat-button osAutofocus (click)="onProject()" color="accent">{{ 'Project' | translate }}</button>
<button mat-button (click)="onAddToPreview()">{{ 'Add to queue' | translate }}</button>
<button mat-button *ngIf="!useHideAction" (click)="onAddToPreview()">{{ 'Add to queue' | translate }}</button>
<button mat-button *ngIf="useHideAction" (click)="onHide()">{{ 'Hide' | translate }}</button>
<button mat-button (click)="onCancel()">{{ 'Cancel' | translate }}</button>
</mat-dialog-actions>
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { ProjectionDialogReturnType } from '../../definitions';
export interface ProjectionDialogConfig {
descriptor: ProjectionBuildDescriptor;
allowReferenceProjector: boolean;
hideActionData?: ViewProjector;
}

@Component({
Expand All @@ -42,6 +43,7 @@ export class ProjectionDialogComponent implements OnInit, OnDestroy {
public options!: SlideOptions;
public descriptor: ProjectionBuildDescriptor;
public allowReferenceProjector = true;
public useHideAction = false;
private _projectorSubscription: string;
private _subscriptions: Subscription[] = [];

Expand All @@ -54,6 +56,10 @@ export class ProjectionDialogComponent implements OnInit, OnDestroy {
) {
this.descriptor = isProjectionBuildDescriptor(data) ? data : data.descriptor;
this.allowReferenceProjector = !isProjectionBuildDescriptor(data) && data.allowReferenceProjector;
this.useHideAction = !isProjectionBuildDescriptor(data) && !!data.hideActionData;
if (this.useHideAction && !isProjectionBuildDescriptor(data)) {
this.selectedProjectors = [data.hideActionData.id];
}
}

public ngOnDestroy(): void {
Expand Down Expand Up @@ -154,6 +160,15 @@ export class ProjectionDialogComponent implements OnInit, OnDestroy {
});
}

public onHide(): void {
this.dialogRef.close({
action: `hide`,
resultDescriptor: this.descriptor,
projectors: this.selectedProjectors.map(id => this.projectors.find(p => p.id === id)).filter(p => p),
options: this.optionValues
});
}

public onCancel(): void {
this.dialogRef.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ViewProjector } from 'src/app/site/pages/meetings/pages/projectors';
import { ProjectionBuildDescriptor } from 'src/app/site/pages/meetings/view-models';

export interface ProjectionDialogReturnType {
action: 'project' | 'addToPreview';
action: 'project' | 'addToPreview' | 'hide';
resultDescriptor: ProjectionBuildDescriptor;
projectors: ViewProjector[];
options: object | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export class ProjectionDialogService {
await this.projectorRepo.project(resultDescriptor, projectors, options);
} else if (action === `addToPreview`) {
await this.projectorRepo.addToPreview(resultDescriptor, projectors, options);
} else if (action === `hide`) {
if (this.projectorRepo.isProjectedOn(resultDescriptor, projectors[0])) {
await this.projectorRepo.toggle(resultDescriptor, projectors, options);
}
} else {
throw new Error(`Unknown projector action ` + action);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class ProjectorButtonComponent implements OnInit, OnDestroy {
/**
* The object to project.
*/

private _object: ProjectionBuildDescriptor | Projectable | null = null;

public get object(): ProjectionBuildDescriptor | Projectable {
Expand Down Expand Up @@ -58,6 +59,9 @@ export class ProjectorButtonComponent implements OnInit, OnDestroy {
@Input()
public allowReferenceProjector = true;

@Input()
public useToggleDialog = false;

/**
* If this is re-defined, it will replace the usual click functionality.
*/
Expand All @@ -67,7 +71,13 @@ export class ProjectorButtonComponent implements OnInit, OnDestroy {
return;
}
const descriptor = this.projectorService.ensureDescriptor(this.object);
if (this.projector) {
if (this.useToggleDialog) {
this.projectionDialogService.openProjectDialogFor({
descriptor,
hideActionData: this.projector,
allowReferenceProjector: true
});
} else if (this.projector) {
this.projectorService.toggle(descriptor, [this.projector]);
} else {
// open the projection dialog
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
<div
id="chyron"
*ngIf="data"
[id]="data.options['chyron_type'] === 'new' ? 'chyron_new' : 'chyron'"
[ngStyle]="{
'background-color': projector?.chyron_background_color || data.data.background_color,
color: projector?.chyron_font_color || data.data.font_color
'--chyron-background-color': projector?.chyron_background_color || data.data.background_color,
'--chyron-font-color': projector?.chyron_font_color || data.data.font_color,
'--chyron-background-color-2': projector?.chyron_background_color_2 || data.data.background_color_2,
'--chyron-font-color-2': projector?.chyron_font_color_2 || data.data.font_color_2
}"
>
<span id="inner">
<div id="inner-name">{{ data.data.current_speaker_name }}</div>
<div id="inner-level">{{ data.data.current_speaker_level }}</div>
</span>
<div id="chyron_agenda_item" *ngIf="data && data.options['agenda_item'] && data.data.title_information">
<span class="inner">
{{ data.data.title_information?.agenda_item_number }}
{{ !!data.data.title_information?.agenda_item_number ? '&middot;' : '' }}
{{ data.data.title_information?.title }}
</span>
</div>

<div id="chyron_speaker" *ngIf="data && data.options['chyron_type'] !== 'none' && data.data.current_speaker_name">
<span *ngIf="data.options['chyron_type'] === 'old'" class="inner">
<div class="name">{{ data.data.current_speaker_name }}</div>
<div class="level">{{ data.data.current_speaker_level }}</div>
</span>
<span *ngIf="data.options['chyron_type'] === 'new'" class="inner">
<os-comma-separated-listing [list]="getSpeaker()"></os-comma-separated-listing>
</span>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,33 +1,61 @@
@import 'src/assets/styles/fonts.scss';

#chyron {
#chyron,
#chyron_new {
position: absolute;
left: 50px;
bottom: 20px;
right: 0;
z-index: 10;
height: 80px;
font-size: 32px;
margin-right: 50px;
bastianjoel marked this conversation as resolved.
Show resolved Hide resolved
}

#chyron_agenda_item,
#chyron_speaker {
text-align: left;
line-height: 1;
line-height: 1.25;
opacity: 1;

#inner {
.inner {
background-color: var(--chyron-background-color);
color: var(--chyron-font-color);
display: inline-block;

vertical-align: middle;
padding-left: 18px;
padding-right: 20px;
padding-right: 18px;
padding-top: 10px;
padding-bottom: 10px;
height: 60px;
height: 40px;
display: table-cell;
}
}

#inner-name {
#chyron_agenda_item {
font-size: 24px;
.inner {
background-color: var(--chyron-background-color-2);
color: var(--chyron-font-color-2);
}
margin-bottom: -1px;
}

#chyron_speaker {
font-size: 32px;
.inner {
.name {
font-family: customChyronNameFont, $font-chyronname;
}

#inner-level {
.level {
margin-top: 5px;
font-size: 70%;
}
}
}

#chyron_new {
#chyron_speaker {
min-height: 80px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ import { CurrentSpeakerChyronSlideData } from '../current-speaker-chyron-slide-d
templateUrl: `./current-speaker-chyron-slide.component.html`,
styleUrls: [`./current-speaker-chyron-slide.component.scss`]
})
export class CurrentSpeakerChyronSlideComponent extends BaseSlideComponent<CurrentSpeakerChyronSlideData> {}
export class CurrentSpeakerChyronSlideComponent extends BaseSlideComponent<CurrentSpeakerChyronSlideData> {
public getSpeaker(): string[] {
const parts: string[] = [this.data.data.current_speaker_name];
if (!!this.data.data.current_speaker_level) {
parts.push(this.data.data.current_speaker_level);
}
return parts;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ export interface CurrentSpeakerChyronSlideData {
current_speaker_level?: string;
background_color: string;
font_color: string;
background_color_2: string;
font_color_2: string;
title_information?: any;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { CommaSeparatedListingModule } from '../../../../../../../../../ui/modules/comma-separated-listing/comma-separated-listing.module';
import { SlideToken } from '../../definitions';
import { CurrentSpeakerChyronSlideComponent } from './components/current-speaker-chyron-slide.component';
@NgModule({
imports: [CommonModule],
declarations: [CurrentSpeakerChyronSlideComponent],
providers: [{ provide: SlideToken.token, useValue: CurrentSpeakerChyronSlideComponent }]
providers: [{ provide: SlideToken.token, useValue: CurrentSpeakerChyronSlideComponent }],
imports: [CommonModule, CommaSeparatedListingModule]
})
export class CurrentSpeakerChyronSlideModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ <h3>{{ 'Projection defaults' | translate }}</h3>
</ng-template>

<ng-template
*ngFor="let field of colorFields | keyvalue"
*ngFor="let colorPair of colorFields"
[ngTemplateOutlet]="colorFormField"
[ngTemplateOutletContext]="{ title: field.value, form: field.key }"
[ngTemplateOutletContext]="{ title: colorPair[1], form: colorPair[0] }"
></ng-template>
</div>
</mat-dialog-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,17 @@ export class ProjectorEditDialogComponent extends BaseUiComponent implements OnI
*/
public readonly projectiondefaultKeys = PROJECTIONDEFAULT;

public readonly colorFields = {
color: _(`Foreground color`),
background_color: _(`Background color`),
header_background_color: _(`Header background color`),
header_font_color: _(`Header font color`),
header_h1_color: _(`Headline color`),
chyron_background_color: _(`Chyron background color`),
chyron_font_color: _(`Chyron font color`)
};
public readonly colorFields = [
[`background_color`, _(`Background color`)],
[`color`, _(`Foreground color`)],
[`header_background_color`, _(`Header background color`)],
[`header_font_color`, _(`Header font color`)],
[`header_h1_color`, _(`Headline color`)],
[`chyron_background_color`, _(`Chyron background color`)],
[`chyron_font_color`, _(`Chyron font color`)],
[`chyron_background_color_2`, _(`Chyron second background color`)],
[`chyron_font_color_2`, _(`Chyron second font color`)]
];

private get _aspectRatioControl(): AbstractControl {
return this.updateForm.get(ASPECT_RATIO_FORM_KEY)!;
Expand Down Expand Up @@ -150,6 +152,8 @@ export class ProjectorEditDialogComponent extends BaseUiComponent implements OnI
header_h1_color: [``, Validators.required],
chyron_background_color: [``, Validators.required],
chyron_font_color: [``, Validators.required],
chyron_background_color_2: [``, Validators.required],
chyron_font_color_2: [``, Validators.required],
show_header_footer: [],
show_title: [],
show_logo: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ <h2>{{ projector.name }}</h2>
<os-projector-button
[object]="getChyronBuildDesc()"
[projector]="projector"
[useToggleDialog]="true"
></os-projector-button>
<span class="spacer-left-10">{{ 'Chyron – current contribution' | translate }}</span>
</mat-list-item>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { marker as _ } from '@colsen1991/ngx-translate-extract-marker';
import { PROJECTIONDEFAULT } from 'src/app/domain/models/projector/projection-default';
import { MeetingProjectionType } from 'src/app/gateways/repositories/meeting-repository.service';
import { ViewProjector } from 'src/app/site/pages/meetings/pages/projectors';
Expand Down Expand Up @@ -28,7 +29,20 @@ export class CurrentSpeakerChyronSlideService {
type: MeetingProjectionType.CurrentSpeakerChyron,
projectionDefault: PROJECTIONDEFAULT.currentListOfSpeakers,
stable: true,
getDialogTitle: () => `Current speaker chyron`
getDialogTitle: () => `Current speaker chyron`,
slideOptions: [
{
key: `chyron_type`,
displayName: _(`Chyron Type`),
choices: [
{ value: `old`, displayName: _(`Old Chyron`) },
{ value: `new`, displayName: _(`New Chyron`) },
{ value: `none`, displayName: _(`None`) }
],
default: `old`
},
{ key: `agenda_item`, displayName: _(`Show Agenda Item`), default: false }
]
};
}

Expand Down
Loading