From 0722b5bca15e8db1bcc064b55faccc6b5296b4f3 Mon Sep 17 00:00:00 2001
From: shaed-parkar <41630528+shaed-parkar@users.noreply.github.com>
Date: Mon, 29 Apr 2024 11:45:54 +0100
Subject: [PATCH] VIH-8295 observer hearing room UI bug fix (#2127)
Hide additional flex bar in icons container when user is an observer because they will see a bar but no icons such as share-screen to separate the sections
---
.../app/services/user-media.service.spec.ts | 12 +-
.../hearing-controls-base.component.spec.ts | 18 +++
.../hearing-controls-base.component.ts | 4 +
...-consultation-room-controls.component.html | 144 ++++++++++++++----
4 files changed, 144 insertions(+), 34 deletions(-)
diff --git a/VideoWeb/VideoWeb/ClientApp/src/app/services/user-media.service.spec.ts b/VideoWeb/VideoWeb/ClientApp/src/app/services/user-media.service.spec.ts
index d4f77445ae..f86690dc3e 100644
--- a/VideoWeb/VideoWeb/ClientApp/src/app/services/user-media.service.spec.ts
+++ b/VideoWeb/VideoWeb/ClientApp/src/app/services/user-media.service.spec.ts
@@ -387,9 +387,15 @@ describe('UserMediaService', () => {
const conferenceId = 'conferenceId';
localStorageServiceSpy.load.and.returnValue(null);
userMediaService.updateStartWithAudioMuted(conferenceId, true);
- expect(localStorageServiceSpy.save).toHaveBeenCalledWith(userMediaService.CONFERENCES_KEY, [
- new ConferenceSetting(conferenceId, true)
- ]);
+ expect(localStorageServiceSpy.save).toHaveBeenCalledWith(
+ userMediaService.CONFERENCES_KEY,
+ jasmine.arrayContaining([
+ jasmine.objectContaining({
+ conferenceId: conferenceId,
+ startWithAudioMuted: true
+ })
+ ])
+ );
});
it('should not insert into local storage when startWithAudioMuted is false', () => {
diff --git a/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/hearing-controls/hearing-controls-base.component.spec.ts b/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/hearing-controls/hearing-controls-base.component.spec.ts
index d7a1242977..77cd7ad943 100644
--- a/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/hearing-controls/hearing-controls-base.component.spec.ts
+++ b/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/hearing-controls/hearing-controls-base.component.spec.ts
@@ -5,6 +5,7 @@ import {
ClientSettingsResponse,
ConferenceResponse,
ParticipantForUserResponse,
+ ParticipantResponse,
ParticipantStatus,
Role
} from 'src/app/services/clients/api-client';
@@ -1122,4 +1123,21 @@ describe('HearingControlsBaseComponent', () => {
expect(eventsServiceSpy.sendMediaStatus).toHaveBeenCalledTimes(0);
});
});
+
+ describe('isObserver', () => {
+ it('should return true when participant role is QuickLinkObserver', () => {
+ component.participant = { role: Role.QuickLinkObserver } as ParticipantResponse;
+ expect(component.isObserver).toBeTrue();
+ });
+
+ it('should return false when participant role is not QuickLinkObserver', () => {
+ component.participant = { role: Role.Judge } as ParticipantResponse;
+ expect(component.isObserver).toBeFalse();
+ });
+
+ it('should return false when participant is undefined', () => {
+ component.participant = undefined;
+ expect(component.isObserver).toBeFalse();
+ });
+ });
});
diff --git a/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/hearing-controls/hearing-controls-base.component.ts b/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/hearing-controls/hearing-controls-base.component.ts
index b94e7fa8f7..370f50f804 100644
--- a/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/hearing-controls/hearing-controls-base.component.ts
+++ b/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/hearing-controls/hearing-controls-base.component.ts
@@ -106,6 +106,10 @@ export abstract class HearingControlsBaseComponent implements OnInit, OnDestroy
return this.participant.role === Role.JudicialOfficeHolder || this.isJudge;
}
+ get isObserver(): boolean {
+ return this.participant?.role === Role.QuickLinkObserver;
+ }
+
get isJOHRoom(): boolean {
return this.participant?.current_room?.label.startsWith('JudgeJOH');
}
diff --git a/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/private-consultation-room-controls/private-consultation-room-controls.component.html b/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/private-consultation-room-controls/private-consultation-room-controls.component.html
index 712149f92d..643e06df5a 100644
--- a/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/private-consultation-room-controls/private-consultation-room-controls.component.html
+++ b/VideoWeb/VideoWeb/ClientApp/src/app/waiting-space/private-consultation-room-controls/private-consultation-room-controls.component.html
@@ -7,7 +7,10 @@
colour="grey"
[class]="{ 'dropdown-opaque': showContextMenu }"
(click)="showContextMenu = !showContextMenu"
+ (keydown.enter)="showContextMenu = !showContextMenu"
+ (keydown.space)="showContextMenu = !showContextMenu"
tabindex="0"
+ role="listbox"
>