@hmcts/ccd-case-ui-toolkit 6.0.2-migration-dynamic-list-rc1 → 6.0.2-migration-dynamic-list-rc2

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 (33) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +483 -255
  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-viewer/case-full-access-view/case-full-access-view.component.js +20 -3
  6. package/esm2015/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.js +30 -19
  7. package/esm2015/lib/shared/components/palette/case-flag/write-case-flag-field.component.js +35 -24
  8. package/esm2015/lib/shared/components/palette/datetime-picker/datetime-picker.component.js +10 -3
  9. package/esm2015/lib/shared/components/search-result/search-result.component.js +10 -14
  10. package/esm2015/lib/shared/directives/conditional-show/domain/conditional-show.model.js +103 -200
  11. package/esm2015/lib/shared/directives/conditional-show/services/condition-parser.service.js +201 -0
  12. package/esm2015/lib/shared/directives/conditional-show/services/condition.peg.js +103 -0
  13. package/esm2015/lib/shared/domain/case-flag/hmcts-service-detail.model.js +1 -1
  14. package/esm2015/lib/shared/services/case-flag/case-flag-refdata.service.js +25 -4
  15. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +499 -235
  16. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  17. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts +1 -0
  18. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts.map +1 -1
  19. package/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.d.ts +3 -1
  20. package/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.d.ts.map +1 -1
  21. package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts +2 -0
  22. package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts.map +1 -1
  23. package/lib/shared/components/palette/datetime-picker/datetime-picker.component.d.ts.map +1 -1
  24. package/lib/shared/directives/conditional-show/domain/conditional-show.model.d.ts +13 -30
  25. package/lib/shared/directives/conditional-show/domain/conditional-show.model.d.ts.map +1 -1
  26. package/lib/shared/directives/conditional-show/services/condition-parser.service.d.ts +30 -0
  27. package/lib/shared/directives/conditional-show/services/condition-parser.service.d.ts.map +1 -0
  28. package/lib/shared/directives/conditional-show/services/condition.peg.d.ts +3 -0
  29. package/lib/shared/directives/conditional-show/services/condition.peg.d.ts.map +1 -0
  30. package/lib/shared/domain/case-flag/hmcts-service-detail.model.d.ts.map +1 -1
  31. package/lib/shared/services/case-flag/case-flag-refdata.service.d.ts +14 -3
  32. package/lib/shared/services/case-flag/case-flag-refdata.service.d.ts.map +1 -1
  33. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/router'), require('@angular/forms'), require('rx-polling'), require('rxjs'), require('@angular/common/http'), require('rxjs/operators'), require('class-transformer'), require('underscore'), require('moment'), require('util'), require('@edium/fsm'), require('@angular/material/dialog'), require('@angular-material-components/datetime-picker'), require('@angular/cdk/overlay'), require('@angular/cdk/tree'), require('@angular/material/autocomplete'), require('@angular/material/core'), require('@angular/material/datepicker'), require('@angular/material/form-field'), require('@angular/material/input'), require('@hmcts/ccpay-web-component'), require('@hmcts/media-viewer'), require('@nicky-lenaers/ngx-scroll-to'), require('ngx-md'), require('@angular-material-components/moment-adapter'), require('@angular/cdk/portal'), require('ngx-pagination'), require('@angular/material/tabs')) :
3
- typeof define === 'function' && define.amd ? define('@hmcts/ccd-case-ui-toolkit', ['exports', '@angular/core', '@angular/common', '@angular/router', '@angular/forms', 'rx-polling', 'rxjs', '@angular/common/http', 'rxjs/operators', 'class-transformer', 'underscore', 'moment', 'util', '@edium/fsm', '@angular/material/dialog', '@angular-material-components/datetime-picker', '@angular/cdk/overlay', '@angular/cdk/tree', '@angular/material/autocomplete', '@angular/material/core', '@angular/material/datepicker', '@angular/material/form-field', '@angular/material/input', '@hmcts/ccpay-web-component', '@hmcts/media-viewer', '@nicky-lenaers/ngx-scroll-to', 'ngx-md', '@angular-material-components/moment-adapter', '@angular/cdk/portal', 'ngx-pagination', '@angular/material/tabs'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.hmcts = global.hmcts || {}, global.hmcts["ccd-case-ui-toolkit"] = {}), global.ng.core, global.ng.common, global.ng.router, global.ng.forms, global["rx-polling"], global.rxjs, global.ng.common.http, global.rxjs.operators, global["class-transformer"], global.underscore, global.moment, global.util, global["@edium/fsm"], global.ng.material.dialog, global["@angular-material-components/datetime-picker"], global.ng.cdk.overlay, global.ng.cdk.tree, global.ng.material.autocomplete, global.ng.material.core, global.ng.material.datepicker, global.ng.material.formField, global.ng.material.input, global["@hmcts/ccpay-web-component"], global.i11, global["@nicky-lenaers/ngx-scroll-to"], global["ngx-md"], global["@angular-material-components/moment-adapter"], global.ng.cdk.portal, global["ngx-pagination"], global.ng.material.tabs));
5
- })(this, (function (exports, i0, i1, i1$1, i2, polling, rxjs, i1$2, operators, classTransformer, _, moment, util, fsm, i1$3, i4, i1$4, i7, i5, i6, i5$1, i6$1, i3$1, i3, i11, i2$1, i1$5, momentAdapter, i6$2, i1$6, i9) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/router'), require('@angular/forms'), require('rx-polling'), require('rxjs'), require('@angular/common/http'), require('rxjs/operators'), require('class-transformer'), require('moment'), require('underscore'), require('pegjs'), require('util'), require('@edium/fsm'), require('@angular/material/dialog'), require('@angular-material-components/datetime-picker'), require('@angular/cdk/overlay'), require('@angular/cdk/tree'), require('@angular/material/autocomplete'), require('@angular/material/core'), require('@angular/material/datepicker'), require('@angular/material/form-field'), require('@angular/material/input'), require('@hmcts/ccpay-web-component'), require('@hmcts/media-viewer'), require('@nicky-lenaers/ngx-scroll-to'), require('ngx-md'), require('@angular-material-components/moment-adapter'), require('@angular/cdk/portal'), require('ngx-pagination'), require('@angular/material/tabs')) :
3
+ typeof define === 'function' && define.amd ? define('@hmcts/ccd-case-ui-toolkit', ['exports', '@angular/core', '@angular/common', '@angular/router', '@angular/forms', 'rx-polling', 'rxjs', '@angular/common/http', 'rxjs/operators', 'class-transformer', 'moment', 'underscore', 'pegjs', 'util', '@edium/fsm', '@angular/material/dialog', '@angular-material-components/datetime-picker', '@angular/cdk/overlay', '@angular/cdk/tree', '@angular/material/autocomplete', '@angular/material/core', '@angular/material/datepicker', '@angular/material/form-field', '@angular/material/input', '@hmcts/ccpay-web-component', '@hmcts/media-viewer', '@nicky-lenaers/ngx-scroll-to', 'ngx-md', '@angular-material-components/moment-adapter', '@angular/cdk/portal', 'ngx-pagination', '@angular/material/tabs'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.hmcts = global.hmcts || {}, global.hmcts["ccd-case-ui-toolkit"] = {}), global.ng.core, global.ng.common, global.ng.router, global.ng.forms, global["rx-polling"], global.rxjs, global.ng.common.http, global.rxjs.operators, global["class-transformer"], global.moment, global.underscore, global.pegjs, global.util, global["@edium/fsm"], global.ng.material.dialog, global["@angular-material-components/datetime-picker"], global.ng.cdk.overlay, global.ng.cdk.tree, global.ng.material.autocomplete, global.ng.material.core, global.ng.material.datepicker, global.ng.material.formField, global.ng.material.input, global["@hmcts/ccpay-web-component"], global.i11, global["@nicky-lenaers/ngx-scroll-to"], global["ngx-md"], global["@angular-material-components/moment-adapter"], global.ng.cdk.portal, global["ngx-pagination"], global.ng.material.tabs));
5
+ })(this, (function (exports, i0, i1, i1$1, i2, polling, rxjs, i1$2, operators, classTransformer, moment, _, pegjs, util, fsm, i1$3, i4, i1$4, i7, i5, i6, i5$1, i6$1, i3$1, i3, i11, i2$1, i1$5, momentAdapter, i6$2, i1$6, i9) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -30,8 +30,8 @@
30
30
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
31
31
  var polling__default = /*#__PURE__*/_interopDefaultLegacy(polling);
32
32
  var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
33
- var ___namespace = /*#__PURE__*/_interopNamespace(_);
34
33
  var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
34
+ var ___namespace = /*#__PURE__*/_interopNamespace(_);
35
35
  var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$3);
36
36
  var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
37
37
  var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$4);
@@ -534,6 +534,64 @@
534
534
  function __param(paramIndex, decorator) {
535
535
  return function (target, key) { decorator(target, key, paramIndex); };
536
536
  }
537
+ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
538
+ function accept(f) { if (f !== void 0 && typeof f !== "function")
539
+ throw new TypeError("Function expected"); return f; }
540
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
541
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
542
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
543
+ var _, done = false;
544
+ for (var i = decorators.length - 1; i >= 0; i--) {
545
+ var context = {};
546
+ for (var p in contextIn)
547
+ context[p] = p === "access" ? {} : contextIn[p];
548
+ for (var p in contextIn.access)
549
+ context.access[p] = contextIn.access[p];
550
+ context.addInitializer = function (f) { if (done)
551
+ throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
552
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
553
+ if (kind === "accessor") {
554
+ if (result === void 0)
555
+ continue;
556
+ if (result === null || typeof result !== "object")
557
+ throw new TypeError("Object expected");
558
+ if (_ = accept(result.get))
559
+ descriptor.get = _;
560
+ if (_ = accept(result.set))
561
+ descriptor.set = _;
562
+ if (_ = accept(result.init))
563
+ initializers.push(_);
564
+ }
565
+ else if (_ = accept(result)) {
566
+ if (kind === "field")
567
+ initializers.push(_);
568
+ else
569
+ descriptor[key] = _;
570
+ }
571
+ }
572
+ if (target)
573
+ Object.defineProperty(target, contextIn.name, descriptor);
574
+ done = true;
575
+ }
576
+ ;
577
+ function __runInitializers(thisArg, initializers, value) {
578
+ var useValue = arguments.length > 2;
579
+ for (var i = 0; i < initializers.length; i++) {
580
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
581
+ }
582
+ return useValue ? value : void 0;
583
+ }
584
+ ;
585
+ function __propKey(x) {
586
+ return typeof x === "symbol" ? x : "".concat(x);
587
+ }
588
+ ;
589
+ function __setFunctionName(f, name, prefix) {
590
+ if (typeof name === "symbol")
591
+ name = name.description ? "[".concat(name.description, "]") : "";
592
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
593
+ }
594
+ ;
537
595
  function __metadata(metadataKey, metadataValue) {
538
596
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
539
597
  return Reflect.metadata(metadataKey, metadataValue);
@@ -733,7 +791,7 @@
733
791
  function __asyncDelegator(o) {
734
792
  var i, p;
735
793
  return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
736
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
794
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
737
795
  }
738
796
  function __asyncValues(o) {
739
797
  if (!Symbol.asyncIterator)
@@ -4422,183 +4480,69 @@
4422
4480
  }], null, null);
4423
4481
  })();
4424
4482
 
4425
- var ShowCondition = /** @class */ (function () {
4426
- // Expects a show condition of the form: <fieldName>="string"
4427
- function ShowCondition(condition) {
4428
- this.condition = condition;
4429
- this.orConditions = null;
4430
- this.andConditions = null;
4431
- if (!!condition) {
4432
- if (condition.search(ShowCondition.OR_CONDITION_REGEXP) !== -1) {
4433
- this.orConditions = condition.split(ShowCondition.OR_CONDITION_REGEXP);
4434
- }
4435
- else {
4436
- this.andConditions = condition.split(ShowCondition.AND_CONDITION_REGEXP);
4437
- }
4438
- }
4483
+ var conditionSource = "{\n function flat(arr, depth = 1) {\n var flatten = function (arr, depth = 1) {\n if (depth) return arr;\n\n // Otherwise, concatenate into the parent array\n return arr.reduce(function (acc, val) {\n return acc.concat(Array.isArray(val) ? flatten(val, depth - 1) : val);\n }, []);\n\n };\n\n return flatten(arr, depth - 1);\n }\n }\n\n Start\n = Formula\n\n Formula\n = EnclosedFormula\n / OpenFormula\n\n EnclosedFormula\n = bracket formula:OpenFormula bracket join:(JoinComparator)*\n { return flat([ [formula], join[0] ], 1) }\n\n OpenFormula\n = eq:OpenEqualityCheck joins:(JoinComparator)*\n { return flat([ eq, flat(joins) ]) }\n\n JoinComparator\n = comp:Comparator eq:OpenEqualityCheck\n { return [comp, eq]; }\n / CompoundJoinComparator\n\n CompoundJoinComparator\n = comp:Comparator bracket f:OpenFormula bracket\n { return [comp, f ] }\n\n OpenEqualityCheck\n = fr:FieldRef _? op:operator _? val:Value\n { return { fieldReference: fr, comparator: op, value: val } }\n\n Comparator\n = _? c:'AND' _?\n { return c; }\n / _? c:'OR' _?\n { return c; }\n\n Word\n = l:Letter+\n { return l.join(\"\"); }\n\n Letter\n = [a-zA-Z]\n\n Value\n = v:quotedValue / v:Word\n { return v.join(\"\") }\n / v:number\n { return parseInt(v.join(\"\")) }\n\n FieldRef\n = FieldReference / MetadataFieldReference\n\n MetadataFieldReference\n = s1:openSquare fr:FieldReference s2:closeSquare\n { return s1 + fr + s2 }\n\n FieldReference\n = characters:[A-Za-z0-9._-]+ { return characters.join(\"\"); }\n\n openSquare\n = \"[\"\n\n closeSquare\n = \"]\"\n\n number\n = [0-9]+\n\n quotedValue\n = '\"'val:[A-Za-z0-9.,* _&()/-]*'\"'\n { return val.join(\"\"); }\n\n bracket\n = (_? \"(\"+ _? / _? \")\"+ _? )\n\n operator\n = \"=\" / \"!=\" / \"CONTAINS\"\n\n ws \"Whitespace\"\n = [ \t]\n\n _ \"One or more whitespaces\"\n = ws+\n\n nl \"New line\"\n = \"\\n\"";
4484
+ var peg = pegjs.generate(conditionSource);
4485
+
4486
+ var ConditionParser = /** @class */ (function () {
4487
+ function ConditionParser() {
4439
4488
  }
4440
- ShowCondition.addPathPrefixToCondition = function (showCondition, pathPrefix) {
4441
- if (!pathPrefix || pathPrefix === '') {
4442
- return showCondition;
4443
- }
4444
- if (showCondition.search(ShowCondition.OR_CONDITION_REGEXP) !== -1) {
4445
- var orConditions = showCondition.split(ShowCondition.OR_CONDITION_REGEXP);
4446
- orConditions = this.extractConditions(orConditions, pathPrefix);
4447
- return orConditions.join(' OR ');
4448
- }
4449
- else {
4450
- var andConditions = showCondition.split(ShowCondition.AND_CONDITION_REGEXP);
4451
- andConditions = this.extractConditions(andConditions, pathPrefix);
4452
- return andConditions.join(' AND ');
4453
- }
4454
- };
4455
- // Cache instances so that we can cache results more effectively
4456
- ShowCondition.getInstance = function (condition) {
4457
- var instance = this.instanceCache.get(condition);
4458
- if (!instance) {
4459
- instance = new ShowCondition(condition);
4460
- this.instanceCache.set(condition, instance);
4489
+ /**
4490
+ * Parse the raw formula and output structured condition data
4491
+ * that can be used in evaluating show/hide logic
4492
+ * @param condition raw formula e.g. TextField = "Hello"
4493
+ */
4494
+ ConditionParser.parse = function (condition) {
4495
+ if (!condition) {
4496
+ return null;
4461
4497
  }
4462
- return instance;
4498
+ ;
4499
+ condition = condition.replace(/CONTAINS/g, ' CONTAINS');
4500
+ return peg.parse(condition.trim(), {});
4463
4501
  };
4464
4502
  /**
4465
- * Determine whether a ShowCondition model is affected by fields that have
4466
- * a display_context of HIDDEN or READONLY, which means they aren't able to
4467
- * be changed by the user's actions.
4468
- *
4469
- * @param showCondition The ShowCondition model to evaluate.
4470
- * @param caseFields Inspected to see appropriate display_contexts.
4503
+ * Evaluate the current fields against the conditions
4504
+ * @param fields the current page fields and their value
4505
+ * @param conditions The PegJS formula output
4471
4506
  */
4472
- ShowCondition.hiddenCannotChange = function (showCondition, caseFields) {
4473
- var e_1, _a;
4474
- if (showCondition && caseFields) {
4475
- var conditions = showCondition.andConditions || showCondition.orConditions;
4476
- if (conditions && conditions.length > 0) {
4477
- var allUnchangeable = true;
4478
- var _loop_1 = function (condition) {
4479
- var _a = __read(ShowCondition.getField(condition), 1), field = _a[0];
4480
- var path = field.split('.');
4481
- var head = path.shift();
4482
- var caseField = caseFields.find(function (cf) { return cf.id === head; });
4483
- while (path.length > 0) {
4484
- head = path.shift();
4485
- if (caseField) {
4486
- // Jump out if this is HIDDEN or READONLY, regardless of whether or not it's
4487
- // complex or a collection - nested fields will "inherit" the display_context.
4488
- if (['HIDDEN', 'READONLY'].indexOf(caseField.display_context) > -1) {
4489
- break;
4490
- }
4491
- // Consider what type of field this is.
4492
- var ft = caseField.field_type;
4493
- switch (ft.type) {
4494
- case 'Collection':
4495
- if (ft.collection_field_type.type === 'Complex' && ft.collection_field_type.complex_fields) {
4496
- caseField = ft.collection_field_type.complex_fields.find(function (cf) { return cf.id === head; });
4497
- }
4498
- break;
4499
- case 'Complex':
4500
- if (ft.complex_fields) {
4501
- caseField = ft.complex_fields.find(function (cf) { return cf.id === head; });
4502
- }
4503
- break;
4504
- }
4505
- }
4506
- }
4507
- if (caseField) {
4508
- allUnchangeable = allUnchangeable && ['HIDDEN', 'READONLY'].indexOf(caseField.display_context) > -1;
4509
- }
4510
- };
4511
- try {
4512
- for (var conditions_1 = __values(conditions), conditions_1_1 = conditions_1.next(); !conditions_1_1.done; conditions_1_1 = conditions_1.next()) {
4513
- var condition = conditions_1_1.value;
4514
- _loop_1(condition);
4515
- }
4516
- }
4517
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
4518
- finally {
4519
- try {
4520
- if (conditions_1_1 && !conditions_1_1.done && (_a = conditions_1.return)) _a.call(conditions_1);
4521
- }
4522
- finally { if (e_1) throw e_1.error; }
4507
+ ConditionParser.evaluate = function (fields, conditions, path) {
4508
+ var _this = this;
4509
+ if (!conditions || conditions.length === 0) {
4510
+ return true;
4511
+ }
4512
+ ;
4513
+ var validJoinComparators = ['AND', 'OR'];
4514
+ var result = conditions.reduce(function (accumulator, condition, index) {
4515
+ var isJoinComparator = function (comparator) { return (typeof comparator === 'string' && validJoinComparators.indexOf(comparator) !== -1); };
4516
+ if (isJoinComparator(condition)) {
4517
+ return accumulator;
4518
+ }
4519
+ ;
4520
+ var currentConditionResult = true;
4521
+ if (Array.isArray(condition)) {
4522
+ currentConditionResult = _this.evaluate(fields, condition);
4523
+ if (isJoinComparator(conditions[index - 1])) {
4524
+ return _this.evaluateJoin(accumulator, conditions[index - 1], currentConditionResult);
4523
4525
  }
4524
- return allUnchangeable;
4525
4526
  }
4526
- }
4527
- return false;
4528
- };
4529
- ShowCondition.extractConditions = function (conditionsArray, pathPrefix) {
4530
- var extracted = conditionsArray.map(function (condition) {
4531
- if (condition.startsWith(pathPrefix)) {
4532
- return condition;
4527
+ if (condition.comparator) {
4528
+ var formula = condition.fieldReference + condition.comparator + condition.value;
4529
+ currentConditionResult = _this.matchEqualityCondition(fields, formula, path);
4533
4530
  }
4534
- return pathPrefix + "." + condition;
4535
- });
4536
- return extracted;
4537
- };
4538
- ShowCondition.getField = function (condition) {
4539
- var separator = ShowCondition.CONTAINS;
4540
- if (condition.indexOf(ShowCondition.CONTAINS) < 0) {
4541
- separator = ShowCondition.CONDITION_EQUALS;
4542
- if (condition.indexOf(ShowCondition.CONDITION_NOT_EQUALS) > -1) {
4543
- separator = ShowCondition.CONDITION_NOT_EQUALS;
4531
+ if (isJoinComparator(conditions[index - 1])) {
4532
+ return _this.evaluateJoin(accumulator, conditions[index - 1], currentConditionResult);
4544
4533
  }
4545
- }
4546
- return [condition.split(separator)[0], separator];
4547
- };
4548
- ShowCondition.prototype.match = function (fields, path) {
4549
- if (!this.condition) {
4550
- return true;
4551
- }
4552
- return this.matchAndConditions(fields, this.updatePathName(path));
4553
- };
4554
- ShowCondition.prototype.matchByContextFields = function (contextFields) {
4555
- return this.match(FieldsUtils.toValuesMap(contextFields));
4556
- };
4557
- /**
4558
- * Determine whether this is affected by fields that have a display_context
4559
- * of HIDDEN or READONLY, which means they aren't able to be changed by the
4560
- * user's actions.
4561
- *
4562
- * @param caseFields Inspected to see appropriate display_contexts.
4563
- */
4564
- ShowCondition.prototype.hiddenCannotChange = function (caseFields) {
4565
- return ShowCondition.hiddenCannotChange(this, caseFields);
4566
- };
4567
- /**
4568
- * Path Name gets updated for complex sub fields
4569
- * @param path Path name.
4570
- */
4571
- ShowCondition.prototype.updatePathName = function (path) {
4572
- if (path && path.split(/[_]+/g).length > 0) {
4573
- var _a = __read(path.split(/[_]+/g)), pathName_1 = _a[0], pathTail = _a.slice(1);
4574
- var pathFinalIndex_1 = pathTail.pop();
4575
- var pathTailString = pathTail.toString();
4576
- var mappedPathTail = void 0;
4577
- mappedPathTail = pathTail.map(function (value) {
4578
- return Number(pathFinalIndex_1) === Number(value) ? pathName_1 : value;
4579
- });
4580
- return pathTailString !== mappedPathTail.toString()
4581
- ? pathName_1 + "_" + mappedPathTail.join('_') + "_" + pathFinalIndex_1
4582
- : path;
4583
- }
4584
- else {
4585
- return path;
4586
- }
4534
+ return currentConditionResult;
4535
+ }, true);
4536
+ return result;
4587
4537
  };
4588
- ShowCondition.prototype.matchAndConditions = function (fields, path) {
4589
- var _this = this;
4590
- if (!!this.orConditions) {
4591
- return this.orConditions.some(function (orCondition) { return _this.matchEqualityCondition(fields, orCondition, path); });
4592
- }
4593
- else if (!!this.andConditions) {
4594
- return this.andConditions.every(function (andCondition) { return _this.matchEqualityCondition(fields, andCondition, path); });
4595
- }
4596
- else {
4597
- return false;
4538
+ ConditionParser.evaluateJoin = function (leftResult, comparator, rightResult) {
4539
+ switch (comparator) {
4540
+ case 'OR': return leftResult || rightResult;
4541
+ case 'AND': return leftResult && rightResult;
4598
4542
  }
4599
4543
  };
4600
- ShowCondition.prototype.matchEqualityCondition = function (fields, condition, path) {
4601
- var _a = __read(ShowCondition.getField(condition), 2), field = _a[0], conditionSeparator = _a[1];
4544
+ ConditionParser.matchEqualityCondition = function (fields, condition, path) {
4545
+ var _a = __read(this.getField(condition), 2), field = _a[0], conditionSeparator = _a[1];
4602
4546
  var _b = __read(field.split('.')), head = _b[0], tail = _b.slice(1);
4603
4547
  var currentValue = this.findValueForComplexCondition(fields, head, tail, path);
4604
4548
  var expectedValue = this.unquoted(condition.split(conditionSeparator)[1]);
@@ -4609,7 +4553,29 @@
4609
4553
  return this.checkValueEquals(expectedValue, currentValue, conditionSeparator);
4610
4554
  }
4611
4555
  };
4612
- ShowCondition.prototype.checkValueEquals = function (expectedValue, currentValue, conditionSeparaor) {
4556
+ ConditionParser.getValue = function (fields, head) {
4557
+ if (this.isDynamicList(fields[head])) {
4558
+ return fields[head].value.code;
4559
+ }
4560
+ else {
4561
+ return fields[head];
4562
+ }
4563
+ };
4564
+ ConditionParser.isDynamicList = function (dynamiclist) {
4565
+ return !___namespace.isEmpty(dynamiclist) &&
4566
+ (___namespace.has(dynamiclist, 'value') && ___namespace.has(dynamiclist, 'list_items'));
4567
+ };
4568
+ ConditionParser.getField = function (condition) {
4569
+ var separator = ShowCondition.CONTAINS;
4570
+ if (condition.indexOf(ShowCondition.CONTAINS) < 0) {
4571
+ separator = ShowCondition.CONDITION_EQUALS;
4572
+ if (condition.indexOf(ShowCondition.CONDITION_NOT_EQUALS) > -1) {
4573
+ separator = ShowCondition.CONDITION_NOT_EQUALS;
4574
+ }
4575
+ }
4576
+ return [condition.split(separator)[0], separator];
4577
+ };
4578
+ ConditionParser.checkValueEquals = function (expectedValue, currentValue, conditionSeparaor) {
4613
4579
  if (expectedValue.search('[,]') > -1) { // for multi-select list
4614
4580
  return this.checkMultiSelectListEquals(expectedValue, currentValue, conditionSeparaor);
4615
4581
  }
@@ -4629,7 +4595,7 @@
4629
4595
  }
4630
4596
  }
4631
4597
  };
4632
- ShowCondition.prototype.checkValueNotEquals = function (expectedValue, currentValue) {
4598
+ ConditionParser.checkValueNotEquals = function (expectedValue, currentValue) {
4633
4599
  var formatCurrentValue = currentValue ? currentValue.toString().trim() : '';
4634
4600
  if ('*' === expectedValue && formatCurrentValue !== '') {
4635
4601
  return false;
@@ -4637,7 +4603,7 @@
4637
4603
  var formatExpectedValue = expectedValue ? expectedValue.toString().trim() : '';
4638
4604
  return formatCurrentValue != formatExpectedValue; // tslint:disable-line
4639
4605
  };
4640
- ShowCondition.prototype.checkMultiSelectListEquals = function (expectedValue, currentValue, conditionSeparator) {
4606
+ ConditionParser.checkMultiSelectListEquals = function (expectedValue, currentValue, conditionSeparator) {
4641
4607
  var expectedValues = expectedValue.split(',').sort().toString();
4642
4608
  var values = currentValue ? currentValue.sort().toString() : '';
4643
4609
  if (conditionSeparator === ShowCondition.CONDITION_NOT_EQUALS) {
@@ -4647,7 +4613,7 @@
4647
4613
  return expectedValues === values;
4648
4614
  }
4649
4615
  };
4650
- ShowCondition.prototype.checkValueContains = function (expectedValue, currentValue) {
4616
+ ConditionParser.checkValueContains = function (expectedValue, currentValue) {
4651
4617
  if (expectedValue.search(',') > -1) {
4652
4618
  var expectedValues = expectedValue.split(',').sort();
4653
4619
  var values_1 = currentValue ? currentValue.sort().toString() : '';
@@ -4658,7 +4624,11 @@
4658
4624
  return values.search(expectedValue) >= 0;
4659
4625
  }
4660
4626
  };
4661
- ShowCondition.prototype.findValueForComplexCondition = function (fields, head, tail, path) {
4627
+ ConditionParser.unquoted = function (str) {
4628
+ var res = str.replace(/^"|"$/g, '');
4629
+ return res;
4630
+ };
4631
+ ConditionParser.findValueForComplexCondition = function (fields, head, tail, path) {
4662
4632
  if (!fields) {
4663
4633
  return undefined;
4664
4634
  }
@@ -4674,7 +4644,7 @@
4674
4644
  }
4675
4645
  }
4676
4646
  };
4677
- ShowCondition.prototype.findValueForComplexConditionForPathIfAny = function (fields, head, tail, path) {
4647
+ ConditionParser.findValueForComplexConditionForPathIfAny = function (fields, head, tail, path) {
4678
4648
  if (path) {
4679
4649
  var _a = __read(path.split(/[_]+/g)), _ = _a[0], pathTail = _a.slice(1);
4680
4650
  return this.findValueForComplexCondition(fields[head], tail[0], tail.slice(1), pathTail.join('_'));
@@ -4683,9 +4653,9 @@
4683
4653
  return this.findValueForComplexCondition(fields[head], tail[0], tail.slice(1), path);
4684
4654
  }
4685
4655
  };
4686
- ShowCondition.prototype.findValueForComplexConditionInArray = function (fields, head, tail, path) {
4656
+ ConditionParser.findValueForComplexConditionInArray = function (fields, head, tail, path) {
4687
4657
  // use the path to resolve which array element we refer to
4688
- if (path && path.startsWith(head)) {
4658
+ if (path.startsWith(head)) {
4689
4659
  var _a = __read(path.split(/[_]+/g)), _ = _a[0], pathTail = _a.slice(1);
4690
4660
  if (pathTail.length > 0) {
4691
4661
  try {
@@ -4694,43 +4664,239 @@
4694
4664
  return (fields[head][arrayIndex] !== undefined) ? this.findValueForComplexCondition(fields[head][arrayIndex]['value'], tail[0], tail.slice(1), dropNumberPath.join('_')) : null;
4695
4665
  }
4696
4666
  catch (e) {
4697
- console.log('Error while parsing number', pathTail[0], e);
4667
+ console.error('Error while parsing number', pathTail[0], e);
4698
4668
  }
4699
4669
  }
4700
4670
  }
4701
4671
  else {
4702
- console.log('Path in formArray should start with ', head, ', full path: ', path);
4672
+ console.error('Path in formArray should start with ', head, ', full path: ', path);
4703
4673
  }
4704
4674
  };
4705
- ShowCondition.prototype.getValue = function (fields, head) {
4706
- if (this.isDynamicList(fields[head])) {
4707
- return fields[head].value.code;
4675
+ ConditionParser.removeStarChar = function (str) {
4676
+ if (str && str.indexOf('*') > -1) {
4677
+ return str.substring(0, str.indexOf('*'));
4678
+ }
4679
+ return str;
4680
+ };
4681
+ ConditionParser.okIfBothEmpty = function (right, value) {
4682
+ return value === null && (right === '');
4683
+ };
4684
+ return ConditionParser;
4685
+ }());
4686
+
4687
+ var ShowCondition = /** @class */ (function () {
4688
+ // Expects a show condition of the form: <fieldName>="string"
4689
+ function ShowCondition(condition) {
4690
+ this.condition = condition;
4691
+ this.conditions = [];
4692
+ if (!!condition) {
4693
+ this.conditions = ConditionParser.parse(condition);
4694
+ }
4695
+ }
4696
+ ShowCondition.addPathPrefixToCondition = function (showCondition, pathPrefix) {
4697
+ if (!pathPrefix || pathPrefix === '') {
4698
+ return showCondition;
4699
+ }
4700
+ if (!showCondition) {
4701
+ return '';
4702
+ }
4703
+ var formula = ConditionParser.parse(showCondition);
4704
+ if (!formula) {
4705
+ return showCondition;
4706
+ }
4707
+ this.processedList = [];
4708
+ showCondition = showCondition.replace(/CONTAINS/g, ' CONTAINS');
4709
+ var processedCondition = this.processAddPathPrefixToCondition(formula, pathPrefix, showCondition);
4710
+ return processedCondition.replace(/ CONTAINS/g, 'CONTAINS');
4711
+ };
4712
+ ShowCondition.processAddPathPrefixToCondition = function (formula, pathPrefix, originalCondition) {
4713
+ var _this = this;
4714
+ var finalCondition = originalCondition;
4715
+ if (Array.isArray(formula)) {
4716
+ formula.forEach(function (condition) {
4717
+ if (typeof condition === 'string' && _this.validJoinComparators.indexOf(condition) !== -1) {
4718
+ // do nothing
4719
+ }
4720
+ else {
4721
+ if (Array.isArray(condition)) {
4722
+ finalCondition = _this.processAddPathPrefixToCondition(condition, pathPrefix, finalCondition);
4723
+ }
4724
+ else {
4725
+ finalCondition = _this.extractConditions(condition, pathPrefix, finalCondition);
4726
+ }
4727
+ }
4728
+ });
4708
4729
  }
4709
4730
  else {
4710
- return fields[head];
4731
+ finalCondition = this.extractConditions(formula, pathPrefix, finalCondition);
4711
4732
  }
4733
+ return finalCondition;
4712
4734
  };
4713
- ShowCondition.prototype.isDynamicList = function (dynamiclist) {
4714
- return !___namespace.isEmpty(dynamiclist) &&
4715
- (___namespace.has(dynamiclist, 'value') && ___namespace.has(dynamiclist, 'list_items'));
4735
+ ShowCondition.extractConditions = function (condition, pathPrefix, originalCondition) {
4736
+ if (condition.fieldReference.startsWith(pathPrefix)) {
4737
+ return originalCondition;
4738
+ }
4739
+ else {
4740
+ if (originalCondition.indexOf(condition.fieldReference) > -1) {
4741
+ if (this.processedList && this.processedList.indexOf(condition.fieldReference) === -1) {
4742
+ this.processedList.push(condition.fieldReference);
4743
+ var regularExp = new RegExp('(\\b)' + condition.fieldReference + '(?=[^"]*(?:"[^"]*"[^"]*)*$)(\\b)', 'g');
4744
+ return originalCondition.replace(regularExp, pathPrefix + '.' + condition.fieldReference);
4745
+ }
4746
+ else {
4747
+ return originalCondition;
4748
+ }
4749
+ }
4750
+ }
4716
4751
  };
4717
- ShowCondition.prototype.unquoted = function (str) {
4718
- return str.replace(/(?:^")|(?:"$)/g, '');
4752
+ // Cache instances so that we can cache results more effectively
4753
+ ShowCondition.getInstance = function (condition) {
4754
+ var instance = this.instanceCache.get(condition);
4755
+ if (!instance) {
4756
+ instance = new ShowCondition(condition);
4757
+ this.instanceCache.set(condition, instance);
4758
+ }
4759
+ return instance;
4719
4760
  };
4720
- ShowCondition.prototype.removeStarChar = function (str) {
4721
- return str.substring(0, str.length - 1);
4761
+ ShowCondition.getField = function (condition) {
4762
+ var separator = ShowCondition.CONTAINS;
4763
+ if (condition.indexOf(ShowCondition.CONTAINS) < 0) {
4764
+ separator = ShowCondition.CONDITION_EQUALS;
4765
+ if (condition.indexOf(ShowCondition.CONDITION_NOT_EQUALS) > -1) {
4766
+ separator = ShowCondition.CONDITION_NOT_EQUALS;
4767
+ }
4768
+ }
4769
+ return [condition.split(separator)[0], separator];
4722
4770
  };
4723
- ShowCondition.prototype.okIfBothEmpty = function (right, value) {
4724
- return value === null && (right === '');
4771
+ ShowCondition.getConditions = function (formula) {
4772
+ var _this = this;
4773
+ var conditionList = [];
4774
+ if (!!formula) {
4775
+ var newFormula = typeof formula === 'string' ? JSON.parse(formula) : formula;
4776
+ if (Array.isArray(newFormula)) {
4777
+ newFormula.forEach(function (condition) {
4778
+ if (!(typeof condition === 'string' && _this.validJoinComparators.indexOf(condition) !== -1)) {
4779
+ if (Array.isArray(condition)) {
4780
+ conditionList.push(ShowCondition.getConditions(condition).toString());
4781
+ }
4782
+ else {
4783
+ conditionList.push(condition.fieldReference + condition.comparator + condition.value);
4784
+ }
4785
+ }
4786
+ });
4787
+ }
4788
+ else {
4789
+ conditionList.push(newFormula.fieldReference + newFormula.comparator + newFormula.value);
4790
+ }
4791
+ }
4792
+ return conditionList.toString();
4793
+ };
4794
+ /**
4795
+ * Determine whether a ShowCondition model is affected by fields that have
4796
+ * a display_context of HIDDEN or READONLY, which means they aren't able to
4797
+ * be changed by the user's actions.
4798
+ *
4799
+ * @param showCondition The ShowCondition model to evaluate.
4800
+ * @param caseFields Inspected to see appropriate display_contexts.
4801
+ */
4802
+ ShowCondition.hiddenCannotChange = function (showCondition, caseFields) {
4803
+ var e_1, _a;
4804
+ if (showCondition && showCondition.conditions.length && caseFields) {
4805
+ var conditions = this.getConditions(showCondition.conditions).split(',');
4806
+ if (conditions && conditions.length > 0) {
4807
+ var allUnchangeable = true;
4808
+ var _loop_1 = function (condition) {
4809
+ var _a = __read(ShowCondition.getField(condition), 1), field = _a[0];
4810
+ var path = field.split('.');
4811
+ var head = path.shift();
4812
+ var caseField = caseFields.find(function (cf) { return cf.id === head; });
4813
+ while (path.length > 0) {
4814
+ head = path.shift();
4815
+ if (caseField) {
4816
+ // Jump out if this is HIDDEN or READONLY, regardless of whether or not it's
4817
+ // complex or a collection - nested fields will "inherit" the display_context.
4818
+ if (['HIDDEN', 'READONLY'].indexOf(caseField.display_context) > -1) {
4819
+ break;
4820
+ }
4821
+ // Consider what type of field this is.
4822
+ var ft = caseField.field_type;
4823
+ switch (ft.type) {
4824
+ case 'Collection':
4825
+ if (ft.collection_field_type.type === 'Complex' && ft.collection_field_type.complex_fields) {
4826
+ caseField = ft.collection_field_type.complex_fields.find(function (cf) { return cf.id === head; });
4827
+ }
4828
+ break;
4829
+ case 'Complex':
4830
+ if (ft.complex_fields) {
4831
+ caseField = ft.complex_fields.find(function (cf) { return cf.id === head; });
4832
+ }
4833
+ break;
4834
+ }
4835
+ }
4836
+ }
4837
+ if (caseField) {
4838
+ allUnchangeable = allUnchangeable && ['HIDDEN', 'READONLY'].indexOf(caseField.display_context) > -1;
4839
+ }
4840
+ };
4841
+ try {
4842
+ for (var conditions_1 = __values(conditions), conditions_1_1 = conditions_1.next(); !conditions_1_1.done; conditions_1_1 = conditions_1.next()) {
4843
+ var condition = conditions_1_1.value;
4844
+ _loop_1(condition);
4845
+ }
4846
+ }
4847
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
4848
+ finally {
4849
+ try {
4850
+ if (conditions_1_1 && !conditions_1_1.done && (_a = conditions_1.return)) _a.call(conditions_1);
4851
+ }
4852
+ finally { if (e_1) throw e_1.error; }
4853
+ }
4854
+ return allUnchangeable;
4855
+ }
4856
+ }
4857
+ return false;
4858
+ };
4859
+ ShowCondition.prototype.match = function (fields, path) {
4860
+ return ConditionParser.evaluate(fields, this.conditions, this.updatePathName(path));
4861
+ };
4862
+ ShowCondition.prototype.updatePathName = function (path) {
4863
+ if (path && path.split(/[_]+/g).length > 0) {
4864
+ /* tslint:disable-next-line */
4865
+ var _a = __read(path.split(/[_]+/g)), pathName_1 = _a[0], pathTail = _a.slice(1);
4866
+ var pathFinalIndex_1 = pathTail.pop();
4867
+ var pathTailString = pathTail.toString();
4868
+ pathTail = pathTail.map(function (value) {
4869
+ return Number(pathFinalIndex_1) === Number(value) ? pathName_1 : value;
4870
+ });
4871
+ return pathTailString !== pathTail.toString()
4872
+ ? pathName_1 + "_" + pathTail.join('_') + "_" + pathFinalIndex_1
4873
+ : path;
4874
+ }
4875
+ else {
4876
+ return path;
4877
+ }
4878
+ };
4879
+ ShowCondition.prototype.matchByContextFields = function (contextFields) {
4880
+ return this.match(FieldsUtils.toValuesMap(contextFields));
4881
+ };
4882
+ /**
4883
+ * Determine whether this is affected by fields that have a display_context
4884
+ * of HIDDEN or READONLY, which means they aren't able to be changed by the
4885
+ * user's actions.
4886
+ *
4887
+ * @param caseFields Inspected to see appropriate display_contexts.
4888
+ */
4889
+ ShowCondition.prototype.hiddenCannotChange = function (caseFields) {
4890
+ return ShowCondition.hiddenCannotChange(this, caseFields);
4725
4891
  };
4726
4892
  return ShowCondition;
4727
4893
  }());
4728
- ShowCondition.AND_CONDITION_REGEXP = new RegExp('\\sAND\\s(?![^"]*"(?:(?:[^"]*"){2})*[^"]*$)', 'g');
4729
- ShowCondition.OR_CONDITION_REGEXP = new RegExp('\\sOR\\s(?![^"]*"(?:(?:[^"]*"){2})*[^"]*$)', 'g');
4730
4894
  ShowCondition.CONDITION_NOT_EQUALS = '!=';
4731
4895
  ShowCondition.CONDITION_EQUALS = '=';
4732
4896
  ShowCondition.CONTAINS = 'CONTAINS';
4733
4897
  ShowCondition.instanceCache = new Map();
4898
+ ShowCondition.validJoinComparators = ['AND', 'OR'];
4899
+ ShowCondition.processedList = [];
4734
4900
 
4735
4901
  var Constants = /** @class */ (function () {
4736
4902
  function Constants() {
@@ -6924,13 +7090,14 @@
6924
7090
  return rxjs.of(null);
6925
7091
  };
6926
7092
  /**
6927
- * Retrieves the HMCTS service details for a jurisdiction or service, including service code. (For example, the "SSCS"
6928
- * service has a corresponding service code of "BBA3".)
7093
+ * Retrieves the HMCTS service details for a jurisdiction or service, including service codes. More than one
7094
+ * service code may be present. For example, the Divorce jurisdiction/service has corresponding service codes of
7095
+ * "ABA1" and "ABA2".
6929
7096
  *
6930
7097
  * @param serviceNames The service name(s) to look up, comma-separated if more than one
6931
7098
  * @returns An `Observable` of an array of service details
6932
7099
  */
6933
- CaseFlagRefdataService.prototype.getHmctsServiceDetails = function (serviceNames) {
7100
+ CaseFlagRefdataService.prototype.getHmctsServiceDetailsByServiceName = function (serviceNames) {
6934
7101
  var url = this.appConfig.getLocationRefApiUrl();
6935
7102
  if (url) {
6936
7103
  url += '/orgServices';
@@ -6941,6 +7108,26 @@
6941
7108
  }
6942
7109
  return rxjs.of(null);
6943
7110
  };
7111
+ /**
7112
+ * Retrieves the HMCTS service details for a case type, including service code. For example, the
7113
+ * "FinancialRemedyContested" case type is associated with the Divorce jurisdiction/service and service code "ABA2".
7114
+ *
7115
+ * Note that a case type might not be associated with any service codes of a jurisdiction or service.
7116
+ *
7117
+ * @param caseTypeId The case type ID to look up
7118
+ * @returns An `Observable` of an array of service details
7119
+ */
7120
+ CaseFlagRefdataService.prototype.getHmctsServiceDetailsByCaseType = function (caseTypeId) {
7121
+ var url = this.appConfig.getLocationRefApiUrl();
7122
+ if (url) {
7123
+ url += '/orgServices';
7124
+ if (caseTypeId) {
7125
+ url += "?ccdCaseType=" + caseTypeId;
7126
+ }
7127
+ return this.http.get(url, { observe: 'body' });
7128
+ }
7129
+ return rxjs.of(null);
7130
+ };
6944
7131
  return CaseFlagRefdataService;
6945
7132
  }());
6946
7133
  CaseFlagRefdataService.ɵfac = function CaseFlagRefdataService_Factory(t) { return new (t || CaseFlagRefdataService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig)); };
@@ -12301,7 +12488,7 @@
12301
12488
  if (rf & 2) {
12302
12489
  var ctx_r8 = i0__namespace.ɵɵnextContext(2);
12303
12490
  i0__namespace.ɵɵadvance(1);
12304
- i0__namespace.ɵɵproperty("formGroup", ctx_r8.caseFlagParentFormGroup)("jurisdiction", ctx_r8.jurisdiction);
12491
+ i0__namespace.ɵɵproperty("formGroup", ctx_r8.caseFlagParentFormGroup)("jurisdiction", ctx_r8.jurisdiction)("caseTypeId", ctx_r8.caseTypeId)("hmctsServiceId", ctx_r8.hmctsServiceId);
12305
12492
  }
12306
12493
  }
12307
12494
  function WriteCaseFlagFieldComponent_div_1_ng_container_6_Template(rf, ctx) {
@@ -12343,7 +12530,7 @@
12343
12530
  i0__namespace.ɵɵtext(3);
12344
12531
  i0__namespace.ɵɵelementEnd();
12345
12532
  i0__namespace.ɵɵtemplate(4, WriteCaseFlagFieldComponent_div_1_ng_container_4_Template, 2, 2, "ng-container", 11);
12346
- i0__namespace.ɵɵtemplate(5, WriteCaseFlagFieldComponent_div_1_ng_container_5_Template, 2, 2, "ng-container", 11);
12533
+ i0__namespace.ɵɵtemplate(5, WriteCaseFlagFieldComponent_div_1_ng_container_5_Template, 2, 4, "ng-container", 11);
12347
12534
  i0__namespace.ɵɵtemplate(6, WriteCaseFlagFieldComponent_div_1_ng_container_6_Template, 2, 3, "ng-container", 11);
12348
12535
  i0__namespace.ɵɵtemplate(7, WriteCaseFlagFieldComponent_div_1_ng_container_7_Template, 2, 2, "ng-container", 11);
12349
12536
  i0__namespace.ɵɵelementEnd();
@@ -12456,29 +12643,40 @@
12456
12643
  }
12457
12644
  }), true);
12458
12645
  this.createFlagCaption = exports.CaseFlagText.CAPTION;
12459
- // Get the jurisdiction from the CaseView object in the snapshot data (required for retrieving the available flag
12646
+ // Get the case type ID from the CaseView object in the snapshot data (required for retrieving the available flag
12460
12647
  // types for a case)
12461
- if (this.route.snapshot.data.case && this.route.snapshot.data.case.case_type &&
12462
- this.route.snapshot.data.case.case_type.jurisdiction) {
12463
- this.jurisdiction = this.route.snapshot.data.case.case_type.jurisdiction.id;
12648
+ if (this.route.snapshot.data.case && this.route.snapshot.data.case.case_type) {
12649
+ this.caseTypeId = this.route.snapshot.data.case.case_type.id;
12650
+ // Get the jurisdiction (required for retrieving the available flag types if unable to determine using case type ID)
12651
+ if (this.route.snapshot.data.case.case_type.jurisdiction) {
12652
+ this.jurisdiction = this.route.snapshot.data.case.case_type.jurisdiction.id;
12653
+ }
12464
12654
  }
12465
12655
  // Extract all flags-related data from the CaseEventTrigger object in the snapshot data
12466
- if (this.route.snapshot.data.eventTrigger && this.route.snapshot.data.eventTrigger.case_fields) {
12467
- this.flagsData = (this.route.snapshot.data.eventTrigger.case_fields)
12468
- .reduce(function (flags, caseField) {
12469
- return FieldsUtils.extractFlagsDataFromCaseField(flags, caseField, caseField.id, caseField);
12470
- }, []);
12471
- // Set boolean indicating the display_context_parameter is "update"
12472
- this.isDisplayContextParameterUpdate =
12473
- this.setDisplayContextParameterUpdate((this.route.snapshot.data.eventTrigger.case_fields));
12474
- // Set starting field state
12475
- this.fieldState = this.isDisplayContextParameterUpdate ? exports.CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS : exports.CaseFlagFieldState.FLAG_LOCATION;
12476
- // Get case title, to be used by child components
12477
- this.caseEditDataService.caseTitle$.subscribe({
12478
- next: function (title) {
12479
- _this.caseTitle = title.length > 0 ? title : _this.caseNameMissing;
12480
- }
12481
- });
12656
+ if (this.route.snapshot.data.eventTrigger) {
12657
+ // Get the HMCTSServiceId from supplementary data, if it exists (required for retrieving the available flag types in
12658
+ // the first instance, only falling back on case type ID or jurisidiction if it's not present)
12659
+ if (this.route.snapshot.data.eventTrigger.supplementary_data
12660
+ && this.route.snapshot.data.eventTrigger.supplementary_data.HMCTSServiceId) {
12661
+ this.hmctsServiceId = this.route.snapshot.data.eventTrigger.supplementary_data.HMCTSServiceId;
12662
+ }
12663
+ if (this.route.snapshot.data.eventTrigger.case_fields) {
12664
+ this.flagsData = (this.route.snapshot.data.eventTrigger.case_fields)
12665
+ .reduce(function (flags, caseField) {
12666
+ return FieldsUtils.extractFlagsDataFromCaseField(flags, caseField, caseField.id, caseField);
12667
+ }, []);
12668
+ // Set boolean indicating the display_context_parameter is "update"
12669
+ this.isDisplayContextParameterUpdate =
12670
+ this.setDisplayContextParameterUpdate((this.route.snapshot.data.eventTrigger.case_fields));
12671
+ // Set starting field state
12672
+ this.fieldState = this.isDisplayContextParameterUpdate ? exports.CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS : exports.CaseFlagFieldState.FLAG_LOCATION;
12673
+ // Get case title, to be used by child components
12674
+ this.caseEditDataService.caseTitle$.subscribe({
12675
+ next: function (title) {
12676
+ _this.caseTitle = title.length > 0 ? title : _this.caseNameMissing;
12677
+ }
12678
+ });
12679
+ }
12482
12680
  }
12483
12681
  };
12484
12682
  WriteCaseFlagFieldComponent.prototype.setDisplayContextParameterUpdate = function (caseFields) {
@@ -12714,7 +12912,7 @@
12714
12912
  return WriteCaseFlagFieldComponent;
12715
12913
  }(AbstractFieldWriteComponent));
12716
12914
  WriteCaseFlagFieldComponent.ɵfac = function WriteCaseFlagFieldComponent_Factory(t) { return new (t || WriteCaseFlagFieldComponent)(i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute), i0__namespace.ɵɵdirectiveInject(CaseEditDataService)); };
12717
- WriteCaseFlagFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteCaseFlagFieldComponent, selectors: [["ccd-write-case-flag-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 3, vars: 3, consts: [["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], ["id", "create-flag-caption", 1, "govuk-caption-l", 3, "ngClass"], [4, "ngSwitchCase"], [3, "formGroup", "flagsData", "caseFlagStateEmitter"], [3, "formGroup", "jurisdiction", "caseFlagStateEmitter", "flagCommentsOptionalEmitter"], [3, "formGroup", "languages", "flagCode", "caseFlagStateEmitter"], [3, "formGroup", "optional", "caseFlagStateEmitter"], [3, "formGroup", "flagsData", "caseTitle", "caseFlagStateEmitter"], [3, "formGroup", "selectedFlag", "caseFlagStateEmitter"]], template: function WriteCaseFlagFieldComponent_Template(rf, ctx) {
12915
+ WriteCaseFlagFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteCaseFlagFieldComponent, selectors: [["ccd-write-case-flag-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 3, vars: 3, consts: [["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], ["id", "create-flag-caption", 1, "govuk-caption-l", 3, "ngClass"], [4, "ngSwitchCase"], [3, "formGroup", "flagsData", "caseFlagStateEmitter"], [3, "formGroup", "jurisdiction", "caseTypeId", "hmctsServiceId", "caseFlagStateEmitter", "flagCommentsOptionalEmitter"], [3, "formGroup", "languages", "flagCode", "caseFlagStateEmitter"], [3, "formGroup", "optional", "caseFlagStateEmitter"], [3, "formGroup", "flagsData", "caseTitle", "caseFlagStateEmitter"], [3, "formGroup", "selectedFlag", "caseFlagStateEmitter"]], template: function WriteCaseFlagFieldComponent_Template(rf, ctx) {
12718
12916
  if (rf & 1) {
12719
12917
  i0__namespace.ɵɵtemplate(0, WriteCaseFlagFieldComponent_div_0_Template, 4, 1, "div", 0);
12720
12918
  i0__namespace.ɵɵtemplate(1, WriteCaseFlagFieldComponent_div_1_Template, 8, 10, "div", 1);
@@ -19339,23 +19537,30 @@
19339
19537
  && this.formGroup['caseField'].id === this.caseLevelCaseFlagsFieldId
19340
19538
  ? exports.RefdataCaseFlagType.CASE
19341
19539
  : exports.RefdataCaseFlagType.PARTY;
19342
- // HMCTS service code for a given jurisdiction is required to retrieve the relevant list of flag types
19343
- this.flagRefdata$ = this.caseFlagRefdataService.getHmctsServiceDetails(this.jurisdiction)
19344
- .pipe(
19345
- // Use switchMap to return an inner Observable of the flag types data, having received the service details
19346
- // including service_code. This avoids having nested `subscribe`s, which is an anti-pattern!
19347
- operators.switchMap(function (serviceDetails) {
19348
- return _this.caseFlagRefdataService.getCaseFlagsRefdata(serviceDetails[0].service_code, flagType);
19349
- }))
19350
- .subscribe({
19351
- next: function (flagTypes) {
19540
+ // If hmctsServiceId is present, use this to retrieve the relevant list of flag types
19541
+ if (this.hmctsServiceId) {
19542
+ this.flagRefdata$ = this.caseFlagRefdataService.getCaseFlagsRefdata(this.hmctsServiceId, flagType)
19543
+ .subscribe({
19352
19544
  // First (and only) object in the returned array should be the top-level "Party" flag type
19353
- _this.flagTypes = flagTypes[0].childFlags;
19354
- },
19355
- error: function (error) {
19356
- _this.onRefdataError(error);
19357
- }
19358
- });
19545
+ next: function (flagTypes) { return _this.flagTypes = flagTypes[0].childFlags; },
19546
+ error: function (error) { return _this.onRefdataError(error); }
19547
+ });
19548
+ }
19549
+ else {
19550
+ // Else, HMCTS service code is required to retrieve the relevant list of flag types; attempt to obtain it by case type ID first
19551
+ this.flagRefdata$ = this.caseFlagRefdataService.getHmctsServiceDetailsByCaseType(this.caseTypeId)
19552
+ .pipe(
19553
+ // If an error occurs retrieving HMCTS service details by case type ID, try by service name instead
19554
+ operators.catchError(function (_) { return _this.caseFlagRefdataService.getHmctsServiceDetailsByServiceName(_this.jurisdiction); }),
19555
+ // Use switchMap to return an inner Observable of the flag types data, having received the service details
19556
+ // including service_code. This avoids having nested `subscribe`s, which is an anti-pattern!
19557
+ operators.switchMap(function (serviceDetails) { return _this.caseFlagRefdataService.getCaseFlagsRefdata(serviceDetails[0].service_code, flagType); }))
19558
+ .subscribe({
19559
+ // First (and only) object in the returned array should be the top-level "Party" flag type
19560
+ next: function (flagTypes) { return _this.flagTypes = flagTypes[0].childFlags; },
19561
+ error: function (error) { return _this.onRefdataError(error); }
19562
+ });
19563
+ }
19359
19564
  };
19360
19565
  SelectFlagTypeComponent.prototype.ngOnDestroy = function () {
19361
19566
  if (this.flagRefdata$) {
@@ -19427,7 +19632,7 @@
19427
19632
  return SelectFlagTypeComponent;
19428
19633
  }());
19429
19634
  SelectFlagTypeComponent.ɵfac = function SelectFlagTypeComponent_Factory(t) { return new (t || SelectFlagTypeComponent)(i0__namespace.ɵɵdirectiveInject(CaseFlagRefdataService)); };
19430
- SelectFlagTypeComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: SelectFlagTypeComponent, selectors: [["ccd-select-flag-type"]], inputs: { formGroup: "formGroup", jurisdiction: "jurisdiction" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter", flagCommentsOptionalEmitter: "flagCommentsOptionalEmitter" }, decls: 11, vars: 9, consts: [[1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-type-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--l"], ["id", "flag-type-heading", 1, "govuk-fieldset__heading"], ["id", "flag-type-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["class", "govuk-radios__conditional", "id", "conditional-flagType", 4, "ngIf"], ["class", "govuk-button-group", 4, "ngIf"], ["id", "flag-type-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName", "change"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "conditional-flagType", 1, "govuk-radios__conditional"], ["for", "other-flag-type-description", 1, "govuk-label"], ["id", "flag-type-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "other-flag-type-description", "type", "text", 1, "govuk-input", "govuk-!-width-one-half", 3, "ngClass", "name", "formControlName"], ["id", "flag-type-error-message", 1, "govuk-error-message"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function SelectFlagTypeComponent_Template(rf, ctx) {
19635
+ SelectFlagTypeComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: SelectFlagTypeComponent, selectors: [["ccd-select-flag-type"]], inputs: { formGroup: "formGroup", jurisdiction: "jurisdiction", caseTypeId: "caseTypeId", hmctsServiceId: "hmctsServiceId" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter", flagCommentsOptionalEmitter: "flagCommentsOptionalEmitter" }, decls: 11, vars: 9, consts: [[1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-type-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--l"], ["id", "flag-type-heading", 1, "govuk-fieldset__heading"], ["id", "flag-type-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["class", "govuk-radios__conditional", "id", "conditional-flagType", 4, "ngIf"], ["class", "govuk-button-group", 4, "ngIf"], ["id", "flag-type-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName", "change"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "conditional-flagType", 1, "govuk-radios__conditional"], ["for", "other-flag-type-description", 1, "govuk-label"], ["id", "flag-type-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "other-flag-type-description", "type", "text", 1, "govuk-input", "govuk-!-width-one-half", 3, "ngClass", "name", "formControlName"], ["id", "flag-type-error-message", 1, "govuk-error-message"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function SelectFlagTypeComponent_Template(rf, ctx) {
19431
19636
  if (rf & 1) {
19432
19637
  i0__namespace.ɵɵelementStart(0, "div", 0);
19433
19638
  i0__namespace.ɵɵelementStart(1, "div", 1);
@@ -19475,6 +19680,10 @@
19475
19680
  type: i0.Input
19476
19681
  }], jurisdiction: [{
19477
19682
  type: i0.Input
19683
+ }], caseTypeId: [{
19684
+ type: i0.Input
19685
+ }], hmctsServiceId: [{
19686
+ type: i0.Input
19478
19687
  }], caseFlagStateEmitter: [{
19479
19688
  type: i0.Output
19480
19689
  }], flagCommentsOptionalEmitter: [{
@@ -21749,7 +21958,10 @@
21749
21958
  }
21750
21959
  }, inputs: { dateControl: "dateControl" }, features: [i0__namespace.ɵɵProvidersFeature([
21751
21960
  { provide: i4.NGX_MAT_DATE_FORMATS, useValue: CUSTOM_MOMENT_FORMATS },
21752
- { provide: i4.NgxMatDateAdapter, useClass: momentAdapter.NgxMatMomentAdapter },
21961
+ { provide: i4.NgxMatDateAdapter,
21962
+ useClass: momentAdapter.NgxMatMomentAdapter,
21963
+ deps: [i6.MAT_DATE_LOCALE, momentAdapter.NGX_MAT_MOMENT_DATE_ADAPTER_OPTIONS]
21964
+ },
21753
21965
  { provide: momentAdapter.NGX_MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: true } }
21754
21966
  ]), i0__namespace.ɵɵInheritDefinitionFeature], decls: 14, vars: 26, consts: [[1, "govuk-form-group", "bottom-30", 3, "id", "ngClass"], ["class", "form-label", 4, "ngIf"], ["class", "form-hint", 4, "ngIf"], ["class", "error-message", 4, "ngIf"], [1, "datepicker-container"], ["ng-model-options", "{timezone:'utc'}", 1, "govuk-input", 3, "min", "max", "formControl", "ngxMatDatetimePicker", "focusin", "focusout", "dateChange"], ["input", ""], ["matSuffix", "", "id", "pickerOpener", 3, "for"], [3, "color", "touchUi", "hideTime", "startView", "stepHour", "stepSecond", "stepMinute", "showSeconds", "showSpinners", "disableMinute", "enableMeridian", "yearSelected", "monthSelected", "opened"], ["picker", ""], [1, "form-label"], [1, "form-hint"], [1, "error-message"]], template: function DatetimePickerComponent_Template(rf, ctx) {
21755
21967
  if (rf & 1) {
@@ -21806,7 +22018,10 @@
21806
22018
  encapsulation: i0.ViewEncapsulation.None,
21807
22019
  providers: [
21808
22020
  { provide: i4.NGX_MAT_DATE_FORMATS, useValue: CUSTOM_MOMENT_FORMATS },
21809
- { provide: i4.NgxMatDateAdapter, useClass: momentAdapter.NgxMatMomentAdapter },
22021
+ { provide: i4.NgxMatDateAdapter,
22022
+ useClass: momentAdapter.NgxMatMomentAdapter,
22023
+ deps: [i6.MAT_DATE_LOCALE, momentAdapter.NGX_MAT_MOMENT_DATE_ADAPTER_OPTIONS]
22024
+ },
21810
22025
  { provide: momentAdapter.NGX_MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: true } }
21811
22026
  ]
21812
22027
  }]
@@ -27903,11 +28118,12 @@
27903
28118
  _this.activitySubscription = _this.postViewActivity().subscribe();
27904
28119
  });
27905
28120
  }
28121
+ this.checkRouteAndSetCaseViewTab();
27906
28122
  // Check for active Case Flags
27907
28123
  this.activeCaseFlags = this.hasActiveCaseFlags();
27908
28124
  };
27909
28125
  CaseFullAccessViewComponent.prototype.ngOnChanges = function (changes) {
27910
- if (!changes.prependedTabs.firstChange) {
28126
+ if (changes && changes.prependedTabs && !changes.prependedTabs.firstChange) {
27911
28127
  this.init();
27912
28128
  this.crf.detectChanges();
27913
28129
  this.organiseTabPosition();
@@ -27932,6 +28148,22 @@
27932
28148
  subscription.unsubscribe();
27933
28149
  }
27934
28150
  };
28151
+ CaseFullAccessViewComponent.prototype.checkRouteAndSetCaseViewTab = function () {
28152
+ var _this = this;
28153
+ this.router.events
28154
+ .pipe(operators.filter(function (event) { return event instanceof i1$1.NavigationEnd; }))
28155
+ .subscribe(function (event) {
28156
+ var url = event && event.url;
28157
+ if (url) {
28158
+ var tabUrl = url ? url.split('#') : null;
28159
+ var tab_1 = tabUrl && tabUrl.length > 1 ? tabUrl[tabUrl.length - 1].replaceAll('%20', ' ') : '';
28160
+ var matTab = _this.tabGroup._tabs.find(function (x) { return x.textLabel.toLowerCase() === tab_1.toLowerCase(); });
28161
+ if (matTab && matTab.position) {
28162
+ _this.tabGroup.selectedIndex = matTab.position;
28163
+ }
28164
+ }
28165
+ });
28166
+ };
27935
28167
  CaseFullAccessViewComponent.prototype.postViewActivity = function () {
27936
28168
  return this.activityPollingService.postViewActivity(this.caseDetails.case_id);
27937
28169
  };
@@ -31689,12 +31921,12 @@
31689
31921
  i0__namespace.ɵɵproperty("checked", ctx_r6.allOnPageSelected())("disabled", !ctx_r6.canAnyBeShared());
31690
31922
  }
31691
31923
  }
31692
- function SearchResultComponent_table_0_th_10_div_6_Template(rf, ctx) {
31924
+ function SearchResultComponent_table_0_th_10_div_4_Template(rf, ctx) {
31693
31925
  if (rf & 1) {
31694
31926
  var _r19_1 = i0__namespace.ɵɵgetCurrentView();
31695
31927
  i0__namespace.ɵɵelementStart(0, "div", 27);
31696
31928
  i0__namespace.ɵɵelementStart(1, "a", 28);
31697
- i0__namespace.ɵɵlistener("click", function SearchResultComponent_table_0_th_10_div_6_Template_a_click_1_listener() { i0__namespace.ɵɵrestoreView(_r19_1); var col_r15 = i0__namespace.ɵɵnextContext().$implicit; var ctx_r17 = i0__namespace.ɵɵnextContext(2); return ctx_r17.sort(col_r15); });
31929
+ i0__namespace.ɵɵlistener("click", function SearchResultComponent_table_0_th_10_div_4_Template_a_click_1_listener() { i0__namespace.ɵɵrestoreView(_r19_1); var col_r15 = i0__namespace.ɵɵnextContext().$implicit; var ctx_r17 = i0__namespace.ɵɵnextContext(2); return ctx_r17.sort(col_r15); });
31698
31930
  i0__namespace.ɵɵelementEnd();
31699
31931
  i0__namespace.ɵɵelementEnd();
31700
31932
  }
@@ -31709,16 +31941,12 @@
31709
31941
  if (rf & 1) {
31710
31942
  var _r22_1 = i0__namespace.ɵɵgetCurrentView();
31711
31943
  i0__namespace.ɵɵelementStart(0, "th");
31712
- i0__namespace.ɵɵelementStart(1, "table", 24);
31713
- i0__namespace.ɵɵelementStart(2, "tr");
31714
- i0__namespace.ɵɵelementStart(3, "th");
31715
- i0__namespace.ɵɵelementStart(4, "div", 25);
31716
- i0__namespace.ɵɵlistener("click", function SearchResultComponent_table_0_th_10_Template_div_click_4_listener() { i0__namespace.ɵɵrestoreView(_r22_1); var col_r15 = ctx.$implicit; var ctx_r21 = i0__namespace.ɵɵnextContext(2); return ctx_r21.sort(col_r15); });
31717
- i0__namespace.ɵɵtext(5);
31718
- i0__namespace.ɵɵelementEnd();
31719
- i0__namespace.ɵɵtemplate(6, SearchResultComponent_table_0_th_10_div_6_Template, 2, 1, "div", 26);
31720
- i0__namespace.ɵɵelementEnd();
31944
+ i0__namespace.ɵɵelementStart(1, "div", 24);
31945
+ i0__namespace.ɵɵelementStart(2, "div", 25);
31946
+ i0__namespace.ɵɵlistener("click", function SearchResultComponent_table_0_th_10_Template_div_click_2_listener() { i0__namespace.ɵɵrestoreView(_r22_1); var col_r15 = ctx.$implicit; var ctx_r21 = i0__namespace.ɵɵnextContext(2); return ctx_r21.sort(col_r15); });
31947
+ i0__namespace.ɵɵtext(3);
31721
31948
  i0__namespace.ɵɵelementEnd();
31949
+ i0__namespace.ɵɵtemplate(4, SearchResultComponent_table_0_th_10_div_4_Template, 2, 1, "div", 26);
31722
31950
  i0__namespace.ɵɵelementEnd();
31723
31951
  i0__namespace.ɵɵelementEnd();
31724
31952
  }
@@ -31727,7 +31955,7 @@
31727
31955
  var ctx_r7 = i0__namespace.ɵɵnextContext(2);
31728
31956
  i0__namespace.ɵɵadvance(1);
31729
31957
  i0__namespace.ɵɵattribute("aria-label", "Sort by " + col_r15.label + " " + ctx_r7.isSortAscending(col_r15) ? "ascending" : "descending");
31730
- i0__namespace.ɵɵadvance(4);
31958
+ i0__namespace.ɵɵadvance(2);
31731
31959
  i0__namespace.ɵɵtextInterpolate(col_r15.label);
31732
31960
  i0__namespace.ɵɵadvance(1);
31733
31961
  i0__namespace.ɵɵproperty("ngIf", ctx_r7.comparator(col_r15));
@@ -32063,7 +32291,7 @@
32063
32291
  i0__namespace.ɵɵelementStart(7, "thead");
32064
32292
  i0__namespace.ɵɵelementStart(8, "tr", 7);
32065
32293
  i0__namespace.ɵɵtemplate(9, SearchResultComponent_table_0_th_9_Template, 4, 2, "th", 8);
32066
- i0__namespace.ɵɵtemplate(10, SearchResultComponent_table_0_th_10_Template, 7, 3, "th", 9);
32294
+ i0__namespace.ɵɵtemplate(10, SearchResultComponent_table_0_th_10_Template, 5, 3, "th", 9);
32067
32295
  i0__namespace.ɵɵtemplate(11, SearchResultComponent_table_0_th_11_Template, 1, 0, "th", 10);
32068
32296
  i0__namespace.ɵɵelementEnd();
32069
32297
  i0__namespace.ɵɵelementEnd();