@hmcts/ccd-case-ui-toolkit 4.18.16 → 4.18.17

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/RELEASE-NOTES.md CHANGED
@@ -1,13 +1,5 @@
1
1
  ## RELEASE NOTES
2
2
 
3
- ### Version 4.17.12-EUI-5743-Mandatory-field-validation-in-collection
4
- **EUI-5743** Bug fix for the Mandatory field validation in collection
5
-
6
- ### Version 4.17.6-EUI-5736-unassigned-cases-pagination
7
- **EUI-5736** unassigned cases pagination
8
-
9
- ### Version 4.12.1-EUI-5682-complex-table-collection-1
10
- **EUI-5682** Bug fix for the complex collection table view
11
3
 
12
4
  ### Version 4.12.1-EUI-5225-organisation-search
13
5
  **EUI-5225** Bug fix the organisation search functionality
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.18.16
3
+ * @version v4.18.17
4
4
  * @link undefined
5
5
  * @license MIT
6
6
  */
@@ -26798,28 +26798,21 @@ var EventStartGuard = /** @class */ (function () {
26798
26798
  }
26799
26799
  EventStartGuard.prototype.canActivate = function (route) {
26800
26800
  var _this = this;
26801
- // Checks must be performed only for Work Allocation 2
26802
- if (this.appConfig.getWorkAllocationApiUrl().toLowerCase() === 'workallocation2') {
26803
- var caseId_1 = route.params['cid'];
26804
- var eventId_1 = route.params['eid'];
26805
- var taskId_1 = route.queryParams['tid'];
26806
- // TODO: NavigationExtras should be used once Angular upgrade changes have been incorporated
26807
- var isComplete = route.queryParams['isComplete'];
26808
- var caseInfoStr = this.sessionStorageService.getItem('caseInfo');
26809
- if (caseInfoStr) {
26810
- var caseInfo = JSON.parse(caseInfoStr);
26811
- if (caseInfo && caseInfo.cid === caseId_1) {
26812
- if (isComplete) {
26813
- return rxjs_1.of(true);
26814
- }
26815
- return this.workAllocationService.getTasksByCaseIdAndEventId(eventId_1, caseId_1, caseInfo.caseType, caseInfo.jurisdiction).pipe(operators_1.switchMap(function (payload) { return _this.checkForTasks(payload, caseId_1, eventId_1, taskId_1); }));
26801
+ var caseId = route.params['cid'];
26802
+ var eventId = route.params['eid'];
26803
+ var taskId = route.queryParams['tid'];
26804
+ // TODO: NavigationExtras should be used once Angular upgrade changes have been incorporated
26805
+ var isComplete = route.queryParams['isComplete'];
26806
+ var caseInfoStr = this.sessionStorageService.getItem('caseInfo');
26807
+ if (caseInfoStr) {
26808
+ var caseInfo = JSON.parse(caseInfoStr);
26809
+ if (caseInfo && caseInfo.cid === caseId) {
26810
+ if (isComplete) {
26811
+ return rxjs_1.of(true);
26816
26812
  }
26813
+ return this.workAllocationService.getTasksByCaseIdAndEventId(eventId, caseId, caseInfo.caseType, caseInfo.jurisdiction).pipe(operators_1.switchMap(function (payload) { return _this.checkForTasks(payload, caseId, eventId, taskId); }));
26817
26814
  }
26818
26815
  }
26819
- else {
26820
- // Checks not required, return true by default for Work Allocation 1
26821
- return rxjs_1.of(true);
26822
- }
26823
26816
  };
26824
26817
  EventStartGuard.prototype.checkForTasks = function (payload, caseId, eventId, taskId) {
26825
26818
  // Clear taskToComplete from session as we will be starting the process for new task
@@ -29685,12 +29678,21 @@ var ReadFieldsFilterPipe = /** @class */ (function () {
29685
29678
  }
29686
29679
  return ReadFieldsFilterPipe_1.isEmpty(field.value) ? value : field.value;
29687
29680
  };
29688
- ReadFieldsFilterPipe.evaluateConditionalShow = function (field, formValue, path) {
29681
+ ReadFieldsFilterPipe.evaluateConditionalShow = function (field, formValue, path, formGroupAvaliable, fieldId) {
29689
29682
  if (field.display_context === 'HIDDEN') {
29690
29683
  field.hidden = true;
29691
29684
  }
29692
29685
  else if (field.show_condition) {
29693
- var cond = directives_1.ShowCondition.getInstance(field.show_condition);
29686
+ var cond = void 0;
29687
+ if (fieldId && field.show_condition.indexOf(fieldId) > -1 && !formGroupAvaliable && !!Object.keys(formValue).length) {
29688
+ var search = fieldId + '.';
29689
+ var searchRegExp = new RegExp(search, 'g');
29690
+ var replaceWith = '';
29691
+ cond = directives_1.ShowCondition.getInstance(field.show_condition.replace(searchRegExp, replaceWith));
29692
+ }
29693
+ else {
29694
+ cond = directives_1.ShowCondition.getInstance(field.show_condition);
29695
+ }
29694
29696
  field.hidden = !cond.match(formValue, path);
29695
29697
  }
29696
29698
  else {
@@ -29717,8 +29719,10 @@ var ReadFieldsFilterPipe = /** @class */ (function () {
29717
29719
  var fields = complexField.field_type.complex_fields || [];
29718
29720
  var values = complexField.value || {};
29719
29721
  var checkConditionalShowAgainst = values;
29722
+ var formGroupAvailable = false;
29720
29723
  if (formGroup) {
29721
29724
  checkConditionalShowAgainst = formGroup.value;
29725
+ formGroupAvailable = true;
29722
29726
  }
29723
29727
  return fields
29724
29728
  .map(function (f) {
@@ -29734,7 +29738,7 @@ var ReadFieldsFilterPipe = /** @class */ (function () {
29734
29738
  f.display_context = complexField.display_context;
29735
29739
  }
29736
29740
  if (setupHidden) {
29737
- ReadFieldsFilterPipe_1.evaluateConditionalShow(f, checkConditionalShowAgainst, path);
29741
+ ReadFieldsFilterPipe_1.evaluateConditionalShow(f, checkConditionalShowAgainst, path, formGroupAvailable, complexField.id);
29738
29742
  }
29739
29743
  return f;
29740
29744
  })