@hmcts/ccd-case-ui-toolkit 7.0.9 → 7.0.10-address-validation-fix
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/shared/commons/address-validation-constants.mjs +11 -0
- package/esm2020/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.mjs +15 -6
- package/esm2020/lib/shared/components/palette/address/write-address-field.component.mjs +57 -20
- package/esm2020/lib/shared/components/palette/yes-no/write-yes-no-field.component.mjs +3 -3
- package/esm2020/lib/shared/components/search-filters/search-filters.component.mjs +24 -4
- package/esm2020/lib/shared/services/addresses/addresses.service.mjs +9 -1
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs +114 -28
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs +109 -28
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/commons/address-validation-constants.d.ts +7 -0
- package/lib/shared/commons/address-validation-constants.d.ts.map +1 -0
- package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts +3 -2
- package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
- package/lib/shared/components/palette/address/write-address-field.component.d.ts +5 -0
- package/lib/shared/components/palette/address/write-address-field.component.d.ts.map +1 -1
- package/lib/shared/components/search-filters/search-filters.component.d.ts.map +1 -1
- package/lib/shared/services/addresses/addresses.service.d.ts +3 -0
- package/lib/shared/services/addresses/addresses.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import * as i1$1 from '@angular/router';
|
|
|
8
8
|
import { RouterModule, NavigationStart, NavigationEnd } from '@angular/router';
|
|
9
9
|
import * as i3 from '@angular/forms';
|
|
10
10
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroup, FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
11
|
-
import { throwError, Subject, EMPTY, Observable, of,
|
|
11
|
+
import { throwError, Subject, EMPTY, BehaviorSubject, Observable, of, timer, fromEvent, forkJoin, Subscription, combineLatest } from 'rxjs';
|
|
12
12
|
import * as i1$2 from '@angular/common/http';
|
|
13
13
|
import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
14
14
|
import { catchError, map, switchMap, debounceTime, publish, refCount, delay, distinctUntilChanged, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
|
|
@@ -55,6 +55,7 @@ import * as i2$2 from 'ngx-pagination';
|
|
|
55
55
|
import { NgxPaginationModule, PaginatePipe } from 'ngx-pagination';
|
|
56
56
|
import * as i10 from '@angular/material/legacy-tabs';
|
|
57
57
|
import { MatLegacyTabsModule } from '@angular/material/legacy-tabs';
|
|
58
|
+
import { decompressFromUTF16, compressToUTF16 } from 'lz-string';
|
|
58
59
|
|
|
59
60
|
function FooterComponent_div_2_Template(rf, ctx) {
|
|
60
61
|
if (rf & 1) {
|
|
@@ -6274,6 +6275,7 @@ class AddressesService {
|
|
|
6274
6275
|
constructor(http, appConfig) {
|
|
6275
6276
|
this.http = http;
|
|
6276
6277
|
this.appConfig = appConfig;
|
|
6278
|
+
this.mandatoryError = new BehaviorSubject(false);
|
|
6277
6279
|
}
|
|
6278
6280
|
getAddressesForPostcode(postcode) {
|
|
6279
6281
|
return this.http
|
|
@@ -6282,6 +6284,12 @@ class AddressesService {
|
|
|
6282
6284
|
.pipe(map(res => res.results))
|
|
6283
6285
|
.pipe(map(output => output.map(addresses => this.format(new AddressParser().parse(addresses[AddressType.DPA])))));
|
|
6284
6286
|
}
|
|
6287
|
+
getMandatoryError() {
|
|
6288
|
+
return this.mandatoryError.asObservable();
|
|
6289
|
+
}
|
|
6290
|
+
setMandatoryError(value) {
|
|
6291
|
+
this.mandatoryError.next(value);
|
|
6292
|
+
}
|
|
6285
6293
|
format(addressModel) {
|
|
6286
6294
|
return this.formatAddressLines(this.shiftAddressLinesUp(addressModel));
|
|
6287
6295
|
}
|
|
@@ -9999,7 +10007,7 @@ function CaseEditPageComponent_ccd_case_event_completion_11_Template(rf, ctx) {
|
|
|
9999
10007
|
}
|
|
10000
10008
|
}
|
|
10001
10009
|
class CaseEditPageComponent {
|
|
10002
|
-
constructor(caseEdit, route, formValueService, formErrorService, cdRef, pageValidationService, dialog, caseFieldService, caseEditDataService, loadingService, validPageListCaseFieldsService) {
|
|
10010
|
+
constructor(caseEdit, route, formValueService, formErrorService, cdRef, pageValidationService, dialog, caseFieldService, caseEditDataService, loadingService, validPageListCaseFieldsService, addressService) {
|
|
10003
10011
|
this.caseEdit = caseEdit;
|
|
10004
10012
|
this.route = route;
|
|
10005
10013
|
this.formValueService = formValueService;
|
|
@@ -10011,6 +10019,7 @@ class CaseEditPageComponent {
|
|
|
10011
10019
|
this.caseEditDataService = caseEditDataService;
|
|
10012
10020
|
this.loadingService = loadingService;
|
|
10013
10021
|
this.validPageListCaseFieldsService = validPageListCaseFieldsService;
|
|
10022
|
+
this.addressService = addressService;
|
|
10014
10023
|
this.triggerTextStart = CaseEditPageComponent.TRIGGER_TEXT_START;
|
|
10015
10024
|
this.triggerTextIgnoreWarnings = CaseEditPageComponent.TRIGGER_TEXT_CONTINUE;
|
|
10016
10025
|
this.formValuesChanged = false;
|
|
@@ -10135,7 +10144,14 @@ class CaseEditPageComponent {
|
|
|
10135
10144
|
}
|
|
10136
10145
|
}
|
|
10137
10146
|
if (fieldElement.hasError('required')) {
|
|
10138
|
-
|
|
10147
|
+
if (casefield.id === 'AddressLine1') {
|
|
10148
|
+
// EUI-1067 - Display more relevant error message to user and correctly navigate to the field
|
|
10149
|
+
this.addressService.setMandatoryError(true);
|
|
10150
|
+
this.caseEditDataService.addFormValidationError({ id: `${path}_${path}`, message: `An address is required` });
|
|
10151
|
+
}
|
|
10152
|
+
else {
|
|
10153
|
+
this.caseEditDataService.addFormValidationError({ id, message: `%FIELDLABEL% is required`, label });
|
|
10154
|
+
}
|
|
10139
10155
|
fieldElement.markAsDirty();
|
|
10140
10156
|
// For the JudicialUser field type, an error needs to be set on the component so that an error message
|
|
10141
10157
|
// can be displayed at field level
|
|
@@ -10210,6 +10226,7 @@ class CaseEditPageComponent {
|
|
|
10210
10226
|
}
|
|
10211
10227
|
}
|
|
10212
10228
|
if (!this.caseEdit.isSubmitting && !this.currentPageIsNotValid()) {
|
|
10229
|
+
this.addressService.setMandatoryError(false);
|
|
10213
10230
|
console.log('Case Edit Error', this.caseEdit.error);
|
|
10214
10231
|
if (this.caseEdit.validPageList.findIndex(page => page.id === this.currentPage.id) === -1) {
|
|
10215
10232
|
this.caseEdit.validPageList.push(this.currentPage);
|
|
@@ -10505,7 +10522,7 @@ CaseEditPageComponent.RESUMED_FORM_SAVE = 'RESUMED_FORM_SAVE';
|
|
|
10505
10522
|
CaseEditPageComponent.TRIGGER_TEXT_START = 'Continue';
|
|
10506
10523
|
CaseEditPageComponent.TRIGGER_TEXT_SAVE = 'Save and continue';
|
|
10507
10524
|
CaseEditPageComponent.TRIGGER_TEXT_CONTINUE = 'Ignore Warning and Continue';
|
|
10508
|
-
CaseEditPageComponent.ɵfac = function CaseEditPageComponent_Factory(t) { return new (t || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService)); };
|
|
10525
|
+
CaseEditPageComponent.ɵfac = function CaseEditPageComponent_Factory(t) { return new (t || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(AddressesService)); };
|
|
10509
10526
|
CaseEditPageComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditPageComponent, selectors: [["ccd-case-edit-page"]], decls: 12, vars: 11, consts: [[4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["titleBlock", ""], ["idBlock", ""], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form", 3, "formGroup", "submit"], ["id", "fieldset-case-data"], [2, "display", "none"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["type", "button", 1, "button", "button-secondary", 3, "disabled", "click"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], [3, "eventCompletionParams", "eventCanBeCompleted"]], template: function CaseEditPageComponent_Template(rf, ctx) {
|
|
10510
10527
|
if (rf & 1) {
|
|
10511
10528
|
i0.ɵɵtemplate(0, CaseEditPageComponent_ng_container_0_Template, 3, 2, "ng-container", 0);
|
|
@@ -10544,7 +10561,7 @@ CaseEditPageComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseE
|
|
|
10544
10561
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditPageComponent, [{
|
|
10545
10562
|
type: Component,
|
|
10546
10563
|
args: [{ selector: 'ccd-case-edit-page', template: "<ng-container *ngIf=\"currentPage\">\n <h1 *ngIf=\"!currentPage.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data']\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <fieldset id=\"fieldset-case-data\">\n <legend style=\"display: none;\"></legend>\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </fieldset>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" [disabled]=\"!(hasPreviousPage$ | async)\" (click)=\"toPreviousPage()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><a (click)=\"cancel()\" href=\"javascript:void(0)\">{{getCancelText() | rpxTranslate}}</a></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
|
|
10547
|
-
}], function () { return [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }]; }, null);
|
|
10564
|
+
}], function () { return [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: AddressesService }]; }, null);
|
|
10548
10565
|
})();
|
|
10549
10566
|
|
|
10550
10567
|
class CallbackErrorsContext {
|
|
@@ -11036,6 +11053,17 @@ class AddressOption {
|
|
|
11036
11053
|
}
|
|
11037
11054
|
}
|
|
11038
11055
|
|
|
11056
|
+
class AddressValidationConstants {
|
|
11057
|
+
}
|
|
11058
|
+
AddressValidationConstants.REGEX_POSTCODE = /^(([A-Za-z]{1,2}\d[A-Za-z0-9]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Za-z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Za-z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/;
|
|
11059
|
+
AddressValidationConstants.ɵfac = function AddressValidationConstants_Factory(t) { return new (t || AddressValidationConstants)(); };
|
|
11060
|
+
AddressValidationConstants.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AddressValidationConstants, factory: AddressValidationConstants.ɵfac });
|
|
11061
|
+
(function () {
|
|
11062
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AddressValidationConstants, [{
|
|
11063
|
+
type: Injectable
|
|
11064
|
+
}], null, null);
|
|
11065
|
+
})();
|
|
11066
|
+
|
|
11039
11067
|
const _c0$U = ["writeComplexFieldComponent"];
|
|
11040
11068
|
function WriteAddressFieldComponent_div_1_div_4_span_5_Template(rf, ctx) {
|
|
11041
11069
|
if (rf & 1) {
|
|
@@ -11045,8 +11073,9 @@ function WriteAddressFieldComponent_div_1_div_4_span_5_Template(rf, ctx) {
|
|
|
11045
11073
|
i0.ɵɵelementEnd();
|
|
11046
11074
|
}
|
|
11047
11075
|
if (rf & 2) {
|
|
11076
|
+
const ctx_r5 = i0.ɵɵnextContext(3);
|
|
11048
11077
|
i0.ɵɵadvance(1);
|
|
11049
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1,
|
|
11078
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r5.errorMessage));
|
|
11050
11079
|
}
|
|
11051
11080
|
}
|
|
11052
11081
|
const _c1$n = function (a0) { return { "form-group-error": a0 }; };
|
|
@@ -11081,7 +11110,20 @@ function WriteAddressFieldComponent_div_1_div_4_Template(rf, ctx) {
|
|
|
11081
11110
|
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(9, 11, "Find address"));
|
|
11082
11111
|
}
|
|
11083
11112
|
}
|
|
11084
|
-
function
|
|
11113
|
+
function WriteAddressFieldComponent_div_1_div_5_span_5_Template(rf, ctx) {
|
|
11114
|
+
if (rf & 1) {
|
|
11115
|
+
i0.ɵɵelementStart(0, "span", 14);
|
|
11116
|
+
i0.ɵɵtext(1);
|
|
11117
|
+
i0.ɵɵpipe(2, "rpxTranslate");
|
|
11118
|
+
i0.ɵɵelementEnd();
|
|
11119
|
+
}
|
|
11120
|
+
if (rf & 2) {
|
|
11121
|
+
const ctx_r8 = i0.ɵɵnextContext(3);
|
|
11122
|
+
i0.ɵɵadvance(1);
|
|
11123
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r8.errorMessage));
|
|
11124
|
+
}
|
|
11125
|
+
}
|
|
11126
|
+
function WriteAddressFieldComponent_div_1_div_5_option_7_Template(rf, ctx) {
|
|
11085
11127
|
if (rf & 1) {
|
|
11086
11128
|
i0.ɵɵelementStart(0, "option", 18);
|
|
11087
11129
|
i0.ɵɵtext(1);
|
|
@@ -11089,31 +11131,35 @@ function WriteAddressFieldComponent_div_1_div_5_option_6_Template(rf, ctx) {
|
|
|
11089
11131
|
i0.ɵɵelementEnd();
|
|
11090
11132
|
}
|
|
11091
11133
|
if (rf & 2) {
|
|
11092
|
-
const
|
|
11093
|
-
i0.ɵɵproperty("ngValue",
|
|
11134
|
+
const addressOption_r10 = ctx.$implicit;
|
|
11135
|
+
i0.ɵɵproperty("ngValue", addressOption_r10.value);
|
|
11094
11136
|
i0.ɵɵadvance(1);
|
|
11095
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2,
|
|
11137
|
+
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, addressOption_r10.description), " ");
|
|
11096
11138
|
}
|
|
11097
11139
|
}
|
|
11098
11140
|
function WriteAddressFieldComponent_div_1_div_5_Template(rf, ctx) {
|
|
11099
11141
|
if (rf & 1) {
|
|
11100
|
-
const
|
|
11142
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
11101
11143
|
i0.ɵɵelementStart(0, "div", 15)(1, "label", 9)(2, "span", 10);
|
|
11102
11144
|
i0.ɵɵtext(3);
|
|
11103
11145
|
i0.ɵɵpipe(4, "rpxTranslate");
|
|
11104
11146
|
i0.ɵɵelementEnd()();
|
|
11105
|
-
i0.ɵɵ
|
|
11106
|
-
i0.ɵɵ
|
|
11107
|
-
i0.ɵɵ
|
|
11147
|
+
i0.ɵɵtemplate(5, WriteAddressFieldComponent_div_1_div_5_span_5_Template, 3, 3, "span", 11);
|
|
11148
|
+
i0.ɵɵelementStart(6, "select", 16);
|
|
11149
|
+
i0.ɵɵlistener("change", function WriteAddressFieldComponent_div_1_div_5_Template_select_change_6_listener() { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r11.addressSelected()); });
|
|
11150
|
+
i0.ɵɵtemplate(7, WriteAddressFieldComponent_div_1_div_5_option_7_Template, 3, 4, "option", 17);
|
|
11108
11151
|
i0.ɵɵelementEnd()();
|
|
11109
11152
|
}
|
|
11110
11153
|
if (rf & 2) {
|
|
11111
11154
|
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
11155
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c1$n, ctx_r3.noAddressSelected));
|
|
11112
11156
|
i0.ɵɵadvance(1);
|
|
11113
11157
|
i0.ɵɵproperty("for", ctx_r3.createElementId("addressList"));
|
|
11114
11158
|
i0.ɵɵadvance(2);
|
|
11115
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4,
|
|
11159
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 7, "Select an address"));
|
|
11116
11160
|
i0.ɵɵadvance(2);
|
|
11161
|
+
i0.ɵɵproperty("ngIf", ctx_r3.noAddressSelected);
|
|
11162
|
+
i0.ɵɵadvance(1);
|
|
11117
11163
|
i0.ɵɵproperty("id", ctx_r3.createElementId("addressList"))("formControl", ctx_r3.addressList);
|
|
11118
11164
|
i0.ɵɵadvance(1);
|
|
11119
11165
|
i0.ɵɵproperty("ngForOf", ctx_r3.addressOptions);
|
|
@@ -11121,9 +11167,9 @@ function WriteAddressFieldComponent_div_1_div_5_Template(rf, ctx) {
|
|
|
11121
11167
|
}
|
|
11122
11168
|
function WriteAddressFieldComponent_div_1_a_6_Template(rf, ctx) {
|
|
11123
11169
|
if (rf & 1) {
|
|
11124
|
-
const
|
|
11170
|
+
const _r14 = i0.ɵɵgetCurrentView();
|
|
11125
11171
|
i0.ɵɵelementStart(0, "a", 19);
|
|
11126
|
-
i0.ɵɵlistener("click", function WriteAddressFieldComponent_div_1_a_6_Template_a_click_0_listener() { i0.ɵɵrestoreView(
|
|
11172
|
+
i0.ɵɵlistener("click", function WriteAddressFieldComponent_div_1_a_6_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r14); const ctx_r13 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r13.blankAddress()); });
|
|
11127
11173
|
i0.ɵɵtext(1);
|
|
11128
11174
|
i0.ɵɵpipe(2, "rpxTranslate");
|
|
11129
11175
|
i0.ɵɵelementEnd();
|
|
@@ -11140,7 +11186,7 @@ function WriteAddressFieldComponent_div_1_Template(rf, ctx) {
|
|
|
11140
11186
|
i0.ɵɵpipe(3, "ccdFieldLabel");
|
|
11141
11187
|
i0.ɵɵelementEnd();
|
|
11142
11188
|
i0.ɵɵtemplate(4, WriteAddressFieldComponent_div_1_div_4_Template, 10, 17, "div", 5);
|
|
11143
|
-
i0.ɵɵtemplate(5, WriteAddressFieldComponent_div_1_div_5_Template,
|
|
11189
|
+
i0.ɵɵtemplate(5, WriteAddressFieldComponent_div_1_div_5_Template, 8, 11, "div", 6);
|
|
11144
11190
|
i0.ɵɵtemplate(6, WriteAddressFieldComponent_div_1_a_6_Template, 3, 3, "a", 7);
|
|
11145
11191
|
i0.ɵɵelementEnd();
|
|
11146
11192
|
}
|
|
@@ -11161,19 +11207,30 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11161
11207
|
super();
|
|
11162
11208
|
this.isCompoundPipe = isCompoundPipe;
|
|
11163
11209
|
this.addressFormGroup = new FormGroup({});
|
|
11210
|
+
this.errorMessage = WriteAddressFieldComponent.REQUIRED_ERROR_MESSAGE;
|
|
11164
11211
|
this.missingPostcode = false;
|
|
11212
|
+
this.noAddressSelected = false;
|
|
11165
11213
|
this.addressesService = addressesService;
|
|
11166
11214
|
}
|
|
11167
11215
|
ngOnInit() {
|
|
11168
11216
|
if (!this.isComplexWithHiddenFields()) {
|
|
11169
|
-
this.postcode = new FormControl('');
|
|
11170
|
-
this.
|
|
11217
|
+
this.postcode = new FormControl('', [Validators.required]);
|
|
11218
|
+
this.formGroup.addControl('postcode', this.postcode);
|
|
11171
11219
|
this.addressList = new FormControl('');
|
|
11172
|
-
this.
|
|
11220
|
+
this.formGroup.addControl('address', this.addressList);
|
|
11173
11221
|
}
|
|
11222
|
+
this.addressesService.getMandatoryError().subscribe((value) => {
|
|
11223
|
+
this.updateErrorsOnContinue(value);
|
|
11224
|
+
});
|
|
11174
11225
|
}
|
|
11175
11226
|
findAddress() {
|
|
11227
|
+
this.noAddressSelected = false;
|
|
11176
11228
|
if (!this.postcode.value) {
|
|
11229
|
+
this.errorMessage = WriteAddressFieldComponent.REQUIRED_ERROR_MESSAGE;
|
|
11230
|
+
this.missingPostcode = true;
|
|
11231
|
+
}
|
|
11232
|
+
else if (!this.postcode.value.match(AddressValidationConstants.REGEX_POSTCODE)) {
|
|
11233
|
+
this.errorMessage = WriteAddressFieldComponent.INVALID_ERROR_MESSAGE;
|
|
11177
11234
|
this.missingPostcode = true;
|
|
11178
11235
|
}
|
|
11179
11236
|
else {
|
|
@@ -11202,6 +11259,8 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11202
11259
|
blankAddress() {
|
|
11203
11260
|
this.caseField.value = new AddressModel();
|
|
11204
11261
|
this.setFormValue();
|
|
11262
|
+
this.missingPostcode = false;
|
|
11263
|
+
this.noAddressSelected = false;
|
|
11205
11264
|
}
|
|
11206
11265
|
isComplexWithHiddenFields() {
|
|
11207
11266
|
if (this.caseField.isComplex() && this.caseField.field_type.complex_fields
|
|
@@ -11233,6 +11292,7 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11233
11292
|
addressSelected() {
|
|
11234
11293
|
this.caseField.value = this.addressList.value;
|
|
11235
11294
|
this.setFormValue();
|
|
11295
|
+
this.noAddressSelected = false;
|
|
11236
11296
|
}
|
|
11237
11297
|
ngOnChanges(changes) {
|
|
11238
11298
|
super.ngOnChanges(changes);
|
|
@@ -11253,7 +11313,14 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11253
11313
|
this.writeComplexFieldComponent.complexGroup.setValue(this.caseField.value);
|
|
11254
11314
|
}
|
|
11255
11315
|
}
|
|
11316
|
+
updateErrorsOnContinue(value) {
|
|
11317
|
+
this.missingPostcode = value && !this.shouldShowDetailFields() && !this.addressOptions;
|
|
11318
|
+
this.noAddressSelected = value && !this.shouldShowDetailFields() && !!this.addressOptions;
|
|
11319
|
+
this.errorMessage = this.noAddressSelected ? 'Select an address' : this.errorMessage;
|
|
11320
|
+
}
|
|
11256
11321
|
}
|
|
11322
|
+
WriteAddressFieldComponent.REQUIRED_ERROR_MESSAGE = 'Enter a Postcode';
|
|
11323
|
+
WriteAddressFieldComponent.INVALID_ERROR_MESSAGE = 'Enter a valid Postcode';
|
|
11257
11324
|
WriteAddressFieldComponent.ɵfac = function WriteAddressFieldComponent_Factory(t) { return new (t || WriteAddressFieldComponent)(i0.ɵɵdirectiveInject(AddressesService), i0.ɵɵdirectiveInject(IsCompoundPipe)); };
|
|
11258
11325
|
WriteAddressFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteAddressFieldComponent, selectors: [["ccd-write-address-field"]], viewQuery: function WriteAddressFieldComponent_Query(rf, ctx) {
|
|
11259
11326
|
if (rf & 1) {
|
|
@@ -11265,7 +11332,7 @@ WriteAddressFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
|
11265
11332
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.writeComplexFieldComponent = _t.first);
|
|
11266
11333
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.focusElementDirectives = _t);
|
|
11267
11334
|
}
|
|
11268
|
-
}, inputs: { formGroup: "formGroup" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 4, vars: 9, consts: [[1, "form-group", 3, "id"], [4, "ngIf"], [3, "hidden", "caseField", "renderLabel", "parent", "formGroup", "ignoreMandatory", "idPrefix"], ["writeComplexFieldComponent", ""], [1, "heading-h2"], ["class", "form-group bottom-30 postcodeLookup", 3, "id", "ngClass", 4, "ngIf"], ["class", "form-group", "id", "selectAddress", 4, "ngIf"], ["class", "manual-link bottom-30", "href", "javascript:void(0)", 3, "click", 4, "ngIf"], [1, "form-group", "bottom-30", "postcodeLookup", 3, "id", "ngClass"], [3, "for"], [1, "form-label"], ["class", "error-message", 4, "ngIf"], ["type", "text", "name", "postcode", 1, "form-control", "postcodeinput", "inline-block", 3, "ngClass", "id", "formControl"], ["type", "button", 1, "button", "button-30", 3, "click"], [1, "error-message"], ["id", "selectAddress", 1, "form-group"], ["name", "address", "focusElement", "", 1, "form-control", "ccd-dropdown", "addressList", 3, "id", "formControl", "change"], [3, "ngValue", 4, "ngFor", "ngForOf"], [3, "ngValue"], ["href", "javascript:void(0)", 1, "manual-link", "bottom-30", 3, "click"]], template: function WriteAddressFieldComponent_Template(rf, ctx) {
|
|
11335
|
+
}, inputs: { formGroup: "formGroup" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 4, vars: 9, consts: [[1, "form-group", 3, "id"], [4, "ngIf"], [3, "hidden", "caseField", "renderLabel", "parent", "formGroup", "ignoreMandatory", "idPrefix"], ["writeComplexFieldComponent", ""], [1, "heading-h2"], ["class", "form-group bottom-30 postcodeLookup", 3, "id", "ngClass", 4, "ngIf"], ["class", "form-group", "id", "selectAddress", 3, "ngClass", 4, "ngIf"], ["class", "manual-link bottom-30", "href", "javascript:void(0)", 3, "click", 4, "ngIf"], [1, "form-group", "bottom-30", "postcodeLookup", 3, "id", "ngClass"], [3, "for"], [1, "form-label"], ["class", "error-message", 4, "ngIf"], ["type", "text", "name", "postcode", 1, "form-control", "postcodeinput", "inline-block", 3, "ngClass", "id", "formControl"], ["type", "button", 1, "button", "button-30", 3, "click"], [1, "error-message"], ["id", "selectAddress", 1, "form-group", 3, "ngClass"], ["name", "address", "focusElement", "", 1, "form-control", "ccd-dropdown", "addressList", 3, "id", "formControl", "change"], [3, "ngValue", 4, "ngFor", "ngForOf"], [3, "ngValue"], ["href", "javascript:void(0)", 1, "manual-link", "bottom-30", 3, "click"]], template: function WriteAddressFieldComponent_Template(rf, ctx) {
|
|
11269
11336
|
if (rf & 1) {
|
|
11270
11337
|
i0.ɵɵelementStart(0, "div", 0);
|
|
11271
11338
|
i0.ɵɵtemplate(1, WriteAddressFieldComponent_div_1_Template, 7, 6, "div", 1);
|
|
@@ -11283,7 +11350,7 @@ WriteAddressFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
|
11283
11350
|
(function () {
|
|
11284
11351
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteAddressFieldComponent, [{
|
|
11285
11352
|
type: Component,
|
|
11286
|
-
args: [{ selector: 'ccd-write-address-field', template: "<div class=\"form-group\" [id]=\"id()\">\n <div *ngIf=\"!isComplexWithHiddenFields()\">\n <h2 class=\"heading-h2\">{{caseField | ccdFieldLabel}}</h2>\n\n <div class=\"form-group bottom-30 postcodeLookup\" [id]=\"createElementId('postcodeLookup')\" [ngClass]=\"{'form-group-error': missingPostcode}\" *ngIf=\"!isExpanded\">\n <label [for]=\"createElementId('postcodeInput')\">\n <span class=\"form-label\">{{'Enter a UK postcode' | rpxTranslate}}</span>\n </label>\n <span class=\"error-message\" *ngIf=\"missingPostcode\">{{
|
|
11353
|
+
args: [{ selector: 'ccd-write-address-field', template: "<div class=\"form-group\" [id]=\"id()\">\n <div *ngIf=\"!isComplexWithHiddenFields()\">\n <h2 class=\"heading-h2\">{{caseField | ccdFieldLabel}}</h2>\n\n <div class=\"form-group bottom-30 postcodeLookup\" [id]=\"createElementId('postcodeLookup')\" [ngClass]=\"{'form-group-error': missingPostcode}\" *ngIf=\"!isExpanded\">\n <label [for]=\"createElementId('postcodeInput')\">\n <span class=\"form-label\">{{'Enter a UK postcode' | rpxTranslate}}</span>\n </label>\n <span class=\"error-message\" *ngIf=\"missingPostcode\">{{errorMessage | rpxTranslate}}</span>\n <input type=\"text\" [ngClass]=\"{'govuk-input--error': missingPostcode}\"\n [id]=\"createElementId('postcodeInput')\" name=\"postcode\" class=\"form-control postcodeinput inline-block\" [formControl]=\"postcode\">\n <button type=\"button\" class=\"button button-30\" (click)=\"findAddress()\">{{'Find address' | rpxTranslate}}</button>\n </div>\n\n <div class=\"form-group\" *ngIf=\"addressOptions\" id=\"selectAddress\" [ngClass]=\"{'form-group-error': noAddressSelected}\">\n <label [for]=\"createElementId('addressList')\">\n <span class=\"form-label\">{{'Select an address' | rpxTranslate}}</span>\n </label>\n <span class=\"error-message\" *ngIf=\"noAddressSelected\">{{errorMessage | rpxTranslate}}</span>\n <select class=\"form-control ccd-dropdown addressList\" [id]=\"createElementId('addressList')\" name=\"address\" [formControl]=\"addressList\" (change)=\"addressSelected()\" focusElement>\n <option *ngFor=\"let addressOption of addressOptions\" [ngValue]=\"addressOption.value\">\n {{addressOption.description | rpxTranslate}}\n </option>\n </select>\n </div>\n\n <a class=\"manual-link bottom-30\" *ngIf=\"!shouldShowDetailFields()\" (click)=\"blankAddress()\" href=\"javascript:void(0)\">\n {{\"I can't enter a UK postcode\" | rpxTranslate}}\n </a>\n </div>\n\n <ccd-write-complex-type-field\n [hidden]=\"!shouldShowDetailFields()\"\n [caseField]=\"caseField\"\n [renderLabel]=\"false\"\n [parent]=\"parent\"\n [formGroup]=\"formGroup\"\n [ignoreMandatory]=\"true\"\n [idPrefix]=\"buildIdPrefix('detail')\"\n #writeComplexFieldComponent>\n </ccd-write-complex-type-field>\n</div>\n", styles: [".manual-link{cursor:pointer;display:block;text-decoration:underline}\n"] }]
|
|
11287
11354
|
}], function () { return [{ type: AddressesService }, { type: IsCompoundPipe }]; }, { writeComplexFieldComponent: [{
|
|
11288
11355
|
type: ViewChild,
|
|
11289
11356
|
args: ['writeComplexFieldComponent', { static: false }]
|
|
@@ -21926,7 +21993,7 @@ function WriteYesNoFieldComponent_div_7_Template(rf, ctx) {
|
|
|
21926
21993
|
i0.ɵɵadvance(1);
|
|
21927
21994
|
i0.ɵɵproperty("for", ctx_r3.createElementId(value_r4));
|
|
21928
21995
|
i0.ɵɵadvance(1);
|
|
21929
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind3(4, 8, ctx_r3.caseField.label, null, value_r4));
|
|
21996
|
+
i0.ɵɵtextInterpolate(ctx_r3.caseField.label ? i0.ɵɵpipeBind3(4, 8, ctx_r3.caseField.label, null, value_r4) : value_r4);
|
|
21930
21997
|
}
|
|
21931
21998
|
}
|
|
21932
21999
|
const _c1$a = function (a0) { return { "form-group-error": a0 }; };
|
|
@@ -21969,7 +22036,7 @@ WriteYesNoFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Wr
|
|
|
21969
22036
|
(function () {
|
|
21970
22037
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteYesNoFieldComponent, [{
|
|
21971
22038
|
type: Component,
|
|
21972
|
-
args: [{ selector: 'ccd-write-yes-no-field', template: "<div [id]=\"id()\" class=\"form-group bottom-30\" [ngClass]=\"{'form-group-error': !yesNoControl.valid && (yesNoControl.dirty || yesNoControl.touched)}\">\n\t<fieldset class=\"inline\">\n <legend>\n <span class=\"form-label\" *ngIf=\"caseField.label\">{{caseField | ccdFieldLabel}}</span>\n </legend>\n <span class=\"form-hint\" *ngIf=\"caseField.hint_text\">{{caseField.hint_text | rpxTranslate}}</span>\n <span class=\"error-message\" *ngIf=\"yesNoControl.errors && (yesNoControl.dirty || yesNoControl.touched)\">\n {{yesNoControl.errors | ccdFirstError:caseField.label}}\n </span>\n\n <div [id]=\"createElementId('radio')\">\n \t <div class=\"multiple-choice\" *ngFor=\"let value of yesNoValues\" [ngClass]=\"{selected: yesNoControl.value === value}\">\n \t <input class=\"form-control\" [id]=\"createElementId(value)\" [attr.name]=\"id()\" [name]=\"id()\" type=\"radio\" [formControl]=\"yesNoControl\" [value]=\"value\">\n
|
|
22039
|
+
args: [{ selector: 'ccd-write-yes-no-field', template: "<div [id]=\"id()\" class=\"form-group bottom-30\" [ngClass]=\"{'form-group-error': !yesNoControl.valid && (yesNoControl.dirty || yesNoControl.touched)}\">\n\t<fieldset class=\"inline\">\n <legend>\n <span class=\"form-label\" *ngIf=\"caseField.label\">{{caseField | ccdFieldLabel}}</span>\n </legend>\n <span class=\"form-hint\" *ngIf=\"caseField.hint_text\">{{caseField.hint_text | rpxTranslate}}</span>\n <span class=\"error-message\" *ngIf=\"yesNoControl.errors && (yesNoControl.dirty || yesNoControl.touched)\">\n {{yesNoControl.errors | ccdFirstError:caseField.label}}\n </span>\n\n <div [id]=\"createElementId('radio')\">\n \t <div class=\"multiple-choice\" *ngFor=\"let value of yesNoValues\" [ngClass]=\"{selected: yesNoControl.value === value}\">\n \t <input class=\"form-control\" [id]=\"createElementId(value)\" [attr.name]=\"id()\" [name]=\"id()\" type=\"radio\" [formControl]=\"yesNoControl\" [value]=\"value\">\n <label class=\"form-label\" [for]=\"createElementId(value)\">{{caseField.label ? (caseField.label | rpxTranslate:null:value) : value}}</label>\n \t </div>\n </div>\n\t</fieldset>\n</div>\n" }]
|
|
21973
22040
|
}], function () { return [{ type: YesNoService }]; }, null);
|
|
21974
22041
|
})();
|
|
21975
22042
|
|
|
@@ -36884,8 +36951,18 @@ class SearchFiltersComponent {
|
|
|
36884
36951
|
if (this.jurisdictions.length === 1 || jurisdiction) {
|
|
36885
36952
|
this.selected.jurisdiction = this.jurisdictions[0];
|
|
36886
36953
|
if (jurisdiction) {
|
|
36887
|
-
|
|
36888
|
-
|
|
36954
|
+
try {
|
|
36955
|
+
console.log('jurisdiction retrieved from local storage len = ' + jurisdiction.length);
|
|
36956
|
+
const localStorageJurisdiction = JSON.parse(decompressFromUTF16(jurisdiction));
|
|
36957
|
+
if (localStorageJurisdiction) {
|
|
36958
|
+
this.selected.jurisdiction = this.jurisdictions
|
|
36959
|
+
.filter(j => j.id === localStorageJurisdiction.id)[0];
|
|
36960
|
+
}
|
|
36961
|
+
}
|
|
36962
|
+
catch (e) {
|
|
36963
|
+
console.log("Failed to retrieve jurisdiction from local storage");
|
|
36964
|
+
this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, null);
|
|
36965
|
+
}
|
|
36889
36966
|
}
|
|
36890
36967
|
this.onJurisdictionIdChange();
|
|
36891
36968
|
}
|
|
@@ -36910,6 +36987,7 @@ class SearchFiltersComponent {
|
|
|
36910
36987
|
this.onReset.emit();
|
|
36911
36988
|
}
|
|
36912
36989
|
apply() {
|
|
36990
|
+
console.log("Search filters apply");
|
|
36913
36991
|
this.selected.formGroup = this.formGroup;
|
|
36914
36992
|
this.selected.page = 1;
|
|
36915
36993
|
this.selected.metadataFields = this.getMetadataFields();
|
|
@@ -36923,7 +37001,15 @@ class SearchFiltersComponent {
|
|
|
36923
37001
|
populateValuesInLocalStorage() {
|
|
36924
37002
|
this.windowService.setLocalStorage(FORM_GROUP_VALUE_LOC_STORAGE, JSON.stringify(this.selected.formGroup.value));
|
|
36925
37003
|
this.windowService.setLocalStorage(META_FIELDS_LOC_STORAGE, JSON.stringify(this.selected.metadataFields));
|
|
36926
|
-
|
|
37004
|
+
try {
|
|
37005
|
+
const compJurisd = compressToUTF16(JSON.stringify(this.selected.jurisdiction));
|
|
37006
|
+
this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, compJurisd);
|
|
37007
|
+
console.log('jurisdiction compressed into local storage, length = ' + compJurisd.length);
|
|
37008
|
+
}
|
|
37009
|
+
catch (e) {
|
|
37010
|
+
console.log('Could not store jurisdiction in local storage');
|
|
37011
|
+
this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, null);
|
|
37012
|
+
}
|
|
36927
37013
|
if (this.selected.caseType) {
|
|
36928
37014
|
this.windowService.setLocalStorage(CASE_TYPE_LOC_STORAGE, JSON.stringify(this.selected.caseType));
|
|
36929
37015
|
}
|