@hmcts/ccd-case-ui-toolkit 5.0.54-rollback-case-link → 5.0.55-rollback-case-link

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 (23) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +23 -33
  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/shared/components/case-editor/case-access-utils/index.js +10 -1
  6. package/esm2015/lib/shared/components/case-editor/services/cases.service.js +5 -25
  7. package/esm2015/lib/shared/domain/case-view/role-request.model.js +1 -1
  8. package/esm2015/lib/shared/domain/user/user-info.model.js +1 -1
  9. package/esm2015/lib/shared/services/fields/fields.utils.js +2 -2
  10. package/esm2015/lib/shared/services/form/form-value.service.js +10 -9
  11. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +23 -33
  12. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  13. package/lib/shared/components/case-editor/case-access-utils/index.d.ts +3 -0
  14. package/lib/shared/components/case-editor/case-access-utils/index.d.ts.map +1 -1
  15. package/lib/shared/components/case-editor/services/cases.service.d.ts +0 -2
  16. package/lib/shared/components/case-editor/services/cases.service.d.ts.map +1 -1
  17. package/lib/shared/domain/case-view/role-request.model.d.ts +1 -1
  18. package/lib/shared/domain/case-view/role-request.model.d.ts.map +1 -1
  19. package/lib/shared/domain/user/user-info.model.d.ts +2 -0
  20. package/lib/shared/domain/user/user-info.model.d.ts.map +1 -1
  21. package/lib/shared/services/form/form-value.service.d.ts +0 -3
  22. package/lib/shared/services/form/form-value.service.d.ts.map +1 -1
  23. package/package.json +1 -1
@@ -4113,7 +4113,7 @@
4113
4113
  // If the Flags CaseField has a value, it is a root-level Complex field; if it does not, it is a Flags
4114
4114
  // CaseField that is a sub-field within another Complex field, so use the currentValue value (if any)
4115
4115
  // instead. The exception to this is the "caseFlags" Flags CaseField, which will have an empty object value
4116
- // initially or could be null or undefined, because no party name is required
4116
+ // initially, because no party name is required
4117
4117
  if (caseField.value && FieldsUtils.isNonEmptyObject(caseField.value) ||
4118
4118
  caseField.id === this.caseLevelCaseFlagsFieldId) {
4119
4119
  flags.push(this.mapCaseFieldToFlagsWithFormGroupPathObject(caseField, pathToFlagsFormGroup));
@@ -6083,9 +6083,6 @@
6083
6083
  // Clear out any MultiSelect labels.
6084
6084
  FormValueService.removeMultiSelectLabels(data);
6085
6085
  };
6086
- /**
6087
- * Remove any empty or invalid array with only id
6088
- */
6089
6086
  FormValueService.prototype.removeInvalidCollectionData = function (data, field) {
6090
6087
  var e_10, _a;
6091
6088
  if (data[field.id] && data[field.id].length > 0) {
@@ -6166,13 +6163,17 @@
6166
6163
  // nothing for a given case field ID (hence the use of hasOwnProperty())
6167
6164
  if (data.hasOwnProperty(caseField.id) && caseField.value) {
6168
6165
  // Create new object for the case field ID within the data object, if necessary
6169
- if (!data[caseField.id]) {
6170
- data[caseField.id] = {};
6166
+ if (data[caseField.id]) {
6167
+ // Copy all values from the corresponding CaseField; this ensures all nested flag data (for example, a
6168
+ // Flags field within a Complex field or a collection of Complex fields) is copied across
6169
+ Object.keys(data[caseField.id]).forEach(function (key) {
6170
+ if (caseField.value.hasOwnProperty(key)) {
6171
+ data[caseField.id][key] = caseField.value[key];
6172
+ }
6173
+ });
6171
6174
  }
6172
- // Copy all values from the corresponding CaseField; this ensures all nested flag data (for example, a
6173
- // Flags field within a Complex field or a collection of Complex fields) is copied across
6174
- Object.keys(caseField.value).forEach(function (key) { return data[caseField.id][key] = caseField.value[key]; });
6175
6175
  }
6176
+ ;
6176
6177
  });
6177
6178
  }
6178
6179
  };
@@ -7963,6 +7964,9 @@
7963
7964
  else if (this.roleOrCategoryExists(CaseAccessUtils.ADMIN_ROLE, CaseAccessUtils.ADMIN_ROLE_CATEGORY, roleKeywords, roleCategories)) {
7964
7965
  return CaseAccessUtils.ADMIN_ROLE_CATEGORY;
7965
7966
  }
7967
+ else if (this.roleOrCategoryExists(CaseAccessUtils.CTSC_ROLE, CaseAccessUtils.CTSC_ROLE_CATEGORY, roleKeywords, roleCategories)) {
7968
+ return CaseAccessUtils.CTSC_ROLE_CATEGORY;
7969
+ }
7966
7970
  else {
7967
7971
  return CaseAccessUtils.LEGAL_OPERATIONS_ROLE_CATEGORY;
7968
7972
  }
@@ -7987,6 +7991,9 @@
7987
7991
  case CaseAccessUtils.ADMIN_ROLE_CATEGORY:
7988
7992
  roleName = accessType + "-access-" + CaseAccessUtils.ADMIN_ROLE_NAME;
7989
7993
  break;
7994
+ case CaseAccessUtils.CTSC_ROLE_CATEGORY:
7995
+ roleName = accessType + "-access-" + CaseAccessUtils.CTSC_ROLE_NAME;
7996
+ break;
7990
7997
  default:
7991
7998
  roleName = accessType + "-access-" + CaseAccessUtils.LEGAL_OPERATIONS_ROLE_NAME;
7992
7999
  break;
@@ -8047,6 +8054,9 @@
8047
8054
  CaseAccessUtils.CITIZEN_ROLE = 'citizen';
8048
8055
  CaseAccessUtils.CITIZEN_ROLE_CATEGORY = 'CITIZEN';
8049
8056
  CaseAccessUtils.CITIZEN_ROLE_NAME = 'citizen';
8057
+ CaseAccessUtils.CTSC_ROLE = 'ctsc';
8058
+ CaseAccessUtils.CTSC_ROLE_CATEGORY = 'CTSC';
8059
+ CaseAccessUtils.CTSC_ROLE_NAME = 'ctsc';
8050
8060
 
8051
8061
  var WizardPageFieldToCaseFieldMapper = /** @class */ (function () {
8052
8062
  function WizardPageFieldToCaseFieldMapper() {
@@ -8467,7 +8477,7 @@
8467
8477
  .set('Content-Type', 'application/json');
8468
8478
  return this.http
8469
8479
  .post(url, eventData, { headers: headers, observe: 'body' })
8470
- .pipe(operators.map(function (body) { return _this.processResponseBody(body, eventData); }), operators.catchError(function (error) {
8480
+ .pipe(operators.catchError(function (error) {
8471
8481
  _this.errorService.setError(error);
8472
8482
  return rxjs.throwError(error);
8473
8483
  }));
@@ -8502,7 +8512,7 @@
8502
8512
  .set('Content-Type', 'application/json');
8503
8513
  return this.http
8504
8514
  .post(url, eventData, { headers: headers, observe: 'body' })
8505
- .pipe(operators.map(function (body) { return _this.processResponseBody(body, eventData); }), operators.catchError(function (error) {
8515
+ .pipe(operators.catchError(function (error) {
8506
8516
  _this.errorService.setError(error);
8507
8517
  return rxjs.throwError(error);
8508
8518
  }));
@@ -8542,10 +8552,6 @@
8542
8552
  }
8543
8553
  return url;
8544
8554
  };
8545
- CasesService.prototype.processResponseBody = function (body, eventData) {
8546
- this.processTasksOnSuccess(body, eventData.event);
8547
- return body;
8548
- };
8549
8555
  CasesService.prototype.initialiseEventTrigger = function (eventTrigger) {
8550
8556
  var _this = this;
8551
8557
  if (!eventTrigger.wizard_pages) {
@@ -8556,22 +8562,6 @@
8556
8562
  wizardPage.case_fields = _this.orderService.sort(_this.wizardPageFieldToCaseFieldMapper.mapAll(wizardPage.wizard_page_fields, eventTrigger.case_fields));
8557
8563
  });
8558
8564
  };
8559
- CasesService.prototype.processTasksOnSuccess = function (caseData, eventData) {
8560
- // The following code is work allocation 1 related
8561
- if (this.appConfig.getWorkAllocationApiUrl().toLowerCase() === 'workallocation') {
8562
- // This is used a feature toggle to
8563
- // control the work allocation
8564
- if (!this.isPuiCaseManager()) {
8565
- this.workAllocationService.completeAppropriateTask(caseData.id, eventData.id, caseData.jurisdiction, caseData.case_type)
8566
- .subscribe(function () {
8567
- // Success. Do nothing.
8568
- }, function (error) {
8569
- // Show an appropriate warning about something that went wrong.
8570
- console.warn('Could not process tasks for this case event', error);
8571
- });
8572
- }
8573
- }
8574
- };
8575
8565
  /*
8576
8566
  Checks if the user has role of pui-case-manager and returns true or false
8577
8567
  */
@@ -8594,7 +8584,7 @@
8594
8584
  if (userInfoStr) {
8595
8585
  userInfo = JSON.parse(userInfoStr);
8596
8586
  }
8597
- var roleCategory = camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
8587
+ var roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
8598
8588
  var roleName = camUtils.getAMRoleName('challenged', roleCategory);
8599
8589
  var beginTime = new Date();
8600
8590
  var endTime = new Date(new Date().setUTCHours(23, 59, 59, 999));
@@ -8611,7 +8601,7 @@
8611
8601
  if (userInfoStr) {
8612
8602
  userInfo = JSON.parse(userInfoStr);
8613
8603
  }
8614
- var roleCategory = camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
8604
+ var roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
8615
8605
  var roleName = camUtils.getAMRoleName('specific', roleCategory);
8616
8606
  var id = userInfo.id ? userInfo.id : userInfo.uid;
8617
8607
  var payload = camUtils.getAMPayload(null, id, roleName, roleCategory, 'SPECIFIC', caseId, sar, null, null, true);