@flarehr/apollo-super-selection 3.52.60060 → 3.53.61179

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 (162) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.css +1 -0
  2. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  3. package/dist/lib/apollo-super-selection/apollo-super-selection.js +1 -1
  4. package/dist/lib/apollo-super-selection/assets/icon-check.svg +3 -0
  5. package/dist/lib/apollo-super-selection/assets/icon-exclamation.svg +3 -0
  6. package/dist/lib/apollo-super-selection/assets/icon-information-circle.svg +3 -0
  7. package/dist/lib/apollo-super-selection/p-03373b03.system.js +1 -0
  8. package/dist/lib/apollo-super-selection/p-14885f78.system.js +15 -0
  9. package/dist/lib/apollo-super-selection/{p-381262c1.system.js → p-15f0e5eb.system.js} +1 -1
  10. package/dist/lib/apollo-super-selection/p-29c11183.js +15 -0
  11. package/dist/lib/apollo-super-selection/p-6c94de60.system.entry.js +69 -0
  12. package/dist/lib/apollo-super-selection/p-74f91404.entry.js +14 -0
  13. package/dist/lib/apollo-super-selection/p-86e3e03f.js +1 -0
  14. package/dist/lib/cjs/apollo-super-selection.cjs.js +3 -4
  15. package/dist/lib/cjs/{app-globals-45007120.js → app-globals-b1125d8c.js} +1 -1
  16. package/dist/lib/cjs/{datorama-akita-7f4b082a.js → datorama-akita-6c9cb8fb.js} +1005 -68
  17. package/dist/lib/cjs/loader.cjs.js +3 -4
  18. package/dist/lib/cjs/{fl-button_31.cjs.entry.js → sss-button_28.cjs.entry.js} +2099 -2167
  19. package/dist/lib/collection/apollo-super-selection.css +1 -0
  20. package/dist/lib/collection/collection-manifest.json +16 -28
  21. package/dist/lib/collection/components/app-host/loading-page.js +3 -3
  22. package/dist/lib/collection/components/app-host/super-selection-app-host.css +0 -4
  23. package/dist/lib/collection/components/app-host/super-selection-app-host.js +7 -19
  24. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.dto.js +69 -1
  25. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +9 -3
  26. package/dist/lib/collection/components/super-selection-app/app-state-pages/success.js +16 -21
  27. package/dist/lib/collection/components/super-selection-app/assets/icon-check.svg +3 -0
  28. package/dist/lib/collection/components/super-selection-app/assets/icon-exclamation.svg +3 -0
  29. package/dist/lib/collection/components/super-selection-app/assets/icon-information-circle.svg +3 -0
  30. package/dist/lib/collection/components/super-selection-app/consent/consent.js +57 -0
  31. package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +132 -0
  32. package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.js +6 -18
  33. package/dist/lib/collection/components/super-selection-app/funds/constants.js +50 -0
  34. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.js +31 -16
  35. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.store.js +10 -14
  36. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/default-fund/default-fund.js +36 -45
  37. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.js +40 -19
  38. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.js +45 -40
  39. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.js +104 -58
  40. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +53 -49
  41. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-not-supported.js +6 -16
  42. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-join-page.js +1 -1
  43. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund.store.js +1 -4
  44. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-iframe-builder.js +10 -4
  45. package/dist/lib/collection/components/super-selection-app/funds/slate-super/services/slate-iframe-builder.js +13 -4
  46. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-join-page.js +2 -3
  47. package/dist/lib/collection/components/super-selection-app/header-section/header-section.js +28 -0
  48. package/dist/lib/collection/components/super-selection-app/misc/button.js +146 -0
  49. package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.css +7 -0
  50. package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.js +359 -0
  51. package/dist/lib/collection/components/super-selection-app/misc/loading-indicator.js +52 -0
  52. package/dist/lib/collection/components/super-selection-app/services/australian-fund-lookup.service.js +8 -4
  53. package/dist/lib/collection/components/super-selection-app/services/event-tracking.service.js +20 -0
  54. package/dist/lib/collection/components/super-selection-app/services/existing-super-choice-info.service.js +95 -0
  55. package/dist/lib/collection/components/super-selection-app/services/navigation.service.js +8 -0
  56. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +6 -4
  57. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.js +71 -34
  58. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.store.js +10 -0
  59. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.js +94 -0
  60. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.js +89 -0
  61. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.js +67 -90
  62. package/dist/lib/collection/components/super-selection-app/super-selection-app.css +16 -4
  63. package/dist/lib/collection/components/super-selection-app/super-selection-app.js +32 -11
  64. package/dist/lib/esm/apollo-super-selection.js +3 -4
  65. package/dist/lib/esm/{app-globals-7ac1ffba.js → app-globals-c1f89805.js} +1 -1
  66. package/dist/lib/esm/{datorama-akita-79ce4385.js → datorama-akita-127aea91.js} +960 -28
  67. package/dist/lib/esm/loader.js +3 -4
  68. package/dist/lib/esm/{fl-button_31.entry.js → sss-button_28.entry.js} +2086 -2151
  69. package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
  70. package/dist/lib/esm-es5/{app-globals-7ac1ffba.js → app-globals-c1f89805.js} +1 -1
  71. package/dist/lib/esm-es5/datorama-akita-127aea91.js +15 -0
  72. package/dist/lib/esm-es5/loader.js +1 -1
  73. package/dist/lib/esm-es5/sss-button_28.entry.js +69 -0
  74. package/dist/lib/types/components/app-host/super-selection-app-host.d.ts +0 -3
  75. package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +30 -0
  76. package/dist/lib/types/components/super-selection-app/api/super-selection.api.d.ts +2 -1
  77. package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +19 -4
  78. package/dist/lib/types/components/super-selection-app/consent/consent.d.ts +9 -0
  79. package/dist/lib/types/components/super-selection-app/existing-choice/existing-choice.d.ts +12 -0
  80. package/dist/lib/types/components/super-selection-app/footer-section/footer-section.d.ts +0 -1
  81. package/dist/lib/types/components/super-selection-app/funds/constants.d.ts +3 -0
  82. package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.d.ts +1 -1
  83. package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.store.d.ts +4 -6
  84. package/dist/lib/types/components/super-selection-app/funds/custom-fund/default-fund/default-fund.d.ts +0 -2
  85. package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.d.ts +2 -1
  86. package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.d.ts +1 -0
  87. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.d.ts +7 -0
  88. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.d.ts +1 -0
  89. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.d.ts +0 -1
  90. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund.store.d.ts +0 -3
  91. package/dist/lib/types/components/super-selection-app/header-section/header-section.d.ts +4 -0
  92. package/dist/lib/types/components/super-selection-app/misc/button.d.ts +11 -0
  93. package/dist/lib/types/components/super-selection-app/misc/dropdown-async.d.ts +44 -0
  94. package/dist/lib/types/components/super-selection-app/misc/loading-indicator.d.ts +5 -0
  95. package/dist/lib/types/components/super-selection-app/services/australian-fund-lookup.service.d.ts +1 -0
  96. package/dist/lib/types/components/super-selection-app/services/event-tracking.service.d.ts +4 -0
  97. package/dist/lib/types/components/super-selection-app/services/existing-super-choice-info.service.d.ts +51 -0
  98. package/dist/lib/types/components/super-selection-app/services/navigation.service.d.ts +6 -0
  99. package/dist/lib/types/components/super-selection-app/services/super-selection-app.routes.d.ts +3 -2
  100. package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.d.ts +6 -3
  101. package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.store.d.ts +8 -0
  102. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.d.ts +9 -0
  103. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.d.ts +7 -0
  104. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-page.d.ts +0 -3
  105. package/dist/lib/types/components/super-selection-app/super-selection-app.d.ts +1 -1
  106. package/dist/lib/types/components.d.ts +146 -97
  107. package/package.json +12 -7
  108. package/dist/lib/apollo-super-selection/assets/logo-qsuper-square.png +0 -0
  109. package/dist/lib/apollo-super-selection/assets/logo-qsuper.png +0 -0
  110. package/dist/lib/apollo-super-selection/p-0623b20a.system.entry.js +0 -69
  111. package/dist/lib/apollo-super-selection/p-13573238.system.js +0 -15
  112. package/dist/lib/apollo-super-selection/p-342cee5a.js +0 -1
  113. package/dist/lib/apollo-super-selection/p-38f24f69.js +0 -1
  114. package/dist/lib/apollo-super-selection/p-64ebe17d.system.entry.js +0 -1
  115. package/dist/lib/apollo-super-selection/p-7dbe5a2f.system.js +0 -1
  116. package/dist/lib/apollo-super-selection/p-d82b00ed.system.js +0 -1
  117. package/dist/lib/apollo-super-selection/p-df9ce4b7.js +0 -15
  118. package/dist/lib/apollo-super-selection/p-f7a45412.entry.js +0 -1
  119. package/dist/lib/apollo-super-selection/p-fbe8c6d1.entry.js +0 -14
  120. package/dist/lib/cjs/delay-81aff2f1.js +0 -955
  121. package/dist/lib/cjs/fl-style-guide.cjs.entry.js +0 -90
  122. package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.css +0 -11
  123. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-not-supported.css +0 -23
  124. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-standard-choice-page.js +0 -62
  125. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-fund.store.js +0 -10
  126. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-standard-choice-page.js +0 -67
  127. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slatesuper-header.css +0 -0
  128. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slatesuper-header.js +0 -19
  129. package/dist/lib/collection/components/super-selection-app/notifications-section/notifications-section.js +0 -25
  130. package/dist/lib/collection/components/super-selection-app/services/notifications.service.js +0 -37
  131. package/dist/lib/collection/components/super-selection-app/services/notifications.store.js +0 -3
  132. package/dist/lib/collection/components/super-selection-app/services/selected-super-choice-info.service.js +0 -50
  133. package/dist/lib/collection/components/super-selection-app/standard-choice/api/standard-choice.model.js +0 -1
  134. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-qsuper-square.png +0 -0
  135. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-qsuper.png +0 -0
  136. package/dist/lib/collection/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.css +0 -18
  137. package/dist/lib/collection/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.js +0 -53
  138. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item.js +0 -296
  139. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.css +0 -70
  140. package/dist/lib/esm/delay-c0555599.js +0 -935
  141. package/dist/lib/esm/fl-style-guide.entry.js +0 -86
  142. package/dist/lib/esm-es5/datorama-akita-79ce4385.js +0 -15
  143. package/dist/lib/esm-es5/delay-c0555599.js +0 -1
  144. package/dist/lib/esm-es5/fl-button_31.entry.js +0 -69
  145. package/dist/lib/esm-es5/fl-style-guide.entry.js +0 -1
  146. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/button/button.css +0 -45
  147. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown/dropdown.css +0 -9
  148. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown-async/dropdown-async.css +0 -9
  149. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/loading-indicator/loading-indicator.css +0 -141
  150. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/promise-button/promise-button.css +0 -5
  151. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/style-guide/style-guide.css +0 -0
  152. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund-standard-choice-page.d.ts +0 -8
  153. package/dist/lib/types/components/super-selection-app/funds/slate-super/slate-fund.store.d.ts +0 -7
  154. package/dist/lib/types/components/super-selection-app/funds/slate-super/slate-standard-choice-page.d.ts +0 -8
  155. package/dist/lib/types/components/super-selection-app/funds/slate-super/slatesuper-header.d.ts +0 -3
  156. package/dist/lib/types/components/super-selection-app/notifications-section/notifications-section.d.ts +0 -5
  157. package/dist/lib/types/components/super-selection-app/services/notifications.service.d.ts +0 -15
  158. package/dist/lib/types/components/super-selection-app/services/notifications.store.d.ts +0 -14
  159. package/dist/lib/types/components/super-selection-app/services/selected-super-choice-info.service.d.ts +0 -18
  160. package/dist/lib/types/components/super-selection-app/standard-choice/api/standard-choice.model.d.ts +0 -3
  161. package/dist/lib/types/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.d.ts +0 -5
  162. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item.d.ts +0 -22
@@ -1,3 +1,4 @@
1
+ import { getAssetPath } from '@stencil/core';
1
2
  export const Slate = {
2
3
  Id: 'slate',
3
4
  Name: 'Slate Super',
@@ -31,3 +32,52 @@ export const PromotedFundIdList = [
31
32
  { dtoPropName: 'aware', id: Aware.Id },
32
33
  { dtoPropName: 'active', id: Active.Id }
33
34
  ];
35
+ export const getFundNameById = (id) => {
36
+ switch (id) {
37
+ case Slate.Id:
38
+ return Slate.Name;
39
+ case AustralianRetirementTrust.Id:
40
+ return AustralianRetirementTrust.Name;
41
+ case Aware.Id:
42
+ return Aware.Name;
43
+ case Active.Id:
44
+ return Active.Name;
45
+ default:
46
+ return;
47
+ }
48
+ };
49
+ export const getFundUsiById = (id) => {
50
+ switch (id) {
51
+ case Slate.Id:
52
+ return Slate.Usi;
53
+ case AustralianRetirementTrust.Id:
54
+ return;
55
+ case Aware.Id:
56
+ return;
57
+ case Active.Id:
58
+ return;
59
+ default:
60
+ return;
61
+ }
62
+ };
63
+ export const getLogoSrc = (id) => {
64
+ let logo = '';
65
+ switch (id) {
66
+ case Slate.Id:
67
+ logo = 'logo-slate.png';
68
+ break;
69
+ case AustralianRetirementTrust.Id:
70
+ logo = 'logo-art.svg';
71
+ break;
72
+ case Aware.Id:
73
+ logo = 'logo-aware.svg';
74
+ break;
75
+ case Active.Id:
76
+ logo = 'logo-active.svg';
77
+ break;
78
+ default:
79
+ return;
80
+ }
81
+ if (logo !== '')
82
+ return getAssetPath(`assets/${logo}`);
83
+ };
@@ -8,6 +8,7 @@ export class CustomFund {
8
8
  constructor() {
9
9
  this.currentCustomFund = customFundOptions[0];
10
10
  this.fundOptionsList = customFundOptions;
11
+ this.showFundOptionsSelection = false;
11
12
  }
12
13
  componentWillLoad() {
13
14
  let currentRoute = '';
@@ -22,24 +23,37 @@ export class CustomFund {
22
23
  navigationService.navigateInternally(this.history, currentRoute);
23
24
  }
24
25
  render() {
25
- return (h("div", { class: "container" },
26
- h("div", { class: "row justify-content-center" },
27
- h("div", { class: "col col-sm-10 col-md-7" },
28
- h("p", { class: "font-weight-bold text-center" }, "Choose your Super"),
29
- h("div", { class: "mb-4" },
30
- h("select", { class: "form-control", required: true, onChange: (ev) => {
31
- this.handleChange(ev.target.value.trim());
32
- } }, this.fundOptionsList.map((f) => (h("option", { value: f.value, selected: this.currentCustomFund.value === f.value }, f.label))))),
33
- h("slot", null)))));
34
- }
35
- handleChange(value) {
36
- const newFund = customFundOptions.find((item) => item.value === value) || {
37
- value: SuperSelectionAppRoutes.MyOwnFund
26
+ const ChevronDownIcon = () => {
27
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", class: "h-5 w-5 text-gray-500", viewBox: "0 0 20 20" },
28
+ h("path", { "fill-rule": "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", "clip-rule": "evenodd" })));
29
+ };
30
+ const CheckIcon = () => {
31
+ return (h("svg", { class: "h-5 w-5 fill-primary-base", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20" },
32
+ h("path", { "fill-rule": "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", "clip-rule": "evenodd" })));
38
33
  };
39
- navigationService.navigateInternally(this.history, newFund.value);
34
+ return (h("div", { class: "max-w-560 relative" },
35
+ h("label", { class: "font-medium text-gray-700 text-sm" }, "Which fund would you like to nominate?"),
36
+ h("div", { class: "mt-1 mb-4" },
37
+ h("button", { type: "button", class: "bg-white relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-primary-focus focus:border-primary-base text-sm", onClick: () => (this.showFundOptionsSelection = !this.showFundOptionsSelection) },
38
+ h("span", { class: {
39
+ 'block truncate': true,
40
+ 'text-gray-500': this.showFundOptionsSelection
41
+ } }, this.showFundOptionsSelection ? 'Select' : this.currentCustomFund.label),
42
+ h("span", { class: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none" },
43
+ h(ChevronDownIcon, null))),
44
+ this.showFundOptionsSelection && (h("ul", { class: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none text-sm" }, this.fundOptionsList.map((f) => (h("li", { class: "text-gray-900 cursor-default select-none relative py-2 pl-3 pr-9 hover:bg-primary-hover", onClick: () => {
45
+ this.showFundOptionsSelection = !this.showFundOptionsSelection;
46
+ navigationService.navigateInternally(this.history, f.value);
47
+ } },
48
+ h("span", { class: {
49
+ 'block truncate': true,
50
+ 'font-semibold': this.currentCustomFund === f
51
+ } }, f.label),
52
+ this.currentCustomFund === f && (h("span", { class: "absolute inset-y-0 right-0 flex items-center pr-4" },
53
+ h(CheckIcon, null))))))))),
54
+ h("slot", null)));
40
55
  }
41
56
  static get is() { return "sss-custom-fund"; }
42
- static get assetsDirs() { return ["assets"]; }
43
57
  static get properties() { return {
44
58
  "history": {
45
59
  "type": "unknown",
@@ -64,7 +78,8 @@ export class CustomFund {
64
78
  }; }
65
79
  static get states() { return {
66
80
  "currentCustomFund": {},
67
- "fundOptionsList": {}
81
+ "fundOptionsList": {},
82
+ "showFundOptionsSelection": {}
68
83
  }; }
69
84
  }
70
85
  injectHistory(CustomFund);
@@ -3,20 +3,17 @@ import * as O from 'fp-ts/Option';
3
3
  import { SuperSelectionAppRoutes } from '../../services/super-selection-app.routes';
4
4
  var CustomFundTypes;
5
5
  (function (CustomFundTypes) {
6
- CustomFundTypes["MyOwnFund"] = "My Own Fund";
7
- CustomFundTypes["DefaultFund"] = "Default Fund";
8
- CustomFundTypes["SelfManagedFund"] = "Self Managed Fund";
6
+ CustomFundTypes["MyOwnFund"] = "Your current super fund";
7
+ CustomFundTypes["DefaultFund"] = "Your employer's default fund";
8
+ CustomFundTypes["SelfManagedFund"] = "Your self-managed super fund";
9
9
  })(CustomFundTypes || (CustomFundTypes = {}));
10
10
  export const initialStateCustomFund = {
11
11
  continueAllowed: false,
12
12
  nextRoute: '/',
13
13
  myOwnFundForm: {
14
14
  fundUsi: O.none,
15
- memberNumber: O.none,
16
- standardChoiceFormSignature: O.none
17
- },
18
- defaultFundForm: {
19
- standardChoiceFormSignature: ''
15
+ fundName: O.none,
16
+ memberNumber: O.none
20
17
  },
21
18
  selfManagedFundForm: {
22
19
  fundName: '',
@@ -29,8 +26,7 @@ export const initialStateCustomFund = {
29
26
  city: '',
30
27
  bankAccountName: '',
31
28
  bsb: '',
32
- bankAccountNumber: '',
33
- standardChoiceFormSignature: ''
29
+ bankAccountNumber: ''
34
30
  },
35
31
  currentCustomFundType: CustomFundTypes.MyOwnFund,
36
32
  customFunds: [
@@ -38,13 +34,13 @@ export const initialStateCustomFund = {
38
34
  label: CustomFundTypes.MyOwnFund,
39
35
  value: SuperSelectionAppRoutes.MyOwnFund
40
36
  },
41
- {
42
- label: CustomFundTypes.DefaultFund,
43
- value: SuperSelectionAppRoutes.DefaultFund
44
- },
45
37
  {
46
38
  label: CustomFundTypes.SelfManagedFund,
47
39
  value: SuperSelectionAppRoutes.SelfManagedFund
40
+ },
41
+ {
42
+ label: CustomFundTypes.DefaultFund,
43
+ value: SuperSelectionAppRoutes.DefaultFund
48
44
  }
49
45
  ]
50
46
  };
@@ -1,13 +1,11 @@
1
- import { Component, h, Host, Prop, State } from '@stencil/core';
1
+ import { Component, getAssetPath, h, Host, Prop, State } from '@stencil/core';
2
2
  import * as O from 'fp-ts/lib/Option';
3
3
  import australianFundLookupService from '../../../services/australian-fund-lookup.service';
4
4
  import { EventTrackingService } from '../../../services/event-tracking.service';
5
5
  import navigationService from '../../../services/navigation.service';
6
- import notificationsService from '../../../services/notifications.service';
7
6
  import { SuperSelectionAppRoutes } from '../../../services/super-selection-app.routes';
8
7
  import superSelectionAppService from '../../../services/super-selection-app.service';
9
8
  import customFundChoiceApi from '../api/custom-fund-choice.api';
10
- import customFundState from '../custom-fund.store';
11
9
  export class DefaultFund {
12
10
  constructor() {
13
11
  this.defaultFundProductName = 'Loading fund...';
@@ -19,65 +17,59 @@ export class DefaultFund {
19
17
  return;
20
18
  }
21
19
  this.isDefaultFundExists = true;
22
- const defaultFundSearchResult = await australianFundLookupService.getFundByUsiAsync(defaultFundUsi.value);
20
+ const defaultFundSearchResult = await australianFundLookupService.getActiveFundByUsiAsync(defaultFundUsi.value);
23
21
  if (O.isNone(defaultFundSearchResult)) {
24
22
  this.isInvalidDefaultFund = true;
25
- notificationsService.showErrorNotification({
26
- title: 'Something is not right',
27
- description: `Couldn't find information about the configured default fund (USI ${defaultFundUsi.value})`
28
- });
29
23
  return;
30
24
  }
31
25
  this.defaultFund = defaultFundSearchResult.value;
32
26
  this.defaultFundProductName = defaultFundSearchResult.value.productName;
33
27
  }
34
28
  componentDidLoad() {
29
+ var _a, _b, _c, _d;
35
30
  return this.eventTrackingService.TrackDefaultSuperFundDetailViewedAsync({
36
- fundUsi: this.defaultFund.usi,
37
- fundName: this.defaultFund.productName,
31
+ fundUsi: (_b = (_a = this.defaultFund) === null || _a === void 0 ? void 0 : _a.usi) !== null && _b !== void 0 ? _b : '',
32
+ fundName: (_d = (_c = this.defaultFund) === null || _c === void 0 ? void 0 : _c.productName) !== null && _d !== void 0 ? _d : '',
38
33
  promotedFundsShown: superSelectionAppService.promotedFunds
39
34
  });
40
35
  }
41
36
  render() {
42
- const NoDefaultFundBlock = () => (h("div", { class: "card p-4" },
43
- h("p", { class: "font-weight-bold" }, "No Default Fund"),
44
- h("p", { class: "mb-4 small" }, "It looks like your employer has not yet defined a default fund. Please contact them if you wish to choose your company's default fund.")));
45
- const DefaultFundBlock = (props) => [
46
- h("div", { class: "card p-4" },
47
- h("p", { class: "font-weight-bold" }, "Default Fund"),
48
- h("p", { class: "mb-4 small" }, "Almost there... all you have to do now is review the fund below, complete and sign the super choice form and save. Your application to join the fund is subject to Trustee approval."),
49
- h("p", { class: "font-weight-bold mt-3" }, "Default Fund Name"),
50
- h("p", null, props.defaultFundName)),
51
- h("sss-standard-choice-form", { onStandardChoiceFormSignatureUpdated: (event) => {
52
- customFundState.defaultFundForm = Object.assign(Object.assign({}, customFundState.defaultFundForm), event.detail);
53
- } })
54
- ];
55
- return (h(Host, { class: "d-flex flex-fill" },
56
- h("sss-custom-fund", { class: "flex-fill" },
57
- h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: {
58
- 'was-validated': this.formState === 'validated'
59
- }, ref: (el) => (this.formElement = el) }, this.isDefaultFundExists ? (h(DefaultFundBlock, { defaultFundName: this.defaultFundProductName })) : (h(NoDefaultFundBlock, null))),
60
- h("div", { class: "mt-4" },
61
- h("sss-notifications-section", null)),
62
- h("div", { class: "d-flex mt-4" },
63
- h("div", { class: "flex-grow-1 w-50" },
64
- h("div", { class: "mr-2" },
65
- h("fl-button", { onClick: () => navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage), isBlockElement: true, variant: "secondary" },
66
- h("span", null, "Back")))),
67
- h("div", { class: "flex-grow-1 w-50" }, this.isDefaultFundExists && (h("div", { class: "ml-2" },
68
- h("fl-promise-button", { isBlockElement: true, disabled: this.isInvalidDefaultFund, promiseFn: () => this.handleSubmitForm() },
69
- h("span", null, "Save and continue")))))))));
37
+ return (h(Host, null,
38
+ h("sss-header-section", { currentPage: "own-fund" }),
39
+ h("div", { class: "flex justify-center mt-11" },
40
+ h("sss-custom-fund", null,
41
+ h("div", { class: "p-4 sm:p-6 border shadow-sm rounded-lg" },
42
+ h("p", { class: "sm:text-lg font-bold mb-3" }, "Fund details"),
43
+ h("div", { class: "bg-yellow-50 border-l-4 border-yellow-400 p-4 my-3" },
44
+ h("div", { class: "flex" },
45
+ h("div", { class: "flex-shrink-0" },
46
+ h("img", { class: "h-5 w-5", src: getAssetPath('assets/icon-exclamation.svg') })),
47
+ h("div", { class: "ml-3 text-sm text-yellow-700 leading-5" }, this.isDefaultFundExists && !this.isInvalidDefaultFund ? (h("span", null, "By choosing to join your employer\u2019s default super fund, you acknowledge that your application to join is subject to Trustee approval.")) : (h("span", null, "It looks like your employer has not specified a default fund, please contact them if you\u2019d like to use your company\u2019s defaut fund."))))),
48
+ this.isDefaultFundExists && !this.isInvalidDefaultFund && (h("div", null,
49
+ h("div", { class: "mt-3" },
50
+ h("label", { class: "text-sm font-medium text-gray-700" }, "Fund Name"),
51
+ h("div", { class: "mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-sm" }, this.defaultFundProductName)),
52
+ h("div", { class: "mt-3" },
53
+ h("label", { class: "text-sm font-medium text-gray-700" }, "Fund USI"),
54
+ h("div", { class: "mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-sm" }, this.defaultFund.usi))))),
55
+ h("div", { class: "flex justify-center mt-8" },
56
+ h("div", { class: "sm:max-w-320 w-full" },
57
+ this.isDefaultFundExists && !this.isInvalidDefaultFund && (h("div", { class: "mb-4" },
58
+ h("sss-button", { fillWidth: true, promiseFn: () => this.handleSubmitForm() }, "Continue"))),
59
+ h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage },
60
+ h("sss-button", { fillWidth: true, variant: "secondary" }, "Back"))))))));
70
61
  }
71
62
  async handleSubmitForm() {
72
63
  if (this.isInvalidDefaultFund) {
73
64
  return;
74
65
  }
75
- this.formState = 'validated';
76
- if (this.formElement.checkValidity()) {
77
- await customFundChoiceApi.submitDefaultFundChoiceAsync(customFundState.defaultFundForm);
78
- superSelectionAppService.markSuperSelectionAsSubmitted();
79
- navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.Success);
80
- }
66
+ navigationService.navigateInternallyToStandardChoice({
67
+ history: this.history,
68
+ fundName: `Employer’s default fund`,
69
+ handleSubmitFn: async (standardChoiceFormSignature) => {
70
+ await customFundChoiceApi.submitDefaultFundChoiceAsync({ standardChoiceFormSignature });
71
+ }
72
+ });
81
73
  }
82
74
  static get is() { return "sss-default-fund"; }
83
75
  static get properties() { return {
@@ -103,7 +95,6 @@ export class DefaultFund {
103
95
  }
104
96
  }; }
105
97
  static get states() { return {
106
- "formState": {},
107
98
  "defaultFundProductName": {}
108
99
  }; }
109
100
  }
@@ -18,24 +18,28 @@ export class MyOwnFundInputs {
18
18
  }
19
19
  render() {
20
20
  return (h("div", null,
21
- h("div", { class: "" },
22
- h("label", { class: "mb-2 font-weight-bold" }, "Superannuation Fund Name"),
23
- h("fl-dropdown-async", { searchFunction: this.searchFundsAsync, minSearchStringLength: this.MIN_SEARCH_STRING_LENGTH, required: true, requiredValidationMessage: "Select a fund", placeholder: `Search by name or USI (type at least ${this.MIN_SEARCH_STRING_LENGTH} characters)`, value: this.selectedOption, onValueChanged: (ev) => {
24
- this.selectedOption = ev.detail;
25
- this.updateFundUsi(ev.detail.value.toString());
26
- } }),
27
- h("div", { class: "invalid-feedback" }, "Select a fund"),
28
- O.isSome(this.myOwnFundForm.fundUsi) && (h("div", null,
29
- h("label", { class: "mb-2 mt-3 font-weight-bold" }, "Superannuation Fund USI"),
30
- h("p", { class: "mb-0" }, this.myOwnFundForm.fundUsi.value),
31
- h("p", { class: "small mt-1" }, "Please ensure this is the correct fund USI as some funds have similar names")))),
32
- h("div", { class: "mt-4" },
33
- h("label", { class: "mb-2 font-weight-bold" }, "Member Number"),
34
- h("input", { placeholder: "Enter your member number", type: "text", class: "form-control", required: true, pattern: "[A-Za-z0-9]{4,16}", name: "memberNumber", id: "memberNumber", value: O.toUndefined(customFundState.myOwnFundForm.memberNumber), onChange: (ev) => this.updateMemberNumber(ev.target.value.trim()) }),
35
- h("div", { class: "invalid-feedback" }, "Enter a valid member number (only numbers and / or letters)"))));
21
+ h("div", null,
22
+ h("label", { class: "text-sm font-medium text-gray-700" }, "Fund name"),
23
+ h("div", { class: "mt-1" },
24
+ h("sss-dropdown-async", { searchFunction: this.searchFundsAsync, minSearchStringLength: this.MIN_SEARCH_STRING_LENGTH, required: true, requiredValidationMessage: "Select a fund", placeholder: `Type to search by name or USI...`, value: this.selectedOption, onValueChanged: (ev) => {
25
+ this.selectedOption = ev.detail;
26
+ this.updateFund(ev.detail);
27
+ }, showValidationErrors: this.showValidationErrors })),
28
+ O.isSome(this.myOwnFundForm.fundUsi) && (h("div", { class: "mt-3" },
29
+ h("label", { class: "text-sm font-medium text-gray-700" }, "Fund USI"),
30
+ h("div", { class: "mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-sm" }, this.myOwnFundForm.fundUsi.value)))),
31
+ h("div", { class: "mt-3" },
32
+ h("label", { class: "text-sm font-medium text-gray-700" }, "Member number"),
33
+ h("div", { class: "mt-1" },
34
+ h("input", { type: "text", class: {
35
+ 'shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-sm border-gray-300 rounded-md': true,
36
+ 'invalid:border-red-300 invalid:text-red-900 invalid:focus:ring-red-500 invalid:focus:border-red-500': this
37
+ .showValidationErrors
38
+ }, required: true, pattern: "[A-Za-z0-9]{4,16}", name: "memberNumber", id: "memberNumber", value: O.toUndefined(customFundState.myOwnFundForm.memberNumber), onChange: (ev) => this.updateMemberNumber(ev.target.value.trim()) }),
39
+ h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid member number (only numbers and / or letters)")))));
36
40
  }
37
- updateFundUsi(usi) {
38
- this.formChanged.emit({ fundUsi: O.some(usi) });
41
+ updateFund(fund) {
42
+ this.formChanged.emit({ fundUsi: O.some(fund.value), fundName: O.some(fund.label) });
39
43
  }
40
44
  updateMemberNumber(memberNumber) {
41
45
  this.formChanged.emit({ memberNumber: O.some(memberNumber) });
@@ -47,7 +51,7 @@ export class MyOwnFundInputs {
47
51
  "mutable": false,
48
52
  "complexType": {
49
53
  "original": "MyOwnFundFormState",
50
- "resolved": "{ fundUsi: Option<string>; memberNumber: Option<string>; standardChoiceFormSignature: Option<string>; }",
54
+ "resolved": "{ fundUsi: Option<string>; fundName: Option<string>; memberNumber: Option<string>; }",
51
55
  "references": {
52
56
  "MyOwnFundFormState": {
53
57
  "location": "import",
@@ -61,6 +65,23 @@ export class MyOwnFundInputs {
61
65
  "tags": [],
62
66
  "text": ""
63
67
  }
68
+ },
69
+ "showValidationErrors": {
70
+ "type": "boolean",
71
+ "mutable": false,
72
+ "complexType": {
73
+ "original": "boolean",
74
+ "resolved": "boolean",
75
+ "references": {}
76
+ },
77
+ "required": false,
78
+ "optional": false,
79
+ "docs": {
80
+ "tags": [],
81
+ "text": ""
82
+ },
83
+ "attribute": "show-validation-errors",
84
+ "reflect": false
64
85
  }
65
86
  }; }
66
87
  static get states() { return {
@@ -78,7 +99,7 @@ export class MyOwnFundInputs {
78
99
  },
79
100
  "complexType": {
80
101
  "original": "Partial<MyOwnFundFormState>",
81
- "resolved": "{ fundUsi?: None | Some<string> | undefined; memberNumber?: None | Some<string> | undefined; standardChoiceFormSignature?: None | Some<string> | undefined; }",
102
+ "resolved": "{ fundUsi?: None | Some<string> | undefined; fundName?: None | Some<string> | undefined; memberNumber?: None | Some<string> | undefined; }",
82
103
  "references": {
83
104
  "Partial": {
84
105
  "location": "global"
@@ -1,4 +1,4 @@
1
- import { Component, h, Host, Prop, State } from '@stencil/core';
1
+ import { Component, getAssetPath, h, Host, Prop, State } from '@stencil/core';
2
2
  import { injectHistory } from '@stencil/router';
3
3
  import { pipe } from 'fp-ts/lib/function';
4
4
  import * as O from 'fp-ts/Option';
@@ -11,6 +11,7 @@ import customFundState from '../custom-fund.store';
11
11
  export class MyOwnFund {
12
12
  constructor() {
13
13
  this.isNotAllInformationProvidedMessageVisible = false;
14
+ this.isSubmitDisabled = true;
14
15
  this.eventTrackingService = EventTrackingService.Instance;
15
16
  }
16
17
  componentDidLoad() {
@@ -19,33 +20,34 @@ export class MyOwnFund {
19
20
  });
20
21
  }
21
22
  render() {
22
- return (h(Host, { class: "d-flex flex-fill" },
23
- h("sss-custom-fund", { class: "flex-fill" },
24
- h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: {
25
- 'was-validated': this.formState === 'validated'
26
- }, ref: (el) => (this.formElement = el) },
27
- h("div", { class: "card p-4" },
28
- h("p", { class: "font-weight-bold" }, "Fund details"),
29
- h("p", { class: "text-warning mb-4 small" }, "Make sure you are already a member of the fund before completing this step."),
30
- h("sss-my-own-fund-inputs", { myOwnFundForm: customFundState.myOwnFundForm, onFormChanged: (event) => {
31
- customFundState.myOwnFundForm = Object.assign(Object.assign({}, customFundState.myOwnFundForm), event.detail);
32
- this.isNotAllInformationProvidedMessageVisible = false;
33
- } })),
34
- h("sss-standard-choice-form", { onStandardChoiceFormSignatureUpdated: (event) => {
35
- customFundState.myOwnFundForm = Object.assign(Object.assign({}, customFundState.myOwnFundForm), { standardChoiceFormSignature: O.fromNullable(event.detail.standardChoiceFormSignature) });
36
- } })),
37
- h("div", { class: "mt-4" },
38
- h("sss-notifications-section", null)),
39
- this.isNotAllInformationProvidedMessageVisible && (h("div", { class: "mt-4 alert alert-danger", role: "alert" }, "All fields are required to complete submission. Make sure you have selected a fund.")),
40
- h("div", { class: "d-flex mt-4" },
41
- h("div", { class: "flex-grow-1 w-50" },
42
- h("div", { class: "mr-2" },
43
- h("fl-button", { onClick: () => navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage), isBlockElement: true, variant: "secondary" },
44
- h("span", null, "Back")))),
45
- h("div", { class: "flex-grow-1 w-50" },
46
- h("div", { class: "ml-2" },
47
- h("fl-promise-button", { isBlockElement: true, promiseFn: () => this.handleSubmitForm() },
48
- h("span", null, "Save and continue"))))))));
23
+ return (h(Host, null,
24
+ h("sss-header-section", { currentPage: "own-fund" }),
25
+ h("div", { class: "flex justify-center mt-11" },
26
+ h("sss-custom-fund", null,
27
+ h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: {
28
+ 'was-validated': this.formState === 'validated'
29
+ }, ref: (el) => (this.formElement = el), onInput: (_) => (this.isSubmitDisabled = !this.formElement.checkValidity()) },
30
+ h("div", { class: "p-4 sm:p-6 border shadow-sm rounded-lg" },
31
+ h("p", { class: "sm:text-lg font-bold mb-3" }, "Fund details"),
32
+ h("div", { class: "bg-yellow-50 border-l-4 border-yellow-400 p-4 mb-3 sm:mb-4" },
33
+ h("div", { class: "flex" },
34
+ h("div", { class: "flex-shrink-0" },
35
+ h("img", { class: "h-5 w-5", src: getAssetPath('assets/icon-exclamation.svg') })),
36
+ h("div", { class: "ml-2" },
37
+ h("ul", { class: "list-disc list-outside ml-6 space-y-2 text-sm text-yellow-700 leading-5" },
38
+ h("li", null, "Make sure you are a current member of the fund before completing this step."),
39
+ h("li", null, "Please check that the fund USI is correct as some funds have similar names."))))),
40
+ h("sss-my-own-fund-inputs", { myOwnFundForm: customFundState.myOwnFundForm, showValidationErrors: this.formState === 'validated', onFormChanged: (event) => {
41
+ customFundState.myOwnFundForm = Object.assign(Object.assign({}, customFundState.myOwnFundForm), event.detail);
42
+ this.isNotAllInformationProvidedMessageVisible = false;
43
+ } }),
44
+ this.isNotAllInformationProvidedMessageVisible && (h("div", { class: "mt-4 rounded-md bg-red-50 p-4 text-sm text-red-700" }, "All fields are required to complete submission. Make sure you have selected a fund."))),
45
+ h("div", { class: "flex justify-center mt-8" },
46
+ h("div", { class: "sm:max-w-320 w-full" },
47
+ h("div", { class: "mb-4" },
48
+ h("sss-button", { fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Continue")),
49
+ h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage },
50
+ h("sss-button", { fillWidth: true, variant: "secondary" }, "Back")))))))));
49
51
  }
50
52
  async handleSubmitForm() {
51
53
  this.formState = 'validated';
@@ -53,20 +55,23 @@ export class MyOwnFund {
53
55
  return;
54
56
  }
55
57
  const isAllInformationProvided = O.isSome(customFundState.myOwnFundForm.fundUsi) &&
56
- O.isSome(customFundState.myOwnFundForm.memberNumber) &&
57
- O.isSome(customFundState.myOwnFundForm.standardChoiceFormSignature);
58
+ O.isSome(customFundState.myOwnFundForm.memberNumber);
58
59
  if (!isAllInformationProvided) {
59
60
  this.isNotAllInformationProvidedMessageVisible = true;
60
61
  return;
61
62
  }
62
- const customFundChoiceDto = {
63
- fundUsi: this.getOrError(customFundState.myOwnFundForm.fundUsi),
64
- memberNumber: this.getOrError(customFundState.myOwnFundForm.memberNumber),
65
- standardChoiceFormSignature: this.getOrError(customFundState.myOwnFundForm.standardChoiceFormSignature)
66
- };
67
- await customFundChoiceApi.submitCustomFundChoiceAsync(customFundChoiceDto);
68
- superSelectionAppService.markSuperSelectionAsSubmitted();
69
- navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.Success);
63
+ navigationService.navigateInternallyToStandardChoice({
64
+ history: this.history,
65
+ fundName: this.getOrError(customFundState.myOwnFundForm.fundName),
66
+ handleSubmitFn: async (standardChoiceFormSignature) => {
67
+ const customFundChoiceDto = {
68
+ fundUsi: this.getOrError(customFundState.myOwnFundForm.fundUsi),
69
+ memberNumber: this.getOrError(customFundState.myOwnFundForm.memberNumber),
70
+ standardChoiceFormSignature
71
+ };
72
+ await customFundChoiceApi.submitCustomFundChoiceAsync(customFundChoiceDto);
73
+ }
74
+ });
70
75
  }
71
76
  getOrError(option) {
72
77
  return pipe(option, O.getOrElse(() => {
@@ -74,7 +79,6 @@ export class MyOwnFund {
74
79
  }));
75
80
  }
76
81
  static get is() { return "sss-my-own-fund"; }
77
- static get assetsDirs() { return ["assets"]; }
78
82
  static get properties() { return {
79
83
  "history": {
80
84
  "type": "unknown",
@@ -99,7 +103,8 @@ export class MyOwnFund {
99
103
  }; }
100
104
  static get states() { return {
101
105
  "formState": {},
102
- "isNotAllInformationProvidedMessageVisible": {}
106
+ "isNotAllInformationProvidedMessageVisible": {},
107
+ "isSubmitDisabled": {}
103
108
  }; }
104
109
  }
105
110
  injectHistory(MyOwnFund);