diff --git a/projects/player/src/app/components/layout/layout.component.ts b/projects/player/src/app/components/layout/layout.component.ts index b3f043091721976a6eba3b75982bc975b917c0c3..caa9222c572c14eb9d744f0d3b53757983df194f 100644 --- a/projects/player/src/app/components/layout/layout.component.ts +++ b/projects/player/src/app/components/layout/layout.component.ts @@ -21,7 +21,7 @@ export class LayoutComponent implements OnInit, OnDestroy { @Input() playerConfig!: PlayerConfig; @Output() selectedIndexChange = new EventEmitter<number>(); - @Output() validPagesDetermined = new EventEmitter<Record<string, string>[]>(); + @Output() validPagesDetermined = new EventEmitter<Record<string, string>>(); private ngUnsubscribe = new Subject<void>(); @@ -65,12 +65,15 @@ export class LayoutComponent implements OnInit, OnDestroy { this.scrollPagesIndices = this.scrollPages.map( (scrollPage: Page): number => this.pages.indexOf(scrollPage) ); - this.validPagesDetermined.emit(this.scrollPages.map((page: Page, index: number): Record<string, string> => ( - { - [index.toString(10)]: `${this.translateService.instant('pageIndication', { - index: index + 1 - })}` - }))); + this.validPagesDetermined + .emit(this.scrollPages.reduce( + (validPages: Record<string, string>, page: Page, index: number) => ({ + ...validPages, + [`page${index + 1}`]: `${this.translateService.instant( + 'pageIndication', { index: index + 1 } + )}` + }), {} + )); } private initLayout(): void { diff --git a/projects/player/src/app/components/player-state/player-state.component.ts b/projects/player/src/app/components/player-state/player-state.component.ts index 718e3a15be1f11983be70c95f0aafece27f0e74c..bbd306edd94664777bd325ee6453e3bcf0166db7 100644 --- a/projects/player/src/app/components/player-state/player-state.component.ts +++ b/projects/player/src/app/components/player-state/player-state.component.ts @@ -25,7 +25,7 @@ export class PlayerStateComponent implements OnInit, OnDestroy { currentPlayerPageIndex: number = 0; selectIndex: Subject<number> = new Subject(); running: boolean = true; - validPages!: Record<string, string> []; + validPages!: Record<string, string>; private ngUnsubscribe = new Subject<void>(); @@ -60,7 +60,7 @@ export class PlayerStateComponent implements OnInit, OnDestroy { this.sendVopStateChangedNotification(); } - onValidPagesDetermined(validPages: Record<string, string>[]): void { + onValidPagesDetermined(validPages: Record<string, string>): void { this.validPages = validPages; this.sendVopStateChangedNotification(); } @@ -100,6 +100,8 @@ export class PlayerStateComponent implements OnInit, OnDestroy { currentPage: this.currentPlayerPageIndex.toString(10), validPages: this.validPages }; + // eslint-disable-next-line no-console + console.log('player: playerState sendVopStateChangedNotification', playerState); this.veronaPostService.sendVopStateChangedNotification({ playerState }, requested); } diff --git a/projects/player/src/app/models/verona.ts b/projects/player/src/app/models/verona.ts index 6d991346d3af805c73367ae9378e601b1021c063..b1aa1db0266bdf0f23e7d32ca2dcccbd0bfb771b 100644 --- a/projects/player/src/app/models/verona.ts +++ b/projects/player/src/app/models/verona.ts @@ -43,7 +43,7 @@ export interface UnitState { export interface PlayerState { state: RunningState; - validPages?: Record<string, string>[]; + validPages?: Record<string, string>; currentPage?: string; }