@hmcts/opal-frontend-common 0.0.88 → 0.0.89

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.
@@ -1,16 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { Location } from '@angular/common';
4
- import { Router } from '@angular/router';
4
+ import { ActivatedRoute, Router } from '@angular/router';
5
5
 
6
6
  class InternalServerErrorComponent {
7
+ activatedRoute = inject(ActivatedRoute);
7
8
  router = inject(Router);
8
9
  location = inject(Location);
9
10
  operationIdDisplay = computed(() => {
11
+ const queryParamOperationId = this.activatedRoute.snapshot.queryParamMap.get('operationId');
10
12
  const navigationState = this.router.currentNavigation()?.extras?.state;
11
13
  const persistedState = this.location.getState();
12
- const operationId = navigationState?.operationId ?? persistedState?.operationId;
13
- return operationId && operationId.trim().length > 0 ? operationId : 'Unavailable';
14
+ const operationId = [queryParamOperationId, navigationState?.operationId, persistedState?.operationId].find((id) => id?.trim());
15
+ return operationId?.trim() ?? 'Unavailable';
14
16
  }, ...(ngDevMode ? [{ debugName: "operationIdDisplay" }] : /* istanbul ignore next */ []));
15
17
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: InternalServerErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
16
18
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: InternalServerErrorComponent, isStandalone: true, selector: "opal-lib-internal-server-error", ngImport: i0, template: "<div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-l\">Sorry, there is a problem with the service</h1>\n <p class=\"govuk-body\" data-testid=\"error-code\">Error code: {{ operationIdDisplay() }}.</p>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
@@ -21,4 +23,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
21
23
  }] });
22
24
 
23
25
  export { InternalServerErrorComponent };
24
- //# sourceMappingURL=hmcts-opal-frontend-common-internal-server-error.component-BiZRHHHQ.mjs.map
26
+ //# sourceMappingURL=hmcts-opal-frontend-common-internal-server-error.component-Cj-ueGWj.mjs.map
@@ -1,16 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { Location } from '@angular/common';
4
- import { Router } from '@angular/router';
4
+ import { ActivatedRoute, Router } from '@angular/router';
5
5
 
6
6
  class InternalServerErrorComponent {
7
+ activatedRoute = inject(ActivatedRoute);
7
8
  router = inject(Router);
8
9
  location = inject(Location);
9
10
  operationIdDisplay = computed(() => {
11
+ const queryParamOperationId = this.activatedRoute.snapshot.queryParamMap.get('operationId');
10
12
  const navigationState = this.router.currentNavigation()?.extras?.state;
11
13
  const persistedState = this.location.getState();
12
- const operationId = navigationState?.operationId ?? persistedState?.operationId;
13
- return operationId && operationId.trim().length > 0 ? operationId : 'Unavailable';
14
+ const operationId = [queryParamOperationId, navigationState?.operationId, persistedState?.operationId].find((id) => id?.trim());
15
+ return operationId?.trim() ?? 'Unavailable';
14
16
  }, ...(ngDevMode ? [{ debugName: "operationIdDisplay" }] : /* istanbul ignore next */ []));
15
17
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: InternalServerErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
16
18
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: InternalServerErrorComponent, isStandalone: true, selector: "opal-lib-internal-server-error", ngImport: i0, template: "<div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-l\">Sorry, there is a problem with the service</h1>\n <p class=\"govuk-body\" data-testid=\"error-code\">Error code: {{ operationIdDisplay() }}.</p>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
@@ -21,4 +23,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
21
23
  }] });
22
24
 
23
25
  export { InternalServerErrorComponent };
24
- //# sourceMappingURL=hmcts-opal-frontend-common-pages-internal-server-error.component-BiZRHHHQ.mjs.map
26
+ //# sourceMappingURL=hmcts-opal-frontend-common-pages-internal-server-error.component-Cj-ueGWj.mjs.map
@@ -27,7 +27,7 @@ const routing = [
27
27
  },
28
28
  {
29
29
  path: PAGES_ROUTING_PATHS.children.internalServerError,
30
- loadComponent: () => import('./hmcts-opal-frontend-common-pages-internal-server-error.component-BiZRHHHQ.mjs').then((c) => c.InternalServerErrorComponent),
30
+ loadComponent: () => import('./hmcts-opal-frontend-common-pages-internal-server-error.component-Cj-ueGWj.mjs').then((c) => c.InternalServerErrorComponent),
31
31
  data: { title: PAGES_ROUTING_TITLES.children.internalServerError },
32
32
  resolve: { title: TitleResolver },
33
33
  },
@@ -54,7 +54,7 @@ const routing = [
54
54
  },
55
55
  {
56
56
  path: PAGES_ROUTING_PATHS.children.internalServerError,
57
- loadComponent: () => import('./hmcts-opal-frontend-common-internal-server-error.component-BiZRHHHQ.mjs').then((c) => c.InternalServerErrorComponent),
57
+ loadComponent: () => import('./hmcts-opal-frontend-common-internal-server-error.component-Cj-ueGWj.mjs').then((c) => c.InternalServerErrorComponent),
58
58
  data: { title: PAGES_ROUTING_TITLES.children.internalServerError },
59
59
  resolve: { title: TitleResolver },
60
60
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmcts/opal-frontend-common",
3
- "version": "0.0.88",
3
+ "version": "0.0.89",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -71,7 +71,7 @@ declare class DateService {
71
71
  * @param format - The format string to apply to the DateTime value.
72
72
  * @returns The formatted string representation of the DateTime value.
73
73
  */
74
- toFormat(value: DateTime<true> | DateTime<false>, format: string): string;
74
+ toFormat(value: DateTime, format: string): string;
75
75
  /**
76
76
  * Converts a given Date object to a formatted string based on the specified format.
77
77
  *