@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';
|
|
@@ -3489,10 +3489,10 @@ class FieldsUtils {
|
|
|
3489
3489
|
* Extract flags data from a `CaseField` instance, recursing and iterating through sub-fields of a Complex field or
|
|
3490
3490
|
* each field in a Collection field.
|
|
3491
3491
|
*
|
|
3492
|
-
* @param flags An array for accumulating extracted flags data and derived `
|
|
3492
|
+
* @param flags An array for accumulating extracted flags data and derived `FormGroup` paths
|
|
3493
3493
|
* @param caseField A `CaseField` instance from which to extract the flags data
|
|
3494
3494
|
* @param pathToFlagsFormGroup A (dot-delimited) string for concatenating the name of each control that forms the path
|
|
3495
|
-
* to the `
|
|
3495
|
+
* to the `FormGroup` for the `Flags` instance
|
|
3496
3496
|
* @param topLevelCaseField The top-level `CaseField` that contains the value property. This is required because _only
|
|
3497
3497
|
* top-level_ `CaseField`s contain actual values and a reference needs to be maintained to such a field
|
|
3498
3498
|
* @param currentValue The current value object of a `CaseField` that is a sub-field of a non root-level Complex field.
|
|
@@ -3500,7 +3500,7 @@ class FieldsUtils {
|
|
|
3500
3500
|
* only the _root-level_ `CaseField` contains a value property - all sub-fields, including any nested Complex fields,
|
|
3501
3501
|
* do *not* contain any values themselves.)
|
|
3502
3502
|
* @returns An array of `FlagsWithFormGroupPath`, each instance comprising a `Flags` object derived from a `CaseField`
|
|
3503
|
-
* of type "Flags", and the dot-delimited path string to the corresponding `
|
|
3503
|
+
* of type "Flags", and the dot-delimited path string to the corresponding `FormGroup`
|
|
3504
3504
|
*/
|
|
3505
3505
|
static extractFlagsDataFromCaseField(flags, caseField, pathToFlagsFormGroup, topLevelCaseField, currentValue) {
|
|
3506
3506
|
const fieldType = caseField.field_type;
|
|
@@ -3698,7 +3698,7 @@ class FieldsUtils {
|
|
|
3698
3698
|
if (aControl instanceof FormArray) { // We're in a collection
|
|
3699
3699
|
formArrayFn(aControl);
|
|
3700
3700
|
}
|
|
3701
|
-
else if (aControl instanceof
|
|
3701
|
+
else if (aControl instanceof FormGroup) { // We're in a complex type.
|
|
3702
3702
|
formGroupFn(aControl);
|
|
3703
3703
|
}
|
|
3704
3704
|
else if (aControl instanceof FormControl) { // FormControl
|
|
@@ -4508,7 +4508,7 @@ class ConditionalShowFormDirective {
|
|
|
4508
4508
|
this.handleFormGroup = (formGroup) => {
|
|
4509
4509
|
this.evaluateControl(formGroup);
|
|
4510
4510
|
let groupControl = formGroup;
|
|
4511
|
-
if (formGroup.get('value') && formGroup.get('value') instanceof
|
|
4511
|
+
if (formGroup.get('value') && formGroup.get('value') instanceof FormGroup) { // Complex Field
|
|
4512
4512
|
groupControl = formGroup.get('value');
|
|
4513
4513
|
}
|
|
4514
4514
|
else if (formGroup.controls) {
|
|
@@ -4530,7 +4530,7 @@ class ConditionalShowFormDirective {
|
|
|
4530
4530
|
}
|
|
4531
4531
|
ngOnInit() {
|
|
4532
4532
|
if (!this.formGroup) {
|
|
4533
|
-
this.formGroup = new
|
|
4533
|
+
this.formGroup = new FormGroup({});
|
|
4534
4534
|
}
|
|
4535
4535
|
}
|
|
4536
4536
|
/**
|
|
@@ -4755,7 +4755,7 @@ class FieldsPurger {
|
|
|
4755
4755
|
for (const complexSubField of field.field_type.complex_fields) {
|
|
4756
4756
|
if ((complexSubField.field_type.type === 'Complex' && complexSubField.field_type.complex_fields.length > 0) ||
|
|
4757
4757
|
!complexSubField.retain_hidden_value) {
|
|
4758
|
-
// Check for the existence of the parent
|
|
4758
|
+
// Check for the existence of the parent FormGroup corresponding to the Complex field; if it exists, call
|
|
4759
4759
|
// deleteFieldValue() to delete the sub-field
|
|
4760
4760
|
const parentFormGroup = form.get('data').controls[field.id];
|
|
4761
4761
|
if (parentFormGroup) {
|
|
@@ -4787,7 +4787,7 @@ class FieldsPurger {
|
|
|
4787
4787
|
}
|
|
4788
4788
|
}
|
|
4789
4789
|
// Recursively delete the sub-field value if retain_hidden_value is false, OR if the sub-field type is
|
|
4790
|
-
// Complex and regardless of retain_hidden_value, passing in the parent
|
|
4790
|
+
// Complex and regardless of retain_hidden_value, passing in the parent FormGroup
|
|
4791
4791
|
if (subCaseField &&
|
|
4792
4792
|
((subCaseField.field_type.type === 'Complex' && subCaseField.field_type.complex_fields.length > 0) ||
|
|
4793
4793
|
!subCaseField.retain_hidden_value)) {
|
|
@@ -4826,7 +4826,7 @@ class FieldsPurger {
|
|
|
4826
4826
|
* types, this recursive method is called until simple or "base" field types are reached. For `Document` field
|
|
4827
4827
|
* types, its _sub-field_ `FormControl` values are set to null.
|
|
4828
4828
|
*
|
|
4829
|
-
* @param
|
|
4829
|
+
* @param FormGroup The `FormGroup` instance containing the `FormControl` for the specified field
|
|
4830
4830
|
* @param field The `CaseField` whose value is to be deleted in the backend
|
|
4831
4831
|
* @param parentField Reference to the parent `CaseField`. Used for checking specifically where a Complex field and
|
|
4832
4832
|
* its sub-fields have `retain_hidden_value` set to `true`, but the field's parent has it set to `false` or undefined
|
|
@@ -4855,7 +4855,7 @@ class FieldsPurger {
|
|
|
4855
4855
|
(field.retain_hidden_value
|
|
4856
4856
|
? !complexSubField.retain_hidden_value || (parentField && !parentField.retain_hidden_value)
|
|
4857
4857
|
: true))) {
|
|
4858
|
-
// The fieldControl is cast to a
|
|
4858
|
+
// The fieldControl is cast to a FormGroup because a Complex field type uses this as its underlying
|
|
4859
4859
|
// implementation
|
|
4860
4860
|
this.deleteFieldValue(fieldControl, complexSubField, field);
|
|
4861
4861
|
}
|
|
@@ -4882,7 +4882,7 @@ class FieldsPurger {
|
|
|
4882
4882
|
break;
|
|
4883
4883
|
}
|
|
4884
4884
|
}
|
|
4885
|
-
// Recursively delete the sub-field value, passing in the parent
|
|
4885
|
+
// Recursively delete the sub-field value, passing in the parent FormGroup
|
|
4886
4886
|
const parentFormGroup = fieldControl.at(index).get('value');
|
|
4887
4887
|
this.deleteFieldValue(parentFormGroup, subCaseField);
|
|
4888
4888
|
}));
|
|
@@ -4897,7 +4897,7 @@ class FieldsPurger {
|
|
|
4897
4897
|
// the single Document case)
|
|
4898
4898
|
if (documentFieldValues) {
|
|
4899
4899
|
documentFieldValues.forEach((fieldValue, index) => Object.keys(fieldValue.value).forEach(subFieldId => {
|
|
4900
|
-
// Get the
|
|
4900
|
+
// Get the FormGroup containing the FormControl for the sub-field and set its value to null
|
|
4901
4901
|
fieldControl.at(index).get(`value.${subFieldId}`).setValue(null);
|
|
4902
4902
|
}));
|
|
4903
4903
|
}
|
|
@@ -4916,8 +4916,8 @@ class FieldsPurger {
|
|
|
4916
4916
|
}
|
|
4917
4917
|
break;
|
|
4918
4918
|
case 'Document':
|
|
4919
|
-
// NOTE: The field control (a
|
|
4920
|
-
// all existing values of a
|
|
4919
|
+
// NOTE: The field control (a FormGroup in this case) cannot just be set to null because Angular checks that
|
|
4920
|
+
// all existing values of a FormGroup are present; setting the control's value to null causes a runtime error
|
|
4921
4921
|
const documentFieldValue = fieldControl.value;
|
|
4922
4922
|
for (const key in documentFieldValue) {
|
|
4923
4923
|
if (fieldControl.get(key)) {
|
|
@@ -5795,7 +5795,7 @@ class LabelSubstitutorDirective {
|
|
|
5795
5795
|
ngOnInit() {
|
|
5796
5796
|
this.initialLabel = this.caseField.label;
|
|
5797
5797
|
this.initialHintText = this.caseField.hint_text;
|
|
5798
|
-
this.formGroup = this.formGroup || new
|
|
5798
|
+
this.formGroup = this.formGroup || new FormGroup({});
|
|
5799
5799
|
const fields = this.getReadOnlyAndFormFields();
|
|
5800
5800
|
if (this.shouldSubstitute('label')) {
|
|
5801
5801
|
this.caseField.label = this.resolvePlaceholders(fields, this.caseField.label);
|
|
@@ -6377,7 +6377,9 @@ FormErrorService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormErr
|
|
|
6377
6377
|
class JurisdictionService {
|
|
6378
6378
|
constructor(httpService) {
|
|
6379
6379
|
this.httpService = httpService;
|
|
6380
|
+
// We retain the Subject observable because subscribing code couldn't happen a null value
|
|
6380
6381
|
this.selectedJurisdictionSource = new Subject();
|
|
6382
|
+
this.selectedJurisdictionBS = new BehaviorSubject(null);
|
|
6381
6383
|
this.selectedJurisdiction = this.selectedJurisdictionSource.asObservable();
|
|
6382
6384
|
}
|
|
6383
6385
|
getJurisdictions() {
|
|
@@ -6385,6 +6387,7 @@ class JurisdictionService {
|
|
|
6385
6387
|
}
|
|
6386
6388
|
announceSelectedJurisdiction(jurisdiction) {
|
|
6387
6389
|
this.selectedJurisdictionSource.next(jurisdiction);
|
|
6390
|
+
this.selectedJurisdictionBS.next(jurisdiction);
|
|
6388
6391
|
}
|
|
6389
6392
|
searchJudicialUsers(searchTerm, serviceId) {
|
|
6390
6393
|
return this.httpService.post('api/prd/judicial/getJudicialUsersSearch', { searchString: searchTerm, serviceCode: serviceId });
|
|
@@ -7898,22 +7901,15 @@ class CaseNotifier {
|
|
|
7898
7901
|
this.cachedCaseView = null;
|
|
7899
7902
|
}
|
|
7900
7903
|
announceCase(c) {
|
|
7901
|
-
console.info('announceCase started.');
|
|
7902
7904
|
this.caseViewSource.next(c);
|
|
7903
|
-
console.info('announceCase finished.');
|
|
7904
7905
|
}
|
|
7905
7906
|
fetchAndRefresh(cid) {
|
|
7906
|
-
console.info('fetchAndRefresh started.');
|
|
7907
7907
|
return this.casesService
|
|
7908
7908
|
.getCaseViewV2(cid)
|
|
7909
7909
|
.pipe(map(caseView => {
|
|
7910
|
-
console.info('mapping caseView started.');
|
|
7911
|
-
// this.casesService.syncWait(10);
|
|
7912
|
-
// throw new Error('******************************************************');
|
|
7913
7910
|
this.cachedCaseView = plainToClassFromExist(new CaseView(), caseView);
|
|
7914
7911
|
this.setBasicFields(this.cachedCaseView.tabs);
|
|
7915
7912
|
this.announceCase(this.cachedCaseView);
|
|
7916
|
-
console.info('mapping caseView finished. Returning it.');
|
|
7917
7913
|
return this.cachedCaseView;
|
|
7918
7914
|
}));
|
|
7919
7915
|
}
|
|
@@ -8423,7 +8419,7 @@ class CaseEditComponent {
|
|
|
8423
8419
|
this.sessionStorageService.setItem('eventUrl', this.router.url);
|
|
8424
8420
|
}
|
|
8425
8421
|
this.form = this.fb.group({
|
|
8426
|
-
data: new
|
|
8422
|
+
data: new FormGroup({}),
|
|
8427
8423
|
event: this.fb.group({
|
|
8428
8424
|
id: [this.eventTrigger.id, Validators.required],
|
|
8429
8425
|
summary: [''],
|
|
@@ -8596,7 +8592,7 @@ class CaseEditComponent {
|
|
|
8596
8592
|
return data;
|
|
8597
8593
|
}
|
|
8598
8594
|
/**
|
|
8599
|
-
* Traverse *all* values of a {@link
|
|
8595
|
+
* Traverse *all* values of a {@link FormGroup}, including those for disabled fields (i.e. hidden ones), replacing the
|
|
8600
8596
|
* value of any that are hidden AND have `retain_hidden_value` set to `true` in the corresponding `CaseField`, with
|
|
8601
8597
|
* the *original* value held in the `CaseField` object.
|
|
8602
8598
|
*
|
|
@@ -8609,8 +8605,8 @@ class CaseEditComponent {
|
|
|
8609
8605
|
* * For Collection field types, including collections of Complex and Document field types, the replacement is
|
|
8610
8606
|
* performed for all fields in the collection.
|
|
8611
8607
|
*
|
|
8612
|
-
* @param
|
|
8613
|
-
* @param caseFields The array of {@link CaseField} domain model objects corresponding to fields in `
|
|
8608
|
+
* @param FormGroup The `FormGroup` instance whose raw values are to be traversed
|
|
8609
|
+
* @param caseFields The array of {@link CaseField} domain model objects corresponding to fields in `FormGroup`
|
|
8614
8610
|
* @param parentField Reference to the parent `CaseField`. Used for retrieving the sub-field values of a Complex field
|
|
8615
8611
|
* to perform recursive replacement - the sub-field `CaseField`s themselves do *not* contain any values
|
|
8616
8612
|
* @returns An object with the *raw* form value data (as key-value pairs), with any value replacements as necessary
|
|
@@ -8653,8 +8649,8 @@ class CaseEditComponent {
|
|
|
8653
8649
|
// CaseField itself (the sub-fields do not contain any values, so these need to be obtained from the
|
|
8654
8650
|
// parent)
|
|
8655
8651
|
// Update rawFormValueData for this field
|
|
8656
|
-
// creating form group and adding control into it in case caseField is of complext type and and part of
|
|
8657
|
-
const form = new
|
|
8652
|
+
// creating form group and adding control into it in case caseField is of complext type and and part of FormGroup
|
|
8653
|
+
const form = new FormGroup({});
|
|
8658
8654
|
if (formGroup.controls[key].value) {
|
|
8659
8655
|
Object.keys(formGroup.controls[key].value).forEach((item) => {
|
|
8660
8656
|
form.addControl(item, new FormControl(formGroup.controls[key].value[item]));
|
|
@@ -10163,7 +10159,7 @@ class WriteComplexFieldComponent extends AbstractFieldWriteComponent {
|
|
|
10163
10159
|
this.caseFields = [];
|
|
10164
10160
|
this.renderLabel = true;
|
|
10165
10161
|
this.ignoreMandatory = false;
|
|
10166
|
-
this.complexGroup = new
|
|
10162
|
+
this.complexGroup = new FormGroup({});
|
|
10167
10163
|
}
|
|
10168
10164
|
ngOnInit() {
|
|
10169
10165
|
// Are we inside of a collection? If so, the parent is the complexGroup we want.
|
|
@@ -10381,7 +10377,7 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
|
|
|
10381
10377
|
constructor(addressesService, isCompoundPipe) {
|
|
10382
10378
|
super();
|
|
10383
10379
|
this.isCompoundPipe = isCompoundPipe;
|
|
10384
|
-
this.addressFormGroup = new
|
|
10380
|
+
this.addressFormGroup = new FormGroup({});
|
|
10385
10381
|
this.missingPostcode = false;
|
|
10386
10382
|
this.addressesService = addressesService;
|
|
10387
10383
|
}
|
|
@@ -10866,7 +10862,7 @@ class ReadCaseFlagFieldComponent extends AbstractFieldReadComponent {
|
|
|
10866
10862
|
}
|
|
10867
10863
|
ngOnInit() {
|
|
10868
10864
|
// If the context is PaletteContext.DEFAULT, the Flags fields need to be located by CaseTab (they won't be present
|
|
10869
|
-
// in the
|
|
10865
|
+
// in the FormGroup - only the FlagLauncher field is present)
|
|
10870
10866
|
if (this.context === PaletteContext.DEFAULT) {
|
|
10871
10867
|
// Determine the tab this CaseField belongs to (should be only one), from the CaseView object in the snapshot
|
|
10872
10868
|
// data, and extract all flags-related data from its Flags fields
|
|
@@ -10885,7 +10881,7 @@ class ReadCaseFlagFieldComponent extends AbstractFieldReadComponent {
|
|
|
10885
10881
|
else if (this.context === PaletteContext.CHECK_YOUR_ANSWER) {
|
|
10886
10882
|
// If the context is PaletteContext.CHECK_YOUR_ANSWER, the Flags data is already present within the formGroup.
|
|
10887
10883
|
// The FlagLauncher component, WriteCaseFlagFieldComponent, holds a reference to:
|
|
10888
|
-
// i) the parent
|
|
10884
|
+
// i) the parent FormGroup for the Flags instance where changes have been made;
|
|
10889
10885
|
// ii) the currently selected flag (selectedFlag) if one exists
|
|
10890
10886
|
const flagLauncherControlName = Object.keys(this.formGroup.controls).find(controlName => FieldsUtils.isFlagLauncherCaseField(this.formGroup.get(controlName)['caseField']));
|
|
10891
10887
|
if (flagLauncherControlName && this.formGroup.get(flagLauncherControlName)['component']) {
|
|
@@ -11094,7 +11090,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11094
11090
|
this.caseEditDataService = caseEditDataService;
|
|
11095
11091
|
this.caseFlagFieldState = CaseFlagFieldState;
|
|
11096
11092
|
this.errorMessages = [];
|
|
11097
|
-
this.caseFlagParentFormGroup = new
|
|
11093
|
+
this.caseFlagParentFormGroup = new FormGroup({});
|
|
11098
11094
|
this.flagCommentsOptional = false;
|
|
11099
11095
|
this.listOfValues = null;
|
|
11100
11096
|
this.allCaseFlagStagesCompleted = false;
|
|
@@ -11111,11 +11107,11 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11111
11107
|
if (this.formGroup && this.formGroup.get(this.caseField.id)) {
|
|
11112
11108
|
this.formGroup.removeControl(this.caseField.id);
|
|
11113
11109
|
}
|
|
11114
|
-
// From this point, this.formGroup refers to the
|
|
11115
|
-
this.formGroup = this.registerControl(new
|
|
11110
|
+
// From this point, this.formGroup refers to the FormGroup for the FlagLauncher field, not the parent FormGroup
|
|
11111
|
+
this.formGroup = this.registerControl(new FormGroup({}, {
|
|
11116
11112
|
validators: (_) => {
|
|
11117
11113
|
if (!this.allCaseFlagStagesCompleted) {
|
|
11118
|
-
// Return an error to mark the
|
|
11114
|
+
// Return an error to mark the FormGroup as invalid if not all Case Flag stages have been completed
|
|
11119
11115
|
return { notAllCaseFlagStagesCompleted: true };
|
|
11120
11116
|
}
|
|
11121
11117
|
return null;
|
|
@@ -11164,7 +11160,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11164
11160
|
onCaseFlagStateEmitted(caseFlagState) {
|
|
11165
11161
|
this.caseEditDataService.clearFormValidationErrors();
|
|
11166
11162
|
// If the current state is CaseFlagFieldState.FLAG_LOCATION and a flag location (a Flags instance) has been selected,
|
|
11167
|
-
// set the parent Case Flag
|
|
11163
|
+
// set the parent Case Flag FormGroup for this component's children by using the provided pathToFlagsFormGroup, and
|
|
11168
11164
|
// set the selected flag location on this component
|
|
11169
11165
|
if (caseFlagState.currentCaseFlagFieldState === CaseFlagFieldState.FLAG_LOCATION
|
|
11170
11166
|
&& caseFlagState.selectedFlagsLocation
|
|
@@ -11182,7 +11178,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11182
11178
|
this.listOfValues = caseFlagState.listOfValues;
|
|
11183
11179
|
}
|
|
11184
11180
|
// If the current state is CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS and a flag has been selected, set the parent
|
|
11185
|
-
// Case Flag
|
|
11181
|
+
// Case Flag FormGroup for this component's children by using the provided pathToFlagsFormGroup
|
|
11186
11182
|
if (caseFlagState.currentCaseFlagFieldState === CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS
|
|
11187
11183
|
&& caseFlagState.selectedFlag
|
|
11188
11184
|
&& caseFlagState.selectedFlag.pathToFlagsFormGroup) {
|
|
@@ -11319,8 +11315,8 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11319
11315
|
if (flagsCaseFieldValue) {
|
|
11320
11316
|
const flagDetailToUpdate = flagsCaseFieldValue.details.find(detail => detail.id === this.selectedFlag.flagDetailDisplay.flagDetail.id);
|
|
11321
11317
|
if (flagDetailToUpdate) {
|
|
11322
|
-
flagDetailToUpdate.value.flagComment = this.caseFlagParentFormGroup.value
|
|
11323
|
-
? this.caseFlagParentFormGroup.value
|
|
11318
|
+
flagDetailToUpdate.value.flagComment = this.caseFlagParentFormGroup.value['flagComments']
|
|
11319
|
+
? this.caseFlagParentFormGroup.value['flagComments']
|
|
11324
11320
|
: null;
|
|
11325
11321
|
flagDetailToUpdate.value.status = this.selectedFlag.flagDetailDisplay.flagDetail.status;
|
|
11326
11322
|
flagDetailToUpdate.value.dateTimeModified = new Date().toISOString();
|
|
@@ -11345,12 +11341,12 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11345
11341
|
this.flagCommentsOptional = true;
|
|
11346
11342
|
}
|
|
11347
11343
|
/**
|
|
11348
|
-
* Set the parent {@link
|
|
11349
|
-
* to which data should be attached. **Note:** The parent is not _this_ component's `
|
|
11344
|
+
* Set the parent {@link FormGroup} for this component's children, depending on the `Flags` {@link CaseField} instance
|
|
11345
|
+
* to which data should be attached. **Note:** The parent is not _this_ component's `FormGroup` (as might otherwise be
|
|
11350
11346
|
* expected) because this component is not expected to have a value, given it is used for the empty `FlagLauncher` base
|
|
11351
11347
|
* field type.
|
|
11352
11348
|
*
|
|
11353
|
-
* @param pathToFlagsFormGroup The dot-delimited string that is the path to the `
|
|
11349
|
+
* @param pathToFlagsFormGroup The dot-delimited string that is the path to the `FormGroup` for a `Flags` instance
|
|
11354
11350
|
*/
|
|
11355
11351
|
setCaseFlagParentFormGroup(pathToFlagsFormGroup) {
|
|
11356
11352
|
this.caseFlagParentFormGroup = this.formGroup.parent.get(pathToFlagsFormGroup);
|
|
@@ -11359,19 +11355,19 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11359
11355
|
return {
|
|
11360
11356
|
name: this.flagName,
|
|
11361
11357
|
// Currently, subTypeValue and subTypeKey are applicable only to language flag types
|
|
11362
|
-
subTypeValue: this.caseFlagParentFormGroup.value
|
|
11363
|
-
? this.caseFlagParentFormGroup.value
|
|
11364
|
-
: this.caseFlagParentFormGroup.value
|
|
11365
|
-
? this.caseFlagParentFormGroup.value
|
|
11358
|
+
subTypeValue: this.caseFlagParentFormGroup.value['languageSearchTerm']
|
|
11359
|
+
? this.caseFlagParentFormGroup.value['languageSearchTerm'].value
|
|
11360
|
+
: this.caseFlagParentFormGroup.value['mmanualLanguageEntry']
|
|
11361
|
+
? this.caseFlagParentFormGroup.value['mmanualLanguageEntry']
|
|
11366
11362
|
: null,
|
|
11367
11363
|
// For user-entered (i.e. non-Reference Data) languages, there is no key
|
|
11368
|
-
subTypeKey: this.caseFlagParentFormGroup.value
|
|
11369
|
-
? this.caseFlagParentFormGroup.value
|
|
11364
|
+
subTypeKey: this.caseFlagParentFormGroup.value['languageSearchTerm']
|
|
11365
|
+
? this.caseFlagParentFormGroup.value['languageSearchTerm'].key
|
|
11370
11366
|
: null,
|
|
11371
|
-
otherDescription: this.flagCode === this.otherFlagTypeCode && this.caseFlagParentFormGroup.value
|
|
11372
|
-
? this.caseFlagParentFormGroup.value
|
|
11367
|
+
otherDescription: this.flagCode === this.otherFlagTypeCode && this.caseFlagParentFormGroup.value['otherFlagTypeDescription']
|
|
11368
|
+
? this.caseFlagParentFormGroup.value['otherFlagTypeDescription']
|
|
11373
11369
|
: null,
|
|
11374
|
-
flagComment: this.caseFlagParentFormGroup.value
|
|
11370
|
+
flagComment: this.caseFlagParentFormGroup.value['flagComments'] ? this.caseFlagParentFormGroup.value['flagComments'] : null,
|
|
11375
11371
|
dateTimeCreated: new Date().toISOString(),
|
|
11376
11372
|
path: this.flagPath,
|
|
11377
11373
|
hearingRelevant: this.hearingRelevantFlag ? 'Yes' : 'No',
|
|
@@ -11498,12 +11494,12 @@ const _c1$m = function (a0) { return { "form-group-error": a0 }; };
|
|
|
11498
11494
|
class WriteCaseLinkFieldComponent extends AbstractFieldWriteComponent {
|
|
11499
11495
|
ngOnInit() {
|
|
11500
11496
|
if (this.caseField.value) {
|
|
11501
|
-
this.caseLinkGroup = this.registerControl(new
|
|
11497
|
+
this.caseLinkGroup = this.registerControl(new FormGroup({
|
|
11502
11498
|
CaseReference: new FormControl(this.caseField.value.CaseReference, Validators.required),
|
|
11503
11499
|
}), true);
|
|
11504
11500
|
}
|
|
11505
11501
|
else {
|
|
11506
|
-
this.caseLinkGroup = this.registerControl(new
|
|
11502
|
+
this.caseLinkGroup = this.registerControl(new FormGroup({
|
|
11507
11503
|
CaseReference: new FormControl(null, Validators.required),
|
|
11508
11504
|
}), true);
|
|
11509
11505
|
}
|
|
@@ -11829,7 +11825,7 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11829
11825
|
* this is what appears to be happening:
|
|
11830
11826
|
* 1. this.formArray contains no controls at all.
|
|
11831
11827
|
* this.formArray.value = [];
|
|
11832
|
-
* 2. this.formArray contains a
|
|
11828
|
+
* 2. this.formArray contains a FormGroup, which contains a single
|
|
11833
11829
|
* FormControl with the id 'code'.
|
|
11834
11830
|
* this.formArray.value = [{ code: null }]
|
|
11835
11831
|
* 3. this.formArray contains what is being set up below.
|
|
@@ -11841,7 +11837,7 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11841
11837
|
group = this.formArray.at(index);
|
|
11842
11838
|
}
|
|
11843
11839
|
else {
|
|
11844
|
-
group = new
|
|
11840
|
+
group = new FormGroup({});
|
|
11845
11841
|
}
|
|
11846
11842
|
let value;
|
|
11847
11843
|
if (this.isCollectionOfSimpleType(this.caseField)) {
|
|
@@ -11855,14 +11851,14 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11855
11851
|
else {
|
|
11856
11852
|
value = group.get('value');
|
|
11857
11853
|
if (!value) {
|
|
11858
|
-
value = new
|
|
11854
|
+
value = new FormGroup({});
|
|
11859
11855
|
for (const key of Object.keys(group.controls)) {
|
|
11860
11856
|
value.addControl(key, group.get(key));
|
|
11861
11857
|
// DON'T remove the control for this key from the outer group or it
|
|
11862
11858
|
// goes awry. So DON'T uncomment the below line!
|
|
11863
11859
|
// group.removeControl(key);
|
|
11864
11860
|
}
|
|
11865
|
-
// Now add the value
|
|
11861
|
+
// Now add the value FormGroup to the outer group.
|
|
11866
11862
|
group.addControl('value', value);
|
|
11867
11863
|
}
|
|
11868
11864
|
}
|
|
@@ -11967,7 +11963,7 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11967
11963
|
}
|
|
11968
11964
|
getContainer(index) {
|
|
11969
11965
|
const value = this.formArray.at(index).get('value');
|
|
11970
|
-
if (value instanceof
|
|
11966
|
+
if (value instanceof FormGroup) {
|
|
11971
11967
|
return value;
|
|
11972
11968
|
}
|
|
11973
11969
|
else {
|
|
@@ -12076,7 +12072,7 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12076
12072
|
* Applied full solution as part of EUI-3505
|
|
12077
12073
|
*/
|
|
12078
12074
|
getControlIdAt(index) {
|
|
12079
|
-
// this.formArray contains [
|
|
12075
|
+
// this.formArray contains [ FormGroup( id: FormControl, value: FormGroup ), ... ].
|
|
12080
12076
|
// Here, we need to get the value of the id FormControl.
|
|
12081
12077
|
const group = this.formArray.at(index);
|
|
12082
12078
|
const control = group.get('id');
|
|
@@ -12426,17 +12422,18 @@ function WriteDocumentFieldComponent_ccd_read_document_field_10_Template(rf, ctx
|
|
|
12426
12422
|
} }
|
|
12427
12423
|
const _c1$k = function (a0) { return { "form-group-error bottom-30": a0 }; };
|
|
12428
12424
|
class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
12429
|
-
constructor(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService) {
|
|
12425
|
+
constructor(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService, jurisdictionService) {
|
|
12430
12426
|
super();
|
|
12431
12427
|
this.appConfig = appConfig;
|
|
12432
12428
|
this.caseNotifier = caseNotifier;
|
|
12433
12429
|
this.documentManagement = documentManagement;
|
|
12434
12430
|
this.dialog = dialog;
|
|
12435
12431
|
this.fileUploadStateService = fileUploadStateService;
|
|
12432
|
+
this.jurisdictionService = jurisdictionService;
|
|
12436
12433
|
this.valid = true;
|
|
12437
12434
|
}
|
|
12438
12435
|
clickout(event) {
|
|
12439
|
-
// Capturing the event of
|
|
12436
|
+
// Capturing the event of the associated ElementRef <input type="file" #fileInpu
|
|
12440
12437
|
if (this.fileInput.nativeElement.contains(event.target)) {
|
|
12441
12438
|
this.clickInsideTheDocument = true;
|
|
12442
12439
|
}
|
|
@@ -12446,6 +12443,9 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12446
12443
|
}
|
|
12447
12444
|
ngOnInit() {
|
|
12448
12445
|
this.secureModeOn = this.appConfig.getDocumentSecureMode();
|
|
12446
|
+
if (this.secureModeOn) {
|
|
12447
|
+
this.subscribeToCaseDetails();
|
|
12448
|
+
}
|
|
12449
12449
|
this.dialogConfig = initDialog();
|
|
12450
12450
|
// EUI-3403. The field was not being registered when there was no value and the field
|
|
12451
12451
|
// itself was not mandatory, which meant that show_conditions would not be evaluated.
|
|
@@ -12458,9 +12458,6 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12458
12458
|
else {
|
|
12459
12459
|
this.createDocumentForm(document);
|
|
12460
12460
|
}
|
|
12461
|
-
if (this.appConfig.getDocumentSecureMode()) {
|
|
12462
|
-
this.subscribeToCaseDetails();
|
|
12463
|
-
}
|
|
12464
12461
|
}
|
|
12465
12462
|
ngOnDestroy() {
|
|
12466
12463
|
if (this.fileUploadSubscription) {
|
|
@@ -12469,8 +12466,11 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12469
12466
|
if (this.dialogSubscription) {
|
|
12470
12467
|
this.dialogSubscription.unsubscribe();
|
|
12471
12468
|
}
|
|
12472
|
-
if (this.
|
|
12473
|
-
this.
|
|
12469
|
+
if (this.caseNotifierSubscription) {
|
|
12470
|
+
this.caseNotifierSubscription.unsubscribe();
|
|
12471
|
+
}
|
|
12472
|
+
if (this.jurisdictionSubs) {
|
|
12473
|
+
this.jurisdictionSubs.unsubscribe();
|
|
12474
12474
|
}
|
|
12475
12475
|
}
|
|
12476
12476
|
isUploadInProgress() {
|
|
@@ -12521,7 +12521,9 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12521
12521
|
triggerReplace() {
|
|
12522
12522
|
if (this.confirmReplaceResult === 'Replace') {
|
|
12523
12523
|
this.openFileDialog();
|
|
12524
|
+
return true;
|
|
12524
12525
|
}
|
|
12526
|
+
return false;
|
|
12525
12527
|
}
|
|
12526
12528
|
getUploadedFileName() {
|
|
12527
12529
|
if (this.uploadedDocument) {
|
|
@@ -12555,10 +12557,26 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12555
12557
|
this.triggerReplace();
|
|
12556
12558
|
});
|
|
12557
12559
|
}
|
|
12560
|
+
// Depending on the context, we can get the case type and jurisdiction from different sources
|
|
12561
|
+
// If we are running an event, the caseNotifier will have the current case
|
|
12562
|
+
// If we are creating a case, the case doesn't exist yet, so the caseNotifier can't help
|
|
12563
|
+
// Instead we can use the eventTrigger to get the case type, and the jurisdiction service to
|
|
12564
|
+
// get the currently selected jurisdiction
|
|
12558
12565
|
subscribeToCaseDetails() {
|
|
12559
|
-
this.
|
|
12566
|
+
this.caseNotifierSubscription = this.caseNotifier.caseView.subscribe({
|
|
12560
12567
|
next: (caseDetails) => {
|
|
12561
|
-
this.
|
|
12568
|
+
this.caseTypeId = caseDetails?.case_id;
|
|
12569
|
+
this.jurisdictionId = caseDetails?.case_type?.jurisdiction?.id;
|
|
12570
|
+
}
|
|
12571
|
+
});
|
|
12572
|
+
this.jurisdictionSubs = this.jurisdictionService.selectedJurisdictionBS.subscribe({
|
|
12573
|
+
next: (jurisdiction) => {
|
|
12574
|
+
if (jurisdiction) {
|
|
12575
|
+
this.jurisdictionId = jurisdiction.id;
|
|
12576
|
+
if (jurisdiction.currentCaseType) {
|
|
12577
|
+
this.caseTypeId = jurisdiction.currentCaseType.id;
|
|
12578
|
+
}
|
|
12579
|
+
}
|
|
12562
12580
|
}
|
|
12563
12581
|
});
|
|
12564
12582
|
}
|
|
@@ -12602,7 +12620,7 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12602
12620
|
...documentFormGroup,
|
|
12603
12621
|
...{ document_hash: new FormControl(document.document_hash) }
|
|
12604
12622
|
} : documentFormGroup;
|
|
12605
|
-
this.uploadedDocument = this.registerControl(new
|
|
12623
|
+
this.uploadedDocument = this.registerControl(new FormGroup(documentFormGroup), true);
|
|
12606
12624
|
}
|
|
12607
12625
|
createDocumentForm(document) {
|
|
12608
12626
|
let documentFormGroup = {
|
|
@@ -12614,7 +12632,7 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12614
12632
|
...documentFormGroup,
|
|
12615
12633
|
...{ document_hash: new FormControl(document.document_hash) }
|
|
12616
12634
|
} : documentFormGroup;
|
|
12617
|
-
this.uploadedDocument = this.registerControl(new
|
|
12635
|
+
this.uploadedDocument = this.registerControl(new FormGroup(documentFormGroup), true);
|
|
12618
12636
|
}
|
|
12619
12637
|
getErrorMessage(error) {
|
|
12620
12638
|
// Document Management unavailable
|
|
@@ -12628,13 +12646,8 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12628
12646
|
documentUpload.append('files', selectedFile, selectedFile.name);
|
|
12629
12647
|
documentUpload.append('classification', 'PUBLIC');
|
|
12630
12648
|
if (this.appConfig.getDocumentSecureMode()) {
|
|
12631
|
-
const caseTypeId = this.
|
|
12632
|
-
|
|
12633
|
-
this.caseDetails.case_type.id ? this.caseDetails.case_type.id : null;
|
|
12634
|
-
const caseTypeJurisdictionId = this.caseDetails &&
|
|
12635
|
-
this.caseDetails.case_type &&
|
|
12636
|
-
this.caseDetails.case_type.jurisdiction &&
|
|
12637
|
-
this.caseDetails.case_type.jurisdiction.id ? this.caseDetails.case_type.jurisdiction.id : null;
|
|
12649
|
+
const caseTypeId = this.caseTypeId ? this.caseTypeId : null;
|
|
12650
|
+
const caseTypeJurisdictionId = this.jurisdictionId ? this.jurisdictionId : null;
|
|
12638
12651
|
documentUpload.append('caseTypeId', caseTypeId);
|
|
12639
12652
|
documentUpload.append('jurisdictionId', caseTypeJurisdictionId);
|
|
12640
12653
|
}
|
|
@@ -12681,7 +12694,7 @@ WriteDocumentFieldComponent.DOCUMENT_HASH = 'document_hash';
|
|
|
12681
12694
|
WriteDocumentFieldComponent.UPLOAD_ERROR_FILE_REQUIRED = 'File required';
|
|
12682
12695
|
WriteDocumentFieldComponent.UPLOAD_ERROR_NOT_AVAILABLE = 'Document upload facility is not available at the moment';
|
|
12683
12696
|
WriteDocumentFieldComponent.UPLOAD_WAITING_FILE_STATUS = 'Uploading...';
|
|
12684
|
-
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)); };
|
|
12697
|
+
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)); };
|
|
12685
12698
|
WriteDocumentFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteDocumentFieldComponent, selectors: [["ccd-write-document-field"]], viewQuery: function WriteDocumentFieldComponent_Query(rf, ctx) { if (rf & 1) {
|
|
12686
12699
|
i0.ɵɵviewQuery(_c0$N, 5);
|
|
12687
12700
|
} if (rf & 2) {
|
|
@@ -12739,7 +12752,7 @@ WriteDocumentFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
|
12739
12752
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteDocumentFieldComponent, [{
|
|
12740
12753
|
type: Component,
|
|
12741
12754
|
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" }]
|
|
12742
|
-
}], function () { return [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1$4.MatDialog }, { type: FileUploadStateService }]; }, { fileInput: [{
|
|
12755
|
+
}], function () { return [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1$4.MatDialog }, { type: FileUploadStateService }, { type: JurisdictionService }]; }, { fileInput: [{
|
|
12743
12756
|
type: ViewChild,
|
|
12744
12757
|
args: ['fileInput', { static: false }]
|
|
12745
12758
|
}], clickout: [{
|
|
@@ -13786,7 +13799,7 @@ class WriteJudicialUserFieldComponent extends WriteComplexFieldComponent {
|
|
|
13786
13799
|
ngOnInit() {
|
|
13787
13800
|
super.ngOnInit();
|
|
13788
13801
|
this.judicialUserControl = new FormControl(this.caseField.value);
|
|
13789
|
-
// FormControl needs to be added to the main
|
|
13802
|
+
// FormControl needs to be added to the main FormGroup so it can be picked up by the PageValidationService when
|
|
13790
13803
|
// checking if the page is valid. formGroup.setControl() is used here to ensure any existing JudicialUser
|
|
13791
13804
|
// FormControl is replaced when the component is re-initialised, for example, if the user navigates away then
|
|
13792
13805
|
// back to the page containing the JudicialUser field
|
|
@@ -13838,6 +13851,17 @@ class WriteJudicialUserFieldComponent extends WriteComplexFieldComponent {
|
|
|
13838
13851
|
this.jurisdiction = caseInfo?.jurisdiction;
|
|
13839
13852
|
this.caseType = caseInfo?.caseType;
|
|
13840
13853
|
}
|
|
13854
|
+
else {
|
|
13855
|
+
// If there is no case info, attempt to get the current jurisdiction and case type via the JurisdictionService
|
|
13856
|
+
this.jurisdictionSubscription = this.jurisdictionService.selectedJurisdictionBS.subscribe((jurisdiction) => {
|
|
13857
|
+
if (jurisdiction) {
|
|
13858
|
+
this.jurisdiction = jurisdiction.id;
|
|
13859
|
+
if (jurisdiction.currentCaseType) {
|
|
13860
|
+
this.caseType = jurisdiction.currentCaseType.id;
|
|
13861
|
+
}
|
|
13862
|
+
}
|
|
13863
|
+
});
|
|
13864
|
+
}
|
|
13841
13865
|
}
|
|
13842
13866
|
displayJudicialUser(judicialUser) {
|
|
13843
13867
|
return judicialUser
|
|
@@ -13881,6 +13905,9 @@ class WriteJudicialUserFieldComponent extends WriteComplexFieldComponent {
|
|
|
13881
13905
|
this.judicialUserControl.setValidators(Validators.required);
|
|
13882
13906
|
}
|
|
13883
13907
|
}
|
|
13908
|
+
ngOnDestroy() {
|
|
13909
|
+
this.jurisdictionSubscription?.unsubscribe();
|
|
13910
|
+
}
|
|
13884
13911
|
}
|
|
13885
13912
|
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)); };
|
|
13886
13913
|
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) { if (rf & 1) {
|
|
@@ -16003,7 +16030,7 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
|
|
|
16003
16030
|
this.linkedCasesService.caseFieldValue = caseFieldValue.filter(item => unlinkedCaseRefereneIds.indexOf(item.id) === -1);
|
|
16004
16031
|
}
|
|
16005
16032
|
this.formGroup.value.caseLinks = this.linkedCasesService.caseFieldValue;
|
|
16006
|
-
this.caseEditForm.controls['data'] = new
|
|
16033
|
+
this.caseEditForm.controls['data'] = new FormGroup({ caseLinks: new FormControl(this.linkedCasesService.caseFieldValue || []) });
|
|
16007
16034
|
this.caseEditDataService.setCaseEditForm(this.caseEditForm);
|
|
16008
16035
|
}
|
|
16009
16036
|
isAtFinalPage() {
|
|
@@ -16619,7 +16646,7 @@ class WriteOrderSummaryFieldComponent extends AbstractFieldWriteComponent {
|
|
|
16619
16646
|
and has to be built manually.
|
|
16620
16647
|
*/
|
|
16621
16648
|
ngOnInit() {
|
|
16622
|
-
const orderSummaryGroup = this.registerControl(new
|
|
16649
|
+
const orderSummaryGroup = this.registerControl(new FormGroup({}), true);
|
|
16623
16650
|
const paymentReference = new FormControl(this.caseField.value.PaymentReference);
|
|
16624
16651
|
orderSummaryGroup.addControl('PaymentReference', paymentReference);
|
|
16625
16652
|
const paymentTotal = new FormControl(this.caseField.value.PaymentTotal);
|
|
@@ -16631,12 +16658,12 @@ class WriteOrderSummaryFieldComponent extends AbstractFieldWriteComponent {
|
|
|
16631
16658
|
orderSummaryGroup.addControl('Fees', feesArray);
|
|
16632
16659
|
}
|
|
16633
16660
|
getFeeValue(feeValue) {
|
|
16634
|
-
const feeGroup = new
|
|
16661
|
+
const feeGroup = new FormGroup({});
|
|
16635
16662
|
feeGroup.addControl('FeeCode', new FormControl(feeValue.FeeCode));
|
|
16636
16663
|
feeGroup.addControl('FeeAmount', new FormControl(feeValue.FeeAmount));
|
|
16637
16664
|
feeGroup.addControl('FeeDescription', new FormControl(feeValue.FeeDescription));
|
|
16638
16665
|
feeGroup.addControl('FeeVersion', new FormControl(feeValue.FeeVersion));
|
|
16639
|
-
const feeValueGroup = new
|
|
16666
|
+
const feeValueGroup = new FormGroup({});
|
|
16640
16667
|
feeValueGroup.addControl('value', feeGroup);
|
|
16641
16668
|
return feeValueGroup;
|
|
16642
16669
|
}
|
|
@@ -16887,7 +16914,7 @@ class WriteOrganisationFieldComponent extends AbstractFieldWriteComponent {
|
|
|
16887
16914
|
this.searchOrgTextFormControl = new FormControl('');
|
|
16888
16915
|
this.searchOrgValue$ = this.searchOrgTextFormControl.valueChanges;
|
|
16889
16916
|
this.searchOrgValue$.subscribe(value => this.onSearchOrg(value));
|
|
16890
|
-
this.organisationFormGroup = this.registerControl(new
|
|
16917
|
+
this.organisationFormGroup = this.registerControl(new FormGroup({}), true);
|
|
16891
16918
|
if (this.parent && this.parent.controls && this.parent.controls.hasOwnProperty(WriteOrganisationFieldComponent.PRE_POPULATE_TO_USERS_ORGANISATION)
|
|
16892
16919
|
&& this.parent.controls[WriteOrganisationFieldComponent.PRE_POPULATE_TO_USERS_ORGANISATION].value
|
|
16893
16920
|
&& this.parent.controls[WriteOrganisationFieldComponent.PRE_POPULATE_TO_USERS_ORGANISATION].value.toUpperCase()
|
|
@@ -17711,7 +17738,7 @@ class FieldReadComponent extends AbstractFieldReadComponent {
|
|
|
17711
17738
|
this.resolver = resolver;
|
|
17712
17739
|
this.paletteService = paletteService;
|
|
17713
17740
|
this.withLabel = false;
|
|
17714
|
-
this.formGroup = new
|
|
17741
|
+
this.formGroup = new FormGroup({});
|
|
17715
17742
|
this.caseFields = [];
|
|
17716
17743
|
}
|
|
17717
17744
|
ngOnInit() {
|
|
@@ -17734,7 +17761,7 @@ class FieldReadComponent extends AbstractFieldReadComponent {
|
|
|
17734
17761
|
}
|
|
17735
17762
|
component.instance['caseField'] = this.caseField;
|
|
17736
17763
|
component.instance['caseFields'] = this.caseFields;
|
|
17737
|
-
component.instance['
|
|
17764
|
+
component.instance['formGroup'] = this.formGroup;
|
|
17738
17765
|
component.instance['topLevelFormGroup'] = this.topLevelFormGroup;
|
|
17739
17766
|
component.instance['idPrefix'] = this.idPrefix;
|
|
17740
17767
|
component.instance['parent'] = this.parent;
|
|
@@ -17808,7 +17835,7 @@ class FieldWriteComponent extends AbstractFieldWriteComponent {
|
|
|
17808
17835
|
}
|
|
17809
17836
|
component.instance['caseField'] = this.caseField;
|
|
17810
17837
|
component.instance['caseFields'] = this.caseFields;
|
|
17811
|
-
component.instance['
|
|
17838
|
+
component.instance['formGroup'] = this.formGroup;
|
|
17812
17839
|
component.instance['parent'] = this.parent;
|
|
17813
17840
|
component.instance['idPrefix'] = this.idPrefix;
|
|
17814
17841
|
if (this.caseField.field_type.id === 'AddressGlobal') {
|
|
@@ -18439,7 +18466,7 @@ class CaseFileViewFolderComponent {
|
|
|
18439
18466
|
}
|
|
18440
18467
|
}
|
|
18441
18468
|
ngOnInit() {
|
|
18442
|
-
this.documentFilterFormGroup = new
|
|
18469
|
+
this.documentFilterFormGroup = new FormGroup({});
|
|
18443
18470
|
this.documentSearchFormControl = new FormControl('');
|
|
18444
18471
|
this.documentFilterFormGroup.addControl(CaseFileViewFolderComponent.DOCUMENT_SEARCH_FORM_CONTROL_NAME, this.documentSearchFormControl);
|
|
18445
18472
|
// Listen to search input and initiate filter documents if at least three characters entered
|
|
@@ -22248,13 +22275,13 @@ PaletteModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
22248
22275
|
CaseFlagRefdataService,
|
|
22249
22276
|
YesNoService,
|
|
22250
22277
|
CollectionCreateCheckerService,
|
|
22278
|
+
JurisdictionService,
|
|
22251
22279
|
PaletteService,
|
|
22252
22280
|
FormValidatorsService,
|
|
22253
22281
|
FileUploadStateService,
|
|
22254
22282
|
FileUploadProgressGuard,
|
|
22255
22283
|
WindowService,
|
|
22256
22284
|
CommonDataService,
|
|
22257
|
-
JurisdictionService,
|
|
22258
22285
|
LinkedCasesService,
|
|
22259
22286
|
{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' }
|
|
22260
22287
|
], imports: [CommonModule,
|
|
@@ -22353,18 +22380,17 @@ PaletteModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
22353
22380
|
CaseFlagRefdataService,
|
|
22354
22381
|
YesNoService,
|
|
22355
22382
|
CollectionCreateCheckerService,
|
|
22383
|
+
JurisdictionService,
|
|
22356
22384
|
PaletteService,
|
|
22357
22385
|
FormValidatorsService,
|
|
22358
22386
|
FileUploadStateService,
|
|
22359
22387
|
FileUploadProgressGuard,
|
|
22360
22388
|
WindowService,
|
|
22361
22389
|
CommonDataService,
|
|
22362
|
-
JurisdictionService,
|
|
22363
22390
|
LinkedCasesService,
|
|
22364
22391
|
{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' }
|
|
22365
22392
|
],
|
|
22366
|
-
schemas: [
|
|
22367
|
-
entryComponents: [CaseFileViewFolderSelectorComponent]
|
|
22393
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
22368
22394
|
}]
|
|
22369
22395
|
}], null, null); })();
|
|
22370
22396
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaletteModule, { declarations: [FixedListPipe,
|
|
@@ -23693,13 +23719,13 @@ CaseEditorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
23693
23719
|
FormsModule,
|
|
23694
23720
|
ReactiveFormsModule,
|
|
23695
23721
|
CaseEditDataModule,
|
|
23696
|
-
PaletteModule,
|
|
23697
23722
|
LabelSubstitutorModule,
|
|
23698
23723
|
ConditionalShowModule,
|
|
23699
23724
|
ErrorsModule,
|
|
23700
23725
|
PortalModule,
|
|
23701
23726
|
LoadingSpinnerModule,
|
|
23702
23727
|
BannersModule,
|
|
23728
|
+
PaletteModule,
|
|
23703
23729
|
RpxTranslationModule.forChild()] });
|
|
23704
23730
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditorModule, [{
|
|
23705
23731
|
type: NgModule,
|
|
@@ -23710,13 +23736,13 @@ CaseEditorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
23710
23736
|
FormsModule,
|
|
23711
23737
|
ReactiveFormsModule,
|
|
23712
23738
|
CaseEditDataModule,
|
|
23713
|
-
PaletteModule,
|
|
23714
23739
|
LabelSubstitutorModule,
|
|
23715
23740
|
ConditionalShowModule,
|
|
23716
23741
|
ErrorsModule,
|
|
23717
23742
|
PortalModule,
|
|
23718
23743
|
LoadingSpinnerModule,
|
|
23719
23744
|
BannersModule,
|
|
23745
|
+
PaletteModule,
|
|
23720
23746
|
RpxTranslationModule.forChild()
|
|
23721
23747
|
],
|
|
23722
23748
|
declarations: [
|
|
@@ -23788,13 +23814,13 @@ CaseEditorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
23788
23814
|
FormsModule,
|
|
23789
23815
|
ReactiveFormsModule,
|
|
23790
23816
|
CaseEditDataModule,
|
|
23791
|
-
PaletteModule,
|
|
23792
23817
|
LabelSubstitutorModule,
|
|
23793
23818
|
ConditionalShowModule,
|
|
23794
23819
|
ErrorsModule,
|
|
23795
23820
|
PortalModule,
|
|
23796
23821
|
LoadingSpinnerModule,
|
|
23797
|
-
BannersModule,
|
|
23822
|
+
BannersModule,
|
|
23823
|
+
PaletteModule, i1$1.RpxTranslationModule], exports: [CaseEditConfirmComponent,
|
|
23798
23824
|
CaseEditComponent,
|
|
23799
23825
|
CaseEditPageComponent,
|
|
23800
23826
|
CaseEditFormComponent,
|
|
@@ -23803,11 +23829,11 @@ CaseEditorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
|
23803
23829
|
CaseProgressComponent,
|
|
23804
23830
|
CallbackErrorsComponent] }); })();
|
|
23805
23831
|
i0.ɵɵsetComponentScope(CaseEditConfirmComponent, function () { return [i1.NgIf, i3.ɵNgNoValidate, i3.NgControlStatusGroup, i3.FormGroupDirective, MarkdownComponent]; }, function () { return [CaseReferencePipe, CcdCaseTitlePipe, i1$1.RpxTranslatePipe]; });
|
|
23806
|
-
i0.ɵɵsetComponentScope(CaseEditPageComponent, function () { return [i1.NgForOf, i1.NgIf, i3.ɵNgNoValidate, i3.NgControlStatusGroup, i3.FormGroupDirective,
|
|
23832
|
+
i0.ɵɵsetComponentScope(CaseEditPageComponent, function () { return [i1.NgForOf, i1.NgIf, i3.ɵNgNoValidate, i3.NgControlStatusGroup, i3.FormGroupDirective, CallbackErrorsComponent, MarkdownComponent, CaseEditFormComponent,
|
|
23807
23833
|
CaseEventCompletionComponent,
|
|
23808
23834
|
CaseEditGenericErrorsComponent]; }, function () { return [i1.AsyncPipe, CaseReferencePipe, CcdCaseTitlePipe, i1$1.RpxTranslatePipe]; });
|
|
23809
|
-
i0.ɵɵsetComponentScope(CaseEditFormComponent, function () { return [i1.NgForOf, i1.NgIf, i1.NgSwitch, i1.NgSwitchCase, i3.NgControlStatusGroup, i3.FormGroupDirective,
|
|
23810
|
-
i0.ɵɵsetComponentScope(CaseEditSubmitComponent, function () { 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,
|
|
23835
|
+
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]; });
|
|
23836
|
+
i0.ɵɵsetComponentScope(CaseEditSubmitComponent, function () { 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,
|
|
23811
23837
|
CaseEditGenericErrorsComponent]; }, function () { return [IsCompoundPipe, CaseReferencePipe, CcdCaseTitlePipe, CcdCYAPageLabelFilterPipe, ReadFieldsFilterPipe, CcdPageFieldsPipe, i1$1.RpxTranslatePipe]; });
|
|
23812
23838
|
i0.ɵɵsetComponentScope(CaseCreateComponent, function () { return [i1.NgIf, CaseEditComponent]; }, []);
|
|
23813
23839
|
i0.ɵɵsetComponentScope(CaseProgressComponent, function () { return [i1.NgIf, CaseEditComponent]; }, []);
|
|
@@ -24680,7 +24706,7 @@ class WorkbasketFiltersComponent {
|
|
|
24680
24706
|
this.windowService = windowService;
|
|
24681
24707
|
this.onApply = new EventEmitter();
|
|
24682
24708
|
this.onReset = new EventEmitter();
|
|
24683
|
-
this.formGroup = new
|
|
24709
|
+
this.formGroup = new FormGroup({});
|
|
24684
24710
|
this.initialised = false;
|
|
24685
24711
|
}
|
|
24686
24712
|
ngOnInit() {
|
|
@@ -24724,9 +24750,20 @@ class WorkbasketFiltersComponent {
|
|
|
24724
24750
|
if (init) {
|
|
24725
24751
|
this.windowService.setLocalStorage(SAVED_QUERY_PARAM_LOC_STORAGE, JSON.stringify(queryParams));
|
|
24726
24752
|
if (Object.keys(this.formGroup.controls).length > 0) {
|
|
24753
|
+
// Find all "special case" JudicialUser FormControl keys and remove the corresponding values from the
|
|
24754
|
+
// FormGroup value because these values are not intended to be stored and subsequently passed as query string
|
|
24755
|
+
// parameters when calling searchCases API endpoint
|
|
24756
|
+
const judicialUserControlValuesToRemove = Object.keys(this.formGroup.controls).filter((key) => key.endsWith('_judicialUserControl'));
|
|
24757
|
+
judicialUserControlValuesToRemove.forEach((controlKey) => delete this.formGroup.value[controlKey]);
|
|
24727
24758
|
this.windowService.setLocalStorage(FORM_GROUP_VAL_LOC_STORAGE, JSON.stringify(this.formGroup.value));
|
|
24728
24759
|
}
|
|
24729
24760
|
}
|
|
24761
|
+
// Announce selected jurisdiction via JurisdictionService
|
|
24762
|
+
if (this.selected.jurisdiction) {
|
|
24763
|
+
// Set the selected case type as the current case type of the selected jurisdiction
|
|
24764
|
+
this.selected.jurisdiction.currentCaseType = this.selected.caseType;
|
|
24765
|
+
this.jurisdictionService.announceSelectedJurisdiction(this.selected.jurisdiction);
|
|
24766
|
+
}
|
|
24730
24767
|
// Apply filters
|
|
24731
24768
|
this.onApply.emit({ selected: this.selected, queryParams });
|
|
24732
24769
|
this.setFocusToTop();
|
|
@@ -24772,7 +24809,7 @@ class WorkbasketFiltersComponent {
|
|
|
24772
24809
|
if (this.selected.caseType) {
|
|
24773
24810
|
this.selectedCaseTypeStates = this.sortStates(this.selected.caseType.states);
|
|
24774
24811
|
this.selected.caseState = null;
|
|
24775
|
-
this.formGroup = new
|
|
24812
|
+
this.formGroup = new FormGroup({});
|
|
24776
24813
|
this.clearWorkbasketInputs();
|
|
24777
24814
|
if (!this.isApplyButtonDisabled()) {
|
|
24778
24815
|
this.workbasketInputFilterService.getWorkbasketInputs(this.selected.jurisdiction.id, this.selected.caseType.id).pipe(take(1)).subscribe(workbasketInputs => {
|
|
@@ -26894,8 +26931,8 @@ class CaseFullAccessViewComponent {
|
|
|
26894
26931
|
}
|
|
26895
26932
|
/**
|
|
26896
26933
|
* For EUI-3825:
|
|
26897
|
-
* Builds a
|
|
26898
|
-
* This
|
|
26934
|
+
* Builds a FormGroup from all the CaseFields contained within the view.
|
|
26935
|
+
* This FormGroup is necessary for evaluation the show/hide conditions of
|
|
26899
26936
|
* fields that are dependent on a field only available on a DIFFERENT tab.
|
|
26900
26937
|
*/
|
|
26901
26938
|
buildFormGroup(caseFields) {
|
|
@@ -26908,7 +26945,7 @@ class CaseFullAccessViewComponent {
|
|
|
26908
26945
|
};
|
|
26909
26946
|
});
|
|
26910
26947
|
}
|
|
26911
|
-
return new
|
|
26948
|
+
return new FormGroup({ data: new FormControl(value) });
|
|
26912
26949
|
}
|
|
26913
26950
|
resetErrors() {
|
|
26914
26951
|
this.error = null;
|
|
@@ -29407,13 +29444,14 @@ function CreateCaseFiltersComponent_option_27_Template(rf, ctx) { if (rf & 1) {
|
|
|
29407
29444
|
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 2, e_r5.name));
|
|
29408
29445
|
} }
|
|
29409
29446
|
class CreateCaseFiltersComponent {
|
|
29410
|
-
constructor(orderService, definitionsService, sessionStorageService) {
|
|
29447
|
+
constructor(orderService, definitionsService, sessionStorageService, jurisdictionService) {
|
|
29411
29448
|
this.orderService = orderService;
|
|
29412
29449
|
this.definitionsService = definitionsService;
|
|
29413
29450
|
this.sessionStorageService = sessionStorageService;
|
|
29451
|
+
this.jurisdictionService = jurisdictionService;
|
|
29414
29452
|
this.selectionSubmitted = new EventEmitter();
|
|
29415
29453
|
this.selectionChanged = new EventEmitter();
|
|
29416
|
-
this.formGroup = new
|
|
29454
|
+
this.formGroup = new FormGroup({});
|
|
29417
29455
|
}
|
|
29418
29456
|
ngOnInit() {
|
|
29419
29457
|
this.selected = {};
|
|
@@ -29463,6 +29501,8 @@ class CreateCaseFiltersComponent {
|
|
|
29463
29501
|
!this.isDisabled;
|
|
29464
29502
|
}
|
|
29465
29503
|
apply() {
|
|
29504
|
+
this.selected.jurisdiction.currentCaseType = this.selected.caseType;
|
|
29505
|
+
this.jurisdictionService.announceSelectedJurisdiction(this.selected.jurisdiction);
|
|
29466
29506
|
this.selectionSubmitted.emit({
|
|
29467
29507
|
jurisdictionId: this.selected.jurisdiction.id,
|
|
29468
29508
|
caseTypeId: this.selected.caseType.id,
|
|
@@ -29543,7 +29583,7 @@ class CreateCaseFiltersComponent {
|
|
|
29543
29583
|
return value === null || value === undefined;
|
|
29544
29584
|
}
|
|
29545
29585
|
}
|
|
29546
|
-
CreateCaseFiltersComponent.ɵfac = function CreateCaseFiltersComponent_Factory(t) { return new (t || CreateCaseFiltersComponent)(i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(DefinitionsService), i0.ɵɵdirectiveInject(SessionStorageService)); };
|
|
29586
|
+
CreateCaseFiltersComponent.ɵfac = function CreateCaseFiltersComponent_Factory(t) { return new (t || CreateCaseFiltersComponent)(i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(DefinitionsService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(JurisdictionService)); };
|
|
29547
29587
|
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) { if (rf & 1) {
|
|
29548
29588
|
i0.ɵɵelementStart(0, "form", 0);
|
|
29549
29589
|
i0.ɵɵlistener("ngSubmit", function CreateCaseFiltersComponent_Template_form_ngSubmit_0_listener() { return ctx.apply(); });
|
|
@@ -29620,7 +29660,7 @@ CreateCaseFiltersComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
|
29620
29660
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CreateCaseFiltersComponent, [{
|
|
29621
29661
|
type: Component,
|
|
29622
29662
|
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" }]
|
|
29623
|
-
}], function () { return [{ type: OrderService }, { type: DefinitionsService }, { type: SessionStorageService }]; }, { isDisabled: [{
|
|
29663
|
+
}], function () { return [{ type: OrderService }, { type: DefinitionsService }, { type: SessionStorageService }, { type: JurisdictionService }]; }, { isDisabled: [{
|
|
29624
29664
|
type: Input
|
|
29625
29665
|
}], startButtonText: [{
|
|
29626
29666
|
type: Input
|
|
@@ -29744,7 +29784,7 @@ class SearchFiltersComponent {
|
|
|
29744
29784
|
this.onApply = new EventEmitter();
|
|
29745
29785
|
this.onReset = new EventEmitter();
|
|
29746
29786
|
this.onJurisdiction = new EventEmitter();
|
|
29747
|
-
this.formGroup = new
|
|
29787
|
+
this.formGroup = new FormGroup({});
|
|
29748
29788
|
}
|
|
29749
29789
|
ngOnInit() {
|
|
29750
29790
|
this.selected = {};
|
|
@@ -29820,7 +29860,7 @@ class SearchFiltersComponent {
|
|
|
29820
29860
|
this.onJurisdiction.emit(this.selected.jurisdiction);
|
|
29821
29861
|
}
|
|
29822
29862
|
onCaseTypeIdChange() {
|
|
29823
|
-
this.formGroup = new
|
|
29863
|
+
this.formGroup = new FormGroup({});
|
|
29824
29864
|
this.searchInputsReady = false;
|
|
29825
29865
|
this.searchInputs = [];
|
|
29826
29866
|
this.searchService.getSearchInputs(this.selected.jurisdiction.id, this.selected.caseType.id).pipe(tap(() => this.searchInputsReady = true)).subscribe(searchInputs => {
|