@hmcts/ccd-case-ui-toolkit 7.2.3-no-task-error → 7.2.4-default-null-protection

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.
@@ -21330,6 +21330,7 @@ class QueryCheckYourAnswersComponent {
21330
21330
  errorMessages = [];
21331
21331
  filteredTasks = [];
21332
21332
  readyToSubmit;
21333
+ isSubmitting = false;
21333
21334
  constructor(route, router, casesService, caseNotifier, workAllocationService, sessionStorageService, qualifyingQuestionService) {
21334
21335
  this.route = route;
21335
21336
  this.router = router;
@@ -21371,6 +21372,7 @@ class QueryCheckYourAnswersComponent {
21371
21372
  },
21372
21373
  error: (error) => {
21373
21374
  console.error('Error in searchTasksSubscription:', error);
21375
+ this.readyToSubmit = false;
21374
21376
  }
21375
21377
  });
21376
21378
  }
@@ -21386,6 +21388,9 @@ class QueryCheckYourAnswersComponent {
21386
21388
  this.backClicked.emit(true);
21387
21389
  }
21388
21390
  submit() {
21391
+ if (this.isSubmitting) {
21392
+ return;
21393
+ }
21389
21394
  // Check if fieldId is null or undefined
21390
21395
  if (!this.fieldId) {
21391
21396
  console.error('Error: Field ID is missing. Cannot proceed with submission.');
@@ -21401,6 +21406,7 @@ class QueryCheckYourAnswersComponent {
21401
21406
  }
21402
21407
  const data = this.generateCaseQueriesCollectionData();
21403
21408
  const createEvent$ = this.createEvent(data);
21409
+ this.isSubmitting = true;
21404
21410
  if (this.queryCreateContext === QueryCreateContext.RESPOND) {
21405
21411
  if (this.filteredTasks?.length > 0) {
21406
21412
  this.createEventSubscription = createEvent$.pipe(switchMap((createEventResponse) => {
@@ -21422,7 +21428,9 @@ class QueryCheckYourAnswersComponent {
21422
21428
  fieldId: 'field-id'
21423
21429
  }
21424
21430
  ];
21431
+ this.isSubmitting = false;
21425
21432
  window.scrollTo({ left: 0, top: 0, behavior: 'smooth' });
21433
+ return;
21426
21434
  }
21427
21435
  }
21428
21436
  else {
@@ -21452,9 +21460,11 @@ class QueryCheckYourAnswersComponent {
21452
21460
  finaliseSubmission() {
21453
21461
  this.querySubmitted.emit(true);
21454
21462
  this.qualifyingQuestionService.clearQualifyingQuestionSelection();
21463
+ this.isSubmitting = false;
21455
21464
  }
21456
21465
  handleError(error) {
21457
21466
  console.error('Error in API calls:', error);
21467
+ this.isSubmitting = false;
21458
21468
  this.router.navigate(['/', 'service-down']);
21459
21469
  }
21460
21470
  generateCaseQueriesCollectionData() {
@@ -32772,7 +32782,7 @@ class WorkbasketFiltersComponent {
32772
32782
  workbasketInputs;
32773
32783
  workbasketInputsReady;
32774
32784
  workbasketDefaults;
32775
- selected;
32785
+ selected = {};
32776
32786
  formGroup = new FormGroup({});
32777
32787
  selectedJurisdictionCaseTypes;
32778
32788
  selectedCaseTypeStates;
@@ -32799,17 +32809,22 @@ class WorkbasketFiltersComponent {
32799
32809
  : this.getDefaultJurisdiction()?.caseTypes[0];
32800
32810
  }
32801
32811
  ngOnInit() {
32802
- const j = this.getDefaultJurisdiction();
32803
- const ct = this.getDefaultCaseType();
32804
- j.currentCaseType = ct;
32805
32812
  this.selected = {
32806
- jurisdiction: j,
32807
- caseType: ct,
32813
+ jurisdiction: null,
32814
+ caseType: null,
32808
32815
  formGroup: null,
32809
32816
  caseState: undefined,
32810
32817
  page: 1,
32811
32818
  metadataFields: []
32812
32819
  };
32820
+ // EXUI-3162 - do not use defaults unless present
32821
+ if (this.defaults) {
32822
+ const j = this.getDefaultJurisdiction();
32823
+ const ct = this.getDefaultCaseType();
32824
+ j.currentCaseType = ct;
32825
+ this.selected.jurisdiction = j ? j : null;
32826
+ this.selected.caseType = ct ? ct : null;
32827
+ }
32813
32828
  this.jurisdictionService.announceSelectedJurisdiction(this.selected.jurisdiction);
32814
32829
  this.route.queryParams.subscribe(params => {
32815
32830
  if (!this.initialised || !params || !Object.keys(params).length) {