@hmcts/ccd-case-ui-toolkit 7.3.77-5054 → 7.3.77-exui-5016-rc-2

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.
@@ -17,7 +17,6 @@ import moment from 'moment';
17
17
  import { __decorate, __metadata } from 'tslib';
18
18
  import * as _ from 'underscore';
19
19
  import 'reflect-metadata';
20
- import { generate } from 'pegjs';
21
20
  import { StateMachine } from '@edium/fsm';
22
21
  import * as i1$3 from '@angular/material/legacy-dialog';
23
22
  import { MAT_LEGACY_DIALOG_DATA, MatLegacyDialogModule } from '@angular/material/legacy-dialog';
@@ -1854,13 +1853,13 @@ function getUserDetails(sessionStorageService) {
1854
1853
  }
1855
1854
  function isInternalUser(sessionStorageService) {
1856
1855
  const userDetails = getUserDetails(sessionStorageService);
1857
- return userDetails && userDetails?.roles
1856
+ return !!userDetails?.roles
1858
1857
  && !(userDetails.roles.includes(PUI_CASE_MANAGER)
1859
1858
  || userDetails.roles.some((role) => role.toLowerCase().includes(JUDGE)));
1860
1859
  }
1861
1860
  function isJudiciaryUser(sessionStorageService) {
1862
1861
  const userDetails = getUserDetails(sessionStorageService);
1863
- return userDetails && userDetails?.roles
1862
+ return !!userDetails?.roles
1864
1863
  && (userDetails.roles.some((role) => role.toLowerCase().includes(JUDGE)));
1865
1864
  }
1866
1865
 
@@ -4433,7 +4432,11 @@ class FieldsUtils {
4433
4432
  caseFieldType.complex_fields.forEach(field => {
4434
4433
  try {
4435
4434
  const isDynamicField = FieldsUtils.SERVER_RESPONSE_FIELD_TYPE_DYNAMIC_LIST_TYPE.indexOf(field.field_type.type) !== -1;
4436
- if (isDynamicField) {
4435
+ const isDynamicMultiSelectField = field.field_type.type === 'DynamicMultiSelectList';
4436
+ if (isDynamicMultiSelectField) {
4437
+ this.setDynamicMultiSelectListDefinition(field, rootCaseField);
4438
+ }
4439
+ else if (isDynamicField) {
4437
4440
  const dynamicListValue = this.getDynamicListValue(rootCaseField.value, field.id);
4438
4441
  if (dynamicListValue) {
4439
4442
  const list_items = dynamicListValue[0].list_items;
@@ -4466,6 +4469,29 @@ class FieldsUtils {
4466
4469
  }
4467
4470
  }
4468
4471
  }
4472
+ static setDynamicMultiSelectListDefinition(field, rootCaseField) {
4473
+ const dynamicListValue = this.getDynamicListValue(rootCaseField.value, field.id);
4474
+ if (dynamicListValue) {
4475
+ const list_items = dynamicListValue.find(data => data?.list_items !== undefined)?.list_items;
4476
+ if (list_items !== undefined) {
4477
+ field.list_items = list_items;
4478
+ field.formatted_value = {
4479
+ ...field.formatted_value,
4480
+ list_items
4481
+ };
4482
+ }
4483
+ if (rootCaseField.field_type.type !== FieldsUtils.SERVER_RESPONSE_FIELD_TYPE_COLLECTION) {
4484
+ const value = dynamicListValue[0]?.value;
4485
+ if (value !== undefined) {
4486
+ field.value = value;
4487
+ field.formatted_value = {
4488
+ ...field.formatted_value,
4489
+ value
4490
+ };
4491
+ }
4492
+ }
4493
+ }
4494
+ }
4469
4495
  static getDynamicListValue(jsonBlock, key) {
4470
4496
  const data = jsonBlock ? this.getNestedFieldValues(jsonBlock, key, []) : [];
4471
4497
  return data.length > 0 ? data : null;
@@ -4796,107 +4822,955 @@ class FieldsUtils {
4796
4822
  type: Injectable
4797
4823
  }], null, null); })();
4798
4824
 
4799
- const conditionSource = `{
4825
+ // @ts-nocheck
4826
+ // This file is generated by npm run generate:condition-parser. Do not edit by hand.
4827
+ // @generated by Peggy 5.1.0.
4828
+ //
4829
+ // https://peggyjs.org/
4830
+ class peg$SyntaxError extends SyntaxError {
4831
+ constructor(message, expected, found, location) {
4832
+ super(message);
4833
+ this.expected = expected;
4834
+ this.found = found;
4835
+ this.location = location;
4836
+ this.name = "SyntaxError";
4837
+ }
4838
+ format(sources) {
4839
+ let str = "Error: " + this.message;
4840
+ if (this.location) {
4841
+ let src = null;
4842
+ const st = sources.find(s => s.source === this.location.source);
4843
+ if (st) {
4844
+ src = st.text.split(/\r\n|\n|\r/g);
4845
+ }
4846
+ const s = this.location.start;
4847
+ const offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
4848
+ ? this.location.source.offset(s)
4849
+ : s;
4850
+ const loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
4851
+ if (src) {
4852
+ const e = this.location.end;
4853
+ const filler = "".padEnd(offset_s.line.toString().length, " ");
4854
+ const line = src[s.line - 1];
4855
+ const last = s.line === e.line ? e.column : line.length + 1;
4856
+ const hatLen = (last - s.column) || 1;
4857
+ str += "\n --> " + loc + "\n"
4858
+ + filler + " |\n"
4859
+ + offset_s.line + " | " + line + "\n"
4860
+ + filler + " | " + "".padEnd(s.column - 1, " ")
4861
+ + "".padEnd(hatLen, "^");
4862
+ }
4863
+ else {
4864
+ str += "\n at " + loc;
4865
+ }
4866
+ }
4867
+ return str;
4868
+ }
4869
+ static buildMessage(expected, found) {
4870
+ function hex(ch) {
4871
+ return ch.codePointAt(0).toString(16).toUpperCase();
4872
+ }
4873
+ const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, "unicode")
4874
+ ? new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]", "gu")
4875
+ : null;
4876
+ function unicodeEscape(s) {
4877
+ if (nonPrintable) {
4878
+ return s.replace(nonPrintable, ch => "\\u{" + hex(ch) + "}");
4879
+ }
4880
+ return s;
4881
+ }
4882
+ function literalEscape(s) {
4883
+ return unicodeEscape(s
4884
+ .replace(/\\/g, "\\\\")
4885
+ .replace(/"/g, "\\\"")
4886
+ .replace(/\0/g, "\\0")
4887
+ .replace(/\t/g, "\\t")
4888
+ .replace(/\n/g, "\\n")
4889
+ .replace(/\r/g, "\\r")
4890
+ .replace(/[\x00-\x0F]/g, ch => "\\x0" + hex(ch))
4891
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
4892
+ }
4893
+ function classEscape(s) {
4894
+ return unicodeEscape(s
4895
+ .replace(/\\/g, "\\\\")
4896
+ .replace(/\]/g, "\\]")
4897
+ .replace(/\^/g, "\\^")
4898
+ .replace(/-/g, "\\-")
4899
+ .replace(/\0/g, "\\0")
4900
+ .replace(/\t/g, "\\t")
4901
+ .replace(/\n/g, "\\n")
4902
+ .replace(/\r/g, "\\r")
4903
+ .replace(/[\x00-\x0F]/g, ch => "\\x0" + hex(ch))
4904
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
4905
+ }
4906
+ const DESCRIBE_EXPECTATION_FNS = {
4907
+ literal(expectation) {
4908
+ return "\"" + literalEscape(expectation.text) + "\"";
4909
+ },
4910
+ class(expectation) {
4911
+ const escapedParts = expectation.parts.map(part => (Array.isArray(part)
4912
+ ? classEscape(part[0]) + "-" + classEscape(part[1])
4913
+ : classEscape(part)));
4914
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]" + (expectation.unicode ? "u" : "");
4915
+ },
4916
+ any() {
4917
+ return "any character";
4918
+ },
4919
+ end() {
4920
+ return "end of input";
4921
+ },
4922
+ other(expectation) {
4923
+ return expectation.description;
4924
+ },
4925
+ };
4926
+ function describeExpectation(expectation) {
4927
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
4928
+ }
4929
+ function describeExpected(expected) {
4930
+ const descriptions = expected.map(describeExpectation);
4931
+ descriptions.sort();
4932
+ if (descriptions.length > 0) {
4933
+ let j = 1;
4934
+ for (let i = 1; i < descriptions.length; i++) {
4935
+ if (descriptions[i - 1] !== descriptions[i]) {
4936
+ descriptions[j] = descriptions[i];
4937
+ j++;
4938
+ }
4939
+ }
4940
+ descriptions.length = j;
4941
+ }
4942
+ switch (descriptions.length) {
4943
+ case 1:
4944
+ return descriptions[0];
4945
+ case 2:
4946
+ return descriptions[0] + " or " + descriptions[1];
4947
+ default:
4948
+ return descriptions.slice(0, -1).join(", ")
4949
+ + ", or "
4950
+ + descriptions[descriptions.length - 1];
4951
+ }
4952
+ }
4953
+ function describeFound(found) {
4954
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
4955
+ }
4956
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
4957
+ }
4958
+ }
4959
+ function peg$parse(input, options) {
4960
+ options = options !== undefined ? options : {};
4961
+ const peg$FAILED = {};
4962
+ const peg$source = options.grammarSource;
4963
+ const peg$startRuleFunctions = {
4964
+ Start: peg$parseStart,
4965
+ };
4966
+ let peg$startRuleFunction = peg$parseStart;
4967
+ const peg$c0 = "AND";
4968
+ const peg$c1 = "OR";
4969
+ const peg$c2 = "[";
4970
+ const peg$c3 = "]";
4971
+ const peg$c4 = "\"";
4972
+ const peg$c5 = "(";
4973
+ const peg$c6 = ")";
4974
+ const peg$c7 = "=";
4975
+ const peg$c8 = "!=";
4976
+ const peg$c9 = "CONTAINS";
4977
+ const peg$r0 = /^[a-zA-Z]/;
4978
+ const peg$r1 = /^[A-Za-z0-9._\-]/;
4979
+ const peg$r2 = /^[0-9]/;
4980
+ const peg$r3 = /^[A-Za-z0-9.,* _&()\/\-]/;
4981
+ const peg$r4 = /^[ \t]/;
4982
+ const peg$e0 = peg$literalExpectation("AND", false);
4983
+ const peg$e1 = peg$literalExpectation("OR", false);
4984
+ const peg$e2 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false, false);
4985
+ const peg$e3 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], ".", "_", "-"], false, false, false);
4986
+ const peg$e4 = peg$literalExpectation("[", false);
4987
+ const peg$e5 = peg$literalExpectation("]", false);
4988
+ const peg$e6 = peg$classExpectation([["0", "9"]], false, false, false);
4989
+ const peg$e7 = peg$literalExpectation("\"", false);
4990
+ const peg$e8 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], ".", ",", "*", " ", "_", "&", "(", ")", "/", "-"], false, false, false);
4991
+ const peg$e9 = peg$literalExpectation("(", false);
4992
+ const peg$e10 = peg$literalExpectation(")", false);
4993
+ const peg$e11 = peg$literalExpectation("=", false);
4994
+ const peg$e12 = peg$literalExpectation("!=", false);
4995
+ const peg$e13 = peg$literalExpectation("CONTAINS", false);
4996
+ const peg$e14 = peg$otherExpectation("Whitespace");
4997
+ const peg$e15 = peg$classExpectation([" ", "\t"], false, false, false);
4998
+ const peg$e16 = peg$otherExpectation("One or more whitespaces");
4999
+ function peg$f0(term, joins) { return [term].concat(flat(joins)); }
5000
+ function peg$f1(formula) { return formula.length === 1 ? formula[0] : formula; }
5001
+ function peg$f2(comp, term) { return [comp, term]; }
5002
+ function peg$f3(fr, op, val) { return { fieldReference: fr, comparator: op, value: val }; }
5003
+ function peg$f4(c) { return c; }
5004
+ function peg$f5(c) { return c; }
5005
+ function peg$f6(l) { return l.join(""); }
5006
+ function peg$f7(v) { return v.join(""); }
5007
+ function peg$f8(v) { return parseInt(v.join("")); }
5008
+ function peg$f9(s1, fr, s2) { return s1 + fr + s2; }
5009
+ function peg$f10(characters) { return characters.join(""); }
5010
+ function peg$f11(val) { return val.join(""); }
5011
+ let peg$currPos = options.peg$currPos | 0;
5012
+ let peg$savedPos = peg$currPos;
5013
+ const peg$posDetailsCache = [{ line: 1, column: 1 }];
5014
+ let peg$maxFailPos = peg$currPos;
5015
+ let peg$maxFailExpected = options.peg$maxFailExpected || [];
5016
+ let peg$silentFails = options.peg$silentFails | 0;
5017
+ let peg$result;
5018
+ if (options.startRule) {
5019
+ if (!(options.startRule in peg$startRuleFunctions)) {
5020
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
5021
+ }
5022
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
5023
+ }
5024
+ function text() {
5025
+ return input.substring(peg$savedPos, peg$currPos);
5026
+ }
5027
+ function offset() {
5028
+ return peg$savedPos;
5029
+ }
5030
+ function range() {
5031
+ return {
5032
+ source: peg$source,
5033
+ start: peg$savedPos,
5034
+ end: peg$currPos,
5035
+ };
5036
+ }
5037
+ function location() {
5038
+ return peg$computeLocation(peg$savedPos, peg$currPos);
5039
+ }
5040
+ function expected(description, location) {
5041
+ location = location !== undefined
5042
+ ? location
5043
+ : peg$computeLocation(peg$savedPos, peg$currPos);
5044
+ throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location);
5045
+ }
5046
+ function error(message, location) {
5047
+ location = location !== undefined
5048
+ ? location
5049
+ : peg$computeLocation(peg$savedPos, peg$currPos);
5050
+ throw peg$buildSimpleError(message, location);
5051
+ }
5052
+ function peg$getUnicode(pos = peg$currPos) {
5053
+ const cp = input.codePointAt(pos);
5054
+ if (cp === undefined) {
5055
+ return "";
5056
+ }
5057
+ return String.fromCodePoint(cp);
5058
+ }
5059
+ function peg$literalExpectation(text, ignoreCase) {
5060
+ return { type: "literal", text, ignoreCase };
5061
+ }
5062
+ function peg$classExpectation(parts, inverted, ignoreCase, unicode) {
5063
+ return { type: "class", parts, inverted, ignoreCase, unicode };
5064
+ }
5065
+ function peg$anyExpectation() {
5066
+ return { type: "any" };
5067
+ }
5068
+ function peg$endExpectation() {
5069
+ return { type: "end" };
5070
+ }
5071
+ function peg$otherExpectation(description) {
5072
+ return { type: "other", description };
5073
+ }
5074
+ function peg$computePosDetails(pos) {
5075
+ let details = peg$posDetailsCache[pos];
5076
+ let p;
5077
+ if (details) {
5078
+ return details;
5079
+ }
5080
+ else {
5081
+ if (pos >= peg$posDetailsCache.length) {
5082
+ p = peg$posDetailsCache.length - 1;
5083
+ }
5084
+ else {
5085
+ p = pos;
5086
+ while (!peg$posDetailsCache[--p]) { }
5087
+ }
5088
+ details = peg$posDetailsCache[p];
5089
+ details = {
5090
+ line: details.line,
5091
+ column: details.column,
5092
+ };
5093
+ while (p < pos) {
5094
+ if (input.charCodeAt(p) === 10) {
5095
+ details.line++;
5096
+ details.column = 1;
5097
+ }
5098
+ else {
5099
+ details.column++;
5100
+ }
5101
+ p++;
5102
+ }
5103
+ peg$posDetailsCache[pos] = details;
5104
+ return details;
5105
+ }
5106
+ }
5107
+ function peg$computeLocation(startPos, endPos, offset) {
5108
+ const startPosDetails = peg$computePosDetails(startPos);
5109
+ const endPosDetails = peg$computePosDetails(endPos);
5110
+ const res = {
5111
+ source: peg$source,
5112
+ start: {
5113
+ offset: startPos,
5114
+ line: startPosDetails.line,
5115
+ column: startPosDetails.column,
5116
+ },
5117
+ end: {
5118
+ offset: endPos,
5119
+ line: endPosDetails.line,
5120
+ column: endPosDetails.column,
5121
+ },
5122
+ };
5123
+ if (offset && peg$source && (typeof peg$source.offset === "function")) {
5124
+ res.start = peg$source.offset(res.start);
5125
+ res.end = peg$source.offset(res.end);
5126
+ }
5127
+ return res;
5128
+ }
5129
+ function peg$fail(expected) {
5130
+ if (peg$currPos < peg$maxFailPos) {
5131
+ return;
5132
+ }
5133
+ if (peg$currPos > peg$maxFailPos) {
5134
+ peg$maxFailPos = peg$currPos;
5135
+ peg$maxFailExpected = [];
5136
+ }
5137
+ peg$maxFailExpected.push(expected);
5138
+ }
5139
+ function peg$buildSimpleError(message, location) {
5140
+ return new peg$SyntaxError(message, null, null, location);
5141
+ }
5142
+ function peg$buildStructuredError(expected, found, location) {
5143
+ return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
5144
+ }
5145
+ function peg$parseStart() {
5146
+ let s0;
5147
+ s0 = peg$parseFormula();
5148
+ return s0;
5149
+ }
5150
+ function peg$parseFormula() {
5151
+ let s0, s1, s2, s3;
5152
+ s0 = peg$currPos;
5153
+ s1 = peg$parseFormulaTerm();
5154
+ if (s1 !== peg$FAILED) {
5155
+ s2 = [];
5156
+ s3 = peg$parseJoinComparator();
5157
+ while (s3 !== peg$FAILED) {
5158
+ s2.push(s3);
5159
+ s3 = peg$parseJoinComparator();
5160
+ }
5161
+ peg$savedPos = s0;
5162
+ s0 = peg$f0(s1, s2);
5163
+ }
5164
+ else {
5165
+ peg$currPos = s0;
5166
+ s0 = peg$FAILED;
5167
+ }
5168
+ return s0;
5169
+ }
5170
+ function peg$parseFormulaTerm() {
5171
+ let s0;
5172
+ s0 = peg$parseEnclosedFormula();
5173
+ if (s0 === peg$FAILED) {
5174
+ s0 = peg$parseOpenEqualityCheck();
5175
+ }
5176
+ return s0;
5177
+ }
5178
+ function peg$parseEnclosedFormula() {
5179
+ let s0, s1, s2, s3;
5180
+ s0 = peg$currPos;
5181
+ s1 = peg$parseopenBracket();
5182
+ if (s1 !== peg$FAILED) {
5183
+ s2 = peg$parseFormula();
5184
+ if (s2 !== peg$FAILED) {
5185
+ s3 = peg$parsecloseBracket();
5186
+ if (s3 !== peg$FAILED) {
5187
+ peg$savedPos = s0;
5188
+ s0 = peg$f1(s2);
5189
+ }
5190
+ else {
5191
+ peg$currPos = s0;
5192
+ s0 = peg$FAILED;
5193
+ }
5194
+ }
5195
+ else {
5196
+ peg$currPos = s0;
5197
+ s0 = peg$FAILED;
5198
+ }
5199
+ }
5200
+ else {
5201
+ peg$currPos = s0;
5202
+ s0 = peg$FAILED;
5203
+ }
5204
+ return s0;
5205
+ }
5206
+ function peg$parseJoinComparator() {
5207
+ let s0, s1, s2;
5208
+ s0 = peg$currPos;
5209
+ s1 = peg$parseComparator();
5210
+ if (s1 !== peg$FAILED) {
5211
+ s2 = peg$parseFormulaTerm();
5212
+ if (s2 !== peg$FAILED) {
5213
+ peg$savedPos = s0;
5214
+ s0 = peg$f2(s1, s2);
5215
+ }
5216
+ else {
5217
+ peg$currPos = s0;
5218
+ s0 = peg$FAILED;
5219
+ }
5220
+ }
5221
+ else {
5222
+ peg$currPos = s0;
5223
+ s0 = peg$FAILED;
5224
+ }
5225
+ return s0;
5226
+ }
5227
+ function peg$parseOpenEqualityCheck() {
5228
+ let s0, s1, s2, s3, s4, s5;
5229
+ s0 = peg$currPos;
5230
+ s1 = peg$parseFieldRef();
5231
+ if (s1 !== peg$FAILED) {
5232
+ s2 = peg$parse_();
5233
+ if (s2 === peg$FAILED) {
5234
+ s2 = null;
5235
+ }
5236
+ s3 = peg$parseoperator();
5237
+ if (s3 !== peg$FAILED) {
5238
+ s4 = peg$parse_();
5239
+ if (s4 === peg$FAILED) {
5240
+ s4 = null;
5241
+ }
5242
+ s5 = peg$parseValue();
5243
+ if (s5 !== peg$FAILED) {
5244
+ peg$savedPos = s0;
5245
+ s0 = peg$f3(s1, s3, s5);
5246
+ }
5247
+ else {
5248
+ peg$currPos = s0;
5249
+ s0 = peg$FAILED;
5250
+ }
5251
+ }
5252
+ else {
5253
+ peg$currPos = s0;
5254
+ s0 = peg$FAILED;
5255
+ }
5256
+ }
5257
+ else {
5258
+ peg$currPos = s0;
5259
+ s0 = peg$FAILED;
5260
+ }
5261
+ return s0;
5262
+ }
5263
+ function peg$parseComparator() {
5264
+ let s0, s1, s2, s3;
5265
+ s0 = peg$currPos;
5266
+ s1 = peg$parse_();
5267
+ if (s1 === peg$FAILED) {
5268
+ s1 = null;
5269
+ }
5270
+ if (input.substr(peg$currPos, 3) === peg$c0) {
5271
+ s2 = peg$c0;
5272
+ peg$currPos += 3;
5273
+ }
5274
+ else {
5275
+ s2 = peg$FAILED;
5276
+ if (peg$silentFails === 0) {
5277
+ peg$fail(peg$e0);
5278
+ }
5279
+ }
5280
+ if (s2 !== peg$FAILED) {
5281
+ s3 = peg$parse_();
5282
+ if (s3 === peg$FAILED) {
5283
+ s3 = null;
5284
+ }
5285
+ peg$savedPos = s0;
5286
+ s0 = peg$f4(s2);
5287
+ }
5288
+ else {
5289
+ peg$currPos = s0;
5290
+ s0 = peg$FAILED;
5291
+ }
5292
+ if (s0 === peg$FAILED) {
5293
+ s0 = peg$currPos;
5294
+ s1 = peg$parse_();
5295
+ if (s1 === peg$FAILED) {
5296
+ s1 = null;
5297
+ }
5298
+ if (input.substr(peg$currPos, 2) === peg$c1) {
5299
+ s2 = peg$c1;
5300
+ peg$currPos += 2;
5301
+ }
5302
+ else {
5303
+ s2 = peg$FAILED;
5304
+ if (peg$silentFails === 0) {
5305
+ peg$fail(peg$e1);
5306
+ }
5307
+ }
5308
+ if (s2 !== peg$FAILED) {
5309
+ s3 = peg$parse_();
5310
+ if (s3 === peg$FAILED) {
5311
+ s3 = null;
5312
+ }
5313
+ peg$savedPos = s0;
5314
+ s0 = peg$f5(s2);
5315
+ }
5316
+ else {
5317
+ peg$currPos = s0;
5318
+ s0 = peg$FAILED;
5319
+ }
5320
+ }
5321
+ return s0;
5322
+ }
5323
+ function peg$parseWord() {
5324
+ let s0, s1, s2;
5325
+ s0 = peg$currPos;
5326
+ s1 = [];
5327
+ s2 = peg$parseLetter();
5328
+ if (s2 !== peg$FAILED) {
5329
+ while (s2 !== peg$FAILED) {
5330
+ s1.push(s2);
5331
+ s2 = peg$parseLetter();
5332
+ }
5333
+ }
5334
+ else {
5335
+ s1 = peg$FAILED;
5336
+ }
5337
+ if (s1 !== peg$FAILED) {
5338
+ peg$savedPos = s0;
5339
+ s1 = peg$f6(s1);
5340
+ }
5341
+ s0 = s1;
5342
+ return s0;
5343
+ }
5344
+ function peg$parseLetter() {
5345
+ let s0;
5346
+ s0 = input.charAt(peg$currPos);
5347
+ if (peg$r0.test(s0)) {
5348
+ peg$currPos++;
5349
+ }
5350
+ else {
5351
+ s0 = peg$FAILED;
5352
+ if (peg$silentFails === 0) {
5353
+ peg$fail(peg$e2);
5354
+ }
5355
+ }
5356
+ return s0;
5357
+ }
5358
+ function peg$parseValue() {
5359
+ let s0, s1;
5360
+ s0 = peg$parsequotedValue();
5361
+ if (s0 === peg$FAILED) {
5362
+ s0 = peg$currPos;
5363
+ s1 = peg$parseWord();
5364
+ if (s1 !== peg$FAILED) {
5365
+ peg$savedPos = s0;
5366
+ s1 = peg$f7(s1);
5367
+ }
5368
+ s0 = s1;
5369
+ if (s0 === peg$FAILED) {
5370
+ s0 = peg$currPos;
5371
+ s1 = peg$parsenumber();
5372
+ if (s1 !== peg$FAILED) {
5373
+ peg$savedPos = s0;
5374
+ s1 = peg$f8(s1);
5375
+ }
5376
+ s0 = s1;
5377
+ }
5378
+ }
5379
+ return s0;
5380
+ }
5381
+ function peg$parseFieldRef() {
5382
+ let s0;
5383
+ s0 = peg$parseFieldReference();
5384
+ if (s0 === peg$FAILED) {
5385
+ s0 = peg$parseMetadataFieldReference();
5386
+ }
5387
+ return s0;
5388
+ }
5389
+ function peg$parseMetadataFieldReference() {
5390
+ let s0, s1, s2, s3;
5391
+ s0 = peg$currPos;
5392
+ s1 = peg$parseopenSquare();
5393
+ if (s1 !== peg$FAILED) {
5394
+ s2 = peg$parseFieldReference();
5395
+ if (s2 !== peg$FAILED) {
5396
+ s3 = peg$parsecloseSquare();
5397
+ if (s3 !== peg$FAILED) {
5398
+ peg$savedPos = s0;
5399
+ s0 = peg$f9(s1, s2, s3);
5400
+ }
5401
+ else {
5402
+ peg$currPos = s0;
5403
+ s0 = peg$FAILED;
5404
+ }
5405
+ }
5406
+ else {
5407
+ peg$currPos = s0;
5408
+ s0 = peg$FAILED;
5409
+ }
5410
+ }
5411
+ else {
5412
+ peg$currPos = s0;
5413
+ s0 = peg$FAILED;
5414
+ }
5415
+ return s0;
5416
+ }
5417
+ function peg$parseFieldReference() {
5418
+ let s0, s1, s2;
5419
+ s0 = peg$currPos;
5420
+ s1 = [];
5421
+ s2 = input.charAt(peg$currPos);
5422
+ if (peg$r1.test(s2)) {
5423
+ peg$currPos++;
5424
+ }
5425
+ else {
5426
+ s2 = peg$FAILED;
5427
+ if (peg$silentFails === 0) {
5428
+ peg$fail(peg$e3);
5429
+ }
5430
+ }
5431
+ if (s2 !== peg$FAILED) {
5432
+ while (s2 !== peg$FAILED) {
5433
+ s1.push(s2);
5434
+ s2 = input.charAt(peg$currPos);
5435
+ if (peg$r1.test(s2)) {
5436
+ peg$currPos++;
5437
+ }
5438
+ else {
5439
+ s2 = peg$FAILED;
5440
+ if (peg$silentFails === 0) {
5441
+ peg$fail(peg$e3);
5442
+ }
5443
+ }
5444
+ }
5445
+ }
5446
+ else {
5447
+ s1 = peg$FAILED;
5448
+ }
5449
+ if (s1 !== peg$FAILED) {
5450
+ peg$savedPos = s0;
5451
+ s1 = peg$f10(s1);
5452
+ }
5453
+ s0 = s1;
5454
+ return s0;
5455
+ }
5456
+ function peg$parseopenSquare() {
5457
+ let s0;
5458
+ if (input.charCodeAt(peg$currPos) === 91) {
5459
+ s0 = peg$c2;
5460
+ peg$currPos++;
5461
+ }
5462
+ else {
5463
+ s0 = peg$FAILED;
5464
+ if (peg$silentFails === 0) {
5465
+ peg$fail(peg$e4);
5466
+ }
5467
+ }
5468
+ return s0;
5469
+ }
5470
+ function peg$parsecloseSquare() {
5471
+ let s0;
5472
+ if (input.charCodeAt(peg$currPos) === 93) {
5473
+ s0 = peg$c3;
5474
+ peg$currPos++;
5475
+ }
5476
+ else {
5477
+ s0 = peg$FAILED;
5478
+ if (peg$silentFails === 0) {
5479
+ peg$fail(peg$e5);
5480
+ }
5481
+ }
5482
+ return s0;
5483
+ }
5484
+ function peg$parsenumber() {
5485
+ let s0, s1;
5486
+ s0 = [];
5487
+ s1 = input.charAt(peg$currPos);
5488
+ if (peg$r2.test(s1)) {
5489
+ peg$currPos++;
5490
+ }
5491
+ else {
5492
+ s1 = peg$FAILED;
5493
+ if (peg$silentFails === 0) {
5494
+ peg$fail(peg$e6);
5495
+ }
5496
+ }
5497
+ if (s1 !== peg$FAILED) {
5498
+ while (s1 !== peg$FAILED) {
5499
+ s0.push(s1);
5500
+ s1 = input.charAt(peg$currPos);
5501
+ if (peg$r2.test(s1)) {
5502
+ peg$currPos++;
5503
+ }
5504
+ else {
5505
+ s1 = peg$FAILED;
5506
+ if (peg$silentFails === 0) {
5507
+ peg$fail(peg$e6);
5508
+ }
5509
+ }
5510
+ }
5511
+ }
5512
+ else {
5513
+ s0 = peg$FAILED;
5514
+ }
5515
+ return s0;
5516
+ }
5517
+ function peg$parsequotedValue() {
5518
+ let s0, s1, s2, s3;
5519
+ s0 = peg$currPos;
5520
+ if (input.charCodeAt(peg$currPos) === 34) {
5521
+ s1 = peg$c4;
5522
+ peg$currPos++;
5523
+ }
5524
+ else {
5525
+ s1 = peg$FAILED;
5526
+ if (peg$silentFails === 0) {
5527
+ peg$fail(peg$e7);
5528
+ }
5529
+ }
5530
+ if (s1 !== peg$FAILED) {
5531
+ s2 = [];
5532
+ s3 = input.charAt(peg$currPos);
5533
+ if (peg$r3.test(s3)) {
5534
+ peg$currPos++;
5535
+ }
5536
+ else {
5537
+ s3 = peg$FAILED;
5538
+ if (peg$silentFails === 0) {
5539
+ peg$fail(peg$e8);
5540
+ }
5541
+ }
5542
+ while (s3 !== peg$FAILED) {
5543
+ s2.push(s3);
5544
+ s3 = input.charAt(peg$currPos);
5545
+ if (peg$r3.test(s3)) {
5546
+ peg$currPos++;
5547
+ }
5548
+ else {
5549
+ s3 = peg$FAILED;
5550
+ if (peg$silentFails === 0) {
5551
+ peg$fail(peg$e8);
5552
+ }
5553
+ }
5554
+ }
5555
+ if (input.charCodeAt(peg$currPos) === 34) {
5556
+ s3 = peg$c4;
5557
+ peg$currPos++;
5558
+ }
5559
+ else {
5560
+ s3 = peg$FAILED;
5561
+ if (peg$silentFails === 0) {
5562
+ peg$fail(peg$e7);
5563
+ }
5564
+ }
5565
+ if (s3 !== peg$FAILED) {
5566
+ peg$savedPos = s0;
5567
+ s0 = peg$f11(s2);
5568
+ }
5569
+ else {
5570
+ peg$currPos = s0;
5571
+ s0 = peg$FAILED;
5572
+ }
5573
+ }
5574
+ else {
5575
+ peg$currPos = s0;
5576
+ s0 = peg$FAILED;
5577
+ }
5578
+ return s0;
5579
+ }
5580
+ function peg$parseopenBracket() {
5581
+ let s0, s1, s2, s3;
5582
+ s0 = peg$currPos;
5583
+ s1 = peg$parse_();
5584
+ if (s1 === peg$FAILED) {
5585
+ s1 = null;
5586
+ }
5587
+ if (input.charCodeAt(peg$currPos) === 40) {
5588
+ s2 = peg$c5;
5589
+ peg$currPos++;
5590
+ }
5591
+ else {
5592
+ s2 = peg$FAILED;
5593
+ if (peg$silentFails === 0) {
5594
+ peg$fail(peg$e9);
5595
+ }
5596
+ }
5597
+ if (s2 !== peg$FAILED) {
5598
+ s3 = peg$parse_();
5599
+ if (s3 === peg$FAILED) {
5600
+ s3 = null;
5601
+ }
5602
+ s1 = [s1, s2, s3];
5603
+ s0 = s1;
5604
+ }
5605
+ else {
5606
+ peg$currPos = s0;
5607
+ s0 = peg$FAILED;
5608
+ }
5609
+ return s0;
5610
+ }
5611
+ function peg$parsecloseBracket() {
5612
+ let s0, s1, s2, s3;
5613
+ s0 = peg$currPos;
5614
+ s1 = peg$parse_();
5615
+ if (s1 === peg$FAILED) {
5616
+ s1 = null;
5617
+ }
5618
+ if (input.charCodeAt(peg$currPos) === 41) {
5619
+ s2 = peg$c6;
5620
+ peg$currPos++;
5621
+ }
5622
+ else {
5623
+ s2 = peg$FAILED;
5624
+ if (peg$silentFails === 0) {
5625
+ peg$fail(peg$e10);
5626
+ }
5627
+ }
5628
+ if (s2 !== peg$FAILED) {
5629
+ s3 = peg$parse_();
5630
+ if (s3 === peg$FAILED) {
5631
+ s3 = null;
5632
+ }
5633
+ s1 = [s1, s2, s3];
5634
+ s0 = s1;
5635
+ }
5636
+ else {
5637
+ peg$currPos = s0;
5638
+ s0 = peg$FAILED;
5639
+ }
5640
+ return s0;
5641
+ }
5642
+ function peg$parseoperator() {
5643
+ let s0;
5644
+ if (input.charCodeAt(peg$currPos) === 61) {
5645
+ s0 = peg$c7;
5646
+ peg$currPos++;
5647
+ }
5648
+ else {
5649
+ s0 = peg$FAILED;
5650
+ if (peg$silentFails === 0) {
5651
+ peg$fail(peg$e11);
5652
+ }
5653
+ }
5654
+ if (s0 === peg$FAILED) {
5655
+ if (input.substr(peg$currPos, 2) === peg$c8) {
5656
+ s0 = peg$c8;
5657
+ peg$currPos += 2;
5658
+ }
5659
+ else {
5660
+ s0 = peg$FAILED;
5661
+ if (peg$silentFails === 0) {
5662
+ peg$fail(peg$e12);
5663
+ }
5664
+ }
5665
+ if (s0 === peg$FAILED) {
5666
+ if (input.substr(peg$currPos, 8) === peg$c9) {
5667
+ s0 = peg$c9;
5668
+ peg$currPos += 8;
5669
+ }
5670
+ else {
5671
+ s0 = peg$FAILED;
5672
+ if (peg$silentFails === 0) {
5673
+ peg$fail(peg$e13);
5674
+ }
5675
+ }
5676
+ }
5677
+ }
5678
+ return s0;
5679
+ }
5680
+ function peg$parsews() {
5681
+ let s0, s1;
5682
+ peg$silentFails++;
5683
+ s0 = input.charAt(peg$currPos);
5684
+ if (peg$r4.test(s0)) {
5685
+ peg$currPos++;
5686
+ }
5687
+ else {
5688
+ s0 = peg$FAILED;
5689
+ if (peg$silentFails === 0) {
5690
+ peg$fail(peg$e15);
5691
+ }
5692
+ }
5693
+ peg$silentFails--;
5694
+ if (s0 === peg$FAILED) {
5695
+ s1 = peg$FAILED;
5696
+ if (peg$silentFails === 0) {
5697
+ peg$fail(peg$e14);
5698
+ }
5699
+ }
5700
+ return s0;
5701
+ }
5702
+ function peg$parse_() {
5703
+ let s0, s1;
5704
+ peg$silentFails++;
5705
+ s0 = [];
5706
+ s1 = peg$parsews();
5707
+ if (s1 !== peg$FAILED) {
5708
+ while (s1 !== peg$FAILED) {
5709
+ s0.push(s1);
5710
+ s1 = peg$parsews();
5711
+ }
5712
+ }
5713
+ else {
5714
+ s0 = peg$FAILED;
5715
+ }
5716
+ peg$silentFails--;
5717
+ if (s0 === peg$FAILED) {
5718
+ s1 = peg$FAILED;
5719
+ if (peg$silentFails === 0) {
5720
+ peg$fail(peg$e16);
5721
+ }
5722
+ }
5723
+ return s0;
5724
+ }
4800
5725
  function flat(arr, depth = 1) {
4801
- var flatten = function (arr, depth = 1) {
4802
- if (depth) return arr;
4803
-
4804
- // Otherwise, concatenate into the parent array
4805
- return arr.reduce(function (acc, val) {
4806
- return acc.concat(Array.isArray(val) ? flatten(val, depth - 1) : val);
4807
- }, []);
4808
-
4809
- };
4810
-
4811
- return flatten(arr, depth - 1);
5726
+ var flatten = function (arr, depth = 1) {
5727
+ if (depth)
5728
+ return arr;
5729
+ // Otherwise, concatenate into the parent array
5730
+ return arr.reduce(function (acc, val) {
5731
+ return acc.concat(Array.isArray(val) ? flatten(val, depth - 1) : val);
5732
+ }, []);
5733
+ };
5734
+ return flatten(arr, depth - 1);
5735
+ }
5736
+ peg$result = peg$startRuleFunction();
5737
+ const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);
5738
+ function peg$throw() {
5739
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
5740
+ peg$fail(peg$endExpectation());
5741
+ }
5742
+ throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null, peg$maxFailPos < input.length
5743
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
5744
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
5745
+ }
5746
+ if (options.peg$library) {
5747
+ return /** @type {any} */ ({
5748
+ peg$result,
5749
+ peg$currPos,
5750
+ peg$FAILED,
5751
+ peg$maxFailExpected,
5752
+ peg$maxFailPos,
5753
+ peg$success,
5754
+ peg$throw: peg$success ? undefined : peg$throw,
5755
+ });
4812
5756
  }
4813
- }
4814
-
4815
- Start
4816
- = Formula
4817
-
4818
- Formula
4819
- = EnclosedFormula
4820
- / OpenFormula
4821
-
4822
- EnclosedFormula
4823
- = bracket formula:OpenFormula bracket join:(JoinComparator)*
4824
- { return flat([ [formula], join[0] ], 1) }
4825
-
4826
- OpenFormula
4827
- = eq:OpenEqualityCheck joins:(JoinComparator)*
4828
- { return flat([ eq, flat(joins) ]) }
4829
-
4830
- JoinComparator
4831
- = comp:Comparator eq:OpenEqualityCheck
4832
- { return [comp, eq]; }
4833
- / CompoundJoinComparator
4834
-
4835
- CompoundJoinComparator
4836
- = comp:Comparator bracket f:OpenFormula bracket
4837
- { return [comp, f ] }
4838
-
4839
- OpenEqualityCheck
4840
- = fr:FieldRef _? op:operator _? val:Value
4841
- { return { fieldReference: fr, comparator: op, value: val } }
4842
-
4843
- Comparator
4844
- = _? c:'AND' _?
4845
- { return c; }
4846
- / _? c:'OR' _?
4847
- { return c; }
4848
-
4849
- Word
4850
- = l:Letter+
4851
- { return l.join(""); }
4852
-
4853
- Letter
4854
- = [a-zA-Z]
4855
-
4856
- Value
4857
- = v:quotedValue / v:Word
4858
- { return v.join("") }
4859
- / v:number
4860
- { return parseInt(v.join("")) }
4861
-
4862
- FieldRef
4863
- = FieldReference / MetadataFieldReference
4864
-
4865
- MetadataFieldReference
4866
- = s1:openSquare fr:FieldReference s2:closeSquare
4867
- { return s1 + fr + s2 }
4868
-
4869
- FieldReference
4870
- = characters:[A-Za-z0-9._-]+ { return characters.join(""); }
4871
-
4872
- openSquare
4873
- = "["
4874
-
4875
- closeSquare
4876
- = "]"
4877
-
4878
- number
4879
- = [0-9]+
4880
-
4881
- quotedValue
4882
- = '"'val:[A-Za-z0-9.,* _&()/-]*'"'
4883
- { return val.join(""); }
4884
-
4885
- bracket
4886
- = (_? "("+ _? / _? ")"+ _? )
4887
-
4888
- operator
4889
- = "=" / "!=" / "CONTAINS"
4890
-
4891
- ws "Whitespace"
4892
- = [ \t]
4893
-
4894
- _ "One or more whitespaces"
4895
- = ws+
5757
+ if (peg$success) {
5758
+ return peg$result;
5759
+ }
5760
+ else {
5761
+ peg$throw();
5762
+ }
5763
+ }
5764
+ const peg$allowedStartRules = [
5765
+ "Start"
5766
+ ];
4896
5767
 
4897
- nl "New line"
4898
- = "\\n"`;
4899
- var peg = generate(conditionSource);
5768
+ var parser = /*#__PURE__*/Object.freeze({
5769
+ __proto__: null,
5770
+ StartRules: peg$allowedStartRules,
5771
+ SyntaxError: peg$SyntaxError,
5772
+ parse: peg$parse
5773
+ });
4900
5774
 
4901
5775
  class ConditionParser {
4902
5776
  static logger = new StructuredLoggerService();
@@ -4910,7 +5784,7 @@ class ConditionParser {
4910
5784
  return null;
4911
5785
  }
4912
5786
  condition = condition.replace(/CONTAINS/g, ' CONTAINS');
4913
- return peg.parse(condition.trim(), {});
5787
+ return parser.parse(condition.trim(), {});
4914
5788
  }
4915
5789
  /**
4916
5790
  * Evaluate the current fields against the conditions
@@ -6117,8 +6991,12 @@ class FieldTypeSanitiser {
6117
6991
  break;
6118
6992
  case FieldTypeSanitiser.FIELD_TYPE_COLLECTION:
6119
6993
  if (Array.isArray(data[caseField.id])) {
6120
- data[caseField.id].forEach((formElement) => {
6121
- this.sanitiseLists(caseField.field_type.collection_field_type.complex_fields, formElement.value);
6994
+ data[caseField.id].forEach((formElement, index) => {
6995
+ const matchingItem = Array.isArray(caseField.value) && formElement?.id !== undefined
6996
+ ? caseField.value.find((item) => item?.id === formElement.id)
6997
+ : null;
6998
+ const collectionItem = matchingItem || (Array.isArray(caseField.value) ? caseField.value[index] : null);
6999
+ this.sanitiseLists(this.copyCaseFieldsWithCollectionData(caseField.field_type.collection_field_type.complex_fields, collectionItem?.value || collectionItem), formElement.value);
6122
7000
  });
6123
7001
  }
6124
7002
  break;
@@ -6158,6 +7036,25 @@ class FieldTypeSanitiser {
6158
7036
  }
6159
7037
  });
6160
7038
  }
7039
+ copyCaseFieldsWithCollectionData(caseFields, collectionItemData) {
7040
+ return caseFields.map((field) => {
7041
+ const fieldData = collectionItemData?.[field.id];
7042
+ if (field.field_type.type === FieldTypeSanitiser.FIELD_TYPE_COMPLEX) {
7043
+ return {
7044
+ ...field,
7045
+ field_type: {
7046
+ ...field.field_type,
7047
+ complex_fields: this.copyCaseFieldsWithCollectionData(field.field_type.complex_fields, fieldData)
7048
+ }
7049
+ };
7050
+ }
7051
+ return this.isDynamicList(field.field_type.type) &&
7052
+ field.display_context !== 'HIDDEN' &&
7053
+ fieldData?.list_items !== undefined
7054
+ ? { ...field, list_items: fieldData.list_items }
7055
+ : field;
7056
+ });
7057
+ }
6161
7058
  isDynamicList(fieldType) {
6162
7059
  return FieldTypeSanitiser.DYNAMIC_LIST_TYPE.indexOf(fieldType) !== -1;
6163
7060
  }
@@ -7059,6 +7956,7 @@ class LabelSubstitutorModule {
7059
7956
  static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
7060
7957
  FieldsUtils,
7061
7958
  CurrencyPipe,
7959
+ PlaceholderService
7062
7960
  ] });
7063
7961
  }
7064
7962
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LabelSubstitutorModule, [{
@@ -7073,6 +7971,7 @@ class LabelSubstitutorModule {
7073
7971
  providers: [
7074
7972
  FieldsUtils,
7075
7973
  CurrencyPipe,
7974
+ PlaceholderService
7076
7975
  ]
7077
7976
  }]
7078
7977
  }], null, null); })();
@@ -8121,6 +9020,9 @@ class RequestOptionsBuilder {
8121
9020
  * @param value The value to be assessed.
8122
9021
  */
8123
9022
  static includeParam(value) {
9023
+ if (Array.isArray(value)) {
9024
+ return value.some(item => RequestOptionsBuilder.includeParam(item));
9025
+ }
8124
9026
  /* istanbul ignore else */
8125
9027
  if (value) {
8126
9028
  /* istanbul ignore else */
@@ -8131,6 +9033,36 @@ class RequestOptionsBuilder {
8131
9033
  }
8132
9034
  return false;
8133
9035
  }
9036
+ static sanitiseValue(value) {
9037
+ const trimmedValue = value.trim ? value.trim() : value;
9038
+ return trimmedValue.replace ? trimmedValue.replace(/’/i, `'`) : trimmedValue;
9039
+ }
9040
+ static getValueByPath(value, path) {
9041
+ return path.split('.').reduce((currentValue, pathPart) => {
9042
+ if (currentValue === undefined || currentValue === null) {
9043
+ return undefined;
9044
+ }
9045
+ return currentValue[pathPart];
9046
+ }, value);
9047
+ }
9048
+ static getCollectionValues(value, criterion) {
9049
+ if (!Array.isArray(value) ||
9050
+ !criterion.includes('.value.') ||
9051
+ value.some(item => item === null || typeof item !== 'object' || !Object.hasOwn(item, 'value'))) {
9052
+ return value;
9053
+ }
9054
+ const valuePath = criterion.substring(criterion.indexOf('.value.') + 1);
9055
+ return value.map(item => RequestOptionsBuilder.getValueByPath(item, valuePath));
9056
+ }
9057
+ static appendParam(params, key, value) {
9058
+ if (Array.isArray(value)) {
9059
+ const values = value
9060
+ .filter(item => RequestOptionsBuilder.includeParam(item))
9061
+ .map(item => RequestOptionsBuilder.sanitiseValue(item));
9062
+ return params.set(key, `[${values.join(', ')}]`);
9063
+ }
9064
+ return params.set(key, RequestOptionsBuilder.sanitiseValue(value));
9065
+ }
8134
9066
  buildOptions(metaCriteria, caseCriteria, view) {
8135
9067
  // TODO: This should probably be the now built-in URLSearchParams but it
8136
9068
  // requires a bigger refactor and there are bigger fish to fry right now.
@@ -8155,8 +9087,7 @@ class RequestOptionsBuilder {
8155
9087
  /* istanbul ignore else */
8156
9088
  if (RequestOptionsBuilder.includeParam(caseCriteria[criterion])) {
8157
9089
  const key = RequestOptionsBuilder.FIELD_PREFIX + criterion;
8158
- const value = caseCriteria[criterion].trim ? caseCriteria[criterion].trim() : caseCriteria[criterion];
8159
- params = params.set(key, value.replace(/’/i, `'`));
9090
+ params = RequestOptionsBuilder.appendParam(params, key, RequestOptionsBuilder.getCollectionValues(caseCriteria[criterion], criterion));
8160
9091
  }
8161
9092
  }
8162
9093
  }
@@ -8669,31 +9600,32 @@ class CaseAccessUtils {
8669
9600
  static CTSC_ROLE = 'ctsc';
8670
9601
  static CTSC_ROLE_CATEGORY = 'CTSC';
8671
9602
  static CTSC_ROLE_NAME = 'ctsc';
8672
- getMappedRoleCategory(roles = [], roleCategories = []) {
9603
+ // fallback purely if roleCategories is not available in
9604
+ getMappedRoleCategories(roles = []) {
8673
9605
  const roleKeywords = roles.join().split('-').join().split(',');
8674
- if (this.roleOrCategoryExists(CaseAccessUtils.JUDGE_ROLE, CaseAccessUtils.JUDGE_ROLE_CATEGORY, roleKeywords, roleCategories)) {
8675
- return CaseAccessUtils.JUDGE_ROLE_CATEGORY;
9606
+ const roleCategoryList = [];
9607
+ if (this.roleHasKeyword(CaseAccessUtils.JUDGE_ROLE, roleKeywords)) {
9608
+ roleCategoryList.push(CaseAccessUtils.JUDGE_ROLE_CATEGORY);
8676
9609
  }
8677
- else if (this.roleOrCategoryExists(CaseAccessUtils.PROFESSIONAL_ROLE, CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY, roleKeywords, roleCategories)) {
8678
- return CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY;
9610
+ if (this.roleHasKeyword(CaseAccessUtils.PROFESSIONAL_ROLE, roleKeywords)) {
9611
+ roleCategoryList.push(CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY);
8679
9612
  }
8680
- else if (this.roleOrCategoryExists(CaseAccessUtils.CITIZEN_ROLE, CaseAccessUtils.CITIZEN_ROLE_CATEGORY, roleKeywords, roleCategories)) {
8681
- return CaseAccessUtils.CITIZEN_ROLE_CATEGORY;
9613
+ if (this.roleHasKeyword(CaseAccessUtils.CITIZEN_ROLE, roleKeywords)) {
9614
+ roleCategoryList.push(CaseAccessUtils.CITIZEN_ROLE_CATEGORY);
8682
9615
  }
8683
- else if (this.roleOrCategoryExists(CaseAccessUtils.ADMIN_ROLE, CaseAccessUtils.ADMIN_ROLE_CATEGORY, roleKeywords, roleCategories)) {
8684
- return CaseAccessUtils.ADMIN_ROLE_CATEGORY;
9616
+ if (this.roleHasKeyword(CaseAccessUtils.ADMIN_ROLE, roleKeywords)) {
9617
+ roleCategoryList.push(CaseAccessUtils.ADMIN_ROLE_CATEGORY);
8685
9618
  }
8686
- else if (this.roleOrCategoryExists(CaseAccessUtils.CTSC_ROLE, CaseAccessUtils.CTSC_ROLE_CATEGORY, roleKeywords, roleCategories)) {
8687
- return CaseAccessUtils.CTSC_ROLE_CATEGORY;
9619
+ if (this.roleHasKeyword(CaseAccessUtils.CTSC_ROLE, roleKeywords)) {
9620
+ roleCategoryList.push(CaseAccessUtils.CTSC_ROLE_CATEGORY);
8688
9621
  }
8689
- else {
8690
- return CaseAccessUtils.LEGAL_OPERATIONS_ROLE_CATEGORY;
9622
+ if (this.roleHasKeyword(CaseAccessUtils.LEGAL_OPERATIONS_ROLE, roleKeywords)) {
9623
+ roleCategoryList.push(CaseAccessUtils.LEGAL_OPERATIONS_ROLE_CATEGORY);
8691
9624
  }
9625
+ return roleCategoryList;
8692
9626
  }
8693
- roleOrCategoryExists(roleKeyword, roleCategory, roleKeywords, roleCategories) {
8694
- const categoryExists = roleCategories.indexOf(roleCategory) > -1;
8695
- const keywordExists = roleKeywords.indexOf(roleKeyword) > -1;
8696
- return categoryExists ? categoryExists : keywordExists;
9627
+ roleHasKeyword(keyword, roleWords) {
9628
+ return roleWords.includes(keyword);
8697
9629
  }
8698
9630
  getAMRoleName(accessType, aMRole) {
8699
9631
  let roleName = '';
@@ -9123,10 +10055,10 @@ class CaseworkerService {
9123
10055
  this.appConfig = appConfig;
9124
10056
  this.errorService = errorService;
9125
10057
  }
9126
- getCaseworkers(serviceId) {
9127
- const url = `${this.appConfig.getWorkAllocationApiUrl()}/caseworker/getUsersByServiceName`;
10058
+ getUserByIdamId(idamId) {
10059
+ const url = `${this.appConfig.getWorkAllocationApiUrl()}/caseworker/getUserByIdamId`;
9128
10060
  return this.http
9129
- .post(url, { services: [serviceId] })
10061
+ .post(url, idamId)
9130
10062
  .pipe(catchError(error => {
9131
10063
  this.errorService.setError(error);
9132
10064
  return throwError(error);
@@ -9977,8 +10909,10 @@ class CaseEditComponent {
9977
10909
  return form.value.event.id;
9978
10910
  }
9979
10911
  generateCaseEventData({ eventTrigger, form }) {
10912
+ const formData = this.replaceHiddenFormValuesWithOriginalCaseData(form.get('data'), eventTrigger.case_fields);
10913
+ this.formValueService.sanitiseDynamicLists(eventTrigger.case_fields, { data: formData });
9980
10914
  const caseEventData = {
9981
- data: this.replaceEmptyComplexFieldValues(this.formValueService.sanitise(this.replaceHiddenFormValuesWithOriginalCaseData(form.get('data'), eventTrigger.case_fields), this.isCaseFlagSubmission)),
10915
+ data: this.replaceEmptyComplexFieldValues(this.formValueService.sanitise(formData, this.isCaseFlagSubmission)),
9982
10916
  event: form.value.event
9983
10917
  };
9984
10918
  this.formValueService.clearNonCaseFields(caseEventData.data, eventTrigger.case_fields);
@@ -10578,30 +11512,35 @@ class CasesService {
10578
11512
  }
10579
11513
  createChallengedAccessRequest(caseId, request) {
10580
11514
  // Assignment API endpoint
10581
- const userInfoStr = this.sessionStorageService.getItem('userDetails');
10582
11515
  const camUtils = new CaseAccessUtils();
10583
- let userInfo;
10584
- if (userInfoStr) {
10585
- userInfo = JSON.parse(userInfoStr);
10586
- }
10587
- const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
10588
- const roleName = camUtils.getAMRoleName('challenged', roleCategory);
11516
+ let userInfo = getUserDetails(this.sessionStorageService);
11517
+ if (!userInfo) {
11518
+ return throwError(() => new Error('User info not found in session storage'));
11519
+ }
11520
+ // EXUI-4758 - getMappedRoleCategories no longer returns a single string, checks all roles to get the most likely roleCategory
11521
+ // Unsure whether we should be using mapped role categories any more - should trust the roleCategories from userInfo if they exist
11522
+ const roleCategories = userInfo.roleCategories || camUtils.getMappedRoleCategories(userInfo.roles);
11523
+ // If user has no role categories, default to LEGAL_OPERATIONS
11524
+ const roleName = camUtils.getAMRoleName('challenged', roleCategories?.length > 0 ? roleCategories[0] : "LEGAL_OPERATIONS");
10589
11525
  const beginTime = new Date();
10590
11526
  const endTime = new Date(new Date().setUTCHours(23, 59, 59, 999));
10591
11527
  const id = userInfo.id ? userInfo.id : userInfo.uid;
10592
11528
  const isNew = true;
10593
- const payload = camUtils.getAMPayload(id, id, roleName, roleCategory, 'CHALLENGED', caseId, request, beginTime, endTime, isNew);
11529
+ const payload = camUtils.getAMPayload(id, id, roleName,
11530
+ // EXUI-4758 - Return first roleCategory as the roleCategory
11531
+ roleCategories[0], 'CHALLENGED', caseId, request, beginTime, endTime, isNew);
10594
11532
  return this.http.post(`/api/challenged-access-request`, payload);
10595
11533
  }
10596
11534
  createSpecificAccessRequest(caseId, sar) {
10597
- // Assignment API endpoint
10598
- const userInfoStr = this.sessionStorageService.getItem('userDetails');
10599
11535
  const camUtils = new CaseAccessUtils();
10600
- let userInfo;
10601
- if (userInfoStr) {
10602
- userInfo = JSON.parse(userInfoStr);
10603
- }
10604
- const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
11536
+ let userInfo = getUserDetails(this.sessionStorageService);
11537
+ if (!userInfo) {
11538
+ return throwError(() => new Error('User info not found in session storage'));
11539
+ }
11540
+ // EXUI-4758 - See above comment
11541
+ const roleCategories = userInfo.roleCategories || camUtils.getMappedRoleCategories(userInfo.roles);
11542
+ // EXUI-4758 - Return first roleCategory as the roleCategory for now, unless not present, in which case default to LEGAL_OPERATIONS
11543
+ const roleCategory = roleCategories?.length > 0 ? roleCategories[0] : "LEGAL_OPERATIONS";
10605
11544
  const roleName = camUtils.getAMRoleName('specific', roleCategory);
10606
11545
  const id = userInfo.id ? userInfo.id : userInfo.uid;
10607
11546
  const payload = camUtils.getAMPayload(null, id, roleName, roleCategory, 'SPECIFIC', caseId, sar, null, null, true);
@@ -11558,6 +12497,8 @@ class CaseEditPageComponent {
11558
12497
  saveDraftSub;
11559
12498
  caseFormValidationErrorsSub;
11560
12499
  logger = new StructuredLoggerService();
12500
+ fieldsUtils = new FieldsUtils();
12501
+ placeholderService = new PlaceholderService();
11561
12502
  caseEditFormComponents;
11562
12503
  static scrollToTop() {
11563
12504
  window.scrollTo(0, 0);
@@ -11722,7 +12663,7 @@ class CaseEditPageComponent {
11722
12663
  ? group.get(`${casefield.id}_judicialUserControl`)
11723
12664
  : group.get(casefield.id);
11724
12665
  if (fieldElement) {
11725
- const label = casefield.label || 'Field';
12666
+ const label = this.getInterpolatedFieldLabel(casefield);
11726
12667
  let id = casefield.id;
11727
12668
  if (fieldElement['component'] && (fieldElement['component'].parent || sourceFromComplexField)) {
11728
12669
  if (fieldElement['component'].idPrefix.indexOf(`_${id}_`) === -1) {
@@ -11787,7 +12728,7 @@ class CaseEditPageComponent {
11787
12728
  });
11788
12729
  }
11789
12730
  else {
11790
- this.validationErrors.push({ id, message: `Select or fill the required ${casefield.label} field` });
12731
+ this.validationErrors.push({ id, message: `Select or fill the required ${label} field` });
11791
12732
  fieldElement.markAsDirty();
11792
12733
  }
11793
12734
  }
@@ -12144,13 +13085,15 @@ class CaseEditPageComponent {
12144
13085
  return result;
12145
13086
  }
12146
13087
  buildCaseEventData(fromPreviousPage) {
12147
- const formValue = this.editForm.value;
13088
+ // EXUI-3839 - we need to get the raw value of the form because otherwise disabled fields
13089
+ // (e.g. read only fields or fields disabled due to show condition) will not be included
13090
+ const formRawValue = this.editForm.getRawValue();
12148
13091
  // Get the CaseEventData for the current page.
12149
13092
  const pageFields = this.currentPage.case_fields;
12150
- const pageEventData = this.getFilteredCaseEventData(pageFields, formValue, true);
13093
+ const pageEventData = this.getFilteredCaseEventData(pageFields, formRawValue, true);
12151
13094
  // Get the CaseEventData for the entire form (all pages).
12152
13095
  const allCaseFields = this.getCaseFieldsFromCurrentAndPreviousPages();
12153
- const formEventData = this.getFilteredCaseEventData(allCaseFields, formValue, false, true, fromPreviousPage);
13096
+ const formEventData = this.getFilteredCaseEventData(allCaseFields, formRawValue, false, true, fromPreviousPage);
12154
13097
  // Now here's the key thing - the pageEventData has a property called `event_data` and
12155
13098
  // we need THAT to be the value of the entire form: `formEventData.data`.
12156
13099
  pageEventData.event_data = formEventData.data;
@@ -12195,7 +13138,20 @@ class CaseEditPageComponent {
12195
13138
  });
12196
13139
  }
12197
13140
  getRpxTranslatePipeArgs(fieldLabel) {
12198
- return fieldLabel ? ({ FIELDLABEL: fieldLabel }) : null;
13141
+ return fieldLabel ? ({ FIELDLABEL: this.resolveLabelPlaceholders(fieldLabel) }) : null;
13142
+ }
13143
+ getInterpolatedFieldLabel(caseField) {
13144
+ const label = caseField.label || 'Field';
13145
+ return this.resolveLabelPlaceholders(label);
13146
+ }
13147
+ resolveLabelPlaceholders(label) {
13148
+ const dataControl = this.editForm?.controls?.['data'];
13149
+ const formFields = dataControl && typeof dataControl.getRawValue === 'function'
13150
+ ? dataControl.getRawValue()
13151
+ : {};
13152
+ const contextFields = this.caseFields?.length ? this.caseFields : this.eventTrigger?.case_fields || [];
13153
+ const fields = this.fieldsUtils.mergeLabelCaseFieldsAndFormFields(contextFields, formFields);
13154
+ return this.placeholderService.resolvePlaceholders(fields, label);
12199
13155
  }
12200
13156
  onEventCanBeCompleted(eventCanBeCompleted) {
12201
13157
  this.caseEdit.onEventCanBeCompleted({
@@ -12255,7 +13211,7 @@ class CaseEditPageComponent {
12255
13211
  type: ViewChildren,
12256
13212
  args: [CaseEditFormComponent]
12257
13213
  }] }); })();
12258
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 37 }); })();
13214
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 38 }); })();
12259
13215
 
12260
13216
  class CallbackErrorsContext {
12261
13217
  triggerText;
@@ -12701,12 +13657,9 @@ class CaseEventCompletionTaskReassignedComponent {
12701
13657
  this.jurisdiction = task.jurisdiction;
12702
13658
  this.caseType = task.case_type_id;
12703
13659
  // Current user is a caseworker?
12704
- this.caseworkerSubscription = this.caseworkerService.getCaseworkers(task.jurisdiction).subscribe(result => {
12705
- if (result && result[0].service === task.jurisdiction && result[0].caseworkers) {
12706
- const caseworker = result[0].caseworkers.find(x => x.idamId === task.assignee);
12707
- if (caseworker) {
12708
- this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
12709
- }
13660
+ this.caseworkerSubscription = this.caseworkerService.getUserByIdamId(task.assignee).subscribe(caseworker => {
13661
+ if (caseworker) {
13662
+ this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
12710
13663
  }
12711
13664
  if (!this.assignedUserName) {
12712
13665
  // Current user is a judicial user?
@@ -25350,7 +26303,7 @@ class FieldReadComponent extends AbstractFieldReadComponent {
25350
26303
  type: ViewChild,
25351
26304
  args: ['fieldContainer', { static: false, read: ViewContainerRef }]
25352
26305
  }] }); })();
25353
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FieldReadComponent, { className: "FieldReadComponent", filePath: "lib/shared/components/palette/base-field/field-read.component.ts", lineNumber: 16 }); })();
26306
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FieldReadComponent, { className: "FieldReadComponent", filePath: "lib/shared/components/palette/base-field/field-read.component.ts", lineNumber: 15 }); })();
25354
26307
 
25355
26308
  const _c0$y = ["fieldContainer"];
25356
26309
  const FIX_CASEFIELD_FOR = ['FixedList', 'DynamicList', 'DynamicMultiSelectList'];
@@ -29712,22 +30665,24 @@ class UpdateFlagTitleDisplayPipe extends AsyncPipe {
29712
30665
 
29713
30666
  const _c0$l = (a0, a1, a2) => [a0, false, undefined, true, a1, a2];
29714
30667
  function ReadComplexFieldRawComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
29715
- i0.ɵɵelementContainerStart(0);
29716
- i0.ɵɵelementStart(1, "dt", 2)(2, "span", 3);
29717
- i0.ɵɵtext(3);
29718
- i0.ɵɵpipe(4, "rpxTranslate");
30668
+ i0.ɵɵelementContainerStart(0)(1, 2);
30669
+ i0.ɵɵelementStart(2, "dt", 3)(3, "span", 4);
30670
+ i0.ɵɵtext(4);
30671
+ i0.ɵɵpipe(5, "rpxTranslate");
29719
30672
  i0.ɵɵelementEnd()();
29720
- i0.ɵɵelementStart(5, "dd", 2);
29721
- i0.ɵɵelement(6, "ccd-field-read", 4);
30673
+ i0.ɵɵelementStart(6, "dd", 3);
30674
+ i0.ɵɵelement(7, "ccd-field-read", 5);
29722
30675
  i0.ɵɵelementEnd();
29723
- i0.ɵɵelementContainerEnd();
30676
+ i0.ɵɵelementContainerEnd()();
29724
30677
  } if (rf & 2) {
29725
30678
  const field_r1 = ctx.$implicit;
29726
30679
  const ctx_r1 = i0.ɵɵnextContext();
29727
30680
  i0.ɵɵadvance();
30681
+ i0.ɵɵproperty("caseField", field_r1)("formGroup", ctx_r1.topLevelFormGroup)("contextFields", ctx_r1.caseFields);
30682
+ i0.ɵɵadvance();
29728
30683
  i0.ɵɵproperty("hidden", field_r1.hidden || field_r1.field_type.type === "Label");
29729
30684
  i0.ɵɵadvance(2);
29730
- i0.ɵɵtextInterpolate(ctx_r1.isTranslatable(field_r1) ? i0.ɵɵpipeBind1(4, 8, field_r1.label) : field_r1.label);
30685
+ i0.ɵɵtextInterpolate(ctx_r1.isTranslatable(field_r1) ? i0.ɵɵpipeBind1(5, 11, field_r1.label) : field_r1.label);
29731
30686
  i0.ɵɵadvance(2);
29732
30687
  i0.ɵɵproperty("hidden", field_r1.hidden);
29733
30688
  i0.ɵɵadvance();
@@ -29740,9 +30695,9 @@ function ReadComplexFieldRawComponent_ng_container_1_Template(rf, ctx) { if (rf
29740
30695
  class ReadComplexFieldRawComponent extends AbstractFieldReadComponent {
29741
30696
  caseFields = [];
29742
30697
  static ɵfac = /*@__PURE__*/ (() => { let ɵReadComplexFieldRawComponent_BaseFactory; return function ReadComplexFieldRawComponent_Factory(__ngFactoryType__) { return (ɵReadComplexFieldRawComponent_BaseFactory || (ɵReadComplexFieldRawComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadComplexFieldRawComponent)))(__ngFactoryType__ || ReadComplexFieldRawComponent); }; })();
29743
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadComplexFieldRawComponent, selectors: [["ccd-read-complex-field-raw"]], inputs: { caseFields: "caseFields" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 12, consts: [[1, "complex-raw"], [4, "ngFor", "ngForOf"], [3, "hidden"], [1, "text-16"], [3, "caseField", "context", "caseFields", "topLevelFormGroup", "idPrefix"]], template: function ReadComplexFieldRawComponent_Template(rf, ctx) { if (rf & 1) {
30698
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadComplexFieldRawComponent, selectors: [["ccd-read-complex-field-raw"]], inputs: { caseFields: "caseFields" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 12, consts: [[1, "complex-raw"], [4, "ngFor", "ngForOf"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], [3, "hidden"], [1, "text-16"], [3, "caseField", "context", "caseFields", "topLevelFormGroup", "idPrefix"]], template: function ReadComplexFieldRawComponent_Template(rf, ctx) { if (rf & 1) {
29744
30699
  i0.ɵɵelementStart(0, "dl", 0);
29745
- i0.ɵɵtemplate(1, ReadComplexFieldRawComponent_ng_container_1_Template, 7, 10, "ng-container", 1);
30700
+ i0.ɵɵtemplate(1, ReadComplexFieldRawComponent_ng_container_1_Template, 8, 13, "ng-container", 1);
29746
30701
  i0.ɵɵpipe(2, "ccdReadFieldsFilter");
29747
30702
  i0.ɵɵelementEnd();
29748
30703
  } if (rf & 2) {
@@ -29752,17 +30707,17 @@ class ReadComplexFieldRawComponent extends AbstractFieldReadComponent {
29752
30707
  }
29753
30708
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadComplexFieldRawComponent, [{
29754
30709
  type: Component,
29755
- args: [{ selector: 'ccd-read-complex-field-raw', standalone: false, template: "<dl class=\"complex-raw\">\n <ng-container *ngFor=\"let field of caseField | ccdReadFieldsFilter:false :undefined :true :topLevelFormGroup :id()\">\n <dt [hidden]=\"field.hidden || field.field_type.type === 'Label'\"><span class=\"text-16\">{{isTranslatable(field) ? (field.label | rpxTranslate) : field.label}}</span></dt>\n <dd [hidden]=\"field.hidden\">\n <ccd-field-read [caseField]=\"field\" [context]=\"context\" [caseFields]=\"caseFields\" [topLevelFormGroup]=\"topLevelFormGroup\" [idPrefix]=\"idPrefix\"></ccd-field-read>\n </dd>\n </ng-container>\n</dl>\n", styles: ["dl.complex-raw{list-style-type:none;margin:5px 0 10px}dl.complex-raw dl.complex-raw{padding-left:2ch}dl.complex-raw dt{font-weight:700}\n"] }]
30710
+ args: [{ selector: 'ccd-read-complex-field-raw', standalone: false, template: "<dl class=\"complex-raw\">\n <ng-container *ngFor=\"let field of caseField | ccdReadFieldsFilter:false :undefined :true :topLevelFormGroup :id()\">\n <ng-container ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"topLevelFormGroup\" [contextFields]=\"caseFields\">\n <dt [hidden]=\"field.hidden || field.field_type.type === 'Label'\"><span class=\"text-16\">{{isTranslatable(field) ? (field.label | rpxTranslate) : field.label}}</span></dt>\n <dd [hidden]=\"field.hidden\">\n <ccd-field-read [caseField]=\"field\" [context]=\"context\" [caseFields]=\"caseFields\" [topLevelFormGroup]=\"topLevelFormGroup\" [idPrefix]=\"idPrefix\"></ccd-field-read>\n </dd>\n </ng-container>\n </ng-container>\n</dl>\n", styles: ["dl.complex-raw{list-style-type:none;margin:5px 0 10px}dl.complex-raw dl.complex-raw{padding-left:2ch}dl.complex-raw dt{font-weight:700}\n"] }]
29756
30711
  }], null, { caseFields: [{
29757
30712
  type: Input
29758
30713
  }] }); })();
29759
30714
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadComplexFieldRawComponent, { className: "ReadComplexFieldRawComponent", filePath: "lib/shared/components/palette/complex/read-complex-field-raw.component.ts", lineNumber: 17 }); })();
29760
30715
 
29761
30716
  const _c0$k = (a0, a1, a2, a3) => [a0, false, undefined, true, a1, a2, a3];
29762
- function ReadComplexFieldTableComponent_ng_container_9_ng_container_1_Template(rf, ctx) { if (rf & 1) {
30717
+ function ReadComplexFieldTableComponent_ng_container_9_ng_container_2_Template(rf, ctx) { if (rf & 1) {
29763
30718
  i0.ɵɵelementContainerStart(0);
29764
- i0.ɵɵelementStart(1, "tr", 7)(2, "td", 8)(3, "span", 3);
29765
- i0.ɵɵelement(4, "ccd-field-read", 9);
30719
+ i0.ɵɵelementStart(1, "tr", 8)(2, "td", 9)(3, "span", 3);
30720
+ i0.ɵɵelement(4, "ccd-field-read", 10);
29766
30721
  i0.ɵɵelementEnd()()();
29767
30722
  i0.ɵɵelementContainerEnd();
29768
30723
  } if (rf & 2) {
@@ -29773,13 +30728,13 @@ function ReadComplexFieldTableComponent_ng_container_9_ng_container_1_Template(r
29773
30728
  i0.ɵɵadvance(3);
29774
30729
  i0.ɵɵproperty("topLevelFormGroup", ctx_r1.topLevelFormGroup)("caseFields", ctx_r1.caseFields)("caseField", field_r1)("context", ctx_r1.context);
29775
30730
  } }
29776
- function ReadComplexFieldTableComponent_ng_container_9_ng_template_3_Template(rf, ctx) { if (rf & 1) {
29777
- i0.ɵɵelementStart(0, "tr", 10)(1, "th", 11)(2, "span", 3);
30731
+ function ReadComplexFieldTableComponent_ng_container_9_ng_template_4_Template(rf, ctx) { if (rf & 1) {
30732
+ i0.ɵɵelementStart(0, "tr", 11)(1, "th", 12)(2, "span", 3);
29778
30733
  i0.ɵɵtext(3);
29779
30734
  i0.ɵɵpipe(4, "rpxTranslate");
29780
30735
  i0.ɵɵelementEnd()();
29781
30736
  i0.ɵɵelementStart(5, "td")(6, "span", 3);
29782
- i0.ɵɵelement(7, "ccd-field-read", 9);
30737
+ i0.ɵɵelement(7, "ccd-field-read", 10);
29783
30738
  i0.ɵɵelementEnd()()();
29784
30739
  } if (rf & 2) {
29785
30740
  const field_r1 = i0.ɵɵnextContext().$implicit;
@@ -29791,16 +30746,19 @@ function ReadComplexFieldTableComponent_ng_container_9_ng_template_3_Template(rf
29791
30746
  i0.ɵɵproperty("topLevelFormGroup", ctx_r1.topLevelFormGroup)("caseFields", ctx_r1.caseFields)("caseField", field_r1)("context", ctx_r1.context);
29792
30747
  } }
29793
30748
  function ReadComplexFieldTableComponent_ng_container_9_Template(rf, ctx) { if (rf & 1) {
29794
- i0.ɵɵelementContainerStart(0);
29795
- i0.ɵɵtemplate(1, ReadComplexFieldTableComponent_ng_container_9_ng_container_1_Template, 5, 5, "ng-container", 6);
29796
- i0.ɵɵpipe(2, "ccdIsCompound");
29797
- i0.ɵɵtemplate(3, ReadComplexFieldTableComponent_ng_container_9_ng_template_3_Template, 8, 8, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
29798
- i0.ɵɵelementContainerEnd();
30749
+ i0.ɵɵelementContainerStart(0)(1, 6);
30750
+ i0.ɵɵtemplate(2, ReadComplexFieldTableComponent_ng_container_9_ng_container_2_Template, 5, 5, "ng-container", 7);
30751
+ i0.ɵɵpipe(3, "ccdIsCompound");
30752
+ i0.ɵɵtemplate(4, ReadComplexFieldTableComponent_ng_container_9_ng_template_4_Template, 8, 8, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
30753
+ i0.ɵɵelementContainerEnd()();
29799
30754
  } if (rf & 2) {
29800
30755
  const field_r1 = ctx.$implicit;
29801
- const SimpleRow_r3 = i0.ɵɵreference(4);
30756
+ const SimpleRow_r3 = i0.ɵɵreference(5);
30757
+ const ctx_r1 = i0.ɵɵnextContext();
30758
+ i0.ɵɵadvance();
30759
+ i0.ɵɵproperty("caseField", field_r1)("formGroup", ctx_r1.topLevelFormGroup)("contextFields", ctx_r1.caseFields);
29802
30760
  i0.ɵɵadvance();
29803
- i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 2, field_r1))("ngIfElse", SimpleRow_r3);
30761
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(3, 5, field_r1))("ngIfElse", SimpleRow_r3);
29804
30762
  } }
29805
30763
  class ReadComplexFieldTableComponent extends AbstractFieldReadComponent {
29806
30764
  // parent_ can be replaced with any ***_ - underscore is only important character
@@ -29821,7 +30779,7 @@ class ReadComplexFieldTableComponent extends AbstractFieldReadComponent {
29821
30779
  this.path = ReadComplexFieldTableComponent.DUMMY_STRING_PRE + this.idPrefix + ReadComplexFieldTableComponent.DUMMY_STRING_POST;
29822
30780
  }
29823
30781
  static ɵfac = /*@__PURE__*/ (() => { let ɵReadComplexFieldTableComponent_BaseFactory; return function ReadComplexFieldTableComponent_Factory(__ngFactoryType__) { return (ɵReadComplexFieldTableComponent_BaseFactory || (ɵReadComplexFieldTableComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadComplexFieldTableComponent)))(__ngFactoryType__ || ReadComplexFieldTableComponent); }; })();
29824
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadComplexFieldTableComponent, selectors: [["ccd-read-complex-field-table"]], inputs: { caseFields: "caseFields" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 17, consts: [["SimpleRow", ""], [1, "complex-panel"], [1, "complex-panel-title"], [1, "text-16"], ["aria-describedby", "complex field table", 1, "complex-panel-table"], [4, "ngFor", "ngForOf"], [4, "ngIf", "ngIfElse"], [1, "complex-panel-compound-field", 3, "hidden"], ["colspan", "2"], [3, "topLevelFormGroup", "caseFields", "caseField", "context"], [1, "complex-panel-simple-field", 3, "hidden"], ["id", "complex-panel-simple-field-label"]], template: function ReadComplexFieldTableComponent_Template(rf, ctx) { if (rf & 1) {
30782
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadComplexFieldTableComponent, selectors: [["ccd-read-complex-field-table"]], inputs: { caseFields: "caseFields" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 17, consts: [["SimpleRow", ""], [1, "complex-panel"], [1, "complex-panel-title"], [1, "text-16"], ["aria-describedby", "complex field table", 1, "complex-panel-table"], [4, "ngFor", "ngForOf"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], [4, "ngIf", "ngIfElse"], [1, "complex-panel-compound-field", 3, "hidden"], ["colspan", "2"], [3, "topLevelFormGroup", "caseFields", "caseField", "context"], [1, "complex-panel-simple-field", 3, "hidden"], ["id", "complex-panel-simple-field-label"]], template: function ReadComplexFieldTableComponent_Template(rf, ctx) { if (rf & 1) {
29825
30783
  i0.ɵɵelementStart(0, "div", 1)(1, "dl", 2)(2, "dt")(3, "span", 3);
29826
30784
  i0.ɵɵtext(4);
29827
30785
  i0.ɵɵpipe(5, "rpxTranslate");
@@ -29829,7 +30787,7 @@ class ReadComplexFieldTableComponent extends AbstractFieldReadComponent {
29829
30787
  i0.ɵɵelement(6, "dd");
29830
30788
  i0.ɵɵelementEnd();
29831
30789
  i0.ɵɵelementStart(7, "table", 4)(8, "tbody");
29832
- i0.ɵɵtemplate(9, ReadComplexFieldTableComponent_ng_container_9_Template, 5, 4, "ng-container", 5);
30790
+ i0.ɵɵtemplate(9, ReadComplexFieldTableComponent_ng_container_9_Template, 6, 7, "ng-container", 5);
29833
30791
  i0.ɵɵpipe(10, "ccdReadFieldsFilter");
29834
30792
  i0.ɵɵelementEnd()()();
29835
30793
  } if (rf & 2) {
@@ -29841,7 +30799,7 @@ class ReadComplexFieldTableComponent extends AbstractFieldReadComponent {
29841
30799
  }
29842
30800
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadComplexFieldTableComponent, [{
29843
30801
  type: Component,
29844
- args: [{ selector: 'ccd-read-complex-field-table', standalone: false, template: "<div class=\"complex-panel\">\n <dl class=\"complex-panel-title\"><dt><span class=\"text-16\">{{caseField.label | rpxTranslate}}</span></dt><dd></dd></dl>\n <table class=\"complex-panel-table\" aria-describedby=\"complex field table\">\n <tbody>\n <ng-container *ngFor=\"let field of caseField | ccdReadFieldsFilter:false :undefined :true :topLevelFormGroup :path :idPrefix\">\n <ng-container *ngIf=\"(field | ccdIsCompound); else SimpleRow\">\n <tr class=\"complex-panel-compound-field\" [hidden]=\"field.hidden\">\n <td colspan=\"2\">\n <span class=\"text-16\">\n <ccd-field-read [topLevelFormGroup]=\"topLevelFormGroup\" [caseFields]=\"caseFields\"\n [caseField]=\"field\" [context]=\"context\"></ccd-field-read>\n </span>\n </td>\n </tr>\n </ng-container>\n <ng-template #SimpleRow>\n <tr class=\"complex-panel-simple-field\" [hidden]=\"field.hidden\">\n <th id=\"complex-panel-simple-field-label\"><span class=\"text-16\">{{field.label | rpxTranslate}}</span></th>\n <td>\n <span class=\"text-16\">\n <ccd-field-read [topLevelFormGroup]=\"topLevelFormGroup\" [caseFields]=\"caseFields\"\n [caseField]=\"field\" [context]=\"context\"></ccd-field-read>\n </span>\n </td>\n </tr>\n </ng-template>\n </ng-container>\n </tbody>\n </table>\n</div>\n", styles: [".complex-panel{margin:13px 0;border:1px solid #bfc1c3}.complex-panel .complex-panel-title{background-color:#dee0e2;padding:5px 5px 2px;border-bottom:1px solid #bfc1c3;display:block;color:#0b0c0c;font-family:nta,Arial,sans-serif;font-weight:700;text-transform:none;font-size:16px;line-height:1.25}@media(min-width:641px){.complex-panel .complex-panel-title{font-size:19px;line-height:1.3157894737}}.complex-panel .complex-panel-table>tbody>tr>th{vertical-align:top}.complex-panel .complex-panel-table>tbody>tr:last-child>th,.complex-panel .complex-panel-table>tbody>tr:last-child>td{border-bottom:none}.complex-panel .complex-panel-simple-field th{padding-left:5px;width:295px}.complex-panel .complex-panel-compound-field td{padding:5px}\n"] }]
30802
+ args: [{ selector: 'ccd-read-complex-field-table', standalone: false, template: "<div class=\"complex-panel\">\n <dl class=\"complex-panel-title\"><dt><span class=\"text-16\">{{caseField.label | rpxTranslate}}</span></dt><dd></dd></dl>\n <table class=\"complex-panel-table\" aria-describedby=\"complex field table\">\n <tbody>\n <ng-container *ngFor=\"let field of caseField | ccdReadFieldsFilter:false :undefined :true :topLevelFormGroup :path :idPrefix\">\n <ng-container ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"topLevelFormGroup\" [contextFields]=\"caseFields\">\n <ng-container *ngIf=\"(field | ccdIsCompound); else SimpleRow\">\n <tr class=\"complex-panel-compound-field\" [hidden]=\"field.hidden\">\n <td colspan=\"2\">\n <span class=\"text-16\">\n <ccd-field-read [topLevelFormGroup]=\"topLevelFormGroup\" [caseFields]=\"caseFields\"\n [caseField]=\"field\" [context]=\"context\"></ccd-field-read>\n </span>\n </td>\n </tr>\n </ng-container>\n <ng-template #SimpleRow>\n <tr class=\"complex-panel-simple-field\" [hidden]=\"field.hidden\">\n <th id=\"complex-panel-simple-field-label\"><span class=\"text-16\">{{field.label | rpxTranslate}}</span></th>\n <td>\n <span class=\"text-16\">\n <ccd-field-read [topLevelFormGroup]=\"topLevelFormGroup\" [caseFields]=\"caseFields\"\n [caseField]=\"field\" [context]=\"context\"></ccd-field-read>\n </span>\n </td>\n </tr>\n </ng-template>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n</div>\n", styles: [".complex-panel{margin:13px 0;border:1px solid #bfc1c3}.complex-panel .complex-panel-title{background-color:#dee0e2;padding:5px 5px 2px;border-bottom:1px solid #bfc1c3;display:block;color:#0b0c0c;font-family:nta,Arial,sans-serif;font-weight:700;text-transform:none;font-size:16px;line-height:1.25}@media(min-width:641px){.complex-panel .complex-panel-title{font-size:19px;line-height:1.3157894737}}.complex-panel .complex-panel-table>tbody>tr>th{vertical-align:top}.complex-panel .complex-panel-table>tbody>tr:last-child>th,.complex-panel .complex-panel-table>tbody>tr:last-child>td{border-bottom:none}.complex-panel .complex-panel-simple-field th{padding-left:5px;width:295px}.complex-panel .complex-panel-compound-field td{padding:5px}\n"] }]
29845
30803
  }], null, { caseFields: [{
29846
30804
  type: Input
29847
30805
  }] }); })();
@@ -32621,8 +33579,8 @@ i0.ɵɵsetComponentScope(ReadOrderSummaryRowComponent, function () { return [Rea
32621
33579
  i0.ɵɵsetComponentScope(ReadComplexFieldComponent, function () { return [i4.NgSwitch, i4.NgSwitchCase, i4.NgSwitchDefault, ReadComplexFieldRawComponent,
32622
33580
  ReadComplexFieldTableComponent,
32623
33581
  ReadComplexFieldCollectionTableComponent]; }, []);
32624
- i0.ɵɵsetComponentScope(ReadComplexFieldRawComponent, function () { return [i4.NgForOf, FieldReadComponent]; }, function () { return [ReadFieldsFilterPipe, i1.RpxTranslatePipe]; });
32625
- i0.ɵɵsetComponentScope(ReadComplexFieldTableComponent, function () { return [i4.NgForOf, i4.NgIf, FieldReadComponent]; }, function () { return [IsCompoundPipe, ReadFieldsFilterPipe, i1.RpxTranslatePipe]; });
33582
+ i0.ɵɵsetComponentScope(ReadComplexFieldRawComponent, function () { return [i4.NgForOf, i3.NgControlStatusGroup, i3.FormGroupDirective, LabelSubstitutorDirective, FieldReadComponent]; }, function () { return [ReadFieldsFilterPipe, i1.RpxTranslatePipe]; });
33583
+ i0.ɵɵsetComponentScope(ReadComplexFieldTableComponent, function () { return [i4.NgForOf, i4.NgIf, i3.NgControlStatusGroup, i3.FormGroupDirective, LabelSubstitutorDirective, FieldReadComponent]; }, function () { return [IsCompoundPipe, ReadFieldsFilterPipe, i1.RpxTranslatePipe]; });
32626
33584
  i0.ɵɵsetComponentScope(ReadComplexFieldCollectionTableComponent, function () { return [i4.NgForOf, i4.NgIf, FieldReadComponent,
32627
33585
  ReadCaseLinkFieldComponent]; }, function () { return [i4.KeyValuePipe, IsCompoundPipe, CcdCollectionTableCaseFieldsFilterPipe, ReadFieldsFilterPipe, i1.RpxTranslatePipe]; });
32628
33586
  i0.ɵɵsetComponentScope(ReadCaseFlagFieldComponent, function () { return [i4.NgForOf, i4.NgIf, i4.NgSwitch, i4.NgSwitchCase, i4.NgSwitchDefault,
@@ -34730,6 +35688,7 @@ class WorkbasketFiltersComponent {
34730
35688
  }
34731
35689
  }
34732
35690
  onJurisdictionIdChange() {
35691
+ this.clearStoredWorkbasketFilterValues();
34733
35692
  if (this.selected.jurisdiction) {
34734
35693
  this.jurisdictionService.announceSelectedJurisdiction(this.selected.jurisdiction);
34735
35694
  this.selectedJurisdictionCaseTypes = this.selected.jurisdiction.caseTypes.length > 0
@@ -34744,7 +35703,7 @@ class WorkbasketFiltersComponent {
34744
35703
  this.selected.caseState = null;
34745
35704
  this.clearWorkbasketInputs();
34746
35705
  if (!this.isApplyButtonDisabled()) {
34747
- this.onCaseTypeIdChange();
35706
+ this.onCaseTypeIdChange(false);
34748
35707
  }
34749
35708
  }
34750
35709
  else {
@@ -34752,7 +35711,10 @@ class WorkbasketFiltersComponent {
34752
35711
  this.resetCaseState();
34753
35712
  }
34754
35713
  }
34755
- onCaseTypeIdChange() {
35714
+ onCaseTypeIdChange(clearStoredValues = true) {
35715
+ if (clearStoredValues) {
35716
+ this.clearStoredWorkbasketFilterValues();
35717
+ }
34756
35718
  if (this.selected.caseType) {
34757
35719
  this.selectedCaseTypeStates = this.sortStates(this.selected.caseType.states);
34758
35720
  this.selected.caseState = null;
@@ -34846,7 +35808,7 @@ class WorkbasketFiltersComponent {
34846
35808
  this.selectedJurisdictionCaseTypes = this.selected.jurisdiction.caseTypes;
34847
35809
  this.selected.caseType = this.selectCaseType(this.selected, this.selectedJurisdictionCaseTypes, routeSnapshot);
34848
35810
  if (this.selected.caseType) {
34849
- this.onCaseTypeIdChange();
35811
+ this.onCaseTypeIdChange(false);
34850
35812
  this.selected.caseState = this.selectCaseState(this.selected.caseType, routeSnapshot);
34851
35813
  }
34852
35814
  this.workbasketDefaults = true;
@@ -34893,6 +35855,9 @@ class WorkbasketFiltersComponent {
34893
35855
  this.workbasketInputsReady = false;
34894
35856
  this.workbasketInputs = [];
34895
35857
  }
35858
+ clearStoredWorkbasketFilterValues() {
35859
+ this.windowService.removeLocalStorage(FORM_GROUP_VAL_LOC_STORAGE);
35860
+ }
34896
35861
  resetCaseState() {
34897
35862
  this.defaults.state_id = null;
34898
35863
  this.selected.caseState = null;
@@ -37834,12 +38799,9 @@ class TaskAssignedComponent {
37834
38799
  // Current user is a caseworker?
37835
38800
  this.jurisdiction = this.task.jurisdiction;
37836
38801
  this.caseType = this.task.case_type_id;
37837
- this.caseworkerSubscription = this.caseworkerService.getCaseworkers(this.task.jurisdiction).subscribe(result => {
37838
- if (result && result[0].service === this.task.jurisdiction && result[0].caseworkers) {
37839
- const caseworker = result[0].caseworkers.find(x => x.idamId === this.task.assignee);
37840
- if (caseworker) {
37841
- this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
37842
- }
38802
+ this.caseworkerSubscription = this.caseworkerService.getUserByIdamId(this.task.assignee).subscribe(caseworker => {
38803
+ if (caseworker) {
38804
+ this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
37843
38805
  }
37844
38806
  if (!this.assignedUserName) {
37845
38807
  // Current user is a judicial user?