@hmcts/ccd-case-ui-toolkit 7.0.9 → 7.0.10

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.
@@ -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) { if (rf & 1) {
60
61
  i0.ɵɵelementStart(0, "div", 3)(1, "div", 4);
@@ -20358,7 +20359,7 @@ function WriteYesNoFieldComponent_div_7_Template(rf, ctx) { if (rf & 1) {
20358
20359
  i0.ɵɵadvance(1);
20359
20360
  i0.ɵɵproperty("for", ctx_r3.createElementId(value_r4));
20360
20361
  i0.ɵɵadvance(1);
20361
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind3(4, 8, ctx_r3.caseField.label, null, value_r4));
20362
+ i0.ɵɵtextInterpolate(ctx_r3.caseField.label ? i0.ɵɵpipeBind3(4, 8, ctx_r3.caseField.label, null, value_r4) : value_r4);
20362
20363
  } }
20363
20364
  const _c1$a = function (a0) { return { "form-group-error": a0 }; };
20364
20365
  class WriteYesNoFieldComponent extends AbstractFieldWriteComponent {
@@ -20396,7 +20397,7 @@ WriteYesNoFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Wr
20396
20397
  } }, dependencies: [i4.NgClass, i4.NgForOf, i4.NgIf, i3.DefaultValueAccessor, i3.RadioControlValueAccessor, i3.NgControlStatus, i3.FormControlDirective, FieldLabelPipe, FirstErrorPipe, i1.RpxTranslatePipe], encapsulation: 2 });
20397
20398
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteYesNoFieldComponent, [{
20398
20399
  type: Component,
20399
- 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 \t <label class=\"form-label\" [for]=\"createElementId(value)\">{{caseField.label | rpxTranslate : null : value}}</label>\n \t </div>\n </div>\n\t</fieldset>\n</div>\n" }]
20400
+ 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" }]
20400
20401
  }], function () { return [{ type: YesNoService }]; }, null); })();
20401
20402
 
20402
20403
  class PaletteService {
@@ -34041,8 +34042,18 @@ class SearchFiltersComponent {
34041
34042
  if (this.jurisdictions.length === 1 || jurisdiction) {
34042
34043
  this.selected.jurisdiction = this.jurisdictions[0];
34043
34044
  if (jurisdiction) {
34044
- const localStorageJurisdiction = JSON.parse(jurisdiction);
34045
- this.selected.jurisdiction = this.jurisdictions.filter(j => j.id === localStorageJurisdiction.id)[0];
34045
+ try {
34046
+ console.log('jurisdiction retrieved from local storage len = ' + jurisdiction.length);
34047
+ const localStorageJurisdiction = JSON.parse(decompressFromUTF16(jurisdiction));
34048
+ if (localStorageJurisdiction) {
34049
+ this.selected.jurisdiction = this.jurisdictions
34050
+ .filter(j => j.id === localStorageJurisdiction.id)[0];
34051
+ }
34052
+ }
34053
+ catch (e) {
34054
+ console.log("Failed to retrieve jurisdiction from local storage");
34055
+ this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, null);
34056
+ }
34046
34057
  }
34047
34058
  this.onJurisdictionIdChange();
34048
34059
  }
@@ -34067,6 +34078,7 @@ class SearchFiltersComponent {
34067
34078
  this.onReset.emit();
34068
34079
  }
34069
34080
  apply() {
34081
+ console.log("Search filters apply");
34070
34082
  this.selected.formGroup = this.formGroup;
34071
34083
  this.selected.page = 1;
34072
34084
  this.selected.metadataFields = this.getMetadataFields();
@@ -34080,7 +34092,15 @@ class SearchFiltersComponent {
34080
34092
  populateValuesInLocalStorage() {
34081
34093
  this.windowService.setLocalStorage(FORM_GROUP_VALUE_LOC_STORAGE, JSON.stringify(this.selected.formGroup.value));
34082
34094
  this.windowService.setLocalStorage(META_FIELDS_LOC_STORAGE, JSON.stringify(this.selected.metadataFields));
34083
- this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, JSON.stringify(this.selected.jurisdiction));
34095
+ try {
34096
+ const compJurisd = compressToUTF16(JSON.stringify(this.selected.jurisdiction));
34097
+ this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, compJurisd);
34098
+ console.log('jurisdiction compressed into local storage, length = ' + compJurisd.length);
34099
+ }
34100
+ catch (e) {
34101
+ console.log('Could not store jurisdiction in local storage');
34102
+ this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, null);
34103
+ }
34084
34104
  if (this.selected.caseType) {
34085
34105
  this.windowService.setLocalStorage(CASE_TYPE_LOC_STORAGE, JSON.stringify(this.selected.caseType));
34086
34106
  }