Skip to content
Draft
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 @@ -62,7 +62,9 @@ <h3>{{ option.displayName | translate }}</h3>
}

<mat-dialog-actions>
<button color="accent" mat-button osAutofocus (click)="onProject()">{{ 'Project' | translate }}</button>
@if (!hideMainButton) {
<button color="accent" mat-button osAutofocus (click)="onProject()">{{ 'Project' | translate }}</button>
}
@if (projectorSelectable) {
<button mat-button (click)="onAddToPreview()">{{ 'Add to queue' | translate }}</button>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface ProjectionDialogConfig {
descriptor: ProjectionBuildDescriptor;
allowReferenceProjector: boolean;
projector?: ViewProjector;
hideMainButton?: boolean;
}

@Component({
Expand Down Expand Up @@ -65,6 +66,8 @@ export class ProjectionDialogComponent implements OnInit, OnDestroy {
private _projectorSubscription: string;
private _subscriptions: Subscription[] = [];

public hideMainButton = false;

public constructor(
public dialogRef: MatDialogRef<ProjectionDialogComponent, ProjectionDialogReturnType>,
@Inject(MAT_DIALOG_DATA) public data: ProjectionDialogConfig | ProjectionBuildDescriptor,
Expand All @@ -87,6 +90,9 @@ export class ProjectionDialogComponent implements OnInit, OnDestroy {
this.currentProjectionOptions = projections[0].options || {};
}
}
if (data && !isProjectionBuildDescriptor(data)) {
this.hideMainButton = data.hideMainButton;
}
}

public ngOnDestroy(): void {
Expand Down Expand Up @@ -180,6 +186,7 @@ export class ProjectionDialogComponent implements OnInit, OnDestroy {
}

public onAddToPreview(): void {
console.log(`keey:`);
this.dialogRef.close({
action: `addToPreview`,
resultDescriptor: this.descriptor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class ProjectionDialogService {
* the projectors will be updated.
*/
public async openProjectDialogFor(descriptor: ProjectionBuildDescriptor | ProjectionDialogConfig): Promise<void> {
console.log(descriptor);
const module = await import(`../projection-dialog.module`).then(m => m.ProjectionDialogModule);
const dialogRef = this.dialog.open<
ProjectionDialogComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<span #ref><ng-content></ng-content></span>
@if (!ref.innerHTML.trim()) {
<span>
{{ 'Project' | translate }}
{{ projectorLabel | translate }}
</span>
}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ export class ProjectorButtonComponent implements OnInit, OnDestroy {
@Input()
public menuItem = false;

@Input()
public projectorLabel = `Project`;

@Input()
public hideMainButton = false;

@Output()
public changeEvent = new EventEmitter<void>();

Expand Down Expand Up @@ -99,7 +105,8 @@ export class ProjectorButtonComponent implements OnInit, OnDestroy {
// open the projection dialog
this.projectionDialogService.openProjectDialogFor({
descriptor,
allowReferenceProjector: this.allowReferenceProjector
allowReferenceProjector: this.allowReferenceProjector,
hideMainButton: this.hideMainButton
});
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ <h1 class="mock-h2" translate>Agenda</h1>
<span>{{ 'Tags' | translate }}</span>
</button>
<mat-divider></mat-divider>
<!-- Add to projector queue -->
<os-projector-button
[hideMainButton]="true"
[menuItem]="true"
[object]="addToProjectorQueue()"
[projectorLabel]="'Add to queue'"
></os-projector-button>

<!-- PDF/CSV export -->
<button mat-menu-item (click)="exportAgendaItems()">
<mat-icon>archive</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export class AgendaItemListComponent extends BaseMeetingListViewComponent<ViewAg

public itemListSlide: ProjectionBuildDescriptor | null = null;

public multiQueue: ProjectionBuildDescriptor | null = null;

/**
* Define extra filter properties
*/
Expand Down Expand Up @@ -328,6 +330,27 @@ export class AgendaItemListComponent extends BaseMeetingListViewComponent<ViewAg
}
}

public addToProjectorQueue(): ProjectionBuildDescriptor {
const agendaItems = this.isMultiSelect ? this.selectedRows : this.listComponent?.source;

if (agendaItems) {
const ids = agendaItems.map(item => item.content_object_id);
return {
content_object_id: ids,
type: MeetingProjectionType.AgendaItemList,
projectionDefault: PROJECTIONDEFAULT.agendaItemList,
getDialogTitle: (): string => this.translate.instant(`Agenda`)
};
} else {
return {
content_object_id: null,
type: MeetingProjectionType.AgendaItemList,
projectionDefault: PROJECTIONDEFAULT.agendaItemList,
getDialogTitle: (): string => this.translate.instant(`Agenda`)
};
}
}

/**
* Triggers the export page of one agenda item
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function isProjectionBuildDescriptor(obj: any): obj is ProjectionBuildDes
}

export interface ProjectionBuildDescriptor {
content_object_id: Fqid;
content_object_id: Fqid | Fqid[];
stable?: boolean;
stableToggle?: string;
type?: string;
Expand Down
Loading