diff --git a/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/summary/summary.component.spec.ts b/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/summary/summary.component.spec.ts index 19fb0f018..30e3462dd 100644 --- a/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/summary/summary.component.spec.ts +++ b/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/summary/summary.component.spec.ts @@ -126,7 +126,7 @@ launchDarklyServiceSpy.getFlag.withArgs(FeatureFlags.eJudFeature).and.returnValu launchDarklyServiceSpy.getFlag.withArgs(FeatureFlags.useV2Api).and.returnValue(of(false)); const bookingStatusService = new BookingStatusService(videoHearingsServiceSpy); -describe('SummaryComponent with valid request', () => { +fdescribe('SummaryComponent with valid request', () => { let component: SummaryComponent; let fixture: ComponentFixture; @@ -567,7 +567,7 @@ describe('SummaryComponent with valid request', () => { }); }); -describe('SummaryComponent with invalid request', () => { +fdescribe('SummaryComponent with invalid request', () => { let component: SummaryComponent; let fixture: ComponentFixture; @@ -650,7 +650,7 @@ describe('SummaryComponent with invalid request', () => { }); }); -describe('SummaryComponent with existing request', () => { +fdescribe('SummaryComponent with existing request', () => { let component: SummaryComponent; let fixture: ComponentFixture; @@ -847,7 +847,7 @@ describe('SummaryComponent with existing request', () => { }); }); -describe('SummaryComponent with multi days request', () => { +fdescribe('SummaryComponent with multi days request', () => { const bookingServiceSpy = jasmine.createSpyObj('BookingService', ['removeParticipantEmail']); recordingGuardServiceSpy = jasmine.createSpyObj('RecordingGuardService', [ 'switchOffRecording', diff --git a/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/summary/summary.component.ts b/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/summary/summary.component.ts index 27e1ab1b9..a34e6dddf 100644 --- a/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/summary/summary.component.ts +++ b/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/summary/summary.component.ts @@ -24,7 +24,7 @@ import { PageUrls } from '../../shared/page-url.constants'; import { ParticipantListComponent } from '../participant'; import { ParticipantService } from '../services/participant.service'; import { OtherInformationModel } from '../../common/model/other-information.model'; -import { first } from 'rxjs/operators'; +import { finalize, first } from 'rxjs/operators'; import { BookingStatusService } from 'src/app/services/booking-status-service'; import { FeatureFlags, LaunchDarklyService } from 'src/app/services/launch-darkly.service'; @@ -396,6 +396,9 @@ export class SummaryComponent implements OnInit, OnDestroy { this.$subscriptions.push( this.hearingService.updateHearing(this.hearing).subscribe({ next: (hearingDetailsResponse: HearingDetailsResponse) => { + const noJudgePrior = + this.hearing.status === BookingStatus.BookedWithoutJudge || + this.hearing.status === BookingStatus.ConfirmedWithoutJudge; this.showWaitSaving = false; this.hearingService.setBookingHasChanged(false); this.logger.info(`${this.loggerPrefix} Updated booking. Navigating to booking details.`, { @@ -408,7 +411,20 @@ export class SummaryComponent implements OnInit, OnDestroy { return; } sessionStorage.setItem(this.newHearingSessionKey, hearingDetailsResponse.id); - this.router.navigate([PageUrls.BookingConfirmation]); + if (this.judgeAssigned && noJudgePrior) { + this.showWaitSaving = true; + this.bookingStatusService + .pollForStatus(hearingDetailsResponse.id) + .pipe( + finalize(() => { + this.showWaitSaving = false; + this.router.navigate([PageUrls.BookingConfirmation]); + }) + ) + .subscribe(); + } else { + this.router.navigate([PageUrls.BookingConfirmation]); + } }, error: error => { this.logger.error(`${this.loggerPrefix} Failed to update hearing with ID: ${this.hearing.hearing_id}.`, error, {