@hmcts/ccd-case-ui-toolkit 7.3.54-body-parser-update → 7.3.54-exui-4309

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8918,10 +8918,10 @@ class CaseworkerService {
8918
8918
  this.appConfig = appConfig;
8919
8919
  this.errorService = errorService;
8920
8920
  }
8921
- getUserByIdamId(idamId) {
8922
- const url = `${this.appConfig.getWorkAllocationApiUrl()}/caseworker/getUserByIdamId`;
8921
+ getCaseworkers(serviceId) {
8922
+ const url = `${this.appConfig.getWorkAllocationApiUrl()}/caseworker/getUsersByServiceName`;
8923
8923
  return this.http
8924
- .post(url, idamId)
8924
+ .post(url, { services: [serviceId] })
8925
8925
  .pipe(catchError(error => {
8926
8926
  this.errorService.setError(error);
8927
8927
  return throwError(error);
@@ -11398,6 +11398,7 @@ class CaseEditPageComponent {
11398
11398
  }
11399
11399
  ngOnInit() {
11400
11400
  initDialog();
11401
+ this.clearValidationErrors();
11401
11402
  this.eventTrigger = this.caseEdit.eventTrigger;
11402
11403
  this.editForm = this.caseEdit.form;
11403
11404
  this.wizard = this.caseEdit.wizard;
@@ -11453,6 +11454,7 @@ class CaseEditPageComponent {
11453
11454
  this.dialogRefAfterClosedSub?.unsubscribe();
11454
11455
  this.saveDraftSub?.unsubscribe();
11455
11456
  this.caseFormValidationErrorsSub?.unsubscribe();
11457
+ this.clearValidationErrors();
11456
11458
  this.multipageComponentStateService.reset();
11457
11459
  }
11458
11460
  applyValuesChanged(valuesChanged) {
@@ -11476,7 +11478,7 @@ class CaseEditPageComponent {
11476
11478
  * EUI-3732 - Breathing space data not persisted on Previous button click with ExpUI Demo
11477
11479
  */
11478
11480
  toPreviousPage() {
11479
- this.caseEditDataService.clearFormValidationErrors();
11481
+ this.clearValidationErrors();
11480
11482
  const caseEventData = this.buildCaseEventData(true);
11481
11483
  caseEventData.data = caseEventData.event_data;
11482
11484
  this.updateFormData(caseEventData);
@@ -11649,7 +11651,7 @@ class CaseEditPageComponent {
11649
11651
  this.editForm.controls['data'].removeControl('caseLinksFlag');
11650
11652
  }
11651
11653
  }
11652
- this.caseEditDataService.clearFormValidationErrors();
11654
+ this.clearValidationErrors();
11653
11655
  this.checkForStagesCompleted();
11654
11656
  if (this.currentPageIsNotValid()) {
11655
11657
  // The generateErrorMessage method filters out the hidden fields.
@@ -11813,7 +11815,7 @@ class CaseEditPageComponent {
11813
11815
  else {
11814
11816
  this.caseEdit.cancelled.emit();
11815
11817
  }
11816
- this.caseEditDataService.clearFormValidationErrors();
11818
+ this.clearValidationErrors();
11817
11819
  this.multipageComponentStateService.reset();
11818
11820
  }
11819
11821
  resetLinkedCaseJourney() {
@@ -11881,6 +11883,7 @@ class CaseEditPageComponent {
11881
11883
  console.log('handleError ', error);
11882
11884
  }
11883
11885
  resetErrors() {
11886
+ this.clearValidationErrors();
11884
11887
  this.caseEdit.error = null;
11885
11888
  this.caseEdit.ignoreWarning = false;
11886
11889
  this.triggerText = this.getTriggerText();
@@ -11888,6 +11891,10 @@ class CaseEditPageComponent {
11888
11891
  this.caseEdit.callbackErrorsSubject.next(null);
11889
11892
  }
11890
11893
  }
11894
+ clearValidationErrors() {
11895
+ this.validationErrors = [];
11896
+ this.caseEditDataService?.clearFormValidationErrors?.();
11897
+ }
11891
11898
  saveDraft() {
11892
11899
  if (this.eventTrigger.can_save_draft) {
11893
11900
  const draftCaseEventData = this.formValueService.sanitise(this.editForm.value);
@@ -12461,9 +12468,12 @@ class CaseEventCompletionTaskReassignedComponent {
12461
12468
  this.jurisdiction = task.jurisdiction;
12462
12469
  this.caseType = task.case_type_id;
12463
12470
  // Current user is a caseworker?
12464
- this.caseworkerSubscription = this.caseworkerService.getUserByIdamId(task.assignee).subscribe(caseworker => {
12465
- if (caseworker) {
12466
- this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
12471
+ this.caseworkerSubscription = this.caseworkerService.getCaseworkers(task.jurisdiction).subscribe(result => {
12472
+ if (result && result[0].service === task.jurisdiction && result[0].caseworkers) {
12473
+ const caseworker = result[0].caseworkers.find(x => x.idamId === task.assignee);
12474
+ if (caseworker) {
12475
+ this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
12476
+ }
12467
12477
  }
12468
12478
  if (!this.assignedUserName) {
12469
12479
  // Current user is a judicial user?
@@ -37572,9 +37582,12 @@ class TaskAssignedComponent {
37572
37582
  // Current user is a caseworker?
37573
37583
  this.jurisdiction = this.task.jurisdiction;
37574
37584
  this.caseType = this.task.case_type_id;
37575
- this.caseworkerSubscription = this.caseworkerService.getUserByIdamId(this.task.assignee).subscribe(caseworker => {
37576
- if (caseworker) {
37577
- this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
37585
+ this.caseworkerSubscription = this.caseworkerService.getCaseworkers(this.task.jurisdiction).subscribe(result => {
37586
+ if (result && result[0].service === this.task.jurisdiction && result[0].caseworkers) {
37587
+ const caseworker = result[0].caseworkers.find(x => x.idamId === this.task.assignee);
37588
+ if (caseworker) {
37589
+ this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
37590
+ }
37578
37591
  }
37579
37592
  if (!this.assignedUserName) {
37580
37593
  // Current user is a judicial user?