@hmcts/ccd-case-ui-toolkit 7.0.7 → 7.0.8-compress-ls

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);
@@ -34044,8 +34045,18 @@ class SearchFiltersComponent {
34044
34045
  if (this.jurisdictions.length === 1 || jurisdiction) {
34045
34046
  this.selected.jurisdiction = this.jurisdictions[0];
34046
34047
  if (jurisdiction) {
34047
- const localStorageJurisdiction = JSON.parse(jurisdiction);
34048
- this.selected.jurisdiction = this.jurisdictions.filter(j => j.id === localStorageJurisdiction.id)[0];
34048
+ try {
34049
+ console.log('jurisdiction retrieved from local storage len = ' + jurisdiction.length);
34050
+ const localStorageJurisdiction = JSON.parse(decompressFromUTF16(jurisdiction));
34051
+ if (localStorageJurisdiction) {
34052
+ this.selected.jurisdiction = this.jurisdictions
34053
+ .filter(j => j.id === localStorageJurisdiction.id)[0];
34054
+ }
34055
+ }
34056
+ catch (e) {
34057
+ console.log("Failed to retrieve jurisdiction from local storage");
34058
+ this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, null);
34059
+ }
34049
34060
  }
34050
34061
  this.onJurisdictionIdChange();
34051
34062
  }
@@ -34070,6 +34081,7 @@ class SearchFiltersComponent {
34070
34081
  this.onReset.emit();
34071
34082
  }
34072
34083
  apply() {
34084
+ console.log("Search filters apply");
34073
34085
  this.selected.formGroup = this.formGroup;
34074
34086
  this.selected.page = 1;
34075
34087
  this.selected.metadataFields = this.getMetadataFields();
@@ -34083,7 +34095,15 @@ class SearchFiltersComponent {
34083
34095
  populateValuesInLocalStorage() {
34084
34096
  this.windowService.setLocalStorage(FORM_GROUP_VALUE_LOC_STORAGE, JSON.stringify(this.selected.formGroup.value));
34085
34097
  this.windowService.setLocalStorage(META_FIELDS_LOC_STORAGE, JSON.stringify(this.selected.metadataFields));
34086
- this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, JSON.stringify(this.selected.jurisdiction));
34098
+ try {
34099
+ const compJurisd = compressToUTF16(JSON.stringify(this.selected.jurisdiction));
34100
+ this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, compJurisd);
34101
+ console.log('jurisdiction compressed into local storage, length = ' + compJurisd.length);
34102
+ }
34103
+ catch (e) {
34104
+ console.log('Could not store jurisdiction in local storage');
34105
+ this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, null);
34106
+ }
34087
34107
  if (this.selected.caseType) {
34088
34108
  this.windowService.setLocalStorage(CASE_TYPE_LOC_STORAGE, JSON.stringify(this.selected.caseType));
34089
34109
  }