@hmcts/ccd-case-ui-toolkit 7.4.18-alignment-issue → 7.4.18-default-focus

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.
@@ -4053,6 +4053,7 @@ class CaseTab {
4053
4053
  order;
4054
4054
  fields;
4055
4055
  show_condition;
4056
+ defaultFocus;
4056
4057
  }
4057
4058
  __decorate([
4058
4059
  Type(() => CaseField),
@@ -9392,6 +9393,15 @@ class RetryUtil {
9392
9393
  const MEDIA_VIEWER_HANDOFF_RETRY_INTERVAL_MS = 100;
9393
9394
  const MEDIA_VIEWER_HANDOFF_MAX_ATTEMPTS = 100;
9394
9395
  class WindowService {
9396
+ setLocalStorage(key, value) {
9397
+ window.localStorage.setItem(key, value);
9398
+ }
9399
+ getLocalStorage(key) {
9400
+ return window.localStorage.getItem(key);
9401
+ }
9402
+ removeLocalStorage(key) {
9403
+ window.localStorage.removeItem(key);
9404
+ }
9395
9405
  locationAssign(url) {
9396
9406
  window.location.assign(url);
9397
9407
  }
@@ -13358,7 +13368,7 @@ class CaseEditPageComponent {
13358
13368
  } if (rf & 2) {
13359
13369
  let _t;
13360
13370
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.caseEditFormComponents = _t);
13361
- } }, standalone: false, decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [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"], ["tabindex", "0", 1, "validation-error", 3, "click", "keyup.enter"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related", "clear-both"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["type", "button", 1, "govuk-js-link", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
13371
+ } }, standalone: false, decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [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"], ["tabindex", "0", 1, "validation-error", 3, "click", "keyup.enter"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["type", "button", 1, "govuk-js-link", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
13362
13372
  const _r1 = i0.ɵɵgetCurrentView();
13363
13373
  i0.ɵɵtemplate(0, CaseEditPageComponent_ng_container_0_Template, 3, 2, "ng-container", 2)(1, CaseEditPageComponent_div_1_Template, 1, 0, "div", 3)(2, CaseEditPageComponent_ng_template_2_Template, 3, 7, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(4, CaseEditPageComponent_ng_template_4_Template, 1, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(6, CaseEditPageComponent_div_6_Template, 5, 4, "div", 4);
13364
13374
  i0.ɵɵelement(7, "ccd-case-edit-generic-errors", 5);
@@ -13389,7 +13399,7 @@ class CaseEditPageComponent {
13389
13399
  }
13390
13400
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditPageComponent, [{
13391
13401
  type: Component,
13392
- args: [{ selector: 'ccd-case-edit-page', standalone: false, template: "<ng-container *ngIf=\"eventTrigger\">\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]=\"demoteCaseTitleHeadingLevel(getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate)\"></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)\" (keyup.enter)=\"navigateToErrorElement(validationError.id)\" tabindex=\"0\" 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)=\"nextStep()\">\n <div id=\"fieldset-case-data\">\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 </div>\n\n <div class=\"form-group form-group-related clear-both\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"toPreviousPage()\" *ngIf=\"!isAtStart()\" [disabled]=\"isDisabled()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><button type=\"button\" (click)=\"cancel()\" class=\"govuk-js-link\">{{getCancelText() | rpxTranslate}}</button></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: [".govuk-js-link{appearance:none;background:none;border:none;color:#005ea5;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;text-decoration:underline}.govuk-js-link:hover{color:#2b8cc4;text-decoration-thickness:max(3px,.1875rem,.12em)}.govuk-js-link:focus{background-color:#ffbf47;color:#000;outline:3px solid transparent;text-decoration:none;box-shadow:0 -2px #ffbf47,0 4px #000}.govuk-js-link:visited{color:#4c2c92}.rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
13402
+ args: [{ selector: 'ccd-case-edit-page', standalone: false, template: "<ng-container *ngIf=\"eventTrigger\">\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]=\"demoteCaseTitleHeadingLevel(getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate)\"></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)\" (keyup.enter)=\"navigateToErrorElement(validationError.id)\" tabindex=\"0\" 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)=\"nextStep()\">\n <div id=\"fieldset-case-data\">\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 </div>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"toPreviousPage()\" *ngIf=\"!isAtStart()\" [disabled]=\"isDisabled()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><button type=\"button\" (click)=\"cancel()\" class=\"govuk-js-link\">{{getCancelText() | rpxTranslate}}</button></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: [".govuk-js-link{appearance:none;background:none;border:none;color:#005ea5;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;text-decoration:underline}.govuk-js-link:hover{color:#2b8cc4;text-decoration-thickness:max(3px,.1875rem,.12em)}.govuk-js-link:focus{background-color:#ffbf47;color:#000;outline:3px solid transparent;text-decoration:none;box-shadow:0 -2px #ffbf47,0 4px #000}.govuk-js-link:visited{color:#4c2c92}.rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
13393
13403
  }], () => [{ type: CaseEditComponent }, { type: i1$2.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: MultipageComponentStateService }, { type: AddressesService }, { type: LinkedCasesService }, { type: CaseFlagStateService }, { type: FocusService }], { caseEditFormComponents: [{
13394
13404
  type: ViewChildren,
13395
13405
  args: [CaseEditFormComponent]
@@ -39240,8 +39250,8 @@ function WorkbasketFiltersComponent_ng_container_39_Template(rf, ctx) { if (rf &
39240
39250
  i0.ɵɵadvance(2);
39241
39251
  i0.ɵɵproperty("ngForOf", ctx_r4.workbasketInputs);
39242
39252
  } }
39243
- const FORM_GROUP_VAL_SES_STORAGE = 'workbasket-filter-form-group-value';
39244
- const SAVED_QUERY_PARAM_SES_STORAGE = 'savedQueryParams';
39253
+ const FORM_GROUP_VAL_LOC_STORAGE = 'workbasket-filter-form-group-value';
39254
+ const SAVED_QUERY_PARAM_LOC_STORAGE = 'savedQueryParams';
39245
39255
  const REGION_LIST_AND_FRC_FILTER = 'regionList';
39246
39256
  class WorkbasketFiltersComponent {
39247
39257
  route;
@@ -39335,7 +39345,7 @@ class WorkbasketFiltersComponent {
39335
39345
  this.alertService.setPreserveAlerts(!this.initialised);
39336
39346
  }
39337
39347
  if (Object.keys(this.formGroup.controls).length === 0) {
39338
- const storedFormGroup = safeJsonParse(this.windowService.getSessionStorage(FORM_GROUP_VAL_SES_STORAGE), null);
39348
+ const storedFormGroup = safeJsonParse(this.windowService.getLocalStorage(FORM_GROUP_VAL_LOC_STORAGE), null);
39339
39349
  this.selected.formGroup = storedFormGroup && Object.keys(storedFormGroup).length > 0 ? storedFormGroup : null;
39340
39350
  }
39341
39351
  else {
@@ -39347,14 +39357,14 @@ class WorkbasketFiltersComponent {
39347
39357
  this.selected.page = 1;
39348
39358
  this.selected.metadataFields = this.getMetadataFields();
39349
39359
  if (init) {
39350
- this.windowService.setSessionStorage(SAVED_QUERY_PARAM_SES_STORAGE, JSON.stringify(queryParams));
39360
+ this.windowService.setLocalStorage(SAVED_QUERY_PARAM_LOC_STORAGE, JSON.stringify(queryParams));
39351
39361
  if (Object.keys(this.formGroup.controls).length > 0) {
39352
39362
  // Find all "special case" JudicialUser FormControl keys and remove the corresponding values from the
39353
39363
  // FormGroup value because these values are not intended to be stored and subsequently passed as query string
39354
39364
  // parameters when calling searchCases API endpoint
39355
39365
  const judicialUserControlValuesToRemove = Object.keys(this.formGroup.controls).filter((key) => key.endsWith('_judicialUserControl'));
39356
39366
  judicialUserControlValuesToRemove.forEach((controlKey) => delete this.formGroup.value[controlKey]);
39357
- this.windowService.setSessionStorage(FORM_GROUP_VAL_SES_STORAGE, JSON.stringify(this.formGroup.value));
39367
+ this.windowService.setLocalStorage(FORM_GROUP_VAL_LOC_STORAGE, JSON.stringify(this.formGroup.value));
39358
39368
  }
39359
39369
  }
39360
39370
  // Announce selected jurisdiction via JurisdictionService
@@ -39368,8 +39378,8 @@ class WorkbasketFiltersComponent {
39368
39378
  this.setFocusToTop();
39369
39379
  }
39370
39380
  reset() {
39371
- this.windowService.removeSessionStorage(FORM_GROUP_VAL_SES_STORAGE);
39372
- this.windowService.removeSessionStorage(SAVED_QUERY_PARAM_SES_STORAGE);
39381
+ this.windowService.removeLocalStorage(FORM_GROUP_VAL_LOC_STORAGE);
39382
+ this.windowService.removeLocalStorage(SAVED_QUERY_PARAM_LOC_STORAGE);
39373
39383
  setTimeout(() => {
39374
39384
  this.resetFieldsWhenNoDefaults();
39375
39385
  this.onReset.emit(true);
@@ -39420,7 +39430,7 @@ class WorkbasketFiltersComponent {
39420
39430
  this.workbasketInputsReady = true;
39421
39431
  this.workbasketInputs = workbasketInputs
39422
39432
  .sort(this.orderService.sortAsc);
39423
- const formValue = this.windowService.getSessionStorage(FORM_GROUP_VAL_SES_STORAGE);
39433
+ const formValue = this.windowService.getLocalStorage(FORM_GROUP_VAL_LOC_STORAGE);
39424
39434
  workbasketInputs.forEach(item => {
39425
39435
  if (item.field.elementPath) {
39426
39436
  item.field.id = `${item.field.id}.${item.field.elementPath}`;
@@ -39460,18 +39470,18 @@ class WorkbasketFiltersComponent {
39460
39470
  * in future to incorporate other dynamic filters.
39461
39471
  */
39462
39472
  updateFormGroupFilters() {
39463
- // Read the form group from session storage
39464
- const formGroupSessionStorage = safeJsonParse(this.windowService.getSessionStorage(FORM_GROUP_VAL_SES_STORAGE), null);
39465
- // Form group session storage is available and contains regionList property
39466
- if (!!formGroupSessionStorage && formGroupSessionStorage.hasOwnProperty(REGION_LIST_AND_FRC_FILTER)) {
39473
+ // Read the form group from local storage
39474
+ const formGroupLS = safeJsonParse(this.windowService.getLocalStorage(FORM_GROUP_VAL_LOC_STORAGE), null);
39475
+ // Form group local storage is available and contains regionList property
39476
+ if (!!formGroupLS && formGroupLS.hasOwnProperty(REGION_LIST_AND_FRC_FILTER)) {
39467
39477
  if (this.formGroup.get(REGION_LIST_AND_FRC_FILTER)) {
39468
- // If regionList value does not match between session storage and form group
39478
+ // If regionList value does not match between local storage and form group
39469
39479
  // then the filter value has been changed and we need to clear the old filter values
39470
- if (formGroupSessionStorage[REGION_LIST_AND_FRC_FILTER] !== this.formGroup.get(REGION_LIST_AND_FRC_FILTER).value) {
39471
- for (const key in formGroupSessionStorage) {
39472
- if (formGroupSessionStorage.hasOwnProperty(key)) {
39473
- const value = formGroupSessionStorage[key];
39474
- // Clear the filter form group control values if it has a value in session storage
39480
+ if (formGroupLS[REGION_LIST_AND_FRC_FILTER] !== this.formGroup.get(REGION_LIST_AND_FRC_FILTER).value) {
39481
+ for (const key in formGroupLS) {
39482
+ if (formGroupLS.hasOwnProperty(key)) {
39483
+ const value = formGroupLS[key];
39484
+ // Clear the filter form group control values if it has a value in local storage
39475
39485
  // The regionList form group control value should be ignored as it always contain the latest value
39476
39486
  if (key !== REGION_LIST_AND_FRC_FILTER && value !== null) {
39477
39487
  this.formGroup.get(key).setValue(null);
@@ -39490,7 +39500,7 @@ class WorkbasketFiltersComponent {
39490
39500
  * Query parameters, when available, take precedence over workbasket defaults.
39491
39501
  */
39492
39502
  initFilters(init) {
39493
- const savedQueryParams = this.windowService.getSessionStorage(SAVED_QUERY_PARAM_SES_STORAGE);
39503
+ const savedQueryParams = this.windowService.getLocalStorage(SAVED_QUERY_PARAM_LOC_STORAGE);
39494
39504
  const routeSnapshot = this.route.snapshot;
39495
39505
  if (savedQueryParams) {
39496
39506
  routeSnapshot.queryParams = JSON.parse(savedQueryParams);
@@ -39551,7 +39561,7 @@ class WorkbasketFiltersComponent {
39551
39561
  this.workbasketInputs = [];
39552
39562
  }
39553
39563
  clearStoredWorkbasketFilterValues() {
39554
- this.windowService.removeSessionStorage(FORM_GROUP_VAL_SES_STORAGE);
39564
+ this.windowService.removeLocalStorage(FORM_GROUP_VAL_LOC_STORAGE);
39555
39565
  }
39556
39566
  resetCaseState() {
39557
39567
  this.defaults.state_id = null;
@@ -41691,7 +41701,7 @@ class CaseFullAccessViewComponent {
41691
41701
  if (!hasHash && !isSpecialTabPath) {
41692
41702
  const paths = url.split('/');
41693
41703
  const lastPath = decodeURIComponent(paths[paths.length - 1]);
41694
- let foundTab = null;
41704
+ let foundTab;
41695
41705
  if (!this.prependedTabs) {
41696
41706
  this.prependedTabs = [];
41697
41707
  }
@@ -41712,10 +41722,13 @@ class CaseFullAccessViewComponent {
41712
41722
  });
41713
41723
  }
41714
41724
  else {
41715
- this.caseDetails.tabs.sort((aTab, bTab) => aTab.order > bTab.order ? 1 : (bTab.order > aTab.order ? -1 : 0));
41725
+ this.caseDetails.tabs = this.orderService.sort(this.caseDetails.tabs);
41726
+ // Presuming default focus only set for one tab here - multiple tabs with default focus are not handled as is a contradiction
41727
+ let preSelectTab = this.caseDetails.tabs.find((tab) => tab.defaultFocus === true) ?? null;
41728
+ // Attempt to pre-select the tab based on the preferred label for the current case type
41716
41729
  const preferredLabel = FieldsUtils.defaultTabList?.[this.caseDetails?.case_type?.id];
41717
- let preSelectTab = null;
41718
- if (preferredLabel) {
41730
+ // If no tab has default focus, attempt to use the preferred label for the current case type
41731
+ if (!preSelectTab && preferredLabel) {
41719
41732
  preSelectTab = this.caseDetails.tabs.find((tab) => (tab.label === preferredLabel) || (tab.id === preferredLabel)) ?? null;
41720
41733
  }
41721
41734
  if (!preSelectTab) {
@@ -45104,10 +45117,10 @@ function SearchFiltersComponent_ng_container_16_Template(rf, ctx) { if (rf & 1)
45104
45117
  i0.ɵɵadvance(2);
45105
45118
  i0.ɵɵproperty("ngForOf", ctx_r3.searchInputs);
45106
45119
  } }
45107
- const JURISDICTION_SES_STORAGE = 'search-jurisdiction';
45108
- const META_FIELDS_SES_STORAGE = 'search-metadata-fields';
45109
- const FORM_GROUP_VALUE_SES_STORAGE = 'search-form-group-value';
45110
- const CASE_TYPE_SES_STORAGE = 'search-caseType';
45120
+ const JURISDICTION_LOC_STORAGE = 'search-jurisdiction';
45121
+ const META_FIELDS_LOC_STORAGE = 'search-metadata-fields';
45122
+ const FORM_GROUP_VALUE_LOC_STORAGE = 'search-form-group-value';
45123
+ const CASE_TYPE_LOC_STORAGE = 'search-caseType';
45111
45124
  class SearchFiltersComponent {
45112
45125
  searchService;
45113
45126
  orderService;
@@ -45136,7 +45149,7 @@ class SearchFiltersComponent {
45136
45149
  this.selected = {};
45137
45150
  }
45138
45151
  ngOnInit() {
45139
- const jurisdiction = this.getValuesFromSessionStorage();
45152
+ const jurisdiction = this.getValuesFromLocalStorage();
45140
45153
  if (this.jurisdictions.length === 1 || jurisdiction) {
45141
45154
  this.selected.jurisdiction = this.jurisdictions[0];
45142
45155
  if (jurisdiction) {
@@ -45163,10 +45176,10 @@ class SearchFiltersComponent {
45163
45176
  });
45164
45177
  }
45165
45178
  reset() {
45166
- this.windowService.removeSessionStorage(FORM_GROUP_VALUE_SES_STORAGE);
45167
- this.windowService.removeSessionStorage(CASE_TYPE_SES_STORAGE);
45168
- this.windowService.removeSessionStorage(JURISDICTION_SES_STORAGE);
45169
- this.windowService.removeSessionStorage(META_FIELDS_SES_STORAGE);
45179
+ this.windowService.removeLocalStorage(FORM_GROUP_VALUE_LOC_STORAGE);
45180
+ this.windowService.removeLocalStorage(CASE_TYPE_LOC_STORAGE);
45181
+ this.windowService.removeLocalStorage(JURISDICTION_LOC_STORAGE);
45182
+ this.windowService.removeLocalStorage(META_FIELDS_LOC_STORAGE);
45170
45183
  this.selected = {};
45171
45184
  if (this.jurisdictions.length === 1) {
45172
45185
  this.selected.jurisdiction = this.jurisdictions[0];
@@ -45178,39 +45191,39 @@ class SearchFiltersComponent {
45178
45191
  this.selected.formGroup = this.formGroup;
45179
45192
  this.selected.page = 1;
45180
45193
  this.selected.metadataFields = this.getMetadataFields();
45181
- this.populateValuesInSessionStorage();
45194
+ this.populateValuesInLocalStorage();
45182
45195
  this.onApply.emit({
45183
45196
  selected: this.selected,
45184
45197
  queryParams: this.getQueryParams()
45185
45198
  });
45186
45199
  this.setFocusToTop();
45187
45200
  }
45188
- populateValuesInSessionStorage() {
45189
- this.windowService.setSessionStorage(FORM_GROUP_VALUE_SES_STORAGE, JSON.stringify(this.selected.formGroup.value));
45190
- this.windowService.setSessionStorage(META_FIELDS_SES_STORAGE, JSON.stringify(this.selected.metadataFields));
45201
+ populateValuesInLocalStorage() {
45202
+ this.windowService.setLocalStorage(FORM_GROUP_VALUE_LOC_STORAGE, JSON.stringify(this.selected.formGroup.value));
45203
+ this.windowService.setLocalStorage(META_FIELDS_LOC_STORAGE, JSON.stringify(this.selected.metadataFields));
45191
45204
  try {
45192
45205
  const compJurisd = compressToUTF16(JSON.stringify(this.selected.jurisdiction));
45193
- this.windowService.setSessionStorage(JURISDICTION_SES_STORAGE, compJurisd);
45206
+ this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, compJurisd);
45194
45207
  }
45195
45208
  catch (e) {
45196
- this.windowService.setSessionStorage(JURISDICTION_SES_STORAGE, null);
45209
+ this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, null);
45197
45210
  }
45198
45211
  if (this.selected.caseType) {
45199
- this.windowService.setSessionStorage(CASE_TYPE_SES_STORAGE, JSON.stringify(this.selected.caseType));
45212
+ this.windowService.setLocalStorage(CASE_TYPE_LOC_STORAGE, JSON.stringify(this.selected.caseType));
45200
45213
  }
45201
45214
  }
45202
- getValuesFromSessionStorage() {
45203
- const jurisdiction = this.windowService.getSessionStorage(JURISDICTION_SES_STORAGE);
45215
+ getValuesFromLocalStorage() {
45216
+ const jurisdiction = this.windowService.getLocalStorage(JURISDICTION_LOC_STORAGE);
45204
45217
  if (jurisdiction) {
45205
45218
  try {
45206
- const sessionStorageJurisdiction = JSON.parse(decompressFromUTF16(jurisdiction));
45207
- if (sessionStorageJurisdiction) {
45208
- return sessionStorageJurisdiction;
45219
+ const localStorageJurisdiction = JSON.parse(decompressFromUTF16(jurisdiction));
45220
+ if (localStorageJurisdiction) {
45221
+ return localStorageJurisdiction;
45209
45222
  }
45210
45223
  }
45211
45224
  catch (e) {
45212
- this.logger.error('Failed to retrieve jurisdiction from session storage.', { error: e });
45213
- this.windowService.setSessionStorage(JURISDICTION_SES_STORAGE, null);
45225
+ this.logger.error('Failed to retrieve jurisdiction from local storage.', { error: e });
45226
+ this.windowService.setLocalStorage(JURISDICTION_LOC_STORAGE, null);
45214
45227
  }
45215
45228
  }
45216
45229
  return null;
@@ -45248,7 +45261,7 @@ class SearchFiltersComponent {
45248
45261
  this.searchInputs = [];
45249
45262
  this.searchService.getSearchInputs(this.selected.jurisdiction.id, this.selected.caseType.id).pipe(tap(() => this.searchInputsReady = true)).subscribe(searchInputs => {
45250
45263
  this.searchInputs = searchInputs.sort(this.orderService.sortAsc);
45251
- const formValue = this.windowService.getSessionStorage(FORM_GROUP_VALUE_SES_STORAGE);
45264
+ const formValue = this.windowService.getLocalStorage(FORM_GROUP_VALUE_LOC_STORAGE);
45252
45265
  let formValueObject = null;
45253
45266
  if (formValue) {
45254
45267
  formValueObject = JSON.parse(formValue);
@@ -45286,7 +45299,7 @@ class SearchFiltersComponent {
45286
45299
  selectCaseType(caseTypes) {
45287
45300
  if (caseTypes && caseTypes.length > 0) {
45288
45301
  this.selected.caseType = caseTypes[0];
45289
- const caseType = this.windowService.getSessionStorage(CASE_TYPE_SES_STORAGE);
45302
+ const caseType = this.windowService.getLocalStorage(CASE_TYPE_LOC_STORAGE);
45290
45303
  if (caseType) {
45291
45304
  const caseTypeObject = JSON.parse(caseType);
45292
45305
  const result = caseTypes.filter(c => c.id === caseTypeObject.id);