@hmcts/ccd-case-ui-toolkit 4.18.12 → 4.18.14-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @hmcts/ccd-case-ui-toolkit - Case UI Toolkit
3
- * @version v4.18.12
3
+ * @version v4.18.14-rc1
4
4
  * @link undefined
5
5
  * @license MIT
6
6
  */
@@ -23902,7 +23902,7 @@ var CaseEventTriggerComponent = /** @class */ (function () {
23902
23902
  + "but the callback service cannot be completed");
23903
23903
  }
23904
23904
  else {
23905
- _this.alertService.success("Case #" + caseReference + " has been updated with event: " + _this.eventTrigger.name);
23905
+ _this.alertService.success("Case #" + caseReference + " has been updated with event: " + _this.eventTrigger.name, true);
23906
23906
  }
23907
23907
  });
23908
23908
  };
@@ -29603,12 +29603,21 @@ var ReadFieldsFilterPipe = /** @class */ (function () {
29603
29603
  }
29604
29604
  return ReadFieldsFilterPipe_1.isEmpty(field.value) ? value : field.value;
29605
29605
  };
29606
- ReadFieldsFilterPipe.evaluateConditionalShow = function (field, formValue, path) {
29606
+ ReadFieldsFilterPipe.evaluateConditionalShow = function (field, formValue, path, formGroupAvaliable, fieldId) {
29607
29607
  if (field.display_context === 'HIDDEN') {
29608
29608
  field.hidden = true;
29609
29609
  }
29610
29610
  else if (field.show_condition) {
29611
- var cond = directives_1.ShowCondition.getInstance(field.show_condition);
29611
+ var cond = void 0;
29612
+ if (fieldId && field.show_condition.indexOf(fieldId) > -1 && !formGroupAvaliable && !!Object.keys(formValue).length) {
29613
+ var search = fieldId + '.';
29614
+ var searchRegExp = new RegExp(search, 'g');
29615
+ var replaceWith = '';
29616
+ cond = directives_1.ShowCondition.getInstance(field.show_condition.replace(searchRegExp, replaceWith));
29617
+ }
29618
+ else {
29619
+ cond = directives_1.ShowCondition.getInstance(field.show_condition);
29620
+ }
29612
29621
  field.hidden = !cond.match(formValue, path);
29613
29622
  }
29614
29623
  else {
@@ -29635,8 +29644,10 @@ var ReadFieldsFilterPipe = /** @class */ (function () {
29635
29644
  var fields = complexField.field_type.complex_fields || [];
29636
29645
  var values = complexField.value || {};
29637
29646
  var checkConditionalShowAgainst = values;
29647
+ var formGroupAvailable = false;
29638
29648
  if (formGroup) {
29639
29649
  checkConditionalShowAgainst = formGroup.value;
29650
+ formGroupAvailable = true;
29640
29651
  }
29641
29652
  return fields
29642
29653
  .map(function (f) {
@@ -29652,7 +29663,7 @@ var ReadFieldsFilterPipe = /** @class */ (function () {
29652
29663
  f.display_context = complexField.display_context;
29653
29664
  }
29654
29665
  if (setupHidden) {
29655
- ReadFieldsFilterPipe_1.evaluateConditionalShow(f, checkConditionalShowAgainst, path);
29666
+ ReadFieldsFilterPipe_1.evaluateConditionalShow(f, checkConditionalShowAgainst, path, formGroupAvailable, complexField.id);
29656
29667
  }
29657
29668
  return f;
29658
29669
  })
@@ -30401,9 +30412,11 @@ var ReadComplexFieldComponent = /** @class */ (function (_super) {
30401
30412
  if (this.caseField.display_context_parameter) {
30402
30413
  this.context = palette_context_enum_1.PaletteContext.TABLE_VIEW;
30403
30414
  }
30404
- else if (!this.caseField.display_context_parameter && this.context && this.context !== palette_context_enum_1.PaletteContext.CHECK_YOUR_ANSWER) {
30415
+ else {
30405
30416
  // default to default views
30406
- this.context = palette_context_enum_1.PaletteContext.DEFAULT;
30417
+ if (!this.caseField.display_context_parameter && this.context) {
30418
+ this.context = palette_context_enum_1.PaletteContext.DEFAULT;
30419
+ }
30407
30420
  }
30408
30421
  if (this.caseField.field_type) {
30409
30422
  this.caseField.field_type.complex_fields.map(function (field) {
@@ -41324,8 +41337,10 @@ var AlertService = /** @class */ (function () {
41324
41337
  // EUI-3381.
41325
41338
  this.push(alert);
41326
41339
  };
41327
- AlertService.prototype.success = function (message) {
41340
+ AlertService.prototype.success = function (message, preserve) {
41341
+ if (preserve === void 0) { preserve = false; }
41328
41342
  this.preservedSuccess = this.preserveMessages(message);
41343
+ this.preserveAlerts = preserve || this.preserveAlerts;
41329
41344
  var alert = { level: 'success', message: message };
41330
41345
  this.successObserver.next(alert);
41331
41346
  // EUI-3381.