@hmcts/ccd-case-ui-toolkit 6.14.4-eui-4157-b → 6.14.4-yarn-3-wa-4

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.
Files changed (145) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +424 -375
  2. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
  3. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
  4. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
  5. package/esm2015/lib/app.config.js +1 -1
  6. package/esm2015/lib/components/form/date-input/date-input.component.js +8 -8
  7. package/esm2015/lib/components/header/header-bar/header-bar.component.js +3 -2
  8. package/esm2015/lib/shared/commons/case-edit-data/case-edit-data.module.js +1 -1
  9. package/esm2015/lib/shared/commons/case-edit-data/case-edit-validation.model.js +1 -1
  10. package/esm2015/lib/shared/components/activity/activity.component.js +5 -5
  11. package/esm2015/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.js +2 -2
  12. package/esm2015/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.js +2 -2
  13. package/esm2015/lib/shared/components/case-editor/case-editor.module.js +1 -1
  14. package/esm2015/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.js +3 -3
  15. package/esm2015/lib/shared/components/case-editor/services/cases.service.js +22 -11
  16. package/esm2015/lib/shared/components/case-editor/services/page-validation.service.js +2 -2
  17. package/esm2015/lib/shared/components/case-editor/services/wizard-page-field-to-case-field.mapper.js +2 -2
  18. package/esm2015/lib/shared/components/case-editor/services/work-allocation.service.js +1 -1
  19. package/esm2015/lib/shared/components/case-viewer/case-challenged-access-request/case-challenged-access-request.component.js +5 -5
  20. package/esm2015/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.js +1 -1
  21. package/esm2015/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.js +4 -4
  22. package/esm2015/lib/shared/components/case-viewer/case-viewer.component.js +5 -5
  23. package/esm2015/lib/shared/components/case-viewer/printer/pipes/print-url.pipe.js +3 -3
  24. package/esm2015/lib/shared/components/case-viewer/services/case.resolver.js +2 -2
  25. package/esm2015/lib/shared/components/event-start/event-guard/event-start.guard.js +2 -2
  26. package/esm2015/lib/shared/components/palette/address/address-option.model.js +7 -4
  27. package/esm2015/lib/shared/components/palette/address/write-address-field.component.js +4 -4
  28. package/esm2015/lib/shared/components/palette/case-file-view/components/case-file-view-folder-selector/case-file-view-folder-selector.component.js +1 -1
  29. package/esm2015/lib/shared/components/palette/case-flag/components/case-flag-table/case-flag-table.component.js +1 -1
  30. package/esm2015/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.js +2 -2
  31. package/esm2015/lib/shared/components/palette/case-flag/enums/index.js +1 -1
  32. package/esm2015/lib/shared/components/palette/collection/collection-create-checker.service.js +5 -5
  33. package/esm2015/lib/shared/components/palette/collection/write-collection-field.component.js +5 -5
  34. package/esm2015/lib/shared/components/palette/complex/read-complex-field-collection-table.component.js +3 -3
  35. package/esm2015/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.js +1 -1
  36. package/esm2015/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-from-table.component.js +1 -1
  37. package/esm2015/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-to-table.component.js +1 -1
  38. package/esm2015/lib/shared/components/palette/linked-cases/domain/linked-cases.model.js +1 -1
  39. package/esm2015/lib/shared/components/palette/linked-cases/read-linked-cases-field.component.js +2 -2
  40. package/esm2015/lib/shared/components/palette/linked-cases/services/linked-cases.service.js +3 -2
  41. package/esm2015/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.js +4 -3
  42. package/esm2015/lib/shared/components/palette/order-summary/fee.model.js +1 -1
  43. package/esm2015/lib/shared/components/palette/order-summary/order-summary.model.js +1 -1
  44. package/esm2015/lib/shared/components/palette/palette.module.js +1 -4
  45. package/esm2015/lib/shared/components/palette/text-area/write-text-area-field.component.js +2 -2
  46. package/esm2015/lib/shared/components/palette/utils/date.pipe.js +4 -4
  47. package/esm2015/lib/shared/components/search-filters/search-filters.component.js +2 -2
  48. package/esm2015/lib/shared/components/workbasket-filters/workbasket-filters.component.js +3 -3
  49. package/esm2015/lib/shared/directives/conditional-show/domain/conditional-show.model.js +3 -3
  50. package/esm2015/lib/shared/directives/conditional-show/services/condition-parser.service.js +6 -2
  51. package/esm2015/lib/shared/domain/case-view/case-view.model.js +1 -1
  52. package/esm2015/lib/shared/domain/case-view/role-assignment-response.model.js +1 -1
  53. package/esm2015/lib/shared/domain/case-view/role-request.model.js +1 -1
  54. package/esm2015/lib/shared/domain/organisation/organisation-converter.js +8 -8
  55. package/esm2015/lib/shared/domain/user/user-info.model.js +1 -1
  56. package/esm2015/lib/shared/fixture/case-field-builder.js +13 -13
  57. package/esm2015/lib/shared/fixture/shared.test.fixture.js +27 -27
  58. package/esm2015/lib/shared/pipes/complex/{ccd-page-fields.pipe.js → cdd-page-fields.pipe.js} +3 -3
  59. package/esm2015/lib/shared/pipes/complex/index.js +2 -2
  60. package/esm2015/lib/shared/pipes/index.js +2 -1
  61. package/esm2015/lib/shared/services/activity/activity.polling.service.js +2 -2
  62. package/esm2015/lib/shared/services/activity/activity.service.js +18 -9
  63. package/esm2015/lib/shared/services/addresses/address-parser.js +5 -5
  64. package/esm2015/lib/shared/services/case-fields/format-translator.service.js +2 -2
  65. package/esm2015/lib/shared/services/case-flag/case-flag-refdata.service.js +2 -2
  66. package/esm2015/lib/shared/services/common-data-service/common-data-service.js +2 -2
  67. package/esm2015/lib/shared/services/definitions/definitions.service.js +8 -3
  68. package/esm2015/lib/shared/services/fields/fields.purger.js +15 -15
  69. package/esm2015/lib/shared/services/fields/fields.utils.js +4 -4
  70. package/esm2015/lib/shared/services/form/form-value.service.js +2 -1
  71. package/esm2015/lib/shared/services/loading/loading.service.js +7 -2
  72. package/esm2015/lib/shared/services/search/search.service.js +10 -5
  73. package/esm2015/lib/shared/services/search-result/sorting/search-result-view-item-comparator-factory.js +5 -5
  74. package/esm2015/lib/shared/services/window/window.service.js +1 -1
  75. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +404 -363
  76. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  77. package/lib/app.config.d.ts.map +1 -1
  78. package/lib/components/header/header-bar/header-bar.component.d.ts.map +1 -1
  79. package/lib/shared/commons/case-edit-data/case-edit-data.module.d.ts.map +1 -1
  80. package/lib/shared/commons/case-edit-data/case-edit-validation.model.d.ts.map +1 -1
  81. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
  82. package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.d.ts +2 -2
  83. package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.d.ts.map +1 -1
  84. package/lib/shared/components/case-editor/services/cases.service.d.ts +3 -1
  85. package/lib/shared/components/case-editor/services/cases.service.d.ts.map +1 -1
  86. package/lib/shared/components/case-editor/services/wizard-page-field-to-case-field.mapper.d.ts.map +1 -1
  87. package/lib/shared/components/case-editor/services/work-allocation.service.d.ts.map +1 -1
  88. package/lib/shared/components/case-viewer/case-challenged-access-request/case-challenged-access-request.component.d.ts.map +1 -1
  89. package/lib/shared/components/case-viewer/case-viewer.component.d.ts.map +1 -1
  90. package/lib/shared/components/case-viewer/printer/pipes/print-url.pipe.d.ts.map +1 -1
  91. package/lib/shared/components/case-viewer/services/case.resolver.d.ts.map +1 -1
  92. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts +1 -1
  93. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts.map +1 -1
  94. package/lib/shared/components/palette/address/address-option.model.d.ts.map +1 -1
  95. package/lib/shared/components/palette/address/write-address-field.component.d.ts.map +1 -1
  96. package/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.d.ts.map +1 -1
  97. package/lib/shared/components/palette/case-flag/enums/index.d.ts.map +1 -1
  98. package/lib/shared/components/palette/collection/collection-create-checker.service.d.ts.map +1 -1
  99. package/lib/shared/components/palette/complex/read-complex-field-collection-table.component.d.ts +1 -1
  100. package/lib/shared/components/palette/complex/read-complex-field-collection-table.component.d.ts.map +1 -1
  101. package/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-from-table.component.d.ts.map +1 -1
  102. package/lib/shared/components/palette/linked-cases/domain/linked-cases.model.d.ts.map +1 -1
  103. package/lib/shared/components/palette/linked-cases/read-linked-cases-field.component.d.ts.map +1 -1
  104. package/lib/shared/components/palette/linked-cases/services/linked-cases.service.d.ts.map +1 -1
  105. package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts.map +1 -1
  106. package/lib/shared/components/palette/order-summary/fee.model.d.ts.map +1 -1
  107. package/lib/shared/components/palette/order-summary/order-summary.model.d.ts.map +1 -1
  108. package/lib/shared/components/palette/palette.module.d.ts.map +1 -1
  109. package/lib/shared/components/palette/text-area/write-text-area-field.component.d.ts.map +1 -1
  110. package/lib/shared/components/palette/utils/date.pipe.d.ts.map +1 -1
  111. package/lib/shared/components/workbasket-filters/workbasket-filters.component.d.ts.map +1 -1
  112. package/lib/shared/directives/conditional-show/domain/conditional-show.model.d.ts.map +1 -1
  113. package/lib/shared/directives/conditional-show/services/condition-parser.service.d.ts.map +1 -1
  114. package/lib/shared/domain/case-view/case-view.model.d.ts.map +1 -1
  115. package/lib/shared/domain/case-view/role-assignment-response.model.d.ts +2 -1
  116. package/lib/shared/domain/case-view/role-assignment-response.model.d.ts.map +1 -1
  117. package/lib/shared/domain/case-view/role-request.model.d.ts.map +1 -1
  118. package/lib/shared/domain/organisation/organisation-converter.d.ts.map +1 -1
  119. package/lib/shared/domain/user/user-info.model.d.ts.map +1 -1
  120. package/lib/shared/fixture/case-field-builder.d.ts +6 -6
  121. package/lib/shared/fixture/case-field-builder.d.ts.map +1 -1
  122. package/lib/shared/fixture/shared.test.fixture.d.ts +6 -6
  123. package/lib/shared/fixture/shared.test.fixture.d.ts.map +1 -1
  124. package/lib/shared/pipes/complex/{ccd-page-fields.pipe.d.ts → cdd-page-fields.pipe.d.ts} +1 -1
  125. package/lib/shared/pipes/complex/cdd-page-fields.pipe.d.ts.map +1 -0
  126. package/lib/shared/pipes/complex/index.d.ts +1 -1
  127. package/lib/shared/pipes/index.d.ts +1 -0
  128. package/lib/shared/pipes/index.d.ts.map +1 -1
  129. package/lib/shared/pipes/pipes.module.d.ts +1 -1
  130. package/lib/shared/services/activity/activity.polling.service.d.ts.map +1 -1
  131. package/lib/shared/services/activity/activity.service.d.ts.map +1 -1
  132. package/lib/shared/services/addresses/address-parser.d.ts.map +1 -1
  133. package/lib/shared/services/common-data-service/common-data-service.d.ts.map +1 -1
  134. package/lib/shared/services/definitions/definitions.service.d.ts.map +1 -1
  135. package/lib/shared/services/fields/fields.purger.d.ts.map +1 -1
  136. package/lib/shared/services/fields/fields.utils.d.ts +1 -0
  137. package/lib/shared/services/fields/fields.utils.d.ts.map +1 -1
  138. package/lib/shared/services/loading/loading.service.d.ts +4 -1
  139. package/lib/shared/services/loading/loading.service.d.ts.map +1 -1
  140. package/lib/shared/services/search/search.service.d.ts +2 -0
  141. package/lib/shared/services/search/search.service.d.ts.map +1 -1
  142. package/lib/shared/services/search-result/sorting/search-result-view-item-comparator-factory.d.ts.map +1 -1
  143. package/lib/shared/services/window/window.service.d.ts.map +1 -1
  144. package/package.json +2 -2
  145. package/lib/shared/pipes/complex/ccd-page-fields.pipe.d.ts.map +0 -1
@@ -1036,22 +1036,22 @@
1036
1036
  }
1037
1037
  };
1038
1038
  DateInputComponent.prototype.dayId = function () {
1039
- return this.id + "-day";
1039
+ return this.id + '-day';
1040
1040
  };
1041
1041
  DateInputComponent.prototype.monthId = function () {
1042
- return this.id + "-month";
1042
+ return this.id + '-month';
1043
1043
  };
1044
1044
  DateInputComponent.prototype.yearId = function () {
1045
- return this.id + "-year";
1045
+ return this.id + '-year';
1046
1046
  };
1047
1047
  DateInputComponent.prototype.hourId = function () {
1048
- return this.id + "-hour";
1048
+ return this.id + '-hour';
1049
1049
  };
1050
1050
  DateInputComponent.prototype.minuteId = function () {
1051
- return this.id + "-minute";
1051
+ return this.id + '-minute';
1052
1052
  };
1053
1053
  DateInputComponent.prototype.secondId = function () {
1054
- return this.id + "-second";
1054
+ return this.id + '-second';
1055
1055
  };
1056
1056
  DateInputComponent.prototype.viewValue = function () {
1057
1057
  if (this.day || this.month || this.year || this.hour || this.minute || this.second) {
@@ -1066,7 +1066,7 @@
1066
1066
  this.minute ? this.pad(this.minute) : '',
1067
1067
  this.second ? this.pad(this.second) : ''
1068
1068
  ].join(':');
1069
- return date + "T" + time + ".000";
1069
+ return date + 'T' + time + '.000';
1070
1070
  }
1071
1071
  else {
1072
1072
  return date;
@@ -2131,7 +2131,7 @@
2131
2131
  });
2132
2132
  ActivityService.handleHttpError = function (response) {
2133
2133
  var error = HttpErrorService.convertToHttpError(response);
2134
- if ((response === null || response === void 0 ? void 0 : response.status) !== error.status) {
2134
+ if (response.status && response.status !== error.status) {
2135
2135
  error.status = response.status;
2136
2136
  }
2137
2137
  return error;
@@ -2139,11 +2139,12 @@
2139
2139
  ActivityService.prototype.getOptions = function () {
2140
2140
  var userDetails = JSON.parse(this.sessionStorageService.getItem('userDetails'));
2141
2141
  var headers = new i1$2.HttpHeaders().set('Content-Type', 'application/json').set('Authorization', userDetails.token);
2142
- return {
2142
+ var options = {
2143
2143
  headers: headers,
2144
2144
  withCredentials: true,
2145
2145
  observe: 'body',
2146
2146
  };
2147
+ return options;
2147
2148
  };
2148
2149
  ActivityService.prototype.getActivities = function () {
2149
2150
  var caseId = [];
@@ -2152,33 +2153,41 @@
2152
2153
  }
2153
2154
  try {
2154
2155
  var options = this.getOptions();
2155
- var url = this.activityUrl() + "/cases/" + caseId.join(',') + "/activity";
2156
+ var url = this.activityUrl() + ("/cases/" + caseId.join(',') + "/activity");
2156
2157
  return this.http
2157
2158
  .get(url, options, false, ActivityService.handleHttpError)
2158
2159
  .pipe(operators.map(function (response) { return response; }));
2159
2160
  }
2160
2161
  catch (error) {
2161
- console.log("user may not be authenticated." + error);
2162
+ console.log('user may not be authenticated.' + error);
2162
2163
  }
2163
2164
  };
2164
2165
  ActivityService.prototype.postActivity = function (caseId, activity) {
2165
2166
  try {
2166
2167
  var options = this.getOptions();
2167
- var url = this.activityUrl() + "/cases/" + caseId + "/activity";
2168
+ var url = this.activityUrl() + ("/cases/" + caseId + "/activity");
2168
2169
  var body = { activity: activity };
2169
2170
  return this.http
2170
2171
  .post(url, body, options, false)
2171
2172
  .pipe(operators.map(function (response) { return response; }));
2172
2173
  }
2173
2174
  catch (error) {
2174
- console.log("user may not be authenticated." + error);
2175
+ console.log('user may not be authenticated.' + error);
2175
2176
  }
2176
2177
  };
2177
2178
  ActivityService.prototype.verifyUserIsAuthorized = function () {
2178
2179
  var _this = this;
2179
- if (this.sessionStorageService.getItem('userDetails') && this.activityUrl() && this.userAuthorised === undefined) {
2180
+ if (this.sessionStorageService.getItem('userDetails') === undefined) {
2181
+ return;
2182
+ }
2183
+ if (this.activityUrl() && this.userAuthorised === undefined) {
2180
2184
  this.getActivities(ActivityService.DUMMY_CASE_REFERENCE).subscribe(function () { return _this.userAuthorised = true; }, function (error) {
2181
- _this.userAuthorised = [401, 403].indexOf(error.status) <= -1;
2185
+ if ([401, 403].indexOf(error.status) > -1) {
2186
+ _this.userAuthorised = false;
2187
+ }
2188
+ else {
2189
+ _this.userAuthorised = true;
2190
+ }
2182
2191
  });
2183
2192
  }
2184
2193
  };
@@ -2291,7 +2300,7 @@
2291
2300
  requests.get(activity.caseId).next(activity);
2292
2301
  });
2293
2302
  }, function (err) {
2294
- console.log("error: " + err);
2303
+ console.log('error: ' + err);
2295
2304
  Array.from(requests.values()).forEach(function (subject) { return subject.error(err); });
2296
2305
  }); });
2297
2306
  });
@@ -2431,9 +2440,9 @@
2431
2440
  };
2432
2441
  ActivityComponent.prototype.generateDescription = function (prefix, suffix, namesArray, unknownCount) {
2433
2442
  var resultText = prefix;
2434
- resultText += namesArray.map(function (activityInfo) { return activityInfo.forename + " " + activityInfo.surname; }).join(', ');
2443
+ resultText += namesArray.map(function (activityInfo) { return activityInfo.forename + ' ' + activityInfo.surname; }).join(', ');
2435
2444
  if (unknownCount > 0) {
2436
- resultText += (namesArray.length > 0 ? " and " + unknownCount + " other" : unknownCount + " user");
2445
+ resultText += (namesArray.length > 0 ? ' and ' + unknownCount + ' other' : unknownCount + ' user');
2437
2446
  resultText += (unknownCount > 1 ? 's' : '');
2438
2447
  }
2439
2448
  else {
@@ -2441,10 +2450,10 @@
2441
2450
  }
2442
2451
  if (suffix.length > 0) {
2443
2452
  if (namesArray.length + unknownCount > 1) {
2444
- resultText += " are " + suffix;
2453
+ resultText += ' are ' + suffix;
2445
2454
  }
2446
2455
  else {
2447
- resultText += " is " + suffix;
2456
+ resultText += ' is ' + suffix;
2448
2457
  }
2449
2458
  }
2450
2459
  return resultText;
@@ -2783,7 +2792,7 @@
2783
2792
  break;
2784
2793
  case 'n':
2785
2794
  case 'N':
2786
- maybePush(result, "***" + c + "***", inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
2795
+ maybePush(result, '***' + c + '***', inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
2787
2796
  break;
2788
2797
  case 'V':
2789
2798
  case 'O':
@@ -2917,9 +2926,9 @@
2917
2926
  resultDate = offsetDate.getDate() + " " + DatePipe.MONTHS[offsetDate.getMonth()] + " " + offsetDate.getFullYear();
2918
2927
  if (match[4] && match[5] && match[6] && format !== 'short') {
2919
2928
  resultDate += ', ';
2920
- resultDate += this.getHour(offsetDate.getHours().toString()) + ":";
2921
- resultDate += this.pad(offsetDate.getMinutes()) + ":";
2922
- resultDate += this.pad(offsetDate.getSeconds()) + " ";
2929
+ resultDate += this.getHour(offsetDate.getHours().toString()) + ':';
2930
+ resultDate += this.pad(offsetDate.getMinutes()) + ':';
2931
+ resultDate += this.pad(offsetDate.getSeconds()) + ' ';
2923
2932
  resultDate += (this.toInt(offsetDate.getHours().toString()) >= 12) ? 'PM' : 'AM';
2924
2933
  }
2925
2934
  }
@@ -3735,25 +3744,25 @@
3735
3744
  OrganisationConverter.toSimpleAddress = function (organisationModel) {
3736
3745
  var simpleAddress = '';
3737
3746
  if (organisationModel.addressLine1) {
3738
- simpleAddress += organisationModel.addressLine1 + "<br>";
3747
+ simpleAddress += organisationModel.addressLine1 + '<br>';
3739
3748
  }
3740
3749
  if (organisationModel.addressLine2) {
3741
- simpleAddress += organisationModel.addressLine2 + "<br>";
3750
+ simpleAddress += organisationModel.addressLine2 + '<br>';
3742
3751
  }
3743
3752
  if (organisationModel.addressLine3) {
3744
- simpleAddress += organisationModel.addressLine3 + "<br>";
3753
+ simpleAddress += organisationModel.addressLine3 + '<br>';
3745
3754
  }
3746
3755
  if (organisationModel.townCity) {
3747
- simpleAddress += organisationModel.townCity + "<br>";
3756
+ simpleAddress += organisationModel.townCity + '<br>';
3748
3757
  }
3749
3758
  if (organisationModel.county) {
3750
- simpleAddress += organisationModel.county + "<br>";
3759
+ simpleAddress += organisationModel.county + '<br>';
3751
3760
  }
3752
3761
  if (organisationModel.country) {
3753
- simpleAddress += organisationModel.country + "<br>";
3762
+ simpleAddress += organisationModel.country + '<br>';
3754
3763
  }
3755
3764
  if (organisationModel.postCode) {
3756
- simpleAddress += organisationModel.postCode + "<br>";
3765
+ simpleAddress += organisationModel.postCode + '<br>';
3757
3766
  }
3758
3767
  return simpleAddress;
3759
3768
  };
@@ -3932,9 +3941,9 @@
3932
3941
  });
3933
3942
  return valueMap;
3934
3943
  };
3935
- // public static getType(elem: any): string {
3936
- // return Object.prototype.toString.call(elem).slice(8, -1);
3937
- // }
3944
+ FieldsUtils.getType = function (elem) {
3945
+ return Object.prototype.toString.call(elem).slice(8, -1);
3946
+ };
3938
3947
  FieldsUtils.isObject = function (elem) {
3939
3948
  return typeof elem === 'object' && elem !== null;
3940
3949
  };
@@ -4492,6 +4501,7 @@
4492
4501
  if (!condition) {
4493
4502
  return null;
4494
4503
  }
4504
+ ;
4495
4505
  condition = condition.replace(/CONTAINS/g, ' CONTAINS');
4496
4506
  return peg.parse(condition.trim(), {});
4497
4507
  };
@@ -4505,12 +4515,14 @@
4505
4515
  if (!conditions || conditions.length === 0) {
4506
4516
  return true;
4507
4517
  }
4518
+ ;
4508
4519
  var validJoinComparators = ['AND', 'OR'];
4509
- return conditions.reduce(function (accumulator, condition, index) {
4520
+ var result = conditions.reduce(function (accumulator, condition, index) {
4510
4521
  var isJoinComparator = function (comparator) { return (typeof comparator === 'string' && validJoinComparators.indexOf(comparator) !== -1); };
4511
4522
  if (isJoinComparator(condition)) {
4512
4523
  return accumulator;
4513
4524
  }
4525
+ ;
4514
4526
  var currentConditionResult = true;
4515
4527
  if (Array.isArray(condition)) {
4516
4528
  currentConditionResult = _this.evaluate(fields, condition);
@@ -4527,6 +4539,7 @@
4527
4539
  }
4528
4540
  return currentConditionResult;
4529
4541
  }, true);
4542
+ return result;
4530
4543
  };
4531
4544
  ConditionParser.evaluateJoin = function (leftResult, comparator, rightResult) {
4532
4545
  switch (comparator) {
@@ -4733,8 +4746,8 @@
4733
4746
  if (originalCondition.indexOf(condition.fieldReference) > -1) {
4734
4747
  if (this.processedList && this.processedList.indexOf(condition.fieldReference) === -1) {
4735
4748
  this.processedList.push(condition.fieldReference);
4736
- var regularExp = new RegExp("(\\b)" + condition.fieldReference + "(?=[^\"]*(?:\"[^\"]*\"[^\"]*)*$)(\\b)", 'g');
4737
- return originalCondition.replace(regularExp, pathPrefix + "." + condition.fieldReference);
4749
+ var regularExp = new RegExp('(\\b)' + condition.fieldReference + '(?=[^"]*(?:"[^"]*"[^"]*)*$)(\\b)', 'g');
4750
+ return originalCondition.replace(regularExp, pathPrefix + '.' + condition.fieldReference);
4738
4751
  }
4739
4752
  else {
4740
4753
  return originalCondition;
@@ -5303,14 +5316,14 @@
5303
5316
  var formFields = form.getRawValue();
5304
5317
  var currentPage = wizard.getPage(currentPageId, this.fieldsUtils.buildCanShowPredicate(eventTrigger, form));
5305
5318
  currentPage.wizard_page_fields.forEach(function (wpf) {
5306
- var caseField = _this.findCaseFieldByWizardPageFieldId(currentPage, wpf);
5307
- if (_this.hasShowConditionField(caseField, formFields)) {
5308
- var condition = new ShowCondition(caseField.show_condition);
5309
- if (_this.isHidden(condition, formFields.data) && !(_this.isReadonly(caseField))) {
5310
- _this.resetField(form, caseField);
5319
+ var case_field = _this.findCaseFieldByWizardPageFieldId(currentPage, wpf);
5320
+ if (_this.hasShowConditionField(case_field, formFields)) {
5321
+ var condition = new ShowCondition(case_field.show_condition);
5322
+ if (_this.isHidden(condition, formFields.data) && !(_this.isReadonly(case_field))) {
5323
+ _this.resetField(form, case_field);
5311
5324
  }
5312
5325
  }
5313
- _this.retainHiddenValueByFieldType(caseField, form);
5326
+ _this.retainHiddenValueByFieldType(case_field, form);
5314
5327
  });
5315
5328
  };
5316
5329
  FieldsPurger.prototype.retainHiddenValueByFieldType = function (field, form) {
@@ -5341,13 +5354,13 @@
5341
5354
  FieldsPurger.prototype.hasShowConditionPage = function (wizardPage, formFields) {
5342
5355
  return wizardPage.show_condition && formFields[this.getShowConditionKey(wizardPage.show_condition)];
5343
5356
  };
5344
- FieldsPurger.prototype.hasShowConditionField = function (caseField, formFields) {
5345
- return caseField.show_condition && formFields.data[this.getShowConditionKey(caseField.show_condition)];
5357
+ FieldsPurger.prototype.hasShowConditionField = function (case_field, formFields) {
5358
+ return case_field.show_condition && formFields.data[this.getShowConditionKey(case_field.show_condition)];
5346
5359
  };
5347
- FieldsPurger.prototype.getShowConditionKey = function (showCondition) {
5360
+ FieldsPurger.prototype.getShowConditionKey = function (show_condition) {
5348
5361
  // Need to allow for negated conditions, i.e. !=, as well as regular ones (=)
5349
5362
  // Also need to allow for conditions specified using the "CONTAINS" keyword
5350
- return showCondition.split(/!=|=|CONTAINS/)[0];
5363
+ return show_condition.split(/!=|=|CONTAINS/)[0];
5351
5364
  };
5352
5365
  FieldsPurger.prototype.resetField = function (form, field) {
5353
5366
  var e_1, _a;
@@ -5443,8 +5456,8 @@
5443
5456
  FieldsPurger.prototype.resetPage = function (form, wizardPage) {
5444
5457
  var _this = this;
5445
5458
  wizardPage.wizard_page_fields.forEach(function (wpf) {
5446
- var caseField = _this.findCaseFieldByWizardPageFieldId(wizardPage, wpf);
5447
- _this.resetField(form, caseField);
5459
+ var case_field = _this.findCaseFieldByWizardPageFieldId(wizardPage, wpf);
5460
+ _this.resetField(form, case_field);
5448
5461
  });
5449
5462
  };
5450
5463
  FieldsPurger.prototype.getType = function (elem) {
@@ -5454,8 +5467,8 @@
5454
5467
  return this.getType(elem) === 'Object';
5455
5468
  };
5456
5469
  // TODO: call isReadOnly on CaseFields once we make it available
5457
- FieldsPurger.prototype.isReadonly = function (caseField) {
5458
- return caseField.display_context.toUpperCase() === 'READONLY';
5470
+ FieldsPurger.prototype.isReadonly = function (case_field) {
5471
+ return case_field.display_context.toUpperCase() === 'READONLY';
5459
5472
  };
5460
5473
  /**
5461
5474
  * Deletes a field value by setting the value of the corresponding {@link FormControl} to null (or an empty array
@@ -6350,6 +6363,7 @@
6350
6363
  });
6351
6364
  }
6352
6365
  }
6366
+ ;
6353
6367
  });
6354
6368
  }
6355
6369
  };
@@ -6788,7 +6802,7 @@
6788
6802
  return addressModel;
6789
6803
  };
6790
6804
  AddressParser.prototype.parseAddressLine1 = function (classification, address) {
6791
- var addressLine;
6805
+ var addressLine = '';
6792
6806
  if (classification === AddressType.RD06) {
6793
6807
  addressLine =
6794
6808
  address.SUB_BUILDING_NAME + " " + address.ORGANISATION_NAME + " " + address.DEPARTMENT_NAME + " " + address.PO_BOX_NUMBER;
@@ -6801,7 +6815,7 @@
6801
6815
  return this.removeNonAddressValues(addressLine);
6802
6816
  };
6803
6817
  AddressParser.prototype.parseAddressLine2 = function (classification, address) {
6804
- var addressLine;
6818
+ var addressLine = '';
6805
6819
  if (classification === AddressType.RD06) {
6806
6820
  addressLine = address.BUILDING_NAME + " ";
6807
6821
  }
@@ -6812,7 +6826,7 @@
6812
6826
  return this.removeNonAddressValues(addressLine);
6813
6827
  };
6814
6828
  AddressParser.prototype.parseAddressLine3 = function (classification, address) {
6815
- var addressLine;
6829
+ var addressLine = '';
6816
6830
  if (classification === AddressType.RD06) {
6817
6831
  addressLine =
6818
6832
  address.BUILDING_NUMBER + " " + address.THOROUGHFARE_NAME;
@@ -6840,7 +6854,7 @@
6840
6854
  return value.replace(new RegExp('^,', 'gi'), '');
6841
6855
  };
6842
6856
  AddressParser.prototype.prefixWithCommaIfPresent = function (value) {
6843
- return value ? ", " + value : value;
6857
+ return value ? ', ' + value : value;
6844
6858
  };
6845
6859
  return AddressParser;
6846
6860
  }());
@@ -7090,7 +7104,7 @@
7090
7104
  if (flagType) {
7091
7105
  url += "?flag-type=" + flagType;
7092
7106
  }
7093
- if (typeof welshRequired === 'boolean') {
7107
+ if (welshRequired != null) {
7094
7108
  // Check if flag-type has been added to the query string; if so, append welsh-required with '&'
7095
7109
  url.indexOf('?') > -1 ? url += '&' : url += '?';
7096
7110
  welshRequired ? url += 'welsh-required=Y' : url += 'welsh-required=N';
@@ -7696,6 +7710,18 @@
7696
7710
  }], null, null);
7697
7711
  })();
7698
7712
 
7713
+ var HasLoadingState = /** @class */ (function () {
7714
+ function HasLoadingState() {
7715
+ }
7716
+ Object.defineProperty(HasLoadingState.prototype, "isLoading", {
7717
+ get: function () {
7718
+ return;
7719
+ },
7720
+ enumerable: false,
7721
+ configurable: true
7722
+ });
7723
+ return HasLoadingState;
7724
+ }());
7699
7725
  var LoadingService = /** @class */ (function () {
7700
7726
  function LoadingService() {
7701
7727
  this.registered = new Map();
@@ -7720,7 +7746,7 @@
7720
7746
  };
7721
7747
  LoadingService.prototype.generateToken = function () {
7722
7748
  var timestamp = window.performance.now();
7723
- return "toolkit-loading-" + timestamp; // format: [source-library]-[unique incrementing number]
7749
+ return 'toolkit-loading-' + timestamp; // format: [source-library]-[unique incrementing number]
7724
7750
  };
7725
7751
  return LoadingService;
7726
7752
  }());
@@ -7741,7 +7767,10 @@
7741
7767
  }
7742
7768
  SearchService.prototype.search = function (jurisdictionId, caseTypeId, metaCriteria, caseCriteria, view) {
7743
7769
  var _this = this;
7744
- var url = this.appConfig.getApiUrl() + "/caseworkers/:uid/jurisdictions/" + jurisdictionId + "/case-types/" + caseTypeId + "/cases";
7770
+ var url = this.appConfig.getApiUrl() + "/caseworkers/:uid"
7771
+ + ("/jurisdictions/" + jurisdictionId)
7772
+ + ("/case-types/" + caseTypeId)
7773
+ + "/cases";
7745
7774
  var options = this.requestOptionsBuilder.buildOptions(metaCriteria, caseCriteria, view);
7746
7775
  var loadingToken = this.loadingService.register();
7747
7776
  return this.httpService
@@ -7750,14 +7779,15 @@
7750
7779
  };
7751
7780
  SearchService.prototype.searchCasesByIds = function (caseTypeId, filter, view, sort) {
7752
7781
  var _this = this;
7753
- var url = this.appConfig.getCaseDataUrl() + "/internal/searchCases?ctid=" + caseTypeId + "&use_case=" + view;
7782
+ var url = this.appConfig.getCaseDataUrl() +
7783
+ ("/internal/searchCases?ctid=" + caseTypeId + "&use_case=" + view);
7754
7784
  var body = Object.assign(Object.assign({ sort: sort }, filter), { size: this.appConfig.getPaginationPageSize() });
7755
7785
  var loadingToken = this.loadingService.register();
7756
7786
  return this.httpService.post(url, body).pipe(operators.map(function (response) { return response; }), operators.finalize(function () { return _this.loadingService.unregister(loadingToken); }));
7757
7787
  };
7758
7788
  SearchService.prototype.searchCases = function (caseTypeId, metaCriteria, caseCriteria, view, sort) {
7759
7789
  var _this = this;
7760
- var url = this.appConfig.getCaseDataUrl() + "/internal/searchCases?ctid=" + caseTypeId + "&use_case=" + view;
7790
+ var url = this.appConfig.getCaseDataUrl() + ("/internal/searchCases?ctid=" + caseTypeId + "&use_case=" + view);
7761
7791
  var options = this.requestOptionsBuilder.buildOptions(metaCriteria, caseCriteria, view);
7762
7792
  var body = {
7763
7793
  sort: sort,
@@ -7802,8 +7832,9 @@
7802
7832
  return SearchService;
7803
7833
  }());
7804
7834
  SearchService.V2_MEDIATYPE_SEARCH_INPUTS = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-search-input-details.v2+json;charset=UTF-8';
7805
- // public static readonly VIEW_SEARCH = 'SEARCH';
7835
+ SearchService.VIEW_SEARCH = 'SEARCH';
7806
7836
  SearchService.VIEW_WORKBASKET = 'WORKBASKET';
7837
+ SearchService.FIELD_PREFIX = 'case.';
7807
7838
  SearchService.ɵfac = function SearchService_Factory(t) { return new (t || SearchService)(i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(RequestOptionsBuilder), i0__namespace.ɵɵinject(LoadingService)); };
7808
7839
  SearchService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: SearchService, factory: SearchService.ɵfac });
7809
7840
  (function () {
@@ -7933,12 +7964,17 @@
7933
7964
  this.appConfig = appConfig;
7934
7965
  }
7935
7966
  DefinitionsService.prototype.getCaseTypes = function (jurisdictionId, access) {
7936
- var url = this.appConfig.getApiUrl() + "/caseworkers/:uid/jurisdictions/" + jurisdictionId + "/case-types?access=" + access;
7967
+ var url = this.appConfig.getApiUrl()
7968
+ + "/caseworkers/:uid"
7969
+ + ("/jurisdictions/" + jurisdictionId)
7970
+ + ("/case-types?access=" + access);
7937
7971
  return this.http
7938
7972
  .get(url).pipe(operators.map(function (response) { return response; }));
7939
7973
  };
7940
7974
  DefinitionsService.prototype.getJurisdictions = function (access) {
7941
- var url = this.appConfig.getApiUrl() + "/caseworkers/:uid/jurisdictions?access=" + access;
7975
+ var url = this.appConfig.getApiUrl()
7976
+ + "/caseworkers/:uid"
7977
+ + ("/jurisdictions?access=" + access);
7942
7978
  return this.http
7943
7979
  .get(url)
7944
7980
  .pipe(operators.map(function (response) { return response; }));
@@ -8020,8 +8056,8 @@
8020
8056
  compare: function (a, b) {
8021
8057
  var fieldA = a.case_fields[fieldId];
8022
8058
  var fieldB = b.case_fields[fieldId];
8023
- fieldA = util.isUndefined(fieldA) || fieldA === null ? '' : fieldA.toLowerCase();
8024
- fieldB = util.isUndefined(fieldB) || fieldB === null ? '' : fieldB.toLowerCase();
8059
+ fieldA = util.isUndefined(fieldA) || fieldA == null ? '' : fieldA.toLowerCase();
8060
+ fieldB = util.isUndefined(fieldB) || fieldB == null ? '' : fieldB.toLowerCase();
8025
8061
  return fieldA === fieldB ? 0 : fieldA > fieldB ? 1 : -1;
8026
8062
  }
8027
8063
  };
@@ -8031,8 +8067,8 @@
8031
8067
  compare: function (a, b) {
8032
8068
  var fieldA = a.case_fields[fieldId];
8033
8069
  var fieldB = b.case_fields[fieldId];
8034
- fieldA = util.isUndefined(fieldA) || fieldA === null ? '' : fieldA.join().toLowerCase();
8035
- fieldB = util.isUndefined(fieldB) || fieldB === null ? '' : fieldB.join().toLowerCase();
8070
+ fieldA = util.isUndefined(fieldA) || fieldA == null ? '' : fieldA.join().toLowerCase();
8071
+ fieldB = util.isUndefined(fieldB) || fieldB == null ? '' : fieldB.join().toLowerCase();
8036
8072
  return fieldA === fieldB ? 0 : fieldA > fieldB ? 1 : -1;
8037
8073
  }
8038
8074
  };
@@ -8328,7 +8364,7 @@
8328
8364
  });
8329
8365
  };
8330
8366
  WizardPageFieldToCaseFieldMapper.prototype.preparePathPrefix = function (pathPrefix, caseField) {
8331
- return pathPrefix.length === 0 ? caseField : pathPrefix + "." + caseField;
8367
+ return pathPrefix.length === 0 ? caseField : pathPrefix + '.' + caseField;
8332
8368
  };
8333
8369
  WizardPageFieldToCaseFieldMapper.prototype.getCaseFieldLeaf = function (caseFieldId, caseFields) {
8334
8370
  var _a = __read(caseFieldId), head = _a[0], tail = _a.slice(1);
@@ -8385,13 +8421,223 @@
8385
8421
  }], null, null);
8386
8422
  })();
8387
8423
 
8424
+ var MULTIPLE_TASKS_FOUND = 'More than one task found!';
8425
+ var WorkAllocationService = /** @class */ (function () {
8426
+ function WorkAllocationService(http, appConfig, errorService, alertService, sessionStorageService) {
8427
+ this.http = http;
8428
+ this.appConfig = appConfig;
8429
+ this.errorService = errorService;
8430
+ this.alertService = alertService;
8431
+ this.sessionStorageService = sessionStorageService;
8432
+ // Check to see if work allocation is enabled
8433
+ }
8434
+ /**
8435
+ * Call the API to get tasks matching the search criteria.
8436
+ * @param searchRequest The search parameters that specify which tasks to match.
8437
+ */
8438
+ WorkAllocationService.prototype.searchTasks = function (searchRequest) {
8439
+ var _this = this;
8440
+ // Do not need to check if WA enabled as parent method will do that
8441
+ var url = this.appConfig.getWorkAllocationApiUrl() + "/searchForCompletable";
8442
+ return this.http
8443
+ .post(url, { searchRequest: searchRequest }, null, false)
8444
+ .pipe(operators.map(function (response) { return response; }), operators.catchError(function (error) {
8445
+ _this.errorService.setError(error);
8446
+ // explicitly eat away 401 error and 400 error
8447
+ if (error && error.status && (error.status === 401 || error.status === 400)) {
8448
+ // do nothing
8449
+ console.log('error status 401 or 400', error);
8450
+ }
8451
+ else {
8452
+ return rxjs.throwError(error);
8453
+ }
8454
+ }));
8455
+ };
8456
+ WorkAllocationService.prototype.isWAEnabled = function (jurisdiction, caseType) {
8457
+ this.features = this.appConfig.getWAServiceConfig();
8458
+ var enabled = false;
8459
+ if (!jurisdiction || !caseType) {
8460
+ var caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo'));
8461
+ jurisdiction = caseInfo.jurisdiction;
8462
+ caseType = caseInfo.caseType;
8463
+ }
8464
+ if (!this.features || !this.features.configurations) {
8465
+ return false;
8466
+ }
8467
+ this.features.configurations.forEach(function (serviceConfig) {
8468
+ if (serviceConfig.serviceName === jurisdiction && (serviceConfig.caseTypes.indexOf(caseType) !== -1)) {
8469
+ enabled = true;
8470
+ }
8471
+ });
8472
+ return enabled;
8473
+ };
8474
+ /**
8475
+ * Call the API to assign a task.
8476
+ * @param taskId specifies which task should be assigned.
8477
+ * @param userId specifies the user the task should be assigned to.
8478
+ */
8479
+ WorkAllocationService.prototype.assignTask = function (taskId, userId) {
8480
+ var _this = this;
8481
+ if (!this.isWAEnabled()) {
8482
+ return rxjs.of(null);
8483
+ }
8484
+ var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/assign";
8485
+ return this.http
8486
+ .post(url, { userId: userId })
8487
+ .pipe(operators.catchError(function (error) {
8488
+ _this.errorService.setError(error);
8489
+ return rxjs.throwError(error);
8490
+ }));
8491
+ };
8492
+ /**
8493
+ * Call the API to complete a task.
8494
+ * @param taskId specifies which task should be completed.
8495
+ */
8496
+ WorkAllocationService.prototype.completeTask = function (taskId) {
8497
+ var _this = this;
8498
+ if (!this.isWAEnabled()) {
8499
+ return rxjs.of(null);
8500
+ }
8501
+ var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
8502
+ return this.http
8503
+ .post(url, {})
8504
+ .pipe(operators.catchError(function (error) {
8505
+ _this.errorService.setError(error);
8506
+ // this will subscribe to get the user details and decide whether to display an error message
8507
+ _this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
8508
+ _this.handleTaskCompletionError(response);
8509
+ });
8510
+ return rxjs.throwError(error);
8511
+ }));
8512
+ };
8513
+ /**
8514
+ * Call the API to assign and complete a task.
8515
+ * @param taskId specifies which task should be completed.
8516
+ */
8517
+ WorkAllocationService.prototype.assignAndCompleteTask = function (taskId) {
8518
+ var _this = this;
8519
+ if (!this.isWAEnabled()) {
8520
+ return rxjs.of(null);
8521
+ }
8522
+ var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
8523
+ return this.http
8524
+ .post(url, {
8525
+ completion_options: {
8526
+ assign_and_complete: true
8527
+ }
8528
+ })
8529
+ .pipe(operators.catchError(function (error) {
8530
+ _this.errorService.setError(error);
8531
+ // this will subscribe to get the user details and decide whether to display an error message
8532
+ _this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
8533
+ _this.handleTaskCompletionError(response);
8534
+ });
8535
+ return rxjs.throwError(error);
8536
+ }));
8537
+ };
8538
+ /**
8539
+ * Handles the response from the observable to get the user details when task is completed.
8540
+ * @param response is the response given from the observable which contains the user detaild.
8541
+ */
8542
+ WorkAllocationService.prototype.handleTaskCompletionError = function (response) {
8543
+ var userDetails = response;
8544
+ if (this.userIsCaseworker(userDetails.userInfo.roles)) {
8545
+ // when submitting the completion of task if not yet rendered cases/case confirm then preserve the alert for re-rendering
8546
+ this.alertService.setPreserveAlerts(true, ['cases/case', 'submit']);
8547
+ this.alertService.warning('A task could not be completed successfully. Please complete the task associated with the case manually.');
8548
+ }
8549
+ };
8550
+ /**
8551
+ * Returns true if the user's role is equivalent to a caseworker.
8552
+ * @param roles is the list of roles found from the current user.
8553
+ */
8554
+ WorkAllocationService.prototype.userIsCaseworker = function (roles) {
8555
+ var lowerCaseRoles = roles.map(function (role) { return role.toLowerCase(); });
8556
+ // When/if lib & target permanently change to es2016, replace indexOf with includes
8557
+ return (lowerCaseRoles.indexOf(WorkAllocationService.iACCaseOfficer) !== -1)
8558
+ || (lowerCaseRoles.indexOf(WorkAllocationService.iACAdmOfficer) !== -1);
8559
+ };
8560
+ /**
8561
+ * Look for open tasks for a case and event combination. There are 5 possible scenarios:
8562
+ * 1. No tasks found => Success.
8563
+ * 2. One task found => Mark as done => Success.
8564
+ * 3. One task found => Mark as done throws error => Failure.
8565
+ * 4. More than one task found => Failure.
8566
+ * 5. Search call throws an error => Failure.
8567
+ * @param ccdId The ID of the case to find tasks for.
8568
+ * @param eventId The ID of the event to find tasks for.
8569
+ */
8570
+ WorkAllocationService.prototype.completeAppropriateTask = function (ccdId, eventId, jurisdiction, caseTypeId) {
8571
+ var _this = this;
8572
+ if (!this.isWAEnabled(jurisdiction, caseTypeId)) {
8573
+ return rxjs.of(null);
8574
+ }
8575
+ var taskSearchParameter = {
8576
+ ccdId: ccdId,
8577
+ eventId: eventId,
8578
+ jurisdiction: jurisdiction,
8579
+ caseTypeId: caseTypeId
8580
+ };
8581
+ return this.searchTasks(taskSearchParameter)
8582
+ .pipe(operators.map(function (response) {
8583
+ var tasks = response.tasks;
8584
+ if (tasks && tasks.length > 0) {
8585
+ if (tasks.length === 1) {
8586
+ _this.completeTask(tasks[0].id).subscribe();
8587
+ }
8588
+ else {
8589
+ // This is a problem. Throw an appropriate error.
8590
+ throw new Error(MULTIPLE_TASKS_FOUND);
8591
+ }
8592
+ }
8593
+ return true; // All good. Nothing to see here.
8594
+ }), operators.catchError(function (error) {
8595
+ // Simply rethrow it.
8596
+ return rxjs.throwError(error);
8597
+ }));
8598
+ };
8599
+ /**
8600
+ * Return tasks for case and event.
8601
+ */
8602
+ WorkAllocationService.prototype.getTasksByCaseIdAndEventId = function (eventId, caseId, caseType, jurisdiction) {
8603
+ var defaultPayload = {
8604
+ task_required_for_event: false,
8605
+ tasks: []
8606
+ };
8607
+ if (!this.isWAEnabled()) {
8608
+ return rxjs.of(defaultPayload);
8609
+ }
8610
+ return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/case/tasks/" + caseId + "/event/" + eventId + "/caseType/" + caseType + "/jurisdiction/" + jurisdiction);
8611
+ };
8612
+ /**
8613
+ * Call the API to get a task
8614
+ */
8615
+ WorkAllocationService.prototype.getTask = function (taskId) {
8616
+ if (!this.isWAEnabled()) {
8617
+ return rxjs.of({ task: null });
8618
+ }
8619
+ return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId);
8620
+ };
8621
+ return WorkAllocationService;
8622
+ }());
8623
+ WorkAllocationService.iACCaseOfficer = 'caseworker-ia-caseofficer';
8624
+ WorkAllocationService.iACAdmOfficer = 'caseworker-ia-admofficer';
8625
+ WorkAllocationService.ɵfac = function WorkAllocationService_Factory(t) { return new (t || WorkAllocationService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(AlertService), i0__namespace.ɵɵinject(SessionStorageService)); };
8626
+ WorkAllocationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: WorkAllocationService, factory: WorkAllocationService.ɵfac });
8627
+ (function () {
8628
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(WorkAllocationService, [{
8629
+ type: i0.Injectable
8630
+ }], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }, { type: AlertService }, { type: SessionStorageService }]; }, null);
8631
+ })();
8632
+
8388
8633
  var CasesService = /** @class */ (function () {
8389
- function CasesService(http, appConfig, orderService, errorService, wizardPageFieldToCaseFieldMapper, loadingService, sessionStorageService) {
8634
+ function CasesService(http, appConfig, orderService, errorService, wizardPageFieldToCaseFieldMapper, workAllocationService, loadingService, sessionStorageService) {
8390
8635
  this.http = http;
8391
8636
  this.appConfig = appConfig;
8392
8637
  this.orderService = orderService;
8393
8638
  this.errorService = errorService;
8394
8639
  this.wizardPageFieldToCaseFieldMapper = wizardPageFieldToCaseFieldMapper;
8640
+ this.workAllocationService = workAllocationService;
8395
8641
  this.loadingService = loadingService;
8396
8642
  this.sessionStorageService = sessionStorageService;
8397
8643
  this.get = this.getCaseView;
@@ -8410,7 +8656,11 @@
8410
8656
  };
8411
8657
  CasesService.prototype.getCaseView = function (jurisdictionId, caseTypeId, caseId) {
8412
8658
  var _this = this;
8413
- var url = this.appConfig.getApiUrl() + "/caseworkers/:uid/jurisdictions/" + jurisdictionId + "/case-types/" + caseTypeId + "/cases/" + caseId;
8659
+ var url = this.appConfig.getApiUrl()
8660
+ + "/caseworkers/:uid"
8661
+ + ("/jurisdictions/" + jurisdictionId)
8662
+ + ("/case-types/" + caseTypeId)
8663
+ + ("/cases/" + caseId);
8414
8664
  var loadingToken = this.loadingService.register();
8415
8665
  return this.http
8416
8666
  .get(url)
@@ -8462,7 +8712,7 @@
8462
8712
  CasesService.prototype.createEvent = function (caseDetails, eventData) {
8463
8713
  var _this = this;
8464
8714
  var caseId = caseDetails.case_id;
8465
- var url = this.appConfig.getCaseDataUrl() + "/cases/" + caseId + "/events";
8715
+ var url = this.appConfig.getCaseDataUrl() + ("/cases/" + caseId + "/events");
8466
8716
  var headers = new i1$2.HttpHeaders()
8467
8717
  .set('experimental', 'true')
8468
8718
  .set('Accept', CasesService.V2_MEDIATYPE_CREATE_EVENT)
@@ -8476,8 +8726,9 @@
8476
8726
  };
8477
8727
  CasesService.prototype.validateCase = function (ctid, eventData, pageId) {
8478
8728
  var _this = this;
8479
- var pageIdString = pageId ? "?pageId=" + pageId : '';
8480
- var url = this.appConfig.getCaseDataUrl() + "/case-types/" + ctid + "/validate" + pageIdString;
8729
+ var pageIdString = pageId ? '?pageId=' + pageId : '';
8730
+ var url = this.appConfig.getCaseDataUrl()
8731
+ + ("/case-types/" + ctid + "/validate" + pageIdString);
8481
8732
  var headers = new i1$2.HttpHeaders()
8482
8733
  .set('experimental', 'true')
8483
8734
  .set('Accept', CasesService.V2_MEDIATYPE_CASE_DATA_VALIDATE)
@@ -8495,7 +8746,8 @@
8495
8746
  if (eventData.ignore_warning) {
8496
8747
  ignoreWarning = 'true';
8497
8748
  }
8498
- var url = this.appConfig.getCaseDataUrl() + "/case-types/" + ctid + "/cases?ignore-warning=" + ignoreWarning;
8749
+ var url = this.appConfig.getCaseDataUrl()
8750
+ + ("/case-types/" + ctid + "/cases?ignore-warning=" + ignoreWarning);
8499
8751
  var headers = new i1$2.HttpHeaders()
8500
8752
  .set('experimental', 'true')
8501
8753
  .set('Accept', CasesService.V2_MEDIATYPE_CREATE_CASE)
@@ -8509,7 +8761,9 @@
8509
8761
  };
8510
8762
  CasesService.prototype.getPrintDocuments = function (caseId) {
8511
8763
  var _this = this;
8512
- var url = this.appConfig.getCaseDataUrl() + "/cases/" + caseId + "/documents";
8764
+ var url = this.appConfig.getCaseDataUrl()
8765
+ + ("/cases/" + caseId)
8766
+ + "/documents";
8513
8767
  var headers = new i1$2.HttpHeaders()
8514
8768
  .set('experimental', 'true')
8515
8769
  .set('Accept', CasesService.V2_MEDIATYPE_CASE_DOCUMENTS)
@@ -8618,12 +8872,12 @@
8618
8872
  CasesService.V2_MEDIATYPE_CREATE_EVENT = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-event.v2+json;charset=UTF-8';
8619
8873
  CasesService.V2_MEDIATYPE_CREATE_CASE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-case.v2+json;charset=UTF-8';
8620
8874
  CasesService.PUI_CASE_MANAGER = 'pui-case-manager';
8621
- CasesService.ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(OrderService), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0__namespace.ɵɵinject(LoadingService), i0__namespace.ɵɵinject(SessionStorageService)); };
8875
+ CasesService.ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(OrderService), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0__namespace.ɵɵinject(WorkAllocationService), i0__namespace.ɵɵinject(LoadingService), i0__namespace.ɵɵinject(SessionStorageService)); };
8622
8876
  CasesService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: CasesService, factory: CasesService.ɵfac });
8623
8877
  (function () {
8624
8878
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CasesService, [{
8625
8879
  type: i0.Injectable
8626
- }], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: OrderService }, { type: HttpErrorService }, { type: WizardPageFieldToCaseFieldMapper }, { type: LoadingService }, { type: SessionStorageService }]; }, null);
8880
+ }], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: OrderService }, { type: HttpErrorService }, { type: WizardPageFieldToCaseFieldMapper }, { type: WorkAllocationService }, { type: LoadingService }, { type: SessionStorageService }]; }, null);
8627
8881
  })();
8628
8882
 
8629
8883
  var EventTriggerService = /** @class */ (function () {
@@ -9245,7 +9499,7 @@
9245
9499
  PageValidationService.prototype.isHidden = function (caseField, editForm, path) {
9246
9500
  var formFields = editForm.getRawValue();
9247
9501
  var condition = ShowCondition.getInstance(caseField.show_condition);
9248
- if (path && path.indexOf("_" + caseField.id + "_") === -1) {
9502
+ if (path && path.indexOf('_' + caseField.id + '_') === -1) {
9249
9503
  path = "" + path + caseField.id;
9250
9504
  }
9251
9505
  return !condition.match(formFields.data, path);
@@ -9277,215 +9531,6 @@
9277
9531
  }], function () { return [{ type: CaseFieldService }]; }, null);
9278
9532
  })();
9279
9533
 
9280
- var MULTIPLE_TASKS_FOUND = 'More than one task found!';
9281
- var WorkAllocationService = /** @class */ (function () {
9282
- function WorkAllocationService(http, appConfig, errorService, alertService, sessionStorageService) {
9283
- this.http = http;
9284
- this.appConfig = appConfig;
9285
- this.errorService = errorService;
9286
- this.alertService = alertService;
9287
- this.sessionStorageService = sessionStorageService;
9288
- // Check to see if work allocation is enabled
9289
- }
9290
- /**
9291
- * Call the API to get tasks matching the search criteria.
9292
- * @param searchRequest The search parameters that specify which tasks to match.
9293
- */
9294
- WorkAllocationService.prototype.searchTasks = function (searchRequest) {
9295
- var _this = this;
9296
- // Do not need to check if WA enabled as parent method will do that
9297
- var url = this.appConfig.getWorkAllocationApiUrl() + "/searchForCompletable";
9298
- return this.http
9299
- .post(url, { searchRequest: searchRequest }, null, false)
9300
- .pipe(operators.map(function (response) { return response; }), operators.catchError(function (error) {
9301
- _this.errorService.setError(error);
9302
- // explicitly eat away 401 error and 400 error
9303
- if (error && error.status && (error.status === 401 || error.status === 400)) {
9304
- // do nothing
9305
- console.log('error status 401 or 400', error);
9306
- }
9307
- else {
9308
- return rxjs.throwError(error);
9309
- }
9310
- }));
9311
- };
9312
- WorkAllocationService.prototype.isWAEnabled = function (jurisdiction, caseType) {
9313
- this.features = this.appConfig.getWAServiceConfig();
9314
- var enabled = false;
9315
- if (!jurisdiction || !caseType) {
9316
- var caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo'));
9317
- jurisdiction = caseInfo.jurisdiction;
9318
- caseType = caseInfo.caseType;
9319
- }
9320
- if (!this.features || !this.features.configurations) {
9321
- return false;
9322
- }
9323
- this.features.configurations.forEach(function (serviceConfig) {
9324
- if (serviceConfig.serviceName === jurisdiction && (serviceConfig.caseTypes.indexOf(caseType) !== -1)) {
9325
- enabled = true;
9326
- }
9327
- });
9328
- return enabled;
9329
- };
9330
- /**
9331
- * Call the API to assign a task.
9332
- * @param taskId specifies which task should be assigned.
9333
- * @param userId specifies the user the task should be assigned to.
9334
- */
9335
- WorkAllocationService.prototype.assignTask = function (taskId, userId) {
9336
- var _this = this;
9337
- if (!this.isWAEnabled()) {
9338
- return rxjs.of(null);
9339
- }
9340
- var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/assign";
9341
- return this.http
9342
- .post(url, { userId: userId })
9343
- .pipe(operators.catchError(function (error) {
9344
- _this.errorService.setError(error);
9345
- return rxjs.throwError(error);
9346
- }));
9347
- };
9348
- /**
9349
- * Call the API to complete a task.
9350
- * @param taskId specifies which task should be completed.
9351
- */
9352
- WorkAllocationService.prototype.completeTask = function (taskId) {
9353
- var _this = this;
9354
- if (!this.isWAEnabled()) {
9355
- return rxjs.of(null);
9356
- }
9357
- var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
9358
- return this.http
9359
- .post(url, {})
9360
- .pipe(operators.catchError(function (error) {
9361
- _this.errorService.setError(error);
9362
- // this will subscribe to get the user details and decide whether to display an error message
9363
- _this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
9364
- _this.handleTaskCompletionError(response);
9365
- });
9366
- return rxjs.throwError(error);
9367
- }));
9368
- };
9369
- /**
9370
- * Call the API to assign and complete a task.
9371
- * @param taskId specifies which task should be completed.
9372
- */
9373
- WorkAllocationService.prototype.assignAndCompleteTask = function (taskId) {
9374
- var _this = this;
9375
- if (!this.isWAEnabled()) {
9376
- return rxjs.of(null);
9377
- }
9378
- var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
9379
- return this.http
9380
- .post(url, {
9381
- completion_options: {
9382
- assign_and_complete: true
9383
- }
9384
- })
9385
- .pipe(operators.catchError(function (error) {
9386
- _this.errorService.setError(error);
9387
- // this will subscribe to get the user details and decide whether to display an error message
9388
- _this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
9389
- _this.handleTaskCompletionError(response);
9390
- });
9391
- return rxjs.throwError(error);
9392
- }));
9393
- };
9394
- /**
9395
- * Handles the response from the observable to get the user details when task is completed.
9396
- * @param response is the response given from the observable which contains the user detaild.
9397
- */
9398
- WorkAllocationService.prototype.handleTaskCompletionError = function (response) {
9399
- var userDetails = response;
9400
- if (this.userIsCaseworker(userDetails.userInfo.roles)) {
9401
- // when submitting the completion of task if not yet rendered cases/case confirm then preserve the alert for re-rendering
9402
- this.alertService.setPreserveAlerts(true, ['cases/case', 'submit']);
9403
- this.alertService.warning('A task could not be completed successfully. Please complete the task associated with the case manually.');
9404
- }
9405
- };
9406
- /**
9407
- * Returns true if the user's role is equivalent to a caseworker.
9408
- * @param roles is the list of roles found from the current user.
9409
- */
9410
- WorkAllocationService.prototype.userIsCaseworker = function (roles) {
9411
- var lowerCaseRoles = roles.map(function (role) { return role.toLowerCase(); });
9412
- // When/if lib & target permanently change to es2016, replace indexOf with includes
9413
- return (lowerCaseRoles.indexOf(WorkAllocationService.iACCaseOfficer) !== -1)
9414
- || (lowerCaseRoles.indexOf(WorkAllocationService.iACAdmOfficer) !== -1);
9415
- };
9416
- /**
9417
- * Look for open tasks for a case and event combination. There are 5 possible scenarios:
9418
- * 1. No tasks found => Success.
9419
- * 2. One task found => Mark as done => Success.
9420
- * 3. One task found => Mark as done throws error => Failure.
9421
- * 4. More than one task found => Failure.
9422
- * 5. Search call throws an error => Failure.
9423
- * @param ccdId The ID of the case to find tasks for.
9424
- * @param eventId The ID of the event to find tasks for.
9425
- */
9426
- WorkAllocationService.prototype.completeAppropriateTask = function (ccdId, eventId, jurisdiction, caseTypeId) {
9427
- var _this = this;
9428
- if (!this.isWAEnabled(jurisdiction, caseTypeId)) {
9429
- return rxjs.of(null);
9430
- }
9431
- var taskSearchParameter = {
9432
- ccdId: ccdId,
9433
- eventId: eventId,
9434
- jurisdiction: jurisdiction,
9435
- caseTypeId: caseTypeId
9436
- };
9437
- return this.searchTasks(taskSearchParameter)
9438
- .pipe(operators.map(function (response) {
9439
- var tasks = response.tasks;
9440
- if (tasks && tasks.length > 0) {
9441
- if (tasks.length === 1) {
9442
- _this.completeTask(tasks[0].id).subscribe();
9443
- }
9444
- else {
9445
- // This is a problem. Throw an appropriate error.
9446
- throw new Error(MULTIPLE_TASKS_FOUND);
9447
- }
9448
- }
9449
- return true; // All good. Nothing to see here.
9450
- }), operators.catchError(function (error) {
9451
- // Simply rethrow it.
9452
- return rxjs.throwError(error);
9453
- }));
9454
- };
9455
- /**
9456
- * Return tasks for case and event.
9457
- */
9458
- WorkAllocationService.prototype.getTasksByCaseIdAndEventId = function (eventId, caseId, caseType, jurisdiction) {
9459
- var defaultPayload = {
9460
- task_required_for_event: false,
9461
- tasks: []
9462
- };
9463
- if (!this.isWAEnabled()) {
9464
- return rxjs.of(defaultPayload);
9465
- }
9466
- return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/case/tasks/" + caseId + "/event/" + eventId + "/caseType/" + caseType + "/jurisdiction/" + jurisdiction);
9467
- };
9468
- /**
9469
- * Call the API to get a task
9470
- */
9471
- WorkAllocationService.prototype.getTask = function (taskId) {
9472
- if (!this.isWAEnabled()) {
9473
- return rxjs.of({ task: null });
9474
- }
9475
- return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId);
9476
- };
9477
- return WorkAllocationService;
9478
- }());
9479
- WorkAllocationService.iACCaseOfficer = 'caseworker-ia-caseofficer';
9480
- WorkAllocationService.iACAdmOfficer = 'caseworker-ia-admofficer';
9481
- WorkAllocationService.ɵfac = function WorkAllocationService_Factory(t) { return new (t || WorkAllocationService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(AlertService), i0__namespace.ɵɵinject(SessionStorageService)); };
9482
- WorkAllocationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: WorkAllocationService, factory: WorkAllocationService.ɵfac });
9483
- (function () {
9484
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(WorkAllocationService, [{
9485
- type: i0.Injectable
9486
- }], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }, { type: AlertService }, { type: SessionStorageService }]; }, null);
9487
- })();
9488
-
9489
9534
  var CaseEditComponent = /** @class */ (function () {
9490
9535
  function CaseEditComponent(fb, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService) {
9491
9536
  this.fb = fb;
@@ -10424,7 +10469,7 @@
10424
10469
  var label = casefield.label || 'Field';
10425
10470
  var id_1 = casefield.id;
10426
10471
  if (fieldElement['component'] && fieldElement['component'].parent) {
10427
- if (fieldElement['component'].idPrefix.indexOf("_" + id_1 + "_") === -1) {
10472
+ if (fieldElement['component'].idPrefix.indexOf('_' + id_1 + '_') === -1) {
10428
10473
  id_1 = "" + fieldElement['component'].idPrefix + id_1;
10429
10474
  }
10430
10475
  else {
@@ -10962,7 +11007,7 @@
10962
11007
 
10963
11008
  var AddressOption = /** @class */ (function () {
10964
11009
  function AddressOption(addressModel, description) {
10965
- if (description === null) {
11010
+ if (description == null) {
10966
11011
  this.value = addressModel;
10967
11012
  this.description = this.getDescription();
10968
11013
  }
@@ -10971,10 +11016,13 @@
10971
11016
  }
10972
11017
  }
10973
11018
  AddressOption.prototype.getDescription = function () {
10974
- return this.removeInitialCommaIfPresent("" + (this.value.AddressLine1 === undefined ? '' : this.value.AddressLine1) + this.prefixWithCommaIfPresent(this.value.AddressLine2) + this.prefixWithCommaIfPresent(this.value.AddressLine3) + ", " + this.value.PostTown);
11019
+ return this.removeInitialCommaIfPresent((this.value.AddressLine1 === undefined ? '' : this.value.AddressLine1)
11020
+ + this.prefixWithCommaIfPresent(this.value.AddressLine2)
11021
+ + this.prefixWithCommaIfPresent(this.value.AddressLine3)
11022
+ + ', ' + this.value.PostTown);
10975
11023
  };
10976
11024
  AddressOption.prototype.prefixWithCommaIfPresent = function (value) {
10977
- return value ? ", " + value : value;
11025
+ return value ? ', ' + value : value;
10978
11026
  };
10979
11027
  AddressOption.prototype.removeInitialCommaIfPresent = function (value) {
10980
11028
  return value.replace(new RegExp('^,', 'gi'), '');
@@ -11118,7 +11166,7 @@
11118
11166
  this.missingPostcode = false;
11119
11167
  var postcode_1 = this.postcode.value;
11120
11168
  this.caseField.value = null;
11121
- this.addressOptions = [];
11169
+ this.addressOptions = new Array();
11122
11170
  this.addressesService.getAddressesForPostcode(postcode_1.replace(' ', '').toUpperCase()).subscribe(function (result) {
11123
11171
  result.forEach(function (address) {
11124
11172
  _this.addressOptions.push(new AddressOption(address, null));
@@ -11161,7 +11209,7 @@
11161
11209
  var hasAddress = false;
11162
11210
  if (address) {
11163
11211
  Object.keys(address).forEach(function (key) {
11164
- if (address[key] !== null) {
11212
+ if (address[key] != null) {
11165
11213
  hasAddress = true;
11166
11214
  }
11167
11215
  });
@@ -11184,7 +11232,7 @@
11184
11232
  };
11185
11233
  WriteAddressFieldComponent.prototype.defaultLabel = function (numberOfAddresses) {
11186
11234
  return numberOfAddresses === 0 ? 'No address found'
11187
- : "" + numberOfAddresses + (numberOfAddresses === 1 ? ' address ' : ' addresses ') + "found";
11235
+ : numberOfAddresses + (numberOfAddresses === 1 ? ' address ' : ' addresses ') + 'found';
11188
11236
  };
11189
11237
  WriteAddressFieldComponent.prototype.setFormValue = function () {
11190
11238
  if (this.writeComplexFieldComponent.complexGroup) {
@@ -12929,16 +12977,16 @@
12929
12977
  && this.collItems[i].caseField.id === counter.toString()) {
12930
12978
  this.collItems[i].caseField.id = i.toString();
12931
12979
  }
12932
- var idPrefix1 = this.collItems[i].prefix ? this.collItems[i].prefix.replace("_" + counter.toString(), "_" + i.toString()) : '';
12933
- var idPrefix1Current = idPrefix1.replace("_" + i.toString(), "_" + counter.toString());
12980
+ var idPrefix1 = this.collItems[i].prefix ? this.collItems[i].prefix.replace('_' + counter.toString(), '_' + i.toString()) : '';
12981
+ var idPrefix1Current = idPrefix1.replace('_' + i.toString(), '_' + counter.toString());
12934
12982
  if (this.collItems[i].prefix && this.collItems[i].prefix === idPrefix1Current) {
12935
12983
  this.collItems[i].prefix = idPrefix1;
12936
12984
  }
12937
12985
  var idPrefixAvailable = this.collItems[i].container && this.collItems[i].container['component']
12938
12986
  && this.collItems[i].container['component'].idPrefix ? true : false;
12939
12987
  var idPrefix2 = idPrefixAvailable ?
12940
- this.collItems[i].container['component'].idPrefix.replace("_" + counter.toString(), "_" + i.toString()) : '';
12941
- var idPrefix2current = idPrefix2.replace("_" + i.toString(), "_" + counter.toString());
12988
+ this.collItems[i].container['component'].idPrefix.replace('_' + counter.toString(), '_' + i.toString()) : '';
12989
+ var idPrefix2current = idPrefix2.replace('_' + i.toString(), '_' + counter.toString());
12942
12990
  if (idPrefixAvailable && this.collItems[i].container['component'].idPrefix === idPrefix2current) {
12943
12991
  this.collItems[i].container['component'].idPrefix = idPrefix2;
12944
12992
  }
@@ -15349,7 +15397,7 @@
15349
15397
  casesResponse.push(_this.mapResponse(result));
15350
15398
  });
15351
15399
  });
15352
- _this.linkedCases = casesResponse.map(function (item) {
15400
+ var caseLinks = casesResponse.map(function (item) {
15353
15401
  return {
15354
15402
  caseReference: item.caseReference,
15355
15403
  caseName: item.caseName,
@@ -15363,6 +15411,7 @@
15363
15411
  }),
15364
15412
  };
15365
15413
  });
15414
+ _this.linkedCases = caseLinks;
15366
15415
  _this.serverLinkedApiError = null;
15367
15416
  }, function (err) {
15368
15417
  _this.serverLinkedApiError = {
@@ -17442,7 +17491,7 @@
17442
17491
  this.caseField = (_a = tab === null || tab === void 0 ? void 0 : tab.fields) === null || _a === void 0 ? void 0 : _a.find(function (field) { return field.id === 'caseLinks'; });
17443
17492
  }
17444
17493
  this.isServerJurisdictionError = this.linkedCasesService.serverJurisdictionError || false;
17445
- var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + "/lov/categories/CaseLinkingReasonCode";
17494
+ var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + '/lov/categories/CaseLinkingReasonCode';
17446
17495
  this.commonDataService.getRefData(reasonCodeAPIurl).subscribe({
17447
17496
  next: function (reasons) {
17448
17497
  _this.reasonListLoaded = true;
@@ -17704,7 +17753,7 @@
17704
17753
  };
17705
17754
  WriteLinkedCasesFieldComponent.prototype.getLinkedCaseReasons = function () {
17706
17755
  var _this = this;
17707
- var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + "/lov/categories/CaseLinkingReasonCode";
17756
+ var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + '/lov/categories/CaseLinkingReasonCode';
17708
17757
  this.commonDataService.getRefData(reasonCodeAPIurl).subscribe({
17709
17758
  next: function (reasons) {
17710
17759
  // Sort in ascending order
@@ -17763,10 +17812,11 @@
17763
17812
  var _this = this;
17764
17813
  this.casesService.getCaseViewV2(this.linkedCasesService.caseId).subscribe(function (caseView) {
17765
17814
  var caseViewFiltered = caseView.tabs.filter(function (tab) {
17766
- return tab.fields.some(function (_b) {
17815
+ var linkField = tab.fields.some(function (_b) {
17767
17816
  var field_type = _b.field_type;
17768
17817
  return field_type && field_type.collection_field_type && field_type.collection_field_type.id === 'CaseLink';
17769
17818
  });
17819
+ return linkField;
17770
17820
  });
17771
17821
  if (caseViewFiltered) {
17772
17822
  var caseLinkFieldValue = caseViewFiltered.map(function (filtered) { var _a; return ((_a = filtered.fields) === null || _a === void 0 ? void 0 : _a.length) > 0 && filtered.fields.filter(function (field) { return field.id === 'caseLinks'; })[0].value; });
@@ -19553,7 +19603,7 @@
19553
19603
  WriteTextAreaFieldComponent.prototype.autoGrow = function (event) {
19554
19604
  if (this.browserService.isIEOrEdge()) {
19555
19605
  event.target.style.height = 'auto';
19556
- event.target.style.height = event.target.scrollHeight + "px";
19606
+ event.target.style.height = event.target.scrollHeight + 'px';
19557
19607
  event.target.scrollTop = event.target.scrollHeight;
19558
19608
  }
19559
19609
  };
@@ -20538,7 +20588,7 @@
20538
20588
  i0__namespace.ɵɵadvance(2);
20539
20589
  i0__namespace.ɵɵproperty("ngForOf", ctx.currentCategories);
20540
20590
  }
20541
- }, directives: [i1__namespace.NgForOf, i1__namespace.NgTemplateOutlet], styles: [":host{position:relative;display:block}.folders{margin-bottom:20px}.folder{display:none;border-top:1px solid #ccc;margin:0 0 -1px}.folder,.folder:last-child{border-bottom:1px solid #ccc}.folders>.folder,input:checked~.folder{display:block}.iconImg{position:relative;display:inline-block;height:28px}.folder>.folder{margin-left:20px}.folder label:before{top:3px}.folder label:after{top:13px}p{font-weight:700}button{margin-right:20px}.close{float:right;width:30px;height:30px;background:url(/assets/img/x.PNG) no-repeat 50%}.cancel,.close{cursor:pointer}.cdk-overlay-pane{overflow:auto}.cdk-overlay-pane::-webkit-scrollbar{width:7px}.cdk-overlay-pane::-webkit-scrollbar-thumb{border:4px solid transparent;background-clip:padding-box;border-radius:9999px;background-color:#aaa}.cdk-overlay-pane::-webkit-scrollbar-button{display:none}.cdk-overlay-pane::-webkit-scrollbar-track-piece{background:#eee}.cdk-overlay-pane::-webkit-scrollbar-thumb{background:#ccc}"], encapsulation: 2 });
20591
+ }, directives: [i1__namespace.NgForOf, i1__namespace.NgTemplateOutlet], styles: [":host{position:relative;display:block}.folders{margin-bottom:20px}.folder{display:none;border-top:1px solid #ccc;margin:0 0 -1px}.folder:last-child{border-bottom:1px solid #ccc}.folders>.folder,input:checked~.folder{display:block}.iconImg{position:relative;display:inline-block;height:28px}.folder>.folder{margin-left:20px}.folder label:before{top:3px}.folder label:after{top:13px}p{font-weight:700}button{margin-right:20px}.close{float:right;width:30px;height:30px;background:url(/assets/img/x.PNG) no-repeat 50%}.cancel,.close{cursor:pointer}.cdk-overlay-pane{overflow:auto}.cdk-overlay-pane::-webkit-scrollbar{width:7px}.cdk-overlay-pane::-webkit-scrollbar-thumb{border:4px solid transparent;background-clip:padding-box;border-radius:9999px;background-color:#aaa}.cdk-overlay-pane::-webkit-scrollbar-button{display:none}.cdk-overlay-pane::-webkit-scrollbar-track-piece{background:#eee}.cdk-overlay-pane::-webkit-scrollbar-thumb{background:#ccc}"], encapsulation: 2 });
20542
20592
  (function () {
20543
20593
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CaseFileViewFolderSelectorComponent, [{
20544
20594
  type: i0.Component,
@@ -22128,7 +22178,7 @@
22128
22178
  // is expected not to have a party name)
22129
22179
  if (this.flagsData) {
22130
22180
  this.filteredFlagsData =
22131
- this.flagsData.filter(function (f) { return f.flags.partyName !== null || f.pathToFlagsFormGroup === _this.caseLevelCaseFlagsFieldId; });
22181
+ this.flagsData.filter(function (f) { return f.flags.partyName != null || f.pathToFlagsFormGroup === _this.caseLevelCaseFlagsFieldId; });
22132
22182
  }
22133
22183
  // Add a FormControl for the selected flag location if there is at least one flags instance remaining after filtering
22134
22184
  if (this.filteredFlagsData && this.filteredFlagsData.length > 0) {
@@ -23425,13 +23475,13 @@
23425
23475
  field.value = { CaseReference: value };
23426
23476
  return field;
23427
23477
  };
23428
- ReadComplexFieldCollectionTableComponent.prototype.toCaseField = function (id, label, fieldType, value) {
23478
+ ReadComplexFieldCollectionTableComponent.prototype.toCaseField = function (id, label, field_type, value) {
23429
23479
  return classTransformer.plainToClassFromExist(new CaseField(), {
23430
23480
  id: id,
23431
23481
  label: label,
23432
23482
  display_context: 'READONLY',
23433
23483
  value: value,
23434
- field_type: fieldType
23484
+ field_type: field_type
23435
23485
  });
23436
23486
  };
23437
23487
  ReadComplexFieldCollectionTableComponent.prototype.sortRowsByColumns = function (column) {
@@ -25267,7 +25317,7 @@
25267
25317
  function CcdPageFieldsPipe() {
25268
25318
  }
25269
25319
  CcdPageFieldsPipe.prototype.transform = function (page, dataFormGroup) {
25270
- var complexFields = Object.keys(dataFormGroup.controls['data'].controls).map(function (key) {
25320
+ var complex_fields = Object.keys(dataFormGroup.controls['data'].controls).map(function (key) {
25271
25321
  var control = dataFormGroup.controls['data'].get(key);
25272
25322
  return control['caseField'];
25273
25323
  }).filter(function (field) {
@@ -25287,7 +25337,7 @@
25287
25337
  field_type: {
25288
25338
  id: page.id,
25289
25339
  type: 'Complex',
25290
- complex_fields: complexFields
25340
+ complex_fields: complex_fields
25291
25341
  }
25292
25342
  });
25293
25343
  };
@@ -25466,11 +25516,11 @@
25466
25516
  }
25467
25517
  return childrenCaseFields;
25468
25518
  };
25469
- CollectionCreateCheckerService.prototype.isComplex = function (caseField) {
25470
- return caseField.field_type.type === 'Complex';
25519
+ CollectionCreateCheckerService.prototype.isComplex = function (case_field) {
25520
+ return case_field.field_type.type === 'Complex';
25471
25521
  };
25472
- CollectionCreateCheckerService.prototype.isCollection = function (caseField) {
25473
- return caseField.field_type.type === 'Collection';
25522
+ CollectionCreateCheckerService.prototype.isCollection = function (case_field) {
25523
+ return case_field.field_type.type === 'Collection';
25474
25524
  };
25475
25525
  CollectionCreateCheckerService.prototype.hasCreateAccess = function (caseField, role) {
25476
25526
  return !!caseField.acls.find(function (acl) { return acl.role === role && acl.create === true; });
@@ -25626,7 +25676,6 @@
25626
25676
  FileUploadStateService,
25627
25677
  FileUploadProgressGuard,
25628
25678
  WindowService,
25629
- LinkedCasesService,
25630
25679
  CommonDataService,
25631
25680
  JurisdictionService,
25632
25681
  { provide: i6.MAT_DATE_LOCALE, useValue: 'en-GB' }
@@ -25970,7 +26019,6 @@
25970
26019
  FileUploadStateService,
25971
26020
  FileUploadProgressGuard,
25972
26021
  WindowService,
25973
- LinkedCasesService,
25974
26022
  CommonDataService,
25975
26023
  JurisdictionService,
25976
26024
  { provide: i6.MAT_DATE_LOCALE, useValue: 'en-GB' }
@@ -26671,7 +26719,7 @@
26671
26719
  if (caseField.field_type.type === 'Complex') {
26672
26720
  // Note: Deliberate use of equality (==) and non-equality (!=) operators for null checks throughout, to
26673
26721
  // handle both null and undefined values
26674
- if (caseField.value !== null) {
26722
+ if (caseField.value != null) {
26675
26723
  // Call this function recursively to replace the Complex field's sub-fields as necessary, passing the
26676
26724
  // CaseField itself (the sub-fields do not contain any values, so these need to be obtained from the
26677
26725
  // parent)
@@ -28700,7 +28748,7 @@
28700
28748
  var formValue = _this.windowService.getLocalStorage(FORM_GROUP_VAL_LOC_STORAGE);
28701
28749
  workbasketInputs.forEach(function (item) {
28702
28750
  if (item.field.elementPath) {
28703
- item.field.id = item.field.id + "." + item.field.elementPath;
28751
+ item.field.id = item.field.id + '.' + item.field.elementPath;
28704
28752
  }
28705
28753
  item.field.label = item.label;
28706
28754
  if (formValue) {
@@ -28752,7 +28800,7 @@
28752
28800
  var value = formGroupLS[key];
28753
28801
  // Clear the filter form group control values if it has a value in local storage
28754
28802
  // The regionList form group control value should be ignored as it always contain the latest value
28755
- if (key !== REGION_LIST_AND_FRC_FILTER && value !== null) {
28803
+ if (key !== REGION_LIST_AND_FRC_FILTER && value != null) {
28756
28804
  this.formGroup.get(key).setValue(null);
28757
28805
  }
28758
28806
  }
@@ -31133,7 +31181,7 @@
31133
31181
  * or the empty string
31134
31182
  */
31135
31183
  PrintUrlPipe.prototype.transform = function (remoteUrl) {
31136
- if ((remoteUrl === null || remoteUrl === void 0 ? void 0 : remoteUrl.length) > 0) {
31184
+ if (remoteUrl && remoteUrl.length > 0) {
31137
31185
  var printServiceUrlPathname = void 0;
31138
31186
  /**
31139
31187
  * Check navigator.userAgent to see if the browser is IE or not. Check for either the browser name, "MSIE", or
@@ -31149,7 +31197,7 @@
31149
31197
  printServiceUrlPathname = urlParser.pathname;
31150
31198
  if (printServiceUrlPathname[0] !== '/') {
31151
31199
  // Fix for IE11; it returns the pathname without leading slash
31152
- printServiceUrlPathname = "/" + printServiceUrlPathname;
31200
+ printServiceUrlPathname = '/' + printServiceUrlPathname;
31153
31201
  }
31154
31202
  }
31155
31203
  else {
@@ -31352,10 +31400,10 @@
31352
31400
  };
31353
31401
  CaseViewerComponent.prototype.setUserAccessType = function (caseDetails) {
31354
31402
  if (caseDetails && Array.isArray(caseDetails.metadataFields)) {
31355
- var accessProcess = caseDetails.metadataFields.find(function (metadataField) { return metadataField.id === CaseViewerComponent.METADATA_FIELD_ACCESS_PROCEES_ID; });
31356
- var accessGranted = caseDetails.metadataFields.find(function (metadataField) { return metadataField.id === CaseViewerComponent.METADATA_FIELD_ACCESS_GRANTED_ID; });
31357
- this.accessGranted = accessGranted ? accessGranted.value !== CaseViewerComponent.BASIC_USER_ACCESS_TYPES : false;
31358
- this.userAccessType = accessProcess ? accessProcess.value : null;
31403
+ var access_process = caseDetails.metadataFields.find(function (metadataField) { return metadataField.id === CaseViewerComponent.METADATA_FIELD_ACCESS_PROCEES_ID; });
31404
+ var access_granted = caseDetails.metadataFields.find(function (metadataField) { return metadataField.id === CaseViewerComponent.METADATA_FIELD_ACCESS_GRANTED_ID; });
31405
+ this.accessGranted = access_granted ? access_granted.value !== CaseViewerComponent.BASIC_USER_ACCESS_TYPES : false;
31406
+ this.userAccessType = access_process ? access_process.value : null;
31359
31407
  }
31360
31408
  };
31361
31409
  CaseViewerComponent.prototype.isDataLoaded = function () {
@@ -32651,11 +32699,11 @@
32651
32699
  };
32652
32700
  this.$roleAssignmentResponseSubscription = this.casesService.createChallengedAccessRequest(caseId_1, challengedAccessRequest)
32653
32701
  .pipe(operators.switchMap(function () { return _this.caseNotifier.fetchAndRefresh(caseId_1); }))
32654
- .subscribe(function () {
32702
+ .subscribe(function (_response) {
32655
32703
  // Would have been nice to pass the caseId within state.data, but this isn't part of NavigationExtras until
32656
32704
  // Angular 7.2!
32657
32705
  _this.router.navigate(['success'], { relativeTo: _this.route });
32658
- }, function () {
32706
+ }, function (_error) {
32659
32707
  // Navigate to error page
32660
32708
  });
32661
32709
  }
@@ -32669,7 +32717,7 @@
32669
32717
  }
32670
32718
  };
32671
32719
  CaseChallengedAccessRequestComponent.prototype.inputEmpty = function (input) {
32672
- return input.value === null || input.value.trim().length === 0;
32720
+ return input.value == null || input.value.trim().length === 0;
32673
32721
  };
32674
32722
  return CaseChallengedAccessRequestComponent;
32675
32723
  }());
@@ -33293,11 +33341,11 @@
33293
33341
  };
33294
33342
  this.$roleAssignmentResponseSubscription = this.casesService.createSpecificAccessRequest(caseId_1, specificAccessRequest)
33295
33343
  .pipe(operators.switchMap(function () { return _this.caseNotifier.fetchAndRefresh(caseId_1); }))
33296
- .subscribe(function () {
33344
+ .subscribe(function (_response) {
33297
33345
  // Would have been nice to pass the caseId within state.data, but this isn't part of NavigationExtras until
33298
33346
  // Angular 7.2
33299
33347
  _this.router.navigate(['success'], { relativeTo: _this.route });
33300
- }, function () {
33348
+ }, function (_error) {
33301
33349
  // Navigate to error page
33302
33350
  });
33303
33351
  }
@@ -33312,7 +33360,7 @@
33312
33360
  }
33313
33361
  };
33314
33362
  CaseSpecificAccessRequestComponent.prototype.inputEmpty = function (input) {
33315
- return input.value === null || input.value.trim().length === 0;
33363
+ return input.value == null || input.value.trim().length === 0;
33316
33364
  };
33317
33365
  return CaseSpecificAccessRequestComponent;
33318
33366
  }());
@@ -34213,7 +34261,7 @@
34213
34261
  }
34214
34262
  searchInputs.forEach(function (item) {
34215
34263
  if (item.field.elementPath) {
34216
- item.field.id = item.field.id + "." + item.field.elementPath;
34264
+ item.field.id = item.field.id + '.' + item.field.elementPath;
34217
34265
  }
34218
34266
  item.field.label = item.label;
34219
34267
  if (formValueObject) {
@@ -35480,24 +35528,24 @@
35480
35528
  this.caseField.id = id;
35481
35529
  return this;
35482
35530
  };
35483
- CaseFieldBuilder.prototype.withFieldType = function (fieldType) {
35484
- this.caseField.field_type = fieldType;
35531
+ CaseFieldBuilder.prototype.withFieldType = function (field_type) {
35532
+ this.caseField.field_type = field_type;
35485
35533
  return this;
35486
35534
  };
35487
- CaseFieldBuilder.prototype.withDisplayContext = function (displayContext) {
35488
- this.caseField.display_context = displayContext;
35535
+ CaseFieldBuilder.prototype.withDisplayContext = function (display_context) {
35536
+ this.caseField.display_context = display_context;
35489
35537
  return this;
35490
35538
  };
35491
- CaseFieldBuilder.prototype.withDisplayContextParameter = function (displayContextParameter) {
35492
- this.caseField.display_context_parameter = displayContextParameter;
35539
+ CaseFieldBuilder.prototype.withDisplayContextParameter = function (display_context_parameter) {
35540
+ this.caseField.display_context_parameter = display_context_parameter;
35493
35541
  return this;
35494
35542
  };
35495
35543
  CaseFieldBuilder.prototype.withHidden = function (hidden) {
35496
35544
  this.caseField.hidden = hidden;
35497
35545
  return this;
35498
35546
  };
35499
- CaseFieldBuilder.prototype.withHintText = function (hintText) {
35500
- this.caseField.hint_text = hintText;
35547
+ CaseFieldBuilder.prototype.withHintText = function (hint_text) {
35548
+ this.caseField.hint_text = hint_text;
35501
35549
  return this;
35502
35550
  };
35503
35551
  CaseFieldBuilder.prototype.withLabel = function (label) {
@@ -35508,12 +35556,12 @@
35508
35556
  this.caseField.order = order;
35509
35557
  return this;
35510
35558
  };
35511
- CaseFieldBuilder.prototype.withSecurityLabel = function (securityLabel) {
35512
- this.caseField.security_label = securityLabel;
35559
+ CaseFieldBuilder.prototype.withSecurityLabel = function (security_label) {
35560
+ this.caseField.security_label = security_label;
35513
35561
  return this;
35514
35562
  };
35515
- CaseFieldBuilder.prototype.withShowCondition = function (showCondition) {
35516
- this.caseField.show_condition = showCondition;
35563
+ CaseFieldBuilder.prototype.withShowCondition = function (show_condition) {
35564
+ this.caseField.show_condition = show_condition;
35517
35565
  return this;
35518
35566
  };
35519
35567
  CaseFieldBuilder.prototype.withShowSummaryContentOption = function (option) {
@@ -35541,21 +35589,21 @@
35541
35589
  complex_fields: []
35542
35590
  };
35543
35591
  };
35544
- var createCaseEventTrigger = function (id, name, caseId, showSummary, caseFields, wizardPages, canSaveDraft) {
35545
- if (wizardPages === void 0) { wizardPages = []; }
35546
- if (canSaveDraft === void 0) { canSaveDraft = false; }
35592
+ var createCaseEventTrigger = function (id, name, case_id, show_summary, case_fields, wizard_pages, can_save_draft) {
35593
+ if (wizard_pages === void 0) { wizard_pages = []; }
35594
+ if (can_save_draft === void 0) { can_save_draft = false; }
35547
35595
  var eventTrigger = new CaseEventTrigger();
35548
35596
  eventTrigger.id = id;
35549
35597
  eventTrigger.name = name;
35550
- eventTrigger.case_id = caseId;
35551
- eventTrigger.show_summary = showSummary;
35552
- eventTrigger.wizard_pages = wizardPages;
35598
+ eventTrigger.case_id = case_id;
35599
+ eventTrigger.show_summary = show_summary;
35600
+ eventTrigger.wizard_pages = wizard_pages;
35553
35601
  eventTrigger.event_token = 'test-token';
35554
- eventTrigger.case_fields = caseFields;
35555
- eventTrigger.can_save_draft = canSaveDraft;
35602
+ eventTrigger.case_fields = case_fields;
35603
+ eventTrigger.can_save_draft = can_save_draft;
35556
35604
  return eventTrigger;
35557
35605
  };
35558
- var aCaseField = function (id, label, type, displayContext, showSummaryContentOption, typeComplexFields, retainHiddenValue, hidden) {
35606
+ var aCaseField = function (id, label, type, display_context, show_summary_content_option, typeComplexFields, retain_hidden_value, hidden) {
35559
35607
  if (typeComplexFields === void 0) { typeComplexFields = []; }
35560
35608
  return ({
35561
35609
  id: id || 'personFirstName',
@@ -35564,10 +35612,10 @@
35564
35612
  type: type || 'Text',
35565
35613
  complex_fields: typeComplexFields || []
35566
35614
  },
35567
- display_context: displayContext || 'OPTIONAL',
35615
+ display_context: display_context || 'OPTIONAL',
35568
35616
  label: label || 'First name',
35569
- show_summary_content_option: showSummaryContentOption,
35570
- retain_hidden_value: retainHiddenValue || false,
35617
+ show_summary_content_option: show_summary_content_option,
35618
+ retain_hidden_value: retain_hidden_value || false,
35571
35619
  hidden: hidden || false
35572
35620
  });
35573
35621
  };
@@ -35609,48 +35657,48 @@
35609
35657
  complexFieldOverride.display_context = 'HIDDEN';
35610
35658
  return complexFieldOverride;
35611
35659
  };
35612
- var createCaseField = function (id, label, hint, fieldType, displayContext, order, showCondition, acls, hidden) {
35660
+ var createCaseField = function (id, label, hint, fieldType, display_context, order, show_condition, ACLs, hidden) {
35613
35661
  if (order === void 0) { order = undefined; }
35614
- if (showCondition === void 0) { showCondition = undefined; }
35615
- if (acls === void 0) { acls = undefined; }
35662
+ if (show_condition === void 0) { show_condition = undefined; }
35663
+ if (ACLs === void 0) { ACLs = undefined; }
35616
35664
  return CaseFieldBuilder.create()
35617
35665
  .withId(id || 'personFirstName')
35618
35666
  .withFieldType(fieldType || textFieldType())
35619
- .withDisplayContext(displayContext || 'OPTIONAL')
35667
+ .withDisplayContext(display_context || 'OPTIONAL')
35620
35668
  .withLabel(label || 'First name')
35621
35669
  .withHintText(hint || 'First name hint text')
35622
35670
  .withShowSummaryContentOption(0)
35623
35671
  .withOrder(order)
35624
- .withShowCondition(showCondition || undefined)
35625
- .withACLs(acls)
35672
+ .withShowCondition(show_condition || undefined)
35673
+ .withACLs(ACLs)
35626
35674
  .withHidden(hidden || false)
35627
35675
  .build();
35628
35676
  };
35629
- var newCaseField = function (id, label, hint, fieldType, displayContext, order) {
35677
+ var newCaseField = function (id, label, hint, fieldType, display_context, order) {
35630
35678
  if (order === void 0) { order = undefined; }
35631
35679
  return CaseFieldBuilder.create()
35632
35680
  .withId(id || 'personFirstName')
35633
35681
  .withFieldType(fieldType || textFieldType())
35634
- .withDisplayContext(displayContext || 'OPTIONAL')
35682
+ .withDisplayContext(display_context || 'OPTIONAL')
35635
35683
  .withHintText(hint || 'First name hint text')
35636
35684
  .withLabel(label || 'First name')
35637
35685
  .withOrder(order)
35638
35686
  .withShowSummaryContentOption(0);
35639
35687
  };
35640
- var createFieldType = function (typeId, type, complexFields, collectionFieldType) {
35641
- if (complexFields === void 0) { complexFields = []; }
35642
- if (collectionFieldType === void 0) { collectionFieldType = undefined; }
35688
+ var createFieldType = function (typeId, type, complex_fields, collection_field_type) {
35689
+ if (complex_fields === void 0) { complex_fields = []; }
35690
+ if (collection_field_type === void 0) { collection_field_type = undefined; }
35643
35691
  return {
35644
35692
  id: typeId || 'Text',
35645
35693
  type: type || 'Text',
35646
- complex_fields: complexFields || [],
35647
- collection_field_type: collectionFieldType || undefined
35694
+ complex_fields: complex_fields || [],
35695
+ collection_field_type: collection_field_type || undefined
35648
35696
  };
35649
35697
  };
35650
35698
  var createFixedListFieldType = function (typeId, fixedListItems) {
35651
35699
  if (fixedListItems === void 0) { fixedListItems = []; }
35652
35700
  return {
35653
- id: "FixedList-" + typeId,
35701
+ id: 'FixedList-' + typeId,
35654
35702
  type: 'FixedList',
35655
35703
  fixed_list_items: fixedListItems || []
35656
35704
  };
@@ -35658,18 +35706,18 @@
35658
35706
  var createMultiSelectListFieldType = function (typeId, fixedListItems) {
35659
35707
  if (fixedListItems === void 0) { fixedListItems = []; }
35660
35708
  return {
35661
- id: "MultiSelectList-" + typeId,
35709
+ id: 'MultiSelectList-' + typeId,
35662
35710
  type: 'MultiSelectList',
35663
35711
  fixed_list_items: fixedListItems || []
35664
35712
  };
35665
35713
  };
35666
- var createACL = function (role, aclCreate, aclRead, aclUpdate, aclDelete) {
35714
+ var createACL = function (role, create, read, update, _delete) {
35667
35715
  return ({
35668
35716
  role: role || 'roleX',
35669
- create: aclCreate,
35670
- read: aclRead,
35671
- update: aclUpdate,
35672
- delete: aclDelete
35717
+ create: create,
35718
+ read: read,
35719
+ update: update,
35720
+ delete: _delete
35673
35721
  });
35674
35722
  };
35675
35723
 
@@ -35888,6 +35936,7 @@
35888
35936
  exports.FormatTranslatorService = FormatTranslatorService;
35889
35937
  exports.GreyBarService = GreyBarService;
35890
35938
  exports.HRef = HRef;
35939
+ exports.HasLoadingState = HasLoadingState;
35891
35940
  exports.HeaderBarComponent = HeaderBarComponent;
35892
35941
  exports.HeadersModule = HeadersModule;
35893
35942
  exports.HttpError = HttpError;