@hmcts/ccd-case-ui-toolkit 4.7.0-rc.2 → 4.7.0-rc.7

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.
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @hmcts/ccd-case-ui-toolkit - Case UI Toolkit
3
- * @version v4.7.0-rc.2
3
+ * @version v4.7.0-rc.7
4
4
  * @link undefined
5
5
  * @license MIT
6
6
  */
@@ -12889,15 +12889,15 @@ var CaseEditPageComponent = /** @class */ (function () {
12889
12889
  CaseEditPageComponent.prototype.updateFormData = function (jsonData) {
12890
12890
  for (var _i = 0, _a = Object.keys(jsonData.data); _i < _a.length; _i++) {
12891
12891
  var caseFieldId = _a[_i];
12892
- if (this.pageWithFieldExists(caseFieldId, this.currentPage.id)) {
12892
+ if (this.pageWithFieldExists(caseFieldId)) {
12893
12893
  this.updateEventTriggerCaseFields(caseFieldId, jsonData, this.caseEdit.eventTrigger);
12894
12894
  this.updateFormControlsValue(this.editForm, caseFieldId, jsonData.data[caseFieldId]);
12895
12895
  }
12896
12896
  }
12897
12897
  };
12898
12898
  // we do the check, becasue the data comes from the external source
12899
- CaseEditPageComponent.prototype.pageWithFieldExists = function (caseFieldId, pageId) {
12900
- return this.wizard.findWizardPage(caseFieldId, pageId);
12899
+ CaseEditPageComponent.prototype.pageWithFieldExists = function (caseFieldId) {
12900
+ return this.wizard.findWizardPage(caseFieldId);
12901
12901
  };
12902
12902
  CaseEditPageComponent.prototype.updateEventTriggerCaseFields = function (caseFieldId, jsonData, eventTrigger) {
12903
12903
  if (eventTrigger.case_fields) {
@@ -14046,8 +14046,8 @@ var Wizard = /** @class */ (function () {
14046
14046
  }
14047
14047
  return canShow(foundPage) ? foundPage : undefined;
14048
14048
  };
14049
- Wizard.prototype.findWizardPage = function (caseFieldId, pageId) {
14050
- return this.pages.find(function (wizardPage) { return wizardPage.id === pageId && wizardPage.case_fields &&
14049
+ Wizard.prototype.findWizardPage = function (caseFieldId) {
14050
+ return this.pages.find(function (wizardPage) { return wizardPage.case_fields &&
14051
14051
  wizardPage.case_fields.filter(function (caseField) { return caseField.id === caseFieldId; }).length > 0; });
14052
14052
  };
14053
14053
  Wizard.prototype.nextPage = function (pageId, canShow) {
@@ -16564,11 +16564,13 @@ var CaseFullAccessViewComponent = /** @class */ (function () {
16564
16564
  return this.caseDetails.case_type.printEnabled;
16565
16565
  };
16566
16566
  CaseFullAccessViewComponent.prototype.ngOnDestroy = function () {
16567
- if (this.activityPollingService.isEnabled) {
16567
+ if (this.activitySubscription && this.activityPollingService.isEnabled) {
16568
16568
  this.activitySubscription.unsubscribe();
16569
16569
  }
16570
- this.callbackErrorsSubject.unsubscribe();
16571
- if (!this.route.snapshot.data.case) {
16570
+ if (this.callbackErrorsSubject) {
16571
+ this.callbackErrorsSubject.unsubscribe();
16572
+ }
16573
+ if (!this.route.snapshot.data.case && this.caseSubscription) {
16572
16574
  this.caseSubscription.unsubscribe();
16573
16575
  }
16574
16576
  if (this.errorSubscription) {
@@ -16663,7 +16665,8 @@ var CaseFullAccessViewComponent = /** @class */ (function () {
16663
16665
  var regExp = new RegExp(CaseFullAccessViewComponent_1.UNICODE_SPACE, 'g');
16664
16666
  hashValue = hashValue.replace(regExp, CaseFullAccessViewComponent_1.EMPTY_SPACE);
16665
16667
  matTab = this.tabGroup._tabs.find(function (x) {
16666
- return x.textLabel.replace(CaseFullAccessViewComponent_1.EMPTY_SPACE, '').toLowerCase() === hashValue.toLowerCase();
16668
+ return x.textLabel.replace(CaseFullAccessViewComponent_1.EMPTY_SPACE, '').toLowerCase() ===
16669
+ hashValue.replace(CaseFullAccessViewComponent_1.EMPTY_SPACE, '').toLowerCase();
16667
16670
  });
16668
16671
  if (matTab && matTab.position) {
16669
16672
  this.tabGroup.selectedIndex = matTab.position;
@@ -16677,8 +16680,9 @@ var CaseFullAccessViewComponent = /** @class */ (function () {
16677
16680
  this.router.navigate([id], { relativeTo: this.route });
16678
16681
  }
16679
16682
  else {
16683
+ var label_1 = tabChangeEvent.tab.textLabel;
16680
16684
  this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]).then(function () {
16681
- window.location.hash = id;
16685
+ window.location.hash = label_1;
16682
16686
  });
16683
16687
  }
16684
16688
  };
@@ -29262,12 +29266,10 @@ var ConditionalShowRegistrarService = /** @class */ (function () {
29262
29266
  this.registeredDirectives = [];
29263
29267
  }
29264
29268
  ConditionalShowRegistrarService.prototype.register = function (newDirective) {
29265
- // console.log('[', this.registeredDirectives.length, ']adding new directive', newDirective.caseField.id);
29266
29269
  this.registeredDirectives.push(newDirective);
29267
29270
  };
29268
29271
  ConditionalShowRegistrarService.prototype.refresh = function () {
29269
29272
  this.registeredDirectives.forEach(function (dir) {
29270
- // console.log('refreshing ', dir.caseField.id);
29271
29273
  dir.refreshVisibility();
29272
29274
  });
29273
29275
  };