@hmcts/ccd-case-ui-toolkit 6.13.10-show-condition-fix → 6.13.10-show-condition-code-fix

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.
@@ -11246,13 +11246,11 @@
11246
11246
  }
11247
11247
  else if (field.show_condition) {
11248
11248
  var cond = void 0;
11249
- if (fieldId && field.show_condition.indexOf(fieldId) > -1 && !formGroupAvaliable && !!Object.keys(formValue).length) {
11249
+ if (fieldId && field.show_condition.indexOf(fieldId + ".") > -1 && !formGroupAvaliable && !!Object.keys(formValue).length) {
11250
11250
  var search = fieldId + '.';
11251
11251
  var searchRegExp = new RegExp(search, 'g');
11252
11252
  var replaceWith = '';
11253
- var condition = field.show_condition.replace(searchRegExp, replaceWith);
11254
- var isValidCondition = condition.split('"').length % 2 === 0;
11255
- cond = ShowCondition.getInstance(isValidCondition ? field.show_condition : condition);
11253
+ cond = ShowCondition.getInstance(field.show_condition.replace(searchRegExp, replaceWith));
11256
11254
  }
11257
11255
  else {
11258
11256
  cond = ShowCondition.getInstance(field.show_condition);