@genesislcap/foundation-login 14.177.0 → 14.177.1-raise-intent.3

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.
Files changed (40) hide show
  1. package/dist/dts/main/config.d.ts +52 -0
  2. package/dist/dts/main/config.d.ts.map +1 -1
  3. package/dist/dts/main/main.d.ts +6 -0
  4. package/dist/dts/main/main.d.ts.map +1 -1
  5. package/dist/dts/routes/base.d.ts +9 -2
  6. package/dist/dts/routes/base.d.ts.map +1 -1
  7. package/dist/dts/routes/forgot-password/forgot-password.d.ts.map +1 -1
  8. package/dist/dts/routes/forgot-password/forgot-password.template.d.ts.map +1 -1
  9. package/dist/dts/routes/login-form/login-form.d.ts +1 -1
  10. package/dist/dts/routes/login-form/login-form.d.ts.map +1 -1
  11. package/dist/dts/routes/login-form/login-form.template.d.ts.map +1 -1
  12. package/dist/dts/routes/request-account/request-account.template.d.ts.map +1 -1
  13. package/dist/dts/routes/reset-password/reset-password.d.ts +1 -1
  14. package/dist/dts/routes/reset-password/reset-password.d.ts.map +1 -1
  15. package/dist/dts/routes/reset-password/reset-password.template.d.ts.map +1 -1
  16. package/dist/dts/routes/verify/verify.template.d.ts.map +1 -1
  17. package/dist/esm/main/config.js +2 -0
  18. package/dist/esm/main/main.js +4 -0
  19. package/dist/esm/routes/base.js +53 -21
  20. package/dist/esm/routes/forgot-password/forgot-password.js +2 -1
  21. package/dist/esm/routes/forgot-password/forgot-password.template.js +4 -3
  22. package/dist/esm/routes/login-form/login-form.js +8 -6
  23. package/dist/esm/routes/login-form/login-form.template.js +15 -11
  24. package/dist/esm/routes/not-found/not-found.js +1 -1
  25. package/dist/esm/routes/protected/protected.template.js +1 -1
  26. package/dist/esm/routes/request-account/request-account.template.js +6 -13
  27. package/dist/esm/routes/reset-password/reset-password.js +9 -5
  28. package/dist/esm/routes/reset-password/reset-password.template.js +4 -3
  29. package/dist/esm/routes/verify/verify.template.js +5 -7
  30. package/dist/esm/translation.json +57 -0
  31. package/dist/foundation-login.api.json +135 -0
  32. package/dist/foundation-login.d.ts +68 -2
  33. package/docs/api/foundation-login.loginconfig.localizationresources.md +36 -0
  34. package/docs/api/foundation-login.loginconfig.md +2 -0
  35. package/docs/api/foundation-login.loginconfig.messagedelays.md +29 -0
  36. package/docs/api/foundation-login.md +2 -0
  37. package/docs/api/foundation-login.messagedelaykey.md +12 -0
  38. package/docs/api/foundation-login.messagedelays.md +14 -0
  39. package/docs/api-report.md +17 -2
  40. package/package.json +16 -14
@@ -1,3 +1,4 @@
1
+ import { I18nextConfig } from '@genesislcap/foundation-i18n';
1
2
  import { ElementStyles } from '@microsoft/fast-element';
2
3
  import { Container } from '@microsoft/fast-foundation';
3
4
  /**
@@ -110,6 +111,14 @@ export type SSOConfig = {
110
111
  */
111
112
  identityProvidersPath: string;
112
113
  };
114
+ /**
115
+ * @public
116
+ */
117
+ export type MessageDelayKey = 'forgotPassword' | 'resetPassword' | 'base';
118
+ /**
119
+ * @public
120
+ */
121
+ export type MessageDelays = Partial<Record<MessageDelayKey, number>>;
113
122
  /**
114
123
  * LoginConfig DI interface.
115
124
  *
@@ -227,6 +236,49 @@ export interface LoginConfig {
227
236
  * ```
228
237
  */
229
238
  versionInformation?: string;
239
+ /**
240
+ * I18n resources.
241
+ *
242
+ * @remarks
243
+ * This property holds the localization resources needed for internationalization of the application.
244
+ * It should follow the structure defined by the I18nextConfig interface, which includes
245
+ * translations grouped by locale and namespace. Each locale can contain multiple namespaces, and each
246
+ * namespace includes key-value pairs for translation strings.
247
+ *
248
+ * @example
249
+ * ```ts
250
+ * resources: {
251
+ * en: {
252
+ * translation: {
253
+ * key: 'Hello World'
254
+ * }
255
+ * },
256
+ * es: {
257
+ * translation: {
258
+ * key: 'Hola Mundo'
259
+ * }
260
+ * }
261
+ * }
262
+ * ```
263
+ */
264
+ localizationResources?: I18nextConfig['resources'];
265
+ /**
266
+ * Delay configurations for various message-related actions.
267
+ *
268
+ * @remarks
269
+ * This property holds numeric values representing delays (in milliseconds) for specific message-related actions
270
+ * within the application. Each key in this object corresponds to a particular message action.
271
+ *
272
+ * @example
273
+ * ```ts
274
+ * messageDelays: {
275
+ * forgotPassword: 1000, // Delay of 1000ms before processing forgot password action
276
+ * resetPassword: 2000, // Delay of 2000ms for reset password action
277
+ * base: 500 // Base delay used for generic message processing
278
+ * }
279
+ * ```
280
+ */
281
+ messageDelays?: MessageDelays;
230
282
  }
231
283
  /**
232
284
  * Default LoginConfig DI implementation.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/main/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAO,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAoB,MAAM,4BAA4B,CAAC;AAKzE;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAuB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW,QAAe,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,eAAe,QAAmB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,cAAc,QAAW,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAa,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,OAAO,QAAgB,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,OAAO,QAAW,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;CAQT,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC;AAE1D;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,QAAQ,GAAE,MAA0B,GAAG,OAAO,CAKvE;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;;OAGG;IACH,QAAQ,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;OAKG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;;OAKG;IACH,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;IACtB;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,qBAAqB,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACnD;;;;;;;;;;;;;;;OAeG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAoChC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,mEAAoC,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,QAQ3E"}
@@ -1,4 +1,5 @@
1
1
  import { Session } from '@genesislcap/foundation-comms';
2
+ import { I18next } from '@genesislcap/foundation-i18n';
2
3
  import { FASTElement } from '@microsoft/fast-element';
3
4
  import { Container } from '@microsoft/fast-foundation';
4
5
  import { MainRouterConfig } from '../routes';
@@ -123,6 +124,11 @@ export declare class Login extends FASTElement {
123
124
  * @internal
124
125
  */
125
126
  session: Session;
127
+ /**
128
+ * i18next instance for managing internationalization.
129
+ * @internal
130
+ */
131
+ i18next: I18next;
126
132
  /**
127
133
  * Marked true when remote components are loaded, currently unused.
128
134
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,OAAO,EAAE,MAAM,+BAA+B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;;;;;;;;;;;;GAsGG;AACH,qBACa,KAAM,SAAQ,WAAW;IACpC;;;;;OAKG;IACuB,MAAM,EAAG,gBAAgB,CAAC;IAEpD;;;OAGG;IACQ,SAAS,EAAG,SAAS,CAAC;IAEjC;;;OAGG;IACM,OAAO,EAAG,OAAO,CAAC;IAE3B;;;OAGG;IACM,OAAO,EAAG,OAAO,CAAC;IAE3B;;;OAGG;IACS,KAAK,EAAE,OAAO,CAAS;IAEnC;;;OAGG;IACS,QAAQ,EAAG,WAAW,CAAC;IAEnC;;OAEG;IACG,iBAAiB;IAQvB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,gBAAgB;IAchB;;;OAGG;IACG,wBAAwB;IAa9B;;OAEG;IACH,SAAS,CAAC,sBAAsB;CAgBjC;AAED;;;;;;;GAOG;AACH,qBAIa,WAAY,SAAQ,KAAK;IAC9B,wBAAwB;CAG/B"}
@@ -1,4 +1,5 @@
1
1
  import { Auth, Connect, CredentialManager, Message, MessageBuilder, Session } from '@genesislcap/foundation-comms';
2
+ import { I18next } from '@genesislcap/foundation-i18n';
2
3
  import { Binding, FASTElement } from '@microsoft/fast-element';
3
4
  import { Container } from '@microsoft/fast-foundation';
4
5
  import { FieldConfigMap, LoginConfig, Routes } from '../main/config';
@@ -21,6 +22,11 @@ export type ConfigHost = {
21
22
  export declare class ConfigHostElement extends FASTElement implements ConfigHost {
22
23
  container: Container;
23
24
  config: LoginConfig;
25
+ /**
26
+ * i18next instance for managing internationalization.
27
+ * @internal
28
+ */
29
+ i18next: I18next;
24
30
  connectedCallback(): void;
25
31
  }
26
32
  /**
@@ -54,7 +60,8 @@ export declare class BaseRoute extends ConfigHostElement {
54
60
  queueOnBack(delay?: number): void;
55
61
  autofill(): Promise<boolean>;
56
62
  storeCredentials(password?: string): void;
57
- sendMessage<T = any>(message: Message<T>, successFeedback?: string, successCallback?: (result: any) => void): Promise<void>;
63
+ sendMessage<T = any>(message: Message<T>, successFeedback?: string, successCallback?: (result: any) => void, delayBack?: number): Promise<void>;
64
+ toLocalisedText(text: string): string;
58
65
  }
59
66
  /**
60
67
  * @internal
@@ -99,7 +106,7 @@ export declare class LogoElement extends ConfigHostElement {
99
106
  /**
100
107
  * @internal
101
108
  */
102
- export declare const backButton: <T extends ConfigHost>(binding: Binding) => import("@microsoft/fast-element").ViewTemplate<T, any>;
109
+ export declare const backButton: <T extends ConfigHost>(binding: Binding, label: string) => import("@microsoft/fast-element").ViewTemplate<T, any>;
103
110
  /**
104
111
  * @internal
105
112
  */
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/routes/base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,OAAO,EAEP,iBAAiB,EAEjB,OAAO,EACP,cAAc,EACd,OAAO,EACR,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAEL,OAAO,EAGP,WAAW,EAIZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EAAsB,cAAc,EAAW,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGlG;;GAEG;AACH,eAAO,MAAM,eAAe,OAAQ,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,WAAY,YAAW,UAAU;IAC3D,SAAS,EAAG,SAAS,CAAC;IACrB,MAAM,EAAE,WAAW,CAAC;IAEhC,iBAAiB;CAMlB;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,iBAAiB;IACxC,IAAI,EAAG,IAAI,CAAC;IACT,OAAO,EAAG,OAAO,CAAC;IAClB,OAAO,EAAG,OAAO,CAAC;IACX,cAAc,EAAG,cAAc,CAAC;IAC7B,iBAAiB,EAAG,iBAAiB,CAAC;IAE7C,IAAI,EAAE,MAAM,CAAM;IAClB,YAAY,EA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AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,4GAE1B,MAAM,cACD,OAAO,iBACJ,MAAM,cACT,MAAM,kBACF,MAAM,mBACL,MAAM,aACZ,OAAO,2DA0BlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,mFAqB7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,mFAkBzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,mFAmBtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,gCAAiC,MAAM,2DAchE,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,cAAc,8BAA+B,KAAK,GAAG,cAAc,2DAe/E,CAAC;AAEF;;;;GAIG;AACH,qBA2Ba,iBAAkB,SAAQ,iBAAiB;IACtD,iBAAiB;CAIlB;AAED;;GAEG;AACH,qBAoBa,WAAY,SAAQ,iBAAiB;CAAG;AAErD;;GAEG;AACH,eAAO,MAAM,UAAU,kCAAmC,OAAO,SAAS,MAAM,2DAU/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,gCAChB,MAAM,eACD,MAAM,aACR,OAAO,2DAWlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,mFAQjC,CAAC;AAEF;;;;GAIG;AACH,qBA0Ba,cAAe,SAAQ,WAAW;IACjC,UAAU,EAAE,MAAM,CAAM;IAC9B,OAAO,EAAE,MAAM,CAAM;IACwB,QAAQ,EAAE,OAAO,CAAS;IAC7E,eAAe;CAGhB;AAED;;GAEG;AACH,qBAuBa,mBAAoB,SAAQ,WAAW;IACK,YAAY,EAAE,OAAO,CAAS;CACtF"}
@@ -1 +1 @@
1
- {"version":3,"file":"forgot-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/forgot-password/forgot-password.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,qBAKa,cAAe,SAAQ,SAAS;IACrC,iBAAiB;IAKjB,QAAQ;CAUf"}
1
+ {"version":3,"file":"forgot-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/forgot-password/forgot-password.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,qBAKa,cAAe,SAAQ,SAAS;IACrC,iBAAiB;IAKjB,QAAQ;CAef"}
@@ -1 +1 @@
1
- {"version":3,"file":"forgot-password.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/forgot-password/forgot-password.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,sBAAsB,qEAuBlC,CAAC"}
1
+ {"version":3,"file":"forgot-password.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/forgot-password/forgot-password.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,sBAAsB,qEAyBlC,CAAC"}
@@ -18,7 +18,7 @@ export declare class LoginForm extends BaseRoute {
18
18
  onHostSubmit(): Promise<void>;
19
19
  onLoginSubmit(): Promise<void>;
20
20
  login(credentials: AuthInfo): Promise<void>;
21
- get connectActionText(): "Disconnect" | "Connect";
21
+ get connectActionText(): string;
22
22
  get submitConnectDisabled(): boolean;
23
23
  get submitDisabled(): boolean;
24
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAKpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAI/B,qBAKa,SAAU,SAAQ,SAAS;IAC1B,IAAI,EAAE,GAAG,EAAE,CAAM;IACjB,WAAW,EAAE,MAAM,CAAM;IACzB,UAAU,EAAE,OAAO,CAAS;IAElC,iBAAiB;IAsBjB,KAAK;IAqBL,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAStD,OAAO,CAAC,yBAAyB;IA8BjC,OAAO,CAAC,iBAAiB;IAczB,iBAAiB;IAmBjB,IACI,eAAe,WAElB;IAED,cAAc,MAAO,WAAW,KAAG,IAAI,CAIrC;IAEF,UAAU;IAiBV,OAAO,CAAC,cAAc;IAQhB,YAAY;IAIZ,aAAa;IAOb,KAAK,CAAC,WAAW,EAAE,QAAQ;IAgDjC,IACI,iBAAiB,6BAEpB;IAED,IAAI,qBAAqB,YAExB;IAED,IAAI,cAAc,YAEjB;CACF"}
1
+ {"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAKpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAI/B,qBAKa,SAAU,SAAQ,SAAS;IAC1B,IAAI,EAAE,GAAG,EAAE,CAAM;IACjB,WAAW,EAAE,MAAM,CAAM;IACzB,UAAU,EAAE,OAAO,CAAS;IAElC,iBAAiB;IAsBjB,KAAK;IAqBL,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAStD,OAAO,CAAC,yBAAyB;IA8BjC,OAAO,CAAC,iBAAiB;IAczB,iBAAiB;IAqBjB,IACI,eAAe,WAElB;IAED,cAAc,MAAO,WAAW,KAAG,IAAI,CAIrC;IAEF,UAAU;IAiBV,OAAO,CAAC,cAAc;IAQhB,YAAY;IAIZ,aAAa;IAOb,KAAK,CAAC,WAAW,EAAE,QAAQ;IAgDjC,IACI,iBAAiB,WAIpB;IAED,IAAI,qBAAqB,YAExB;IAED,IAAI,cAAc,YAEjB;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"login-form.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.template.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAsH9C,eAAO,MAAM,iBAAiB,gEA8E7B,CAAC"}
1
+ {"version":3,"file":"login-form.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.template.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA2H9C,eAAO,MAAM,iBAAiB,gEAmF7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"request-account.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/request-account/request-account.template.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,sBAAsB,qEAiClC,CAAC"}
1
+ {"version":3,"file":"request-account.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/request-account/request-account.template.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,sBAAsB,qEA0BlC,CAAC"}
@@ -9,6 +9,6 @@ export declare class ResetPassword extends BaseRoute {
9
9
  onSubmit(): Promise<void>;
10
10
  onForgotPasswordWorkflow(): Promise<void>;
11
11
  onChangePasswordWorkflow(): Promise<void>;
12
- get headingText(): "Change Password" | "You are required to change your password";
12
+ get headingText(): string;
13
13
  }
14
14
  //# sourceMappingURL=reset-password.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,qBAKa,aAAc,SAAQ,SAAS;IAC9B,kBAAkB,EAAE,OAAO,CAAS;IACpC,kBAAkB,EAAE,MAAM,CAAM;IAEtC,iBAAiB;IAKjB,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC;IAKtC,QAAQ;IAQR,wBAAwB;IAYxB,wBAAwB;IAY9B,IACI,WAAW,mEAEd;CACF"}
1
+ {"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,qBAKa,aAAc,SAAQ,SAAS;IAC9B,kBAAkB,EAAE,OAAO,CAAS;IACpC,kBAAkB,EAAE,MAAM,CAAM;IAEtC,iBAAiB;IAKjB,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC;IAKtC,QAAQ;IAQR,wBAAwB;IAiBxB,wBAAwB;IAiB9B,IACI,WAAW,WAId;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"reset-password.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.template.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,eAAO,MAAM,qBAAqB,oEA8BjC,CAAC"}
1
+ {"version":3,"file":"reset-password.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/reset-password/reset-password.template.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,eAAO,MAAM,qBAAqB,oEA+BjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"verify.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/verify/verify.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,cAAc,6DAkC1B,CAAC"}
1
+ {"version":3,"file":"verify.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/verify/verify.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,cAAc,6DAgC1B,CAAC"}
@@ -3,6 +3,7 @@ import { css } from '@microsoft/fast-element';
3
3
  import { DI, Registration } from '@microsoft/fast-foundation';
4
4
  import defaultBackgroundSrc from '../assets/bg.jpg';
5
5
  import defaultLogoSrc from '../assets/genesis-logo-light.svg';
6
+ import localizationResources from '../translation.json';
6
7
  import { logger } from '../utils';
7
8
  /**
8
9
  * @public
@@ -98,6 +99,7 @@ export const defaultLoginConfig = {
98
99
  sso: {
99
100
  identityProvidersPath: 'gwf/sso/list',
100
101
  },
102
+ localizationResources,
101
103
  };
102
104
  /**
103
105
  * LoginConfig DI key.
@@ -1,5 +1,6 @@
1
1
  import { __awaiter, __decorate } from "tslib";
2
2
  import { ConnectConfig, defaultConnectConfig, Session } from '@genesislcap/foundation-comms';
3
+ import { I18next } from '@genesislcap/foundation-i18n';
3
4
  import { customElement, FASTElement, observable } from '@microsoft/fast-element';
4
5
  import { Container, inject, Registration } from '@microsoft/fast-foundation';
5
6
  import { DefaultRouteRecognizer } from '@microsoft/fast-router';
@@ -209,6 +210,9 @@ __decorate([
209
210
  __decorate([
210
211
  Session
211
212
  ], Login.prototype, "session", void 0);
213
+ __decorate([
214
+ I18next
215
+ ], Login.prototype, "i18next", void 0);
212
216
  __decorate([
213
217
  observable
214
218
  ], Login.prototype, "ready", void 0);
@@ -1,12 +1,15 @@
1
1
  import { __awaiter, __decorate } from "tslib";
2
2
  import { Auth, Connect, CredentialManager, credentialSeparator, MessageBuilder, Session, } from '@genesislcap/foundation-comms';
3
+ import { I18next } from '@genesislcap/foundation-i18n';
3
4
  import { sync } from '@genesislcap/foundation-utils';
4
5
  import { SecondaryRapidColorHEX } from '@genesislcap/foundation-zero';
5
6
  import { attr, css, customElement, FASTElement, html, observable, when, } from '@microsoft/fast-element';
6
7
  import { Container } from '@microsoft/fast-foundation';
7
8
  import { Route } from '@microsoft/fast-router';
8
9
  import { classNames } from '@microsoft/fast-web-utilities';
10
+ import merge from 'lodash/merge';
9
11
  import { defaultLoginConfig, hostUrl, LoginConfig } from '../main/config';
12
+ import { definition } from '../main/main.definition';
10
13
  import { logger } from '../utils';
11
14
  /**
12
15
  * @internal
@@ -23,6 +26,7 @@ export class ConfigHostElement extends FASTElement {
23
26
  this.config = this.container.has(LoginConfig, true)
24
27
  ? this.container.get(LoginConfig)
25
28
  : defaultLoginConfig;
29
+ this.i18next.addResources(merge(defaultLoginConfig.localizationResources, this.config.localizationResources));
26
30
  super.connectedCallback();
27
31
  }
28
32
  }
@@ -32,6 +36,9 @@ __decorate([
32
36
  __decorate([
33
37
  observable
34
38
  ], ConfigHostElement.prototype, "config", void 0);
39
+ __decorate([
40
+ I18next
41
+ ], ConfigHostElement.prototype, "i18next", void 0);
35
42
  /**
36
43
  * @internal
37
44
  */
@@ -69,7 +76,14 @@ export class BaseRoute extends ConfigHostElement {
69
76
  return __awaiter(this, void 0, void 0, function* () {
70
77
  this.isSubmitting = true;
71
78
  this.clearError();
72
- yield this.ensureConnection();
79
+ try {
80
+ yield this.ensureConnection();
81
+ }
82
+ catch (err) {
83
+ this.isSubmitting = false;
84
+ logger.error('Failed to establish connection during onSubmit.', err);
85
+ this.setError(this.toLocalisedText('ERROR_CONNECTION'));
86
+ }
73
87
  });
74
88
  }
75
89
  ensureConnection() {
@@ -96,10 +110,11 @@ export class BaseRoute extends ConfigHostElement {
96
110
  getSubRoutePath(routeName) {
97
111
  return this.config.hostPath !== '' ? `${this.config.hostPath}/${routeName}` : routeName;
98
112
  }
99
- queueOnBack(delay = defaultOnBackMS) {
113
+ queueOnBack(delay) {
114
+ var _a;
100
115
  setTimeout(() => {
101
116
  this.onBack();
102
- }, delay);
117
+ }, delay || ((_a = this.config.messageDelays) === null || _a === void 0 ? void 0 : _a.base) || defaultOnBackMS);
103
118
  }
104
119
  autofill() {
105
120
  var _a, _b, _c;
@@ -151,20 +166,31 @@ export class BaseRoute extends ConfigHostElement {
151
166
  this.credentialManager.storeCredentials(data);
152
167
  }
153
168
  }
154
- sendMessage(message, successFeedback = '', successCallback) {
169
+ sendMessage(message, successFeedback = '', successCallback, delayBack) {
155
170
  return __awaiter(this, void 0, void 0, function* () {
156
171
  yield this.ensureConnection();
157
172
  this.clearError();
158
- const result = yield this.connect.send(message);
159
- if (result.ERROR) {
160
- this.setError(result.ERROR.map((error) => error.TEXT).toString());
161
- return;
173
+ try {
174
+ const result = yield this.connect.send(message);
175
+ if (result.ERROR) {
176
+ this.setError(result.ERROR.map((error) => error.TEXT).toString());
177
+ return;
178
+ }
179
+ this.message = successFeedback;
180
+ successCallback && successCallback(result);
181
+ }
182
+ catch (err) {
183
+ this.isSubmitting = false;
184
+ logger.error('Failed to send message during onSubmit.', err);
185
+ this.setError(this.toLocalisedText('ERROR_SEND_MESSAGE_ON_SUBMIT'));
162
186
  }
163
- this.message = successFeedback;
164
- successCallback && successCallback(result);
165
- this.queueOnBack();
187
+ this.queueOnBack(delayBack);
188
+ this.isSubmitting = false;
166
189
  });
167
190
  }
191
+ toLocalisedText(text) {
192
+ return this.i18next.t(`${definition.name}:${text}`, { lng: this.i18next.language });
193
+ }
168
194
  }
169
195
  __decorate([
170
196
  Auth
@@ -257,7 +283,7 @@ export const organisationField = () => html `
257
283
  ?required="${(x) => (x.config.fields.organisation.required === false ? false : true)}"
258
284
  >
259
285
  <span class="form-title">
260
- ${(x) => { var _a; return (_a = x.config.fields.organisation.label) !== null && _a !== void 0 ? _a : 'Organisation'; }}
286
+ ${(x) => { var _a; return x.toLocalisedText((_a = x.config.fields.organisation.label) !== null && _a !== void 0 ? _a : 'ORGANISATION_TITLE'); }}
261
287
  </span>
262
288
  </zero-text-field>
263
289
  `)}
@@ -279,7 +305,9 @@ export const usernameField = () => html `
279
305
  title="${(x) => x.config.fields.username.title}"
280
306
  required
281
307
  >
282
- <span class="form-title">${(x) => { var _a; return (_a = x.config.fields.username.label) !== null && _a !== void 0 ? _a : 'Username'; }}</span>
308
+ <span class="form-title">
309
+ ${(x) => { var _a; return x.toLocalisedText((_a = x.config.fields.username.label) !== null && _a !== void 0 ? _a : 'FIELD_USERNAME_TITLE'); }}
310
+ </span>
283
311
  </zero-text-field>
284
312
  `;
285
313
  /**
@@ -296,7 +324,9 @@ export const emailField = () => html `
296
324
  :value="${sync((x) => x.email)}"
297
325
  required
298
326
  >
299
- <span class="form-title">${(x) => { var _a; return (_a = x.config.fields.email.label) !== null && _a !== void 0 ? _a : 'Email'; }}</span>
327
+ <span class="form-title">
328
+ ${(x) => { var _a; return x.toLocalisedText((_a = x.config.fields.email.label) !== null && _a !== void 0 ? _a : 'FIELD_EMAIL_TITLE'); }}
329
+ </span>
300
330
  </zero-text-field>
301
331
  `)}
302
332
  `;
@@ -313,12 +343,14 @@ export const passwordField = (label) => html `
313
343
  :value="${sync((x) => x.password)}"
314
344
  required
315
345
  >
316
- <span class="form-title">${(x) => { var _a; return (_a = label !== null && label !== void 0 ? label : x.config.fields.password.label) !== null && _a !== void 0 ? _a : 'Password'; }}</span>
346
+ <span class="form-title">
347
+ ${(x) => { var _a; return x.toLocalisedText((_a = label !== null && label !== void 0 ? label : x.config.fields.password.label) !== null && _a !== void 0 ? _a : 'FIELD_PASSWORD_TITLE'); }}
348
+ </span>
317
349
  </zero-text-field>
318
350
  `;
319
351
  const password2FieldMeta = {
320
- new: ['new-password', 'New Password'],
321
- confirmation: ['password-confirmation', 'Confirm Password'],
352
+ new: ['new-password', 'FIELD_PASSWORD_NEW_TITLE'],
353
+ confirmation: ['password-confirmation', 'FIELD_PASSWORD_CONFIRM_TITLE'],
322
354
  };
323
355
  /**
324
356
  * @internal
@@ -335,7 +367,7 @@ export const password2Field = (type) => {
335
367
  :value="${sync((x) => x.password2)}"
336
368
  required
337
369
  >
338
- <span class="form-title">${label}</span>
370
+ <span class="form-title">${(x) => x.toLocalisedText(label)}</span>
339
371
  </zero-text-field>
340
372
  `;
341
373
  };
@@ -408,7 +440,7 @@ export { LogoElement };
408
440
  /**
409
441
  * @internal
410
442
  */
411
- export const backButton = (binding) => html `
443
+ export const backButton = (binding, label) => html `
412
444
  <zero-button
413
445
  appearance="neutral-grey"
414
446
  type="button"
@@ -416,7 +448,7 @@ export const backButton = (binding) => html `
416
448
  @click=${binding}
417
449
  data-test-id="back"
418
450
  >
419
- Back
451
+ ${label}
420
452
  </zero-button>
421
453
  `;
422
454
  /**
@@ -442,7 +474,7 @@ export const showPasswordsCheckbox = () => html `
442
474
  name="show-passwords"
443
475
  data-test-id="show-passwords"
444
476
  >
445
- Show Passwords
477
+ ${(x) => x.toLocalisedText('FIELD_SHOW_PASSWORD_TITLE')}
446
478
  </zero-checkbox>
447
479
  `;
448
480
  /**
@@ -19,6 +19,7 @@ let ForgotPassword = class ForgotPassword extends BaseRoute {
19
19
  const _super = Object.create(null, {
20
20
  onSubmit: { get: () => super.onSubmit }
21
21
  });
22
+ var _a;
22
23
  return __awaiter(this, void 0, void 0, function* () {
23
24
  logger.debug('forgot password submission');
24
25
  yield _super.onSubmit.call(this);
@@ -27,7 +28,7 @@ let ForgotPassword = class ForgotPassword extends BaseRoute {
27
28
  */
28
29
  const returnUrl = `${location.protocol}//${hostEnv}/${this.getSubRoutePath('reset-password')}`;
29
30
  const message = this.messageBuilder.createForgotPasswordMessage(this.orgUsername, returnUrl);
30
- yield this.sendMessage(message, 'Please check your inbox for reset instructions.');
31
+ yield this.sendMessage(message, this.toLocalisedText('FORGOTTEN_PASSWORD_SUCCESS_MESSAGE'), undefined, (_a = this.config.messageDelays) === null || _a === void 0 ? void 0 : _a.forgotPassword);
31
32
  });
32
33
  }
33
34
  };
@@ -6,13 +6,14 @@ export const ForgotPasswordTemplate = html `
6
6
  <zero-card class="card-pd">
7
7
  <div class="column-content">
8
8
  <login-logo></login-logo>
9
- <div class="heading2">Forgotten Password</div>
10
- <div class="heading3">Enter your account username</div>
9
+ <div class="heading2">${(x) => x.toLocalisedText('FORGOTTEN_PASSWORD_TITLE')}</div>
10
+ <div class="heading3">${(x) => x.toLocalisedText('FORGOTTEN_PASSWORD_SUBTITLE')}</div>
11
11
  </div>
12
12
  <form @submit=${(x) => x.onSubmit()}>
13
13
  ${organisationField()} ${usernameField()}
14
14
  <div class="form-buttons">
15
- ${submitButton('Send Recovery Link')} ${backButton((x) => x.onBack())}
15
+ ${(x) => submitButton(x.toLocalisedText('FORGOTTEN_PASSWORD_SUBMIT_BUTTON'))}
16
+ ${(x) => backButton(() => x.onBack(), x.toLocalisedText('FORGOTTEN_PASSWORD_BACK_BUTTON'))}
16
17
  </div>
17
18
  <submitting-indicator is-submitting="${(x) => x.isSubmitting}"></submitting-indicator>
18
19
  <login-message
@@ -122,14 +122,14 @@ let LoginForm = class LoginForm extends BaseRoute {
122
122
  logger.debug('fetched IDPs', idps);
123
123
  // it no longer throws, check for 'error' manually
124
124
  if (!idps.length || (idps.length === 1 && ((_a = idps[0]) === null || _a === void 0 ? void 0 : _a.id) === 'error')) {
125
- this.setError('Failed to fetch identity providers.');
125
+ this.setError(this.toLocalisedText('LOGIN_FORM_ERROR_FETCH_IDENTITY_PROVIDERS'));
126
126
  }
127
127
  else {
128
128
  this.idps = idps;
129
129
  this.selectedIDP = (_c = (_b = this.idps) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.id;
130
130
  }
131
131
  })
132
- .catch(() => this.setError('Failed to fetch identity providers.'));
132
+ .catch(() => this.setError(this.toLocalisedText('LOGIN_FORM_ERROR_FETCH_IDENTITY_PROVIDERS')));
133
133
  }
134
134
  }
135
135
  get selectedIDPName() {
@@ -182,7 +182,7 @@ let LoginForm = class LoginForm extends BaseRoute {
182
182
  try {
183
183
  const { authToken } = yield this.auth.login(credentials);
184
184
  if (!authToken) {
185
- throw new Error('Unable to login. Try again later.');
185
+ throw new Error(this.toLocalisedText('LOGIN_FORM_ERROR_LOGIN'));
186
186
  }
187
187
  this.storeCredentials();
188
188
  let url = this.config.defaultRedirectUrl;
@@ -208,13 +208,13 @@ let LoginForm = class LoginForm extends BaseRoute {
208
208
  this.storeCredentials();
209
209
  this.session.setLocalStorageItem('refreshToken', err.received.REFRESH_AUTH_TOKEN);
210
210
  this.session.setLocalStorageItem('username', this.username);
211
- this.setError('Please check your inbox for your login link.');
211
+ this.setError(this.toLocalisedText('LOGIN_FORM_ERROR_HAS_MFA'));
212
212
  return;
213
213
  }
214
214
  if (this.config.fields.organisation &&
215
215
  this.config.fields.organisation.required !== false &&
216
216
  !this.organisation.length) {
217
- this.setError(err.message + 'Please fill in Comp Id.');
217
+ this.setError(err.message + this.toLocalisedText('LOGIN_FORM_ERROR_FILL_IN_COMP'));
218
218
  return;
219
219
  }
220
220
  this.setError(err.message + err.getMessageError());
@@ -225,7 +225,9 @@ let LoginForm = class LoginForm extends BaseRoute {
225
225
  });
226
226
  }
227
227
  get connectActionText() {
228
- return this.connect.isConnected ? 'Disconnect' : 'Connect';
228
+ return this.connect.isConnected
229
+ ? this.toLocalisedText('LOGIN_FORM_CONNECT_ACTION_WHEN_CONNECTED')
230
+ : this.toLocalisedText('LOGIN_FORM_CONNECT_ACTION_WHEN_DISCONNECTED');
229
231
  }
230
232
  get submitConnectDisabled() {
231
233
  return !this.host;
@@ -4,10 +4,10 @@ import { organisationField, passwordField, showPasswordsCheckbox, usernameField,
4
4
  const regularLogin = html `
5
5
  ${when((login) => !login.ssoToggled, html `
6
6
  ${organisationField()} ${usernameField()} ${passwordField()}
7
- <span class="case-warning">*Fields are case-sensitive</span>
7
+ <span class="case-warning">${(x) => x.toLocalisedText('LOGIN_FORM_CASE_WARNING')}</span>
8
8
  ${showPasswordsCheckbox()}
9
9
  <div class="form-buttons">
10
- ${(x) => submitButton('Login', 'submit-login', x.submitDisabled)}
10
+ ${(x) => submitButton(x.toLocalisedText('LOGIN_FORM_SUBMIT_BUTTON'), 'submit-login', x.submitDisabled)}
11
11
  <div class="links">
12
12
  <div class="password-links">
13
13
  ${when((x) => !x.config.omitRoutes.includes('forgot-password'), html `
@@ -16,7 +16,7 @@ const regularLogin = html `
16
16
  @click=${(x) => x.onNavigate(x.getSubRoutePath(`forgot-password`))}
17
17
  data-test-id="forgot-password"
18
18
  >
19
- Forgot Password?
19
+ ${(x) => x.toLocalisedText('LOGIN_FORM_FORGOT_PASSWORD_LINK')}
20
20
  </a>
21
21
  `)}
22
22
  ${when((x) => !x.config.omitRoutes.includes('reset-password'), html `
@@ -25,7 +25,7 @@ const regularLogin = html `
25
25
  @click=${(x) => x.onNavigate(x.getSubRoutePath(`reset-password`))}
26
26
  data-test-id="reset-password"
27
27
  >
28
- Change Password
28
+ ${(x) => x.toLocalisedText('LOGIN_FORM_CHANGE_PASSWORD_LINK')}
29
29
  </a>
30
30
  `)}
31
31
  </div>
@@ -36,7 +36,7 @@ const regularLogin = html `
36
36
  @click=${(x) => x.onNavigate(x.getSubRoutePath(`request-account`))}
37
37
  data-test-id="request-account"
38
38
  >
39
- Request Account
39
+ ${(x) => x.toLocalisedText('LOGIN_FORM_REQUEST_ACCOUNT_LINK')}
40
40
  </a>
41
41
  `)}
42
42
  </div>
@@ -54,7 +54,7 @@ const regularLogin = html `
54
54
  const ssoLogin = html `
55
55
  ${when((login) => login.ssoToggled, html `
56
56
  <div class="sso">
57
- <span class="form-title">Providers</span>
57
+ <span class="form-title">${(x) => x.toLocalisedText('LOGIN_FORM_SSO_FORM_TITLE')}</span>
58
58
  <zero-select
59
59
  name="sso"
60
60
  data-test-id="sso"
@@ -73,13 +73,13 @@ const ssoLogin = html `
73
73
  data-test-id="sso-login"
74
74
  ?disabled=${(x) => !x.selectedIDP}
75
75
  >
76
- SSO Login
76
+ ${(x) => x.toLocalisedText('LOGIN_FORM_SSO_BUTTON')}
77
77
  </zero-button>
78
78
  </div>
79
79
  `)}
80
80
  `;
81
81
  const httpModeEnabledText = html `
82
- <pre data-test-id="connect-http-mode">Http Polling Mode Enabled.</pre>
82
+ <pre data-test-id="connect-http-mode">${(x) => x.toLocalisedText('LOGIN_FORM_HTTP_MODE')}</pre>
83
83
  `;
84
84
  const httpMode = html `
85
85
  ${(x) => (x.connect.httpMode() ? httpModeEnabledText : null)}
@@ -112,7 +112,9 @@ export const LoginFormTemplate = html `
112
112
  data-test-id="connect-host"
113
113
  required
114
114
  >
115
- <span class="form-title">Host</span>
115
+ <span class="form-title">
116
+ ${(x) => x.toLocalisedText('LOGIN_FORM_CONNECT_FORM_TITLE')}
117
+ </span>
116
118
  </zero-text-field>
117
119
 
118
120
  ${httpMode}
@@ -127,7 +129,7 @@ export const LoginFormTemplate = html `
127
129
  <zero-card class="card-pd">
128
130
  <div class="column-content">
129
131
  <login-logo></login-logo>
130
- <div class="heading2">Login</div>
132
+ <div class="heading2">${(x) => x.toLocalisedText('LOGIN_FORM_TITLE')}</div>
131
133
  </div>
132
134
  <form
133
135
  id="login-form"
@@ -144,7 +146,9 @@ export const LoginFormTemplate = html `
144
146
  name="sso-toggle"
145
147
  data-test-id="sso-toggle"
146
148
  >
147
- ${(x) => (x.ssoToggled ? 'SSO Enabled' + x.selectedIDPName : 'Enable SSO?')}
149
+ ${(x) => x.ssoToggled
150
+ ? x.toLocalisedText('LOGIN_FORM_SSO_CHECKBOX_ENABLED_TITLE') + x.selectedIDPName
151
+ : x.toLocalisedText('LOGIN_FORM_SSO_CHECKBOX')}
148
152
  </zero-checkbox>
149
153
  `)}
150
154
  <login-message
@@ -8,7 +8,7 @@ NotFound = __decorate([
8
8
  customElement({
9
9
  name: 'foundation-login-not-found',
10
10
  template: html `
11
- <h1 data-test-id="not-found">Not found! 404</h1>
11
+ <h1 data-test-id="not-found">${(x) => x.toLocalisedText('NOT_FOUND_TITLE')}</h1>
12
12
  `,
13
13
  styles: commonLoginRouteStyles,
14
14
  })