@hmcts/ccd-case-ui-toolkit 7.0.0-NodeAndNgUpgrades.1 → 7.0.0-NodeAndNgUpgrades.1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/shared/commons/case-edit-data/case-edit-data.service.mjs +1 -1
- package/esm2020/lib/shared/components/case-editor/case-edit/case-edit.component.mjs +8 -8
- package/esm2020/lib/shared/components/case-editor/case-edit-confirm/case-edit-confirm.component.mjs +1 -1
- package/esm2020/lib/shared/components/case-editor/case-edit-form/case-edit-form.component.mjs +2 -2
- package/esm2020/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.mjs +1 -1
- package/esm2020/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.mjs +1 -1
- package/esm2020/lib/shared/components/case-editor/case-editor.module.mjs +13 -13
- package/esm2020/lib/shared/components/case-editor/services/case.notifier.mjs +1 -8
- package/esm2020/lib/shared/components/case-editor/services/page-validation.service.mjs +1 -1
- package/esm2020/lib/shared/components/case-viewer/case-challenged-access-request/case-challenged-access-request.component.mjs +1 -1
- package/esm2020/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.mjs +5 -5
- package/esm2020/lib/shared/components/case-viewer/case-review-specific-access-request/case-review-specific-access-request.component.mjs +1 -1
- package/esm2020/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.mjs +1 -1
- package/esm2020/lib/shared/components/create-case-filters/create-case-filters.component.mjs +15 -10
- package/esm2020/lib/shared/components/event-trigger/event-trigger.component.mjs +1 -1
- package/esm2020/lib/shared/components/palette/address/write-address-field.component.mjs +3 -3
- package/esm2020/lib/shared/components/palette/base-field/abstract-field-read.component.mjs +1 -1
- package/esm2020/lib/shared/components/palette/base-field/abstract-form-field.component.mjs +2 -2
- package/esm2020/lib/shared/components/palette/base-field/field-read.component.mjs +4 -4
- package/esm2020/lib/shared/components/palette/base-field/field-write.component.mjs +2 -2
- package/esm2020/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.mjs +3 -3
- package/esm2020/lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.mjs +2 -2
- package/esm2020/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.mjs +2 -2
- package/esm2020/lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.mjs +2 -2
- package/esm2020/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.mjs +2 -2
- package/esm2020/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.mjs +2 -2
- package/esm2020/lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.mjs +2 -2
- package/esm2020/lib/shared/components/palette/case-flag/domain/case-flag.model.mjs +1 -1
- package/esm2020/lib/shared/components/palette/case-flag/read-case-flag-field.component.mjs +3 -3
- package/esm2020/lib/shared/components/palette/case-flag/write-case-flag-field.component.mjs +22 -22
- package/esm2020/lib/shared/components/palette/case-link/write-case-link-field.component.mjs +4 -4
- package/esm2020/lib/shared/components/palette/collection/write-collection-field.component.mjs +8 -8
- package/esm2020/lib/shared/components/palette/complex/write-complex-field.component.mjs +3 -3
- package/esm2020/lib/shared/components/palette/document/write-document-field.component.mjs +42 -23
- package/esm2020/lib/shared/components/palette/judicial-user/write-judicial-user-field.component.mjs +16 -2
- package/esm2020/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.mjs +1 -1
- package/esm2020/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.mjs +1 -1
- package/esm2020/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.mjs +3 -3
- package/esm2020/lib/shared/components/palette/order-summary/write-order-summary-field.component.mjs +5 -5
- package/esm2020/lib/shared/components/palette/organisation/write-organisation-field.component.mjs +3 -3
- package/esm2020/lib/shared/components/palette/palette.module.mjs +5 -6
- package/esm2020/lib/shared/components/search-filters/search-filters.component.mjs +4 -4
- package/esm2020/lib/shared/components/search-result/search-result.component.mjs +2 -2
- package/esm2020/lib/shared/components/workbasket-filters/workbasket-filters.component.mjs +15 -4
- package/esm2020/lib/shared/directives/conditional-show/conditional-show-form.directive.mjs +4 -4
- package/esm2020/lib/shared/directives/substitutor/label-substitutor.directive.mjs +3 -3
- package/esm2020/lib/shared/domain/case-edit/case-edit.model.mjs +1 -1
- package/esm2020/lib/shared/domain/definition/jurisdiction.model.mjs +1 -1
- package/esm2020/lib/shared/pipes/complex/ccd-page-fields.pipe.mjs +1 -1
- package/esm2020/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.mjs +1 -1
- package/esm2020/lib/shared/services/fields/fields.purger.mjs +9 -9
- package/esm2020/lib/shared/services/fields/fields.utils.mjs +6 -6
- package/esm2020/lib/shared/services/form/form-error.service.mjs +1 -1
- package/esm2020/lib/shared/services/jurisdiction/jurisdiction.service.mjs +5 -2
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs +156 -114
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs +154 -114
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/commons/case-edit-data/case-edit-data.service.d.ts +3 -3
- package/lib/shared/commons/case-edit-data/case-edit-data.service.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts +5 -5
- package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-edit-confirm/case-edit-confirm.component.d.ts +2 -2
- package/lib/shared/components/case-editor/case-edit-confirm/case-edit-confirm.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-edit-form/case-edit-form.component.d.ts +2 -2
- package/lib/shared/components/case-editor/case-edit-form/case-edit-form.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts +3 -3
- package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.d.ts +2 -2
- package/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-editor.module.d.ts +8 -8
- package/lib/shared/components/case-editor/services/case.notifier.d.ts.map +1 -1
- package/lib/shared/components/case-editor/services/page-validation.service.d.ts +3 -3
- package/lib/shared/components/case-editor/services/page-validation.service.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/case-challenged-access-request/case-challenged-access-request.component.d.ts +2 -2
- package/lib/shared/components/case-viewer/case-challenged-access-request/case-challenged-access-request.component.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts +4 -4
- package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/case-review-specific-access-request/case-review-specific-access-request.component.d.ts +2 -2
- package/lib/shared/components/case-viewer/case-review-specific-access-request/case-review-specific-access-request.component.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.d.ts +2 -2
- package/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.d.ts.map +1 -1
- package/lib/shared/components/create-case-filters/create-case-filters.component.d.ts +6 -4
- package/lib/shared/components/create-case-filters/create-case-filters.component.d.ts.map +1 -1
- package/lib/shared/components/event-trigger/event-trigger.component.d.ts +2 -2
- package/lib/shared/components/event-trigger/event-trigger.component.d.ts.map +1 -1
- package/lib/shared/components/palette/address/write-address-field.component.d.ts +3 -3
- package/lib/shared/components/palette/address/write-address-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/base-field/abstract-field-read.component.d.ts +2 -2
- package/lib/shared/components/palette/base-field/abstract-field-read.component.d.ts.map +1 -1
- package/lib/shared/components/palette/base-field/abstract-form-field.component.d.ts +3 -3
- package/lib/shared/components/palette/base-field/abstract-form-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/base-field/field-read.component.d.ts +2 -2
- package/lib/shared/components/palette/base-field/field-read.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.d.ts +2 -2
- package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.d.ts +2 -2
- package/lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.d.ts +2 -2
- package/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.d.ts +2 -2
- package/lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.d.ts +2 -2
- package/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.d.ts +2 -2
- package/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.d.ts +2 -2
- package/lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-flag/domain/case-flag.model.d.ts +2 -2
- package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts +6 -6
- package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-link/write-case-link-field.component.d.ts +2 -2
- package/lib/shared/components/palette/case-link/write-case-link-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/collection/write-collection-field.component.d.ts +3 -3
- package/lib/shared/components/palette/collection/write-collection-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/complex/write-complex-field.component.d.ts +3 -3
- package/lib/shared/components/palette/complex/write-complex-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/document/write-document-field.component.d.ts +8 -4
- package/lib/shared/components/palette/document/write-document-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/judicial-user/write-judicial-user-field.component.d.ts +5 -3
- package/lib/shared/components/palette/judicial-user/write-judicial-user-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.d.ts +2 -2
- package/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.d.ts.map +1 -1
- package/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.d.ts +2 -2
- package/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.d.ts.map +1 -1
- package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts +2 -2
- package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/organisation/write-organisation-field.component.d.ts +2 -2
- package/lib/shared/components/palette/organisation/write-organisation-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/palette.module.d.ts.map +1 -1
- package/lib/shared/components/search-filters/search-filters.component.d.ts +3 -3
- package/lib/shared/components/search-filters/search-filters.component.d.ts.map +1 -1
- package/lib/shared/components/search-result/search-result.component.d.ts +3 -3
- package/lib/shared/components/search-result/search-result.component.d.ts.map +1 -1
- package/lib/shared/components/workbasket-filters/workbasket-filters.component.d.ts +4 -4
- package/lib/shared/components/workbasket-filters/workbasket-filters.component.d.ts.map +1 -1
- package/lib/shared/directives/conditional-show/conditional-show-form.directive.d.ts +2 -2
- package/lib/shared/directives/conditional-show/conditional-show-form.directive.d.ts.map +1 -1
- package/lib/shared/directives/substitutor/label-substitutor.directive.d.ts +2 -2
- package/lib/shared/directives/substitutor/label-substitutor.directive.d.ts.map +1 -1
- package/lib/shared/domain/case-edit/case-edit.model.d.ts +2 -2
- package/lib/shared/domain/case-edit/case-edit.model.d.ts.map +1 -1
- package/lib/shared/domain/definition/jurisdiction.model.d.ts +1 -0
- package/lib/shared/domain/definition/jurisdiction.model.d.ts.map +1 -1
- package/lib/shared/pipes/complex/ccd-page-fields.pipe.d.ts +2 -2
- package/lib/shared/pipes/complex/ccd-page-fields.pipe.d.ts.map +1 -1
- package/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.d.ts +2 -2
- package/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.d.ts.map +1 -1
- package/lib/shared/services/fields/fields.purger.d.ts +4 -4
- package/lib/shared/services/fields/fields.purger.d.ts.map +1 -1
- package/lib/shared/services/fields/fields.utils.d.ts +6 -6
- package/lib/shared/services/fields/fields.utils.d.ts.map +1 -1
- package/lib/shared/services/form/form-error.service.d.ts +2 -2
- package/lib/shared/services/form/form-error.service.d.ts.map +1 -1
- package/lib/shared/services/jurisdiction/jurisdiction.service.d.ts +3 -2
- package/lib/shared/services/jurisdiction/jurisdiction.service.d.ts.map +1 -1
- package/package.json +2 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, EventEmitter, Output, NgModule, ViewEncapsulation, forwardRef, Pipe, ViewChildren, ContentChildren, Injectable, Inject, Directive, ViewChild, HostListener, Injector, ViewContainerRef, ChangeDetectorRef,
|
|
2
|
+
import { Component, Input, EventEmitter, Output, NgModule, ViewEncapsulation, forwardRef, Pipe, ViewChildren, ContentChildren, Injectable, Inject, Directive, ViewChild, HostListener, Injector, ViewContainerRef, ChangeDetectorRef, CUSTOM_ELEMENTS_SCHEMA, InjectionToken } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule, DOCUMENT, CurrencyPipe, formatDate } from '@angular/common';
|
|
5
5
|
import * as i1$1 from 'rpx-xui-translation';
|
|
@@ -7,7 +7,7 @@ import { RpxTranslationModule, RpxTranslatePipe } from 'rpx-xui-translation';
|
|
|
7
7
|
import * as i1$2 from '@angular/router';
|
|
8
8
|
import { RouterModule, NavigationStart, NavigationEnd } from '@angular/router';
|
|
9
9
|
import * as i3 from '@angular/forms';
|
|
10
|
-
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray,
|
|
10
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
11
11
|
import polling from 'rx-polling';
|
|
12
12
|
import { throwError, Subject, EMPTY, Observable, of, BehaviorSubject, timer, fromEvent, forkJoin } from 'rxjs';
|
|
13
13
|
import * as i1$3 from '@angular/common/http';
|
|
@@ -3481,10 +3481,10 @@ class FieldsUtils {
|
|
|
3481
3481
|
* Extract flags data from a `CaseField` instance, recursing and iterating through sub-fields of a Complex field or
|
|
3482
3482
|
* each field in a Collection field.
|
|
3483
3483
|
*
|
|
3484
|
-
* @param flags An array for accumulating extracted flags data and derived `
|
|
3484
|
+
* @param flags An array for accumulating extracted flags data and derived `FormGroup` paths
|
|
3485
3485
|
* @param caseField A `CaseField` instance from which to extract the flags data
|
|
3486
3486
|
* @param pathToFlagsFormGroup A (dot-delimited) string for concatenating the name of each control that forms the path
|
|
3487
|
-
* to the `
|
|
3487
|
+
* to the `FormGroup` for the `Flags` instance
|
|
3488
3488
|
* @param topLevelCaseField The top-level `CaseField` that contains the value property. This is required because _only
|
|
3489
3489
|
* top-level_ `CaseField`s contain actual values and a reference needs to be maintained to such a field
|
|
3490
3490
|
* @param currentValue The current value object of a `CaseField` that is a sub-field of a non root-level Complex field.
|
|
@@ -3492,7 +3492,7 @@ class FieldsUtils {
|
|
|
3492
3492
|
* only the _root-level_ `CaseField` contains a value property - all sub-fields, including any nested Complex fields,
|
|
3493
3493
|
* do *not* contain any values themselves.)
|
|
3494
3494
|
* @returns An array of `FlagsWithFormGroupPath`, each instance comprising a `Flags` object derived from a `CaseField`
|
|
3495
|
-
* of type "Flags", and the dot-delimited path string to the corresponding `
|
|
3495
|
+
* of type "Flags", and the dot-delimited path string to the corresponding `FormGroup`
|
|
3496
3496
|
*/
|
|
3497
3497
|
static extractFlagsDataFromCaseField(flags, caseField, pathToFlagsFormGroup, topLevelCaseField, currentValue) {
|
|
3498
3498
|
const fieldType = caseField.field_type;
|
|
@@ -3690,7 +3690,7 @@ class FieldsUtils {
|
|
|
3690
3690
|
if (aControl instanceof FormArray) { // We're in a collection
|
|
3691
3691
|
formArrayFn(aControl);
|
|
3692
3692
|
}
|
|
3693
|
-
else if (aControl instanceof
|
|
3693
|
+
else if (aControl instanceof FormGroup) { // We're in a complex type.
|
|
3694
3694
|
formGroupFn(aControl);
|
|
3695
3695
|
}
|
|
3696
3696
|
else if (aControl instanceof FormControl) { // FormControl
|
|
@@ -4510,7 +4510,7 @@ class ConditionalShowFormDirective {
|
|
|
4510
4510
|
this.handleFormGroup = (formGroup) => {
|
|
4511
4511
|
this.evaluateControl(formGroup);
|
|
4512
4512
|
let groupControl = formGroup;
|
|
4513
|
-
if (formGroup.get('value') && formGroup.get('value') instanceof
|
|
4513
|
+
if (formGroup.get('value') && formGroup.get('value') instanceof FormGroup) { // Complex Field
|
|
4514
4514
|
groupControl = formGroup.get('value');
|
|
4515
4515
|
}
|
|
4516
4516
|
else if (formGroup.controls) {
|
|
@@ -4532,7 +4532,7 @@ class ConditionalShowFormDirective {
|
|
|
4532
4532
|
}
|
|
4533
4533
|
ngOnInit() {
|
|
4534
4534
|
if (!this.formGroup) {
|
|
4535
|
-
this.formGroup = new
|
|
4535
|
+
this.formGroup = new FormGroup({});
|
|
4536
4536
|
}
|
|
4537
4537
|
}
|
|
4538
4538
|
/**
|
|
@@ -4761,7 +4761,7 @@ class FieldsPurger {
|
|
|
4761
4761
|
for (const complexSubField of field.field_type.complex_fields) {
|
|
4762
4762
|
if ((complexSubField.field_type.type === 'Complex' && complexSubField.field_type.complex_fields.length > 0) ||
|
|
4763
4763
|
!complexSubField.retain_hidden_value) {
|
|
4764
|
-
// Check for the existence of the parent
|
|
4764
|
+
// Check for the existence of the parent FormGroup corresponding to the Complex field; if it exists, call
|
|
4765
4765
|
// deleteFieldValue() to delete the sub-field
|
|
4766
4766
|
const parentFormGroup = form.get('data').controls[field.id];
|
|
4767
4767
|
if (parentFormGroup) {
|
|
@@ -4793,7 +4793,7 @@ class FieldsPurger {
|
|
|
4793
4793
|
}
|
|
4794
4794
|
}
|
|
4795
4795
|
// Recursively delete the sub-field value if retain_hidden_value is false, OR if the sub-field type is
|
|
4796
|
-
// Complex and regardless of retain_hidden_value, passing in the parent
|
|
4796
|
+
// Complex and regardless of retain_hidden_value, passing in the parent FormGroup
|
|
4797
4797
|
if (subCaseField &&
|
|
4798
4798
|
((subCaseField.field_type.type === 'Complex' && subCaseField.field_type.complex_fields.length > 0) ||
|
|
4799
4799
|
!subCaseField.retain_hidden_value)) {
|
|
@@ -4832,7 +4832,7 @@ class FieldsPurger {
|
|
|
4832
4832
|
* types, this recursive method is called until simple or "base" field types are reached. For `Document` field
|
|
4833
4833
|
* types, its _sub-field_ `FormControl` values are set to null.
|
|
4834
4834
|
*
|
|
4835
|
-
* @param
|
|
4835
|
+
* @param FormGroup The `FormGroup` instance containing the `FormControl` for the specified field
|
|
4836
4836
|
* @param field The `CaseField` whose value is to be deleted in the backend
|
|
4837
4837
|
* @param parentField Reference to the parent `CaseField`. Used for checking specifically where a Complex field and
|
|
4838
4838
|
* its sub-fields have `retain_hidden_value` set to `true`, but the field's parent has it set to `false` or undefined
|
|
@@ -4861,7 +4861,7 @@ class FieldsPurger {
|
|
|
4861
4861
|
(field.retain_hidden_value
|
|
4862
4862
|
? !complexSubField.retain_hidden_value || (parentField && !parentField.retain_hidden_value)
|
|
4863
4863
|
: true))) {
|
|
4864
|
-
// The fieldControl is cast to a
|
|
4864
|
+
// The fieldControl is cast to a FormGroup because a Complex field type uses this as its underlying
|
|
4865
4865
|
// implementation
|
|
4866
4866
|
this.deleteFieldValue(fieldControl, complexSubField, field);
|
|
4867
4867
|
}
|
|
@@ -4888,7 +4888,7 @@ class FieldsPurger {
|
|
|
4888
4888
|
break;
|
|
4889
4889
|
}
|
|
4890
4890
|
}
|
|
4891
|
-
// Recursively delete the sub-field value, passing in the parent
|
|
4891
|
+
// Recursively delete the sub-field value, passing in the parent FormGroup
|
|
4892
4892
|
const parentFormGroup = fieldControl.at(index).get('value');
|
|
4893
4893
|
this.deleteFieldValue(parentFormGroup, subCaseField);
|
|
4894
4894
|
}));
|
|
@@ -4903,7 +4903,7 @@ class FieldsPurger {
|
|
|
4903
4903
|
// the single Document case)
|
|
4904
4904
|
if (documentFieldValues) {
|
|
4905
4905
|
documentFieldValues.forEach((fieldValue, index) => Object.keys(fieldValue.value).forEach(subFieldId => {
|
|
4906
|
-
// Get the
|
|
4906
|
+
// Get the FormGroup containing the FormControl for the sub-field and set its value to null
|
|
4907
4907
|
fieldControl.at(index).get(`value.${subFieldId}`).setValue(null);
|
|
4908
4908
|
}));
|
|
4909
4909
|
}
|
|
@@ -4922,8 +4922,8 @@ class FieldsPurger {
|
|
|
4922
4922
|
}
|
|
4923
4923
|
break;
|
|
4924
4924
|
case 'Document':
|
|
4925
|
-
// NOTE: The field control (a
|
|
4926
|
-
// all existing values of a
|
|
4925
|
+
// NOTE: The field control (a FormGroup in this case) cannot just be set to null because Angular checks that
|
|
4926
|
+
// all existing values of a FormGroup are present; setting the control's value to null causes a runtime error
|
|
4927
4927
|
const documentFieldValue = fieldControl.value;
|
|
4928
4928
|
for (const key in documentFieldValue) {
|
|
4929
4929
|
if (fieldControl.get(key)) {
|
|
@@ -5809,7 +5809,7 @@ class LabelSubstitutorDirective {
|
|
|
5809
5809
|
ngOnInit() {
|
|
5810
5810
|
this.initialLabel = this.caseField.label;
|
|
5811
5811
|
this.initialHintText = this.caseField.hint_text;
|
|
5812
|
-
this.formGroup = this.formGroup || new
|
|
5812
|
+
this.formGroup = this.formGroup || new FormGroup({});
|
|
5813
5813
|
const fields = this.getReadOnlyAndFormFields();
|
|
5814
5814
|
if (this.shouldSubstitute('label')) {
|
|
5815
5815
|
this.caseField.label = this.resolvePlaceholders(fields, this.caseField.label);
|
|
@@ -6627,7 +6627,9 @@ FormErrorService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormErr
|
|
|
6627
6627
|
class JurisdictionService {
|
|
6628
6628
|
constructor(httpService) {
|
|
6629
6629
|
this.httpService = httpService;
|
|
6630
|
+
// We retain the Subject observable because subscribing code couldn't happen a null value
|
|
6630
6631
|
this.selectedJurisdictionSource = new Subject();
|
|
6632
|
+
this.selectedJurisdictionBS = new BehaviorSubject(null);
|
|
6631
6633
|
this.selectedJurisdiction = this.selectedJurisdictionSource.asObservable();
|
|
6632
6634
|
}
|
|
6633
6635
|
getJurisdictions() {
|
|
@@ -6635,6 +6637,7 @@ class JurisdictionService {
|
|
|
6635
6637
|
}
|
|
6636
6638
|
announceSelectedJurisdiction(jurisdiction) {
|
|
6637
6639
|
this.selectedJurisdictionSource.next(jurisdiction);
|
|
6640
|
+
this.selectedJurisdictionBS.next(jurisdiction);
|
|
6638
6641
|
}
|
|
6639
6642
|
searchJudicialUsers(searchTerm, serviceId) {
|
|
6640
6643
|
return this.httpService.post('api/prd/judicial/getJudicialUsersSearch', { searchString: searchTerm, serviceCode: serviceId });
|
|
@@ -8183,22 +8186,15 @@ class CaseNotifier {
|
|
|
8183
8186
|
this.cachedCaseView = null;
|
|
8184
8187
|
}
|
|
8185
8188
|
announceCase(c) {
|
|
8186
|
-
console.info('announceCase started.');
|
|
8187
8189
|
this.caseViewSource.next(c);
|
|
8188
|
-
console.info('announceCase finished.');
|
|
8189
8190
|
}
|
|
8190
8191
|
fetchAndRefresh(cid) {
|
|
8191
|
-
console.info('fetchAndRefresh started.');
|
|
8192
8192
|
return this.casesService
|
|
8193
8193
|
.getCaseViewV2(cid)
|
|
8194
8194
|
.pipe(map(caseView => {
|
|
8195
|
-
console.info('mapping caseView started.');
|
|
8196
|
-
// this.casesService.syncWait(10);
|
|
8197
|
-
// throw new Error('******************************************************');
|
|
8198
8195
|
this.cachedCaseView = plainToClassFromExist(new CaseView(), caseView);
|
|
8199
8196
|
this.setBasicFields(this.cachedCaseView.tabs);
|
|
8200
8197
|
this.announceCase(this.cachedCaseView);
|
|
8201
|
-
console.info('mapping caseView finished. Returning it.');
|
|
8202
8198
|
return this.cachedCaseView;
|
|
8203
8199
|
}));
|
|
8204
8200
|
}
|
|
@@ -8718,7 +8714,7 @@ class CaseEditComponent {
|
|
|
8718
8714
|
this.sessionStorageService.setItem('eventUrl', this.router.url);
|
|
8719
8715
|
}
|
|
8720
8716
|
this.form = this.fb.group({
|
|
8721
|
-
data: new
|
|
8717
|
+
data: new FormGroup({}),
|
|
8722
8718
|
event: this.fb.group({
|
|
8723
8719
|
id: [this.eventTrigger.id, Validators.required],
|
|
8724
8720
|
summary: [''],
|
|
@@ -8891,7 +8887,7 @@ class CaseEditComponent {
|
|
|
8891
8887
|
return data;
|
|
8892
8888
|
}
|
|
8893
8889
|
/**
|
|
8894
|
-
* Traverse *all* values of a {@link
|
|
8890
|
+
* Traverse *all* values of a {@link FormGroup}, including those for disabled fields (i.e. hidden ones), replacing the
|
|
8895
8891
|
* value of any that are hidden AND have `retain_hidden_value` set to `true` in the corresponding `CaseField`, with
|
|
8896
8892
|
* the *original* value held in the `CaseField` object.
|
|
8897
8893
|
*
|
|
@@ -8904,8 +8900,8 @@ class CaseEditComponent {
|
|
|
8904
8900
|
* * For Collection field types, including collections of Complex and Document field types, the replacement is
|
|
8905
8901
|
* performed for all fields in the collection.
|
|
8906
8902
|
*
|
|
8907
|
-
* @param
|
|
8908
|
-
* @param caseFields The array of {@link CaseField} domain model objects corresponding to fields in `
|
|
8903
|
+
* @param FormGroup The `FormGroup` instance whose raw values are to be traversed
|
|
8904
|
+
* @param caseFields The array of {@link CaseField} domain model objects corresponding to fields in `FormGroup`
|
|
8909
8905
|
* @param parentField Reference to the parent `CaseField`. Used for retrieving the sub-field values of a Complex field
|
|
8910
8906
|
* to perform recursive replacement - the sub-field `CaseField`s themselves do *not* contain any values
|
|
8911
8907
|
* @returns An object with the *raw* form value data (as key-value pairs), with any value replacements as necessary
|
|
@@ -8948,8 +8944,8 @@ class CaseEditComponent {
|
|
|
8948
8944
|
// CaseField itself (the sub-fields do not contain any values, so these need to be obtained from the
|
|
8949
8945
|
// parent)
|
|
8950
8946
|
// Update rawFormValueData for this field
|
|
8951
|
-
// creating form group and adding control into it in case caseField is of complext type and and part of
|
|
8952
|
-
const form = new
|
|
8947
|
+
// creating form group and adding control into it in case caseField is of complext type and and part of FormGroup
|
|
8948
|
+
const form = new FormGroup({});
|
|
8953
8949
|
if (formGroup.controls[key].value) {
|
|
8954
8950
|
Object.keys(formGroup.controls[key].value).forEach((item) => {
|
|
8955
8951
|
form.addControl(item, new FormControl(formGroup.controls[key].value[item]));
|
|
@@ -10553,7 +10549,7 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
|
|
|
10553
10549
|
constructor(addressesService, isCompoundPipe) {
|
|
10554
10550
|
super();
|
|
10555
10551
|
this.isCompoundPipe = isCompoundPipe;
|
|
10556
|
-
this.addressFormGroup = new
|
|
10552
|
+
this.addressFormGroup = new FormGroup({});
|
|
10557
10553
|
this.missingPostcode = false;
|
|
10558
10554
|
this.addressesService = addressesService;
|
|
10559
10555
|
}
|
|
@@ -11082,7 +11078,7 @@ class ReadCaseFlagFieldComponent extends AbstractFieldReadComponent {
|
|
|
11082
11078
|
}
|
|
11083
11079
|
ngOnInit() {
|
|
11084
11080
|
// If the context is PaletteContext.DEFAULT, the Flags fields need to be located by CaseTab (they won't be present
|
|
11085
|
-
// in the
|
|
11081
|
+
// in the FormGroup - only the FlagLauncher field is present)
|
|
11086
11082
|
if (this.context === PaletteContext.DEFAULT) {
|
|
11087
11083
|
// Determine the tab this CaseField belongs to (should be only one), from the CaseView object in the snapshot
|
|
11088
11084
|
// data, and extract all flags-related data from its Flags fields
|
|
@@ -11101,7 +11097,7 @@ class ReadCaseFlagFieldComponent extends AbstractFieldReadComponent {
|
|
|
11101
11097
|
else if (this.context === PaletteContext.CHECK_YOUR_ANSWER) {
|
|
11102
11098
|
// If the context is PaletteContext.CHECK_YOUR_ANSWER, the Flags data is already present within the formGroup.
|
|
11103
11099
|
// The FlagLauncher component, WriteCaseFlagFieldComponent, holds a reference to:
|
|
11104
|
-
// i) the parent
|
|
11100
|
+
// i) the parent FormGroup for the Flags instance where changes have been made;
|
|
11105
11101
|
// ii) the currently selected flag (selectedFlag) if one exists
|
|
11106
11102
|
const flagLauncherControlName = Object.keys(this.formGroup.controls).find(controlName => FieldsUtils.isFlagLauncherCaseField(this.formGroup.get(controlName)['caseField']));
|
|
11107
11103
|
if (flagLauncherControlName && this.formGroup.get(flagLauncherControlName)['component']) {
|
|
@@ -11345,7 +11341,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11345
11341
|
this.caseEditDataService = caseEditDataService;
|
|
11346
11342
|
this.caseFlagFieldState = CaseFlagFieldState;
|
|
11347
11343
|
this.errorMessages = [];
|
|
11348
|
-
this.caseFlagParentFormGroup = new
|
|
11344
|
+
this.caseFlagParentFormGroup = new FormGroup({});
|
|
11349
11345
|
this.flagCommentsOptional = false;
|
|
11350
11346
|
this.listOfValues = null;
|
|
11351
11347
|
this.allCaseFlagStagesCompleted = false;
|
|
@@ -11362,11 +11358,11 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11362
11358
|
if (this.formGroup && this.formGroup.get(this.caseField.id)) {
|
|
11363
11359
|
this.formGroup.removeControl(this.caseField.id);
|
|
11364
11360
|
}
|
|
11365
|
-
// From this point, this.formGroup refers to the
|
|
11366
|
-
this.formGroup = this.registerControl(new
|
|
11361
|
+
// From this point, this.formGroup refers to the FormGroup for the FlagLauncher field, not the parent FormGroup
|
|
11362
|
+
this.formGroup = this.registerControl(new FormGroup({}, {
|
|
11367
11363
|
validators: (_) => {
|
|
11368
11364
|
if (!this.allCaseFlagStagesCompleted) {
|
|
11369
|
-
// Return an error to mark the
|
|
11365
|
+
// Return an error to mark the FormGroup as invalid if not all Case Flag stages have been completed
|
|
11370
11366
|
return { notAllCaseFlagStagesCompleted: true };
|
|
11371
11367
|
}
|
|
11372
11368
|
return null;
|
|
@@ -11415,7 +11411,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11415
11411
|
onCaseFlagStateEmitted(caseFlagState) {
|
|
11416
11412
|
this.caseEditDataService.clearFormValidationErrors();
|
|
11417
11413
|
// If the current state is CaseFlagFieldState.FLAG_LOCATION and a flag location (a Flags instance) has been selected,
|
|
11418
|
-
// set the parent Case Flag
|
|
11414
|
+
// set the parent Case Flag FormGroup for this component's children by using the provided pathToFlagsFormGroup, and
|
|
11419
11415
|
// set the selected flag location on this component
|
|
11420
11416
|
if (caseFlagState.currentCaseFlagFieldState === CaseFlagFieldState.FLAG_LOCATION
|
|
11421
11417
|
&& caseFlagState.selectedFlagsLocation
|
|
@@ -11433,7 +11429,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11433
11429
|
this.listOfValues = caseFlagState.listOfValues;
|
|
11434
11430
|
}
|
|
11435
11431
|
// If the current state is CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS and a flag has been selected, set the parent
|
|
11436
|
-
// Case Flag
|
|
11432
|
+
// Case Flag FormGroup for this component's children by using the provided pathToFlagsFormGroup
|
|
11437
11433
|
if (caseFlagState.currentCaseFlagFieldState === CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS
|
|
11438
11434
|
&& caseFlagState.selectedFlag
|
|
11439
11435
|
&& caseFlagState.selectedFlag.pathToFlagsFormGroup) {
|
|
@@ -11570,8 +11566,8 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11570
11566
|
if (flagsCaseFieldValue) {
|
|
11571
11567
|
const flagDetailToUpdate = flagsCaseFieldValue.details.find(detail => detail.id === this.selectedFlag.flagDetailDisplay.flagDetail.id);
|
|
11572
11568
|
if (flagDetailToUpdate) {
|
|
11573
|
-
flagDetailToUpdate.value.flagComment = this.caseFlagParentFormGroup.value
|
|
11574
|
-
? this.caseFlagParentFormGroup.value
|
|
11569
|
+
flagDetailToUpdate.value.flagComment = this.caseFlagParentFormGroup.value['flagComments']
|
|
11570
|
+
? this.caseFlagParentFormGroup.value['flagComments']
|
|
11575
11571
|
: null;
|
|
11576
11572
|
flagDetailToUpdate.value.status = this.selectedFlag.flagDetailDisplay.flagDetail.status;
|
|
11577
11573
|
flagDetailToUpdate.value.dateTimeModified = new Date().toISOString();
|
|
@@ -11596,12 +11592,12 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11596
11592
|
this.flagCommentsOptional = true;
|
|
11597
11593
|
}
|
|
11598
11594
|
/**
|
|
11599
|
-
* Set the parent {@link
|
|
11600
|
-
* to which data should be attached. **Note:** The parent is not _this_ component's `
|
|
11595
|
+
* Set the parent {@link FormGroup} for this component's children, depending on the `Flags` {@link CaseField} instance
|
|
11596
|
+
* to which data should be attached. **Note:** The parent is not _this_ component's `FormGroup` (as might otherwise be
|
|
11601
11597
|
* expected) because this component is not expected to have a value, given it is used for the empty `FlagLauncher` base
|
|
11602
11598
|
* field type.
|
|
11603
11599
|
*
|
|
11604
|
-
* @param pathToFlagsFormGroup The dot-delimited string that is the path to the `
|
|
11600
|
+
* @param pathToFlagsFormGroup The dot-delimited string that is the path to the `FormGroup` for a `Flags` instance
|
|
11605
11601
|
*/
|
|
11606
11602
|
setCaseFlagParentFormGroup(pathToFlagsFormGroup) {
|
|
11607
11603
|
this.caseFlagParentFormGroup = this.formGroup.parent.get(pathToFlagsFormGroup);
|
|
@@ -11610,19 +11606,19 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11610
11606
|
return {
|
|
11611
11607
|
name: this.flagName,
|
|
11612
11608
|
// Currently, subTypeValue and subTypeKey are applicable only to language flag types
|
|
11613
|
-
subTypeValue: this.caseFlagParentFormGroup.value
|
|
11614
|
-
? this.caseFlagParentFormGroup.value
|
|
11615
|
-
: this.caseFlagParentFormGroup.value
|
|
11616
|
-
? this.caseFlagParentFormGroup.value
|
|
11609
|
+
subTypeValue: this.caseFlagParentFormGroup.value['languageSearchTerm']
|
|
11610
|
+
? this.caseFlagParentFormGroup.value['languageSearchTerm'].value
|
|
11611
|
+
: this.caseFlagParentFormGroup.value['mmanualLanguageEntry']
|
|
11612
|
+
? this.caseFlagParentFormGroup.value['mmanualLanguageEntry']
|
|
11617
11613
|
: null,
|
|
11618
11614
|
// For user-entered (i.e. non-Reference Data) languages, there is no key
|
|
11619
|
-
subTypeKey: this.caseFlagParentFormGroup.value
|
|
11620
|
-
? this.caseFlagParentFormGroup.value
|
|
11615
|
+
subTypeKey: this.caseFlagParentFormGroup.value['languageSearchTerm']
|
|
11616
|
+
? this.caseFlagParentFormGroup.value['languageSearchTerm'].key
|
|
11621
11617
|
: null,
|
|
11622
|
-
otherDescription: this.flagCode === this.otherFlagTypeCode && this.caseFlagParentFormGroup.value
|
|
11623
|
-
? this.caseFlagParentFormGroup.value
|
|
11618
|
+
otherDescription: this.flagCode === this.otherFlagTypeCode && this.caseFlagParentFormGroup.value['otherFlagTypeDescription']
|
|
11619
|
+
? this.caseFlagParentFormGroup.value['otherFlagTypeDescription']
|
|
11624
11620
|
: null,
|
|
11625
|
-
flagComment: this.caseFlagParentFormGroup.value
|
|
11621
|
+
flagComment: this.caseFlagParentFormGroup.value['flagComments'] ? this.caseFlagParentFormGroup.value['flagComments'] : null,
|
|
11626
11622
|
dateTimeCreated: new Date().toISOString(),
|
|
11627
11623
|
path: this.flagPath,
|
|
11628
11624
|
hearingRelevant: this.hearingRelevantFlag ? 'Yes' : 'No',
|
|
@@ -11773,12 +11769,12 @@ const _c1$m = function (a0) { return { "form-group-error": a0 }; };
|
|
|
11773
11769
|
class WriteCaseLinkFieldComponent extends AbstractFieldWriteComponent {
|
|
11774
11770
|
ngOnInit() {
|
|
11775
11771
|
if (this.caseField.value) {
|
|
11776
|
-
this.caseLinkGroup = this.registerControl(new
|
|
11772
|
+
this.caseLinkGroup = this.registerControl(new FormGroup({
|
|
11777
11773
|
CaseReference: new FormControl(this.caseField.value.CaseReference, Validators.required),
|
|
11778
11774
|
}), true);
|
|
11779
11775
|
}
|
|
11780
11776
|
else {
|
|
11781
|
-
this.caseLinkGroup = this.registerControl(new
|
|
11777
|
+
this.caseLinkGroup = this.registerControl(new FormGroup({
|
|
11782
11778
|
CaseReference: new FormControl(null, Validators.required),
|
|
11783
11779
|
}), true);
|
|
11784
11780
|
}
|
|
@@ -12152,7 +12148,7 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12152
12148
|
* this is what appears to be happening:
|
|
12153
12149
|
* 1. this.formArray contains no controls at all.
|
|
12154
12150
|
* this.formArray.value = [];
|
|
12155
|
-
* 2. this.formArray contains a
|
|
12151
|
+
* 2. this.formArray contains a FormGroup, which contains a single
|
|
12156
12152
|
* FormControl with the id 'code'.
|
|
12157
12153
|
* this.formArray.value = [{ code: null }]
|
|
12158
12154
|
* 3. this.formArray contains what is being set up below.
|
|
@@ -12164,7 +12160,7 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12164
12160
|
group = this.formArray.at(index);
|
|
12165
12161
|
}
|
|
12166
12162
|
else {
|
|
12167
|
-
group = new
|
|
12163
|
+
group = new FormGroup({});
|
|
12168
12164
|
}
|
|
12169
12165
|
let value;
|
|
12170
12166
|
if (this.isCollectionOfSimpleType(this.caseField)) {
|
|
@@ -12178,14 +12174,14 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12178
12174
|
else {
|
|
12179
12175
|
value = group.get('value');
|
|
12180
12176
|
if (!value) {
|
|
12181
|
-
value = new
|
|
12177
|
+
value = new FormGroup({});
|
|
12182
12178
|
for (const key of Object.keys(group.controls)) {
|
|
12183
12179
|
value.addControl(key, group.get(key));
|
|
12184
12180
|
// DON'T remove the control for this key from the outer group or it
|
|
12185
12181
|
// goes awry. So DON'T uncomment the below line!
|
|
12186
12182
|
// group.removeControl(key);
|
|
12187
12183
|
}
|
|
12188
|
-
// Now add the value
|
|
12184
|
+
// Now add the value FormGroup to the outer group.
|
|
12189
12185
|
group.addControl('value', value);
|
|
12190
12186
|
}
|
|
12191
12187
|
}
|
|
@@ -12290,7 +12286,7 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12290
12286
|
}
|
|
12291
12287
|
getContainer(index) {
|
|
12292
12288
|
const value = this.formArray.at(index).get('value');
|
|
12293
|
-
if (value instanceof
|
|
12289
|
+
if (value instanceof FormGroup) {
|
|
12294
12290
|
return value;
|
|
12295
12291
|
}
|
|
12296
12292
|
else {
|
|
@@ -12400,7 +12396,7 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12400
12396
|
* Applied full solution as part of EUI-3505
|
|
12401
12397
|
*/
|
|
12402
12398
|
getControlIdAt(index) {
|
|
12403
|
-
// this.formArray contains [
|
|
12399
|
+
// this.formArray contains [ FormGroup( id: FormControl, value: FormGroup ), ... ].
|
|
12404
12400
|
// Here, we need to get the value of the id FormControl.
|
|
12405
12401
|
const group = this.formArray.at(index);
|
|
12406
12402
|
const control = group.get('id');
|
|
@@ -12713,7 +12709,7 @@ class WriteComplexFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12713
12709
|
this.caseFields = [];
|
|
12714
12710
|
this.renderLabel = true;
|
|
12715
12711
|
this.ignoreMandatory = false;
|
|
12716
|
-
this.complexGroup = new
|
|
12712
|
+
this.complexGroup = new FormGroup({});
|
|
12717
12713
|
}
|
|
12718
12714
|
ngOnInit() {
|
|
12719
12715
|
// Are we inside of a collection? If so, the parent is the complexGroup we want.
|
|
@@ -13085,17 +13081,18 @@ function WriteDocumentFieldComponent_ccd_read_document_field_10_Template(rf, ctx
|
|
|
13085
13081
|
}
|
|
13086
13082
|
const _c1$k = function (a0) { return { "form-group-error bottom-30": a0 }; };
|
|
13087
13083
|
class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
13088
|
-
constructor(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService) {
|
|
13084
|
+
constructor(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService, jurisdictionService) {
|
|
13089
13085
|
super();
|
|
13090
13086
|
this.appConfig = appConfig;
|
|
13091
13087
|
this.caseNotifier = caseNotifier;
|
|
13092
13088
|
this.documentManagement = documentManagement;
|
|
13093
13089
|
this.dialog = dialog;
|
|
13094
13090
|
this.fileUploadStateService = fileUploadStateService;
|
|
13091
|
+
this.jurisdictionService = jurisdictionService;
|
|
13095
13092
|
this.valid = true;
|
|
13096
13093
|
}
|
|
13097
13094
|
clickout(event) {
|
|
13098
|
-
// Capturing the event of
|
|
13095
|
+
// Capturing the event of the associated ElementRef <input type="file" #fileInpu
|
|
13099
13096
|
if (this.fileInput.nativeElement.contains(event.target)) {
|
|
13100
13097
|
this.clickInsideTheDocument = true;
|
|
13101
13098
|
}
|
|
@@ -13105,6 +13102,9 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
13105
13102
|
}
|
|
13106
13103
|
ngOnInit() {
|
|
13107
13104
|
this.secureModeOn = this.appConfig.getDocumentSecureMode();
|
|
13105
|
+
if (this.secureModeOn) {
|
|
13106
|
+
this.subscribeToCaseDetails();
|
|
13107
|
+
}
|
|
13108
13108
|
this.dialogConfig = initDialog();
|
|
13109
13109
|
// EUI-3403. The field was not being registered when there was no value and the field
|
|
13110
13110
|
// itself was not mandatory, which meant that show_conditions would not be evaluated.
|
|
@@ -13117,9 +13117,6 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
13117
13117
|
else {
|
|
13118
13118
|
this.createDocumentForm(document);
|
|
13119
13119
|
}
|
|
13120
|
-
if (this.appConfig.getDocumentSecureMode()) {
|
|
13121
|
-
this.subscribeToCaseDetails();
|
|
13122
|
-
}
|
|
13123
13120
|
}
|
|
13124
13121
|
ngOnDestroy() {
|
|
13125
13122
|
if (this.fileUploadSubscription) {
|
|
@@ -13128,8 +13125,11 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
13128
13125
|
if (this.dialogSubscription) {
|
|
13129
13126
|
this.dialogSubscription.unsubscribe();
|
|
13130
13127
|
}
|
|
13131
|
-
if (this.
|
|
13132
|
-
this.
|
|
13128
|
+
if (this.caseNotifierSubscription) {
|
|
13129
|
+
this.caseNotifierSubscription.unsubscribe();
|
|
13130
|
+
}
|
|
13131
|
+
if (this.jurisdictionSubs) {
|
|
13132
|
+
this.jurisdictionSubs.unsubscribe();
|
|
13133
13133
|
}
|
|
13134
13134
|
}
|
|
13135
13135
|
isUploadInProgress() {
|
|
@@ -13180,7 +13180,9 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
13180
13180
|
triggerReplace() {
|
|
13181
13181
|
if (this.confirmReplaceResult === 'Replace') {
|
|
13182
13182
|
this.openFileDialog();
|
|
13183
|
+
return true;
|
|
13183
13184
|
}
|
|
13185
|
+
return false;
|
|
13184
13186
|
}
|
|
13185
13187
|
getUploadedFileName() {
|
|
13186
13188
|
if (this.uploadedDocument) {
|
|
@@ -13214,10 +13216,27 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
13214
13216
|
this.triggerReplace();
|
|
13215
13217
|
});
|
|
13216
13218
|
}
|
|
13219
|
+
// Depending on the context, we can get the case type and jurisdiction from different sources
|
|
13220
|
+
// If we are running an event, the caseNotifier will have the current case
|
|
13221
|
+
// If we are creating a case, the case doesn't exist yet, so the caseNotifier can't help
|
|
13222
|
+
// Instead we can use the eventTrigger to get the case type, and the jurisdiction service to
|
|
13223
|
+
// get the currently selected jurisdiction
|
|
13217
13224
|
subscribeToCaseDetails() {
|
|
13218
|
-
this.
|
|
13225
|
+
this.caseNotifierSubscription = this.caseNotifier.caseView.subscribe({
|
|
13219
13226
|
next: (caseDetails) => {
|
|
13220
|
-
|
|
13227
|
+
var _a, _b;
|
|
13228
|
+
this.caseTypeId = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.case_id;
|
|
13229
|
+
this.jurisdictionId = (_b = (_a = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.case_type) === null || _a === void 0 ? void 0 : _a.jurisdiction) === null || _b === void 0 ? void 0 : _b.id;
|
|
13230
|
+
}
|
|
13231
|
+
});
|
|
13232
|
+
this.jurisdictionSubs = this.jurisdictionService.selectedJurisdictionBS.subscribe({
|
|
13233
|
+
next: (jurisdiction) => {
|
|
13234
|
+
if (jurisdiction) {
|
|
13235
|
+
this.jurisdictionId = jurisdiction.id;
|
|
13236
|
+
if (jurisdiction.currentCaseType) {
|
|
13237
|
+
this.caseTypeId = jurisdiction.currentCaseType.id;
|
|
13238
|
+
}
|
|
13239
|
+
}
|
|
13221
13240
|
}
|
|
13222
13241
|
});
|
|
13223
13242
|
}
|
|
@@ -13258,7 +13277,7 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
13258
13277
|
document_filename: new FormControl(document.document_filename, Validators.required)
|
|
13259
13278
|
};
|
|
13260
13279
|
documentFormGroup = this.secureModeOn ? Object.assign(Object.assign({}, documentFormGroup), { document_hash: new FormControl(document.document_hash) }) : documentFormGroup;
|
|
13261
|
-
this.uploadedDocument = this.registerControl(new
|
|
13280
|
+
this.uploadedDocument = this.registerControl(new FormGroup(documentFormGroup), true);
|
|
13262
13281
|
}
|
|
13263
13282
|
createDocumentForm(document) {
|
|
13264
13283
|
let documentFormGroup = {
|
|
@@ -13267,7 +13286,7 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
13267
13286
|
document_filename: new FormControl(document.document_filename)
|
|
13268
13287
|
};
|
|
13269
13288
|
documentFormGroup = this.secureModeOn ? Object.assign(Object.assign({}, documentFormGroup), { document_hash: new FormControl(document.document_hash) }) : documentFormGroup;
|
|
13270
|
-
this.uploadedDocument = this.registerControl(new
|
|
13289
|
+
this.uploadedDocument = this.registerControl(new FormGroup(documentFormGroup), true);
|
|
13271
13290
|
}
|
|
13272
13291
|
getErrorMessage(error) {
|
|
13273
13292
|
// Document Management unavailable
|
|
@@ -13281,13 +13300,8 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
13281
13300
|
documentUpload.append('files', selectedFile, selectedFile.name);
|
|
13282
13301
|
documentUpload.append('classification', 'PUBLIC');
|
|
13283
13302
|
if (this.appConfig.getDocumentSecureMode()) {
|
|
13284
|
-
const caseTypeId = this.
|
|
13285
|
-
|
|
13286
|
-
this.caseDetails.case_type.id ? this.caseDetails.case_type.id : null;
|
|
13287
|
-
const caseTypeJurisdictionId = this.caseDetails &&
|
|
13288
|
-
this.caseDetails.case_type &&
|
|
13289
|
-
this.caseDetails.case_type.jurisdiction &&
|
|
13290
|
-
this.caseDetails.case_type.jurisdiction.id ? this.caseDetails.case_type.jurisdiction.id : null;
|
|
13303
|
+
const caseTypeId = this.caseTypeId ? this.caseTypeId : null;
|
|
13304
|
+
const caseTypeJurisdictionId = this.jurisdictionId ? this.jurisdictionId : null;
|
|
13291
13305
|
documentUpload.append('caseTypeId', caseTypeId);
|
|
13292
13306
|
documentUpload.append('jurisdictionId', caseTypeJurisdictionId);
|
|
13293
13307
|
}
|
|
@@ -13334,7 +13348,7 @@ WriteDocumentFieldComponent.DOCUMENT_HASH = 'document_hash';
|
|
|
13334
13348
|
WriteDocumentFieldComponent.UPLOAD_ERROR_FILE_REQUIRED = 'File required';
|
|
13335
13349
|
WriteDocumentFieldComponent.UPLOAD_ERROR_NOT_AVAILABLE = 'Document upload facility is not available at the moment';
|
|
13336
13350
|
WriteDocumentFieldComponent.UPLOAD_WAITING_FILE_STATUS = 'Uploading...';
|
|
13337
|
-
WriteDocumentFieldComponent.ɵfac = function WriteDocumentFieldComponent_Factory(t) { return new (t || WriteDocumentFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(DocumentManagementService), i0.ɵɵdirectiveInject(i1$4.MatDialog), i0.ɵɵdirectiveInject(FileUploadStateService)); };
|
|
13351
|
+
WriteDocumentFieldComponent.ɵfac = function WriteDocumentFieldComponent_Factory(t) { return new (t || WriteDocumentFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(DocumentManagementService), i0.ɵɵdirectiveInject(i1$4.MatDialog), i0.ɵɵdirectiveInject(FileUploadStateService), i0.ɵɵdirectiveInject(JurisdictionService)); };
|
|
13338
13352
|
WriteDocumentFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteDocumentFieldComponent, selectors: [["ccd-write-document-field"]], viewQuery: function WriteDocumentFieldComponent_Query(rf, ctx) {
|
|
13339
13353
|
if (rf & 1) {
|
|
13340
13354
|
i0.ɵɵviewQuery(_c0$N, 5);
|
|
@@ -13401,7 +13415,7 @@ WriteDocumentFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
|
13401
13415
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteDocumentFieldComponent, [{
|
|
13402
13416
|
type: Component,
|
|
13403
13417
|
args: [{ selector: 'ccd-write-document-field', template: "<div class=\"form-group\" [ngClass]=\"{'form-group-error bottom-30': !valid}\">\n <label [for]=\"id()\">\n <span class=\"form-label\" attr.aria-label=\"{{caseField | ccdFieldLabel}}\">{{(caseField | ccdFieldLabel) | rpxTranslate}}</span>\n </label>\n <span class=\"form-hint\" *ngIf=\"caseField.hint_text\">{{caseField.hint_text | rpxTranslate}}</span>\n <span class=\"error-message\" *ngIf=\"fileUploadMessages && !valid\">{{fileUploadMessages | rpxTranslate}}</span>\n\n <div>\n <!--<span *ngIf=\"getUploadedFileName()\" class=\"text-16\">File name: {{getUploadedFileName()}}</span>-->\n <ccd-read-document-field *ngIf=\"caseField\" [caseField]=\"caseField\"></ccd-read-document-field>\n </div>\n\n <div style='position:relative'>\n\n <div [id]=\"createElementId('fileInputWrapper')\" (click)=\"fileSelectEvent()\"></div>\n <input class=\"form-control bottom-30\" [id]=\"id()\" type=\"file\" (keydown.Tab)=\"fileValidationsOnTab()\" (change)=\"fileChangeEvent($event)\"\n accept=\"{{caseField.field_type.regular_expression}}\" #fileInput/>\n </div>\n</div>\n<div class=\"form-group bottom-30\">\n <button class=\"button button-secondary\" type=\"button\" aria-label=\"Cancel upload\" (click)=\"cancelUpload()\" [disabled]=\"!isUploadInProgress()\">{{'Cancel upload' | rpxTranslate}}</button>\n</div>\n" }]
|
|
13404
|
-
}], function () { return [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1$4.MatDialog }, { type: FileUploadStateService }]; }, { fileInput: [{
|
|
13418
|
+
}], function () { return [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1$4.MatDialog }, { type: FileUploadStateService }, { type: JurisdictionService }]; }, { fileInput: [{
|
|
13405
13419
|
type: ViewChild,
|
|
13406
13420
|
args: ['fileInput', { static: false }]
|
|
13407
13421
|
}], clickout: [{
|
|
@@ -14635,7 +14649,7 @@ class WriteJudicialUserFieldComponent extends WriteComplexFieldComponent {
|
|
|
14635
14649
|
var _a;
|
|
14636
14650
|
super.ngOnInit();
|
|
14637
14651
|
this.judicialUserControl = new FormControl(this.caseField.value);
|
|
14638
|
-
// FormControl needs to be added to the main
|
|
14652
|
+
// FormControl needs to be added to the main FormGroup so it can be picked up by the PageValidationService when
|
|
14639
14653
|
// checking if the page is valid. formGroup.setControl() is used here to ensure any existing JudicialUser
|
|
14640
14654
|
// FormControl is replaced when the component is re-initialised, for example, if the user navigates away then
|
|
14641
14655
|
// back to the page containing the JudicialUser field
|
|
@@ -14687,6 +14701,17 @@ class WriteJudicialUserFieldComponent extends WriteComplexFieldComponent {
|
|
|
14687
14701
|
this.jurisdiction = caseInfo === null || caseInfo === void 0 ? void 0 : caseInfo.jurisdiction;
|
|
14688
14702
|
this.caseType = caseInfo === null || caseInfo === void 0 ? void 0 : caseInfo.caseType;
|
|
14689
14703
|
}
|
|
14704
|
+
else {
|
|
14705
|
+
// If there is no case info, attempt to get the current jurisdiction and case type via the JurisdictionService
|
|
14706
|
+
this.jurisdictionSubscription = this.jurisdictionService.selectedJurisdictionBS.subscribe((jurisdiction) => {
|
|
14707
|
+
if (jurisdiction) {
|
|
14708
|
+
this.jurisdiction = jurisdiction.id;
|
|
14709
|
+
if (jurisdiction.currentCaseType) {
|
|
14710
|
+
this.caseType = jurisdiction.currentCaseType.id;
|
|
14711
|
+
}
|
|
14712
|
+
}
|
|
14713
|
+
});
|
|
14714
|
+
}
|
|
14690
14715
|
}
|
|
14691
14716
|
displayJudicialUser(judicialUser) {
|
|
14692
14717
|
return judicialUser
|
|
@@ -14732,6 +14757,10 @@ class WriteJudicialUserFieldComponent extends WriteComplexFieldComponent {
|
|
|
14732
14757
|
this.judicialUserControl.setValidators(Validators.required);
|
|
14733
14758
|
}
|
|
14734
14759
|
}
|
|
14760
|
+
ngOnDestroy() {
|
|
14761
|
+
var _a;
|
|
14762
|
+
(_a = this.jurisdictionSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
14763
|
+
}
|
|
14735
14764
|
}
|
|
14736
14765
|
WriteJudicialUserFieldComponent.ɵfac = function WriteJudicialUserFieldComponent_Factory(t) { return new (t || WriteJudicialUserFieldComponent)(i0.ɵɵdirectiveInject(JurisdictionService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseFlagRefdataService), i0.ɵɵdirectiveInject(IsCompoundPipe), i0.ɵɵdirectiveInject(FormValidatorsService)); };
|
|
14737
14766
|
WriteJudicialUserFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteJudicialUserFieldComponent, selectors: [["ccd-write-judicial-user-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 12, vars: 17, consts: [[1, "form-group", 3, "formGroup", "ngClass"], [3, "for"], ["class", "form-label", 4, "ngIf"], ["class", "form-hint", 4, "ngIf"], ["class", "error-message", 4, "ngIf"], [1, "form-control", "bottom-30", 3, "id", "formControl", "matAutocomplete", "blur"], ["autoActiveFirstOption", "", 3, "displayWith"], ["autoComplete", "matAutocomplete"], ["class", "select-option", 3, "ngClass", "value", "onSelectionChange", 4, "ngFor", "ngForOf"], ["class", "select-option", "disabled", "", 4, "ngIf"], [1, "form-label"], [1, "form-hint"], [1, "error-message"], [1, "select-option", 3, "ngClass", "value", "onSelectionChange"], ["disabled", "", 1, "select-option"]], template: function WriteJudicialUserFieldComponent_Template(rf, ctx) {
|
|
@@ -17067,7 +17096,7 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
|
|
|
17067
17096
|
this.linkedCasesService.caseFieldValue = caseFieldValue.filter(item => unlinkedCaseRefereneIds.indexOf(item.id) === -1);
|
|
17068
17097
|
}
|
|
17069
17098
|
this.formGroup.value.caseLinks = this.linkedCasesService.caseFieldValue;
|
|
17070
|
-
this.caseEditForm.controls['data'] = new
|
|
17099
|
+
this.caseEditForm.controls['data'] = new FormGroup({ caseLinks: new FormControl(this.linkedCasesService.caseFieldValue || []) });
|
|
17071
17100
|
this.caseEditDataService.setCaseEditForm(this.caseEditForm);
|
|
17072
17101
|
}
|
|
17073
17102
|
isAtFinalPage() {
|
|
@@ -17770,7 +17799,7 @@ class WriteOrderSummaryFieldComponent extends AbstractFieldWriteComponent {
|
|
|
17770
17799
|
and has to be built manually.
|
|
17771
17800
|
*/
|
|
17772
17801
|
ngOnInit() {
|
|
17773
|
-
const orderSummaryGroup = this.registerControl(new
|
|
17802
|
+
const orderSummaryGroup = this.registerControl(new FormGroup({}), true);
|
|
17774
17803
|
const paymentReference = new FormControl(this.caseField.value.PaymentReference);
|
|
17775
17804
|
orderSummaryGroup.addControl('PaymentReference', paymentReference);
|
|
17776
17805
|
const paymentTotal = new FormControl(this.caseField.value.PaymentTotal);
|
|
@@ -17782,12 +17811,12 @@ class WriteOrderSummaryFieldComponent extends AbstractFieldWriteComponent {
|
|
|
17782
17811
|
orderSummaryGroup.addControl('Fees', feesArray);
|
|
17783
17812
|
}
|
|
17784
17813
|
getFeeValue(feeValue) {
|
|
17785
|
-
const feeGroup = new
|
|
17814
|
+
const feeGroup = new FormGroup({});
|
|
17786
17815
|
feeGroup.addControl('FeeCode', new FormControl(feeValue.FeeCode));
|
|
17787
17816
|
feeGroup.addControl('FeeAmount', new FormControl(feeValue.FeeAmount));
|
|
17788
17817
|
feeGroup.addControl('FeeDescription', new FormControl(feeValue.FeeDescription));
|
|
17789
17818
|
feeGroup.addControl('FeeVersion', new FormControl(feeValue.FeeVersion));
|
|
17790
|
-
const feeValueGroup = new
|
|
17819
|
+
const feeValueGroup = new FormGroup({});
|
|
17791
17820
|
feeValueGroup.addControl('value', feeGroup);
|
|
17792
17821
|
return feeValueGroup;
|
|
17793
17822
|
}
|
|
@@ -18078,7 +18107,7 @@ class WriteOrganisationFieldComponent extends AbstractFieldWriteComponent {
|
|
|
18078
18107
|
this.searchOrgTextFormControl = new FormControl('');
|
|
18079
18108
|
this.searchOrgValue$ = this.searchOrgTextFormControl.valueChanges;
|
|
18080
18109
|
this.searchOrgValue$.subscribe(value => this.onSearchOrg(value));
|
|
18081
|
-
this.organisationFormGroup = this.registerControl(new
|
|
18110
|
+
this.organisationFormGroup = this.registerControl(new FormGroup({}), true);
|
|
18082
18111
|
if (this.parent && this.parent.controls && this.parent.controls.hasOwnProperty(WriteOrganisationFieldComponent.PRE_POPULATE_TO_USERS_ORGANISATION)
|
|
18083
18112
|
&& this.parent.controls[WriteOrganisationFieldComponent.PRE_POPULATE_TO_USERS_ORGANISATION].value
|
|
18084
18113
|
&& this.parent.controls[WriteOrganisationFieldComponent.PRE_POPULATE_TO_USERS_ORGANISATION].value.toUpperCase()
|
|
@@ -19008,7 +19037,7 @@ class FieldReadComponent extends AbstractFieldReadComponent {
|
|
|
19008
19037
|
this.resolver = resolver;
|
|
19009
19038
|
this.paletteService = paletteService;
|
|
19010
19039
|
this.withLabel = false;
|
|
19011
|
-
this.formGroup = new
|
|
19040
|
+
this.formGroup = new FormGroup({});
|
|
19012
19041
|
this.caseFields = [];
|
|
19013
19042
|
}
|
|
19014
19043
|
ngOnInit() {
|
|
@@ -19031,7 +19060,7 @@ class FieldReadComponent extends AbstractFieldReadComponent {
|
|
|
19031
19060
|
}
|
|
19032
19061
|
component.instance['caseField'] = this.caseField;
|
|
19033
19062
|
component.instance['caseFields'] = this.caseFields;
|
|
19034
|
-
component.instance['
|
|
19063
|
+
component.instance['formGroup'] = this.formGroup;
|
|
19035
19064
|
component.instance['topLevelFormGroup'] = this.topLevelFormGroup;
|
|
19036
19065
|
component.instance['idPrefix'] = this.idPrefix;
|
|
19037
19066
|
component.instance['parent'] = this.parent;
|
|
@@ -19113,7 +19142,7 @@ class FieldWriteComponent extends AbstractFieldWriteComponent {
|
|
|
19113
19142
|
}
|
|
19114
19143
|
component.instance['caseField'] = this.caseField;
|
|
19115
19144
|
component.instance['caseFields'] = this.caseFields;
|
|
19116
|
-
component.instance['
|
|
19145
|
+
component.instance['formGroup'] = this.formGroup;
|
|
19117
19146
|
component.instance['parent'] = this.parent;
|
|
19118
19147
|
component.instance['idPrefix'] = this.idPrefix;
|
|
19119
19148
|
if (this.caseField.field_type.id === 'AddressGlobal') {
|
|
@@ -19827,7 +19856,7 @@ class CaseFileViewFolderComponent {
|
|
|
19827
19856
|
}
|
|
19828
19857
|
}
|
|
19829
19858
|
ngOnInit() {
|
|
19830
|
-
this.documentFilterFormGroup = new
|
|
19859
|
+
this.documentFilterFormGroup = new FormGroup({});
|
|
19831
19860
|
this.documentSearchFormControl = new FormControl('');
|
|
19832
19861
|
this.documentFilterFormGroup.addControl(CaseFileViewFolderComponent.DOCUMENT_SEARCH_FORM_CONTROL_NAME, this.documentSearchFormControl);
|
|
19833
19862
|
// Listen to search input and initiate filter documents if at least three characters entered
|
|
@@ -23996,13 +24025,13 @@ PaletteModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
23996
24025
|
CaseFlagRefdataService,
|
|
23997
24026
|
YesNoService,
|
|
23998
24027
|
CollectionCreateCheckerService,
|
|
24028
|
+
JurisdictionService,
|
|
23999
24029
|
PaletteService,
|
|
24000
24030
|
FormValidatorsService,
|
|
24001
24031
|
FileUploadStateService,
|
|
24002
24032
|
FileUploadProgressGuard,
|
|
24003
24033
|
WindowService,
|
|
24004
24034
|
CommonDataService,
|
|
24005
|
-
JurisdictionService,
|
|
24006
24035
|
LinkedCasesService,
|
|
24007
24036
|
{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' }
|
|
24008
24037
|
], imports: [CommonModule,
|
|
@@ -24102,18 +24131,17 @@ PaletteModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
24102
24131
|
CaseFlagRefdataService,
|
|
24103
24132
|
YesNoService,
|
|
24104
24133
|
CollectionCreateCheckerService,
|
|
24134
|
+
JurisdictionService,
|
|
24105
24135
|
PaletteService,
|
|
24106
24136
|
FormValidatorsService,
|
|
24107
24137
|
FileUploadStateService,
|
|
24108
24138
|
FileUploadProgressGuard,
|
|
24109
24139
|
WindowService,
|
|
24110
24140
|
CommonDataService,
|
|
24111
|
-
JurisdictionService,
|
|
24112
24141
|
LinkedCasesService,
|
|
24113
24142
|
{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' }
|
|
24114
24143
|
],
|
|
24115
|
-
schemas: [
|
|
24116
|
-
entryComponents: [CaseFileViewFolderSelectorComponent]
|
|
24144
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
24117
24145
|
}]
|
|
24118
24146
|
}], null, null);
|
|
24119
24147
|
})();
|
|
@@ -25592,13 +25620,13 @@ CaseEditorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
25592
25620
|
FormsModule,
|
|
25593
25621
|
ReactiveFormsModule,
|
|
25594
25622
|
CaseEditDataModule,
|
|
25595
|
-
PaletteModule,
|
|
25596
25623
|
LabelSubstitutorModule,
|
|
25597
25624
|
ConditionalShowModule,
|
|
25598
25625
|
ErrorsModule,
|
|
25599
25626
|
PortalModule,
|
|
25600
25627
|
LoadingSpinnerModule,
|
|
25601
25628
|
BannersModule,
|
|
25629
|
+
PaletteModule,
|
|
25602
25630
|
RpxTranslationModule.forChild()] });
|
|
25603
25631
|
(function () {
|
|
25604
25632
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditorModule, [{
|
|
@@ -25610,13 +25638,13 @@ CaseEditorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
25610
25638
|
FormsModule,
|
|
25611
25639
|
ReactiveFormsModule,
|
|
25612
25640
|
CaseEditDataModule,
|
|
25613
|
-
PaletteModule,
|
|
25614
25641
|
LabelSubstitutorModule,
|
|
25615
25642
|
ConditionalShowModule,
|
|
25616
25643
|
ErrorsModule,
|
|
25617
25644
|
PortalModule,
|
|
25618
25645
|
LoadingSpinnerModule,
|
|
25619
25646
|
BannersModule,
|
|
25647
|
+
PaletteModule,
|
|
25620
25648
|
RpxTranslationModule.forChild()
|
|
25621
25649
|
],
|
|
25622
25650
|
declarations: [
|
|
@@ -25690,13 +25718,13 @@ CaseEditorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
25690
25718
|
FormsModule,
|
|
25691
25719
|
ReactiveFormsModule,
|
|
25692
25720
|
CaseEditDataModule,
|
|
25693
|
-
PaletteModule,
|
|
25694
25721
|
LabelSubstitutorModule,
|
|
25695
25722
|
ConditionalShowModule,
|
|
25696
25723
|
ErrorsModule,
|
|
25697
25724
|
PortalModule,
|
|
25698
25725
|
LoadingSpinnerModule,
|
|
25699
|
-
BannersModule,
|
|
25726
|
+
BannersModule,
|
|
25727
|
+
PaletteModule, i1$1.RpxTranslationModule], exports: [CaseEditConfirmComponent,
|
|
25700
25728
|
CaseEditComponent,
|
|
25701
25729
|
CaseEditPageComponent,
|
|
25702
25730
|
CaseEditFormComponent,
|
|
@@ -25707,13 +25735,13 @@ CaseEditorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
25707
25735
|
})();
|
|
25708
25736
|
i0.ɵɵsetComponentScope(CaseEditConfirmComponent, function () { return [i1.NgIf, i3.ɵNgNoValidate, i3.NgControlStatusGroup, i3.FormGroupDirective, MarkdownComponent]; }, function () { return [CaseReferencePipe, CcdCaseTitlePipe, i1$1.RpxTranslatePipe]; });
|
|
25709
25737
|
i0.ɵɵsetComponentScope(CaseEditPageComponent, function () {
|
|
25710
|
-
return [i1.NgForOf, i1.NgIf, i3.ɵNgNoValidate, i3.NgControlStatusGroup, i3.FormGroupDirective,
|
|
25738
|
+
return [i1.NgForOf, i1.NgIf, i3.ɵNgNoValidate, i3.NgControlStatusGroup, i3.FormGroupDirective, CallbackErrorsComponent, MarkdownComponent, CaseEditFormComponent,
|
|
25711
25739
|
CaseEventCompletionComponent,
|
|
25712
25740
|
CaseEditGenericErrorsComponent];
|
|
25713
25741
|
}, function () { return [i1.AsyncPipe, CaseReferencePipe, CcdCaseTitlePipe, i1$1.RpxTranslatePipe]; });
|
|
25714
|
-
i0.ɵɵsetComponentScope(CaseEditFormComponent, function () { return [i1.NgForOf, i1.NgIf, i1.NgSwitch, i1.NgSwitchCase, i3.NgControlStatusGroup, i3.FormGroupDirective,
|
|
25742
|
+
i0.ɵɵsetComponentScope(CaseEditFormComponent, function () { return [i1.NgForOf, i1.NgIf, i1.NgSwitch, i1.NgSwitchCase, i3.NgControlStatusGroup, i3.FormGroupDirective, LabelSubstitutorDirective, ConditionalShowFormDirective, FieldReadComponent, FieldWriteComponent]; }, function () { return [IsCompoundPipe, IsReadOnlyAndNotCollectionPipe]; });
|
|
25715
25743
|
i0.ɵɵsetComponentScope(CaseEditSubmitComponent, function () {
|
|
25716
|
-
return [i1.NgForOf, i1.NgIf, i1.NgSwitch, i1.NgSwitchCase, i3.ɵNgNoValidate, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgControlStatusGroup, i3.MaxLengthValidator, i3.FormGroupDirective, i3.FormControlName, i3.FormGroupName,
|
|
25744
|
+
return [i1.NgForOf, i1.NgIf, i1.NgSwitch, i1.NgSwitchCase, i3.ɵNgNoValidate, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgControlStatusGroup, i3.MaxLengthValidator, i3.FormGroupDirective, i3.FormControlName, i3.FormGroupName, LabelSubstitutorDirective, CallbackErrorsComponent, MarkdownComponent, FieldReadComponent, CaseEventCompletionComponent,
|
|
25717
25745
|
CaseEditGenericErrorsComponent];
|
|
25718
25746
|
}, function () { return [IsCompoundPipe, CaseReferencePipe, CcdCaseTitlePipe, CcdCYAPageLabelFilterPipe, ReadFieldsFilterPipe, CcdPageFieldsPipe, i1$1.RpxTranslatePipe]; });
|
|
25719
25747
|
i0.ɵɵsetComponentScope(CaseCreateComponent, function () { return [i1.NgIf, CaseEditComponent]; }, []);
|
|
@@ -26715,7 +26743,7 @@ class WorkbasketFiltersComponent {
|
|
|
26715
26743
|
this.windowService = windowService;
|
|
26716
26744
|
this.onApply = new EventEmitter();
|
|
26717
26745
|
this.onReset = new EventEmitter();
|
|
26718
|
-
this.formGroup = new
|
|
26746
|
+
this.formGroup = new FormGroup({});
|
|
26719
26747
|
this.initialised = false;
|
|
26720
26748
|
}
|
|
26721
26749
|
ngOnInit() {
|
|
@@ -26759,9 +26787,20 @@ class WorkbasketFiltersComponent {
|
|
|
26759
26787
|
if (init) {
|
|
26760
26788
|
this.windowService.setLocalStorage(SAVED_QUERY_PARAM_LOC_STORAGE, JSON.stringify(queryParams));
|
|
26761
26789
|
if (Object.keys(this.formGroup.controls).length > 0) {
|
|
26790
|
+
// Find all "special case" JudicialUser FormControl keys and remove the corresponding values from the
|
|
26791
|
+
// FormGroup value because these values are not intended to be stored and subsequently passed as query string
|
|
26792
|
+
// parameters when calling searchCases API endpoint
|
|
26793
|
+
const judicialUserControlValuesToRemove = Object.keys(this.formGroup.controls).filter((key) => key.endsWith('_judicialUserControl'));
|
|
26794
|
+
judicialUserControlValuesToRemove.forEach((controlKey) => delete this.formGroup.value[controlKey]);
|
|
26762
26795
|
this.windowService.setLocalStorage(FORM_GROUP_VAL_LOC_STORAGE, JSON.stringify(this.formGroup.value));
|
|
26763
26796
|
}
|
|
26764
26797
|
}
|
|
26798
|
+
// Announce selected jurisdiction via JurisdictionService
|
|
26799
|
+
if (this.selected.jurisdiction) {
|
|
26800
|
+
// Set the selected case type as the current case type of the selected jurisdiction
|
|
26801
|
+
this.selected.jurisdiction.currentCaseType = this.selected.caseType;
|
|
26802
|
+
this.jurisdictionService.announceSelectedJurisdiction(this.selected.jurisdiction);
|
|
26803
|
+
}
|
|
26765
26804
|
// Apply filters
|
|
26766
26805
|
this.onApply.emit({ selected: this.selected, queryParams });
|
|
26767
26806
|
this.setFocusToTop();
|
|
@@ -26807,7 +26846,7 @@ class WorkbasketFiltersComponent {
|
|
|
26807
26846
|
if (this.selected.caseType) {
|
|
26808
26847
|
this.selectedCaseTypeStates = this.sortStates(this.selected.caseType.states);
|
|
26809
26848
|
this.selected.caseState = null;
|
|
26810
|
-
this.formGroup = new
|
|
26849
|
+
this.formGroup = new FormGroup({});
|
|
26811
26850
|
this.clearWorkbasketInputs();
|
|
26812
26851
|
if (!this.isApplyButtonDisabled()) {
|
|
26813
26852
|
this.workbasketInputFilterService.getWorkbasketInputs(this.selected.jurisdiction.id, this.selected.caseType.id).pipe(take(1)).subscribe(workbasketInputs => {
|
|
@@ -29110,8 +29149,8 @@ class CaseFullAccessViewComponent {
|
|
|
29110
29149
|
}
|
|
29111
29150
|
/**
|
|
29112
29151
|
* For EUI-3825:
|
|
29113
|
-
* Builds a
|
|
29114
|
-
* This
|
|
29152
|
+
* Builds a FormGroup from all the CaseFields contained within the view.
|
|
29153
|
+
* This FormGroup is necessary for evaluation the show/hide conditions of
|
|
29115
29154
|
* fields that are dependent on a field only available on a DIFFERENT tab.
|
|
29116
29155
|
*/
|
|
29117
29156
|
buildFormGroup(caseFields) {
|
|
@@ -29121,7 +29160,7 @@ class CaseFullAccessViewComponent {
|
|
|
29121
29160
|
value = Object.assign(Object.assign({}, value), { [caseField.id]: caseField.value });
|
|
29122
29161
|
});
|
|
29123
29162
|
}
|
|
29124
|
-
return new
|
|
29163
|
+
return new FormGroup({ data: new FormControl(value) });
|
|
29125
29164
|
}
|
|
29126
29165
|
resetErrors() {
|
|
29127
29166
|
this.error = null;
|
|
@@ -31805,13 +31844,14 @@ function CreateCaseFiltersComponent_option_27_Template(rf, ctx) {
|
|
|
31805
31844
|
}
|
|
31806
31845
|
}
|
|
31807
31846
|
class CreateCaseFiltersComponent {
|
|
31808
|
-
constructor(orderService, definitionsService, sessionStorageService) {
|
|
31847
|
+
constructor(orderService, definitionsService, sessionStorageService, jurisdictionService) {
|
|
31809
31848
|
this.orderService = orderService;
|
|
31810
31849
|
this.definitionsService = definitionsService;
|
|
31811
31850
|
this.sessionStorageService = sessionStorageService;
|
|
31851
|
+
this.jurisdictionService = jurisdictionService;
|
|
31812
31852
|
this.selectionSubmitted = new EventEmitter();
|
|
31813
31853
|
this.selectionChanged = new EventEmitter();
|
|
31814
|
-
this.formGroup = new
|
|
31854
|
+
this.formGroup = new FormGroup({});
|
|
31815
31855
|
}
|
|
31816
31856
|
ngOnInit() {
|
|
31817
31857
|
this.selected = {};
|
|
@@ -31861,6 +31901,8 @@ class CreateCaseFiltersComponent {
|
|
|
31861
31901
|
!this.isDisabled;
|
|
31862
31902
|
}
|
|
31863
31903
|
apply() {
|
|
31904
|
+
this.selected.jurisdiction.currentCaseType = this.selected.caseType;
|
|
31905
|
+
this.jurisdictionService.announceSelectedJurisdiction(this.selected.jurisdiction);
|
|
31864
31906
|
this.selectionSubmitted.emit({
|
|
31865
31907
|
jurisdictionId: this.selected.jurisdiction.id,
|
|
31866
31908
|
caseTypeId: this.selected.caseType.id,
|
|
@@ -31941,7 +31983,7 @@ class CreateCaseFiltersComponent {
|
|
|
31941
31983
|
return value === null || value === undefined;
|
|
31942
31984
|
}
|
|
31943
31985
|
}
|
|
31944
|
-
CreateCaseFiltersComponent.ɵfac = function CreateCaseFiltersComponent_Factory(t) { return new (t || CreateCaseFiltersComponent)(i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(DefinitionsService), i0.ɵɵdirectiveInject(SessionStorageService)); };
|
|
31986
|
+
CreateCaseFiltersComponent.ɵfac = function CreateCaseFiltersComponent_Factory(t) { return new (t || CreateCaseFiltersComponent)(i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(DefinitionsService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(JurisdictionService)); };
|
|
31945
31987
|
CreateCaseFiltersComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CreateCaseFiltersComponent, selectors: [["ccd-create-case-filters"]], inputs: { isDisabled: "isDisabled", startButtonText: "startButtonText" }, outputs: { selectionSubmitted: "selectionSubmitted", selectionChanged: "selectionChanged" }, decls: 31, vars: 28, consts: [[3, "ngSubmit"], [1, "form-group"], ["for", "cc-jurisdiction", 1, "form-label"], ["id", "cc-jurisdiction", "name", "jurisdiction", 1, "form-control", "ccd-dropdown", 3, "formControl", "change"], ["value", ""], [3, "value", 4, "ngFor", "ngForOf"], ["for", "cc-case-type", 1, "form-label"], ["id", "cc-case-type", "name", "case-type", 1, "form-control", "ccd-dropdown", 3, "formControl", "change"], ["for", "cc-event", 1, "form-label"], ["id", "cc-event", "name", "event", 1, "form-control", "ccd-dropdown", 3, "formControl", "change"], ["type", "submit", 1, "button", 3, "disabled"], [3, "value"]], template: function CreateCaseFiltersComponent_Template(rf, ctx) {
|
|
31946
31988
|
if (rf & 1) {
|
|
31947
31989
|
i0.ɵɵelementStart(0, "form", 0);
|
|
@@ -32022,7 +32064,7 @@ CreateCaseFiltersComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
|
32022
32064
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CreateCaseFiltersComponent, [{
|
|
32023
32065
|
type: Component,
|
|
32024
32066
|
args: [{ selector: 'ccd-create-case-filters', template: "<form (ngSubmit)=\"apply()\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"cc-jurisdiction\">{{'Jurisdiction' | rpxTranslate}}</label>\n <select class=\"form-control ccd-dropdown\" id=\"cc-jurisdiction\" name=\"jurisdiction\" [formControl]=\"filterJurisdictionControl\" (change)=\"onJurisdictionIdChange()\">\n <option value=\"\">--{{'Select a value' | rpxTranslate}}--</option>\n <option *ngFor=\"let j of jurisdictions\" [value]=\"j.id\">{{j.name | rpxTranslate}}</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"cc-case-type\">{{'Case type' | rpxTranslate}}</label>\n <select class=\"form-control ccd-dropdown\" id=\"cc-case-type\" name=\"case-type\" [formControl]=\"filterCaseTypeControl\" (change)=\"onCaseTypeIdChange()\">\n <option value=\"\">--{{'Select a value' | rpxTranslate}}--</option>\n <option *ngFor=\"let ct of selectedJurisdictionCaseTypes\" [value]=\"ct.id\">{{ct.name | rpxTranslate}}</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"cc-event\">{{'Event' | rpxTranslate}}</label>\n <select class=\"form-control ccd-dropdown\" id=\"cc-event\" name=\"event\" [formControl]=\"filterEventControl\" (change)=\"onEventIdChange()\">\n <option value=\"\">--{{'Select a value' | rpxTranslate}}--</option>\n <option *ngFor=\"let e of selectedCaseTypeEvents\" [value]=\"e.id\">{{e.name | rpxTranslate}}</option>\n </select>\n </div>\n\n <button type=\"submit\" class=\"button\" [disabled]=\"!isCreatable()\">{{startButtonText | rpxTranslate}}</button>\n</form>\n" }]
|
|
32025
|
-
}], function () { return [{ type: OrderService }, { type: DefinitionsService }, { type: SessionStorageService }]; }, { isDisabled: [{
|
|
32067
|
+
}], function () { return [{ type: OrderService }, { type: DefinitionsService }, { type: SessionStorageService }, { type: JurisdictionService }]; }, { isDisabled: [{
|
|
32026
32068
|
type: Input
|
|
32027
32069
|
}], startButtonText: [{
|
|
32028
32070
|
type: Input
|
|
@@ -32163,7 +32205,7 @@ class SearchFiltersComponent {
|
|
|
32163
32205
|
this.onApply = new EventEmitter();
|
|
32164
32206
|
this.onReset = new EventEmitter();
|
|
32165
32207
|
this.onJurisdiction = new EventEmitter();
|
|
32166
|
-
this.formGroup = new
|
|
32208
|
+
this.formGroup = new FormGroup({});
|
|
32167
32209
|
}
|
|
32168
32210
|
ngOnInit() {
|
|
32169
32211
|
this.selected = {};
|
|
@@ -32239,7 +32281,7 @@ class SearchFiltersComponent {
|
|
|
32239
32281
|
this.onJurisdiction.emit(this.selected.jurisdiction);
|
|
32240
32282
|
}
|
|
32241
32283
|
onCaseTypeIdChange() {
|
|
32242
|
-
this.formGroup = new
|
|
32284
|
+
this.formGroup = new FormGroup({});
|
|
32243
32285
|
this.searchInputsReady = false;
|
|
32244
32286
|
this.searchInputs = [];
|
|
32245
32287
|
this.searchService.getSearchInputs(this.selected.jurisdiction.id, this.selected.caseType.id).pipe(tap(() => this.searchInputsReady = true)).subscribe(searchInputs => {
|