@flarehr/apollo-super-selection 1.3.65232 → 1.4.32906
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.
- package/dist/lib/apollo-super-selection/apollo-super-selection.css +1 -1
- package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
- package/dist/lib/apollo-super-selection/apollo-super-selection.js +1 -1
- package/dist/lib/apollo-super-selection/p-2054e932.system.entry.js +69 -0
- package/dist/lib/apollo-super-selection/{p-ef3afa00.system.entry.js → p-22939048.system.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/p-24d6e2b8.js +1 -0
- package/dist/lib/apollo-super-selection/{p-02f24922.system.entry.js → p-2b42304a.system.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-9c855634.entry.js → p-33eca162.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/p-4e871154.entry.js +1 -0
- package/dist/lib/apollo-super-selection/{p-6ac8791e.system.entry.js → p-53b231f0.system.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-b89b68db.entry.js → p-5c73c587.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-fcb4050d.entry.js → p-69bbf1dd.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-44bec843.system.js → p-71ca4cf8.system.js} +1 -1
- package/dist/lib/apollo-super-selection/p-9101bd39.entry.js +14 -0
- package/dist/lib/apollo-super-selection/p-97188c78.system.js +1 -0
- package/dist/lib/apollo-super-selection/{p-23cfdd82.entry.js → p-9d2a7c0e.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/p-a0063575.system.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-b00f648b.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-bd6e6a8f.system.js +1 -0
- package/dist/lib/apollo-super-selection/p-c775c0e4.system.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-cd3ed541.system.js +1 -0
- package/dist/lib/apollo-super-selection/{p-51c6dd08.js → p-db0bded8.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-f29066b9.system.entry.js → p-e957b393.system.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-7a89efaf.js → p-fdadb647.js} +1 -1
- package/dist/lib/cjs/apollo-super-selection.cjs.js +1 -1
- package/dist/lib/cjs/custom-fund-choice.api-293c1ace.js +3209 -0
- package/dist/lib/cjs/loader.cjs.js +1 -1
- package/dist/lib/cjs/{sss-button_34.cjs.entry.js → sss-button_32.cjs.entry.js} +577 -3838
- package/dist/lib/cjs/sss-super-byof-host.cjs.entry.js +111 -0
- package/dist/lib/collection/apollo-super-selection.css +1 -1
- package/dist/lib/collection/collection-manifest.json +6 -9
- package/dist/lib/collection/components/super-byof/super-byof-types.js +1 -0
- package/dist/lib/collection/components/super-byof/super-byof.js +139 -0
- package/dist/lib/collection/components/super-campaign/super-campaign.js +15 -18
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.js +5 -5
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/smsf-engagement-step-host.js +161 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/smsf-engagement-step-types.js +1 -0
- package/dist/lib/collection/components/super-selection-app/header-section/header-section.js +24 -5
- package/dist/lib/collection/components/super-selection-app/services/event-tracking.service.js +10 -0
- package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +4 -2
- package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +4 -0
- package/dist/lib/collection/components/super-selection-app/services/super-selection.store.js +1 -0
- package/dist/lib/collection/components/super-smsf/super-smsf-types.js +1 -0
- package/dist/lib/collection/components/super-smsf/super-smsf.form.js +1 -0
- package/dist/lib/collection/components/super-smsf/super-smsf.js +166 -0
- package/dist/lib/esm/{active-router-5e40c0f8.js → active-router-d18b36fb.js} +1 -1
- package/dist/lib/esm/apollo-super-selection.js +2 -2
- package/dist/lib/esm/context-consumer.entry.js +1 -1
- package/dist/lib/esm/custom-fund-choice.api-42801d64.js +3188 -0
- package/dist/lib/esm/{index-189b2180.js → index-107d7c24.js} +1 -1
- package/dist/lib/esm/loader.js +2 -2
- package/dist/lib/esm/{sss-button_34.entry.js → sss-button_32.entry.js} +374 -3633
- package/dist/lib/esm/sss-super-byof-host.entry.js +107 -0
- package/dist/lib/esm/stencil-async-content.entry.js +1 -1
- package/dist/lib/esm/stencil-route-title.entry.js +2 -2
- package/dist/lib/esm/stencil-router-prompt.entry.js +2 -2
- package/dist/lib/esm/stencil-router-redirect.entry.js +2 -2
- package/dist/lib/esm-es5/{active-router-5e40c0f8.js → active-router-d18b36fb.js} +1 -1
- package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
- package/dist/lib/esm-es5/context-consumer.entry.js +1 -1
- package/dist/lib/esm-es5/custom-fund-choice.api-42801d64.js +1 -0
- package/dist/lib/esm-es5/{index-189b2180.js → index-107d7c24.js} +1 -1
- package/dist/lib/esm-es5/loader.js +1 -1
- package/dist/lib/esm-es5/sss-button_32.entry.js +69 -0
- package/dist/lib/esm-es5/sss-super-byof-host.entry.js +1 -0
- package/dist/lib/esm-es5/stencil-async-content.entry.js +1 -1
- package/dist/lib/esm-es5/stencil-route-title.entry.js +1 -1
- package/dist/lib/esm-es5/stencil-router-prompt.entry.js +1 -1
- package/dist/lib/esm-es5/stencil-router-redirect.entry.js +1 -1
- package/dist/lib/types/components/super-byof/super-byof-types.d.ts +26 -0
- package/dist/lib/types/components/super-byof/super-byof.d.ts +19 -0
- package/dist/lib/types/components/super-byof/super-byof.form.d.ts +6 -0
- package/dist/lib/types/components/super-campaign/super-campaign.d.ts +0 -1
- package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +8 -0
- package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +1 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.store.d.ts +1 -1
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/smsf-engagement-step-host.d.ts +28 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/smsf-engagement-step-types.d.ts +15 -0
- package/dist/lib/types/components/super-selection-app/services/event-tracking.service.d.ts +2 -0
- package/dist/lib/types/components/super-selection-app/services/super-selection-app.routes.d.ts +1 -0
- package/dist/lib/types/components/super-selection-app/services/super-selection-app.service.d.ts +1 -0
- package/dist/lib/types/components/super-selection-app/services/super-selection.store.d.ts +1 -0
- package/dist/lib/types/components/super-smsf/super-smsf-types.d.ts +34 -0
- package/dist/lib/types/components/super-smsf/super-smsf.d.ts +20 -0
- package/dist/lib/types/components.d.ts +39 -63
- package/package.json +2 -1
- package/dist/lib/apollo-super-selection/p-071b8545.entry.js +0 -1
- package/dist/lib/apollo-super-selection/p-51aefdb1.system.entry.js +0 -1
- package/dist/lib/apollo-super-selection/p-6cfd85e3.system.entry.js +0 -69
- package/dist/lib/apollo-super-selection/p-80178f87.system.js +0 -1
- package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +0 -1
- package/dist/lib/apollo-super-selection/p-d9f1e505.entry.js +0 -14
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.js +0 -143
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.js +0 -123
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.js +0 -253
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +0 -121
- package/dist/lib/esm-es5/sss-button_34.entry.js +0 -69
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.d.ts +0 -16
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.d.ts +0 -13
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.d.ts +0 -29
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.d.ts +0 -14
- /package/dist/lib/collection/components/{super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.js → super-byof/super-byof.form.js} +0 -0
- /package/dist/lib/types/components/{super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.d.ts → super-smsf/super-smsf.form.d.ts} +0 -0
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { Component, Event, h, Prop, State } from '@stencil/core';
|
|
2
|
-
import * as O from 'fp-ts/Option';
|
|
3
|
-
import australianFundLookupService from '../../../services/australian-fund-lookup.service';
|
|
4
|
-
import customFundState from '../custom-fund.store';
|
|
5
|
-
export class MyOwnFundInputs {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.MIN_SEARCH_STRING_LENGTH = 3;
|
|
8
|
-
this.MAX_RECORD_COUNT = 25;
|
|
9
|
-
this.searchFundsAsync = async (searchBy) => {
|
|
10
|
-
const response = await australianFundLookupService.searchFundsAsync(searchBy, this.MAX_RECORD_COUNT);
|
|
11
|
-
switch (response.result) {
|
|
12
|
-
case 'TooManyResults': {
|
|
13
|
-
return { kind: 'too-many-results' };
|
|
14
|
-
}
|
|
15
|
-
default: {
|
|
16
|
-
const funds = response.data
|
|
17
|
-
.sort((a, b) => a.productName.localeCompare(b.productName))
|
|
18
|
-
.map((fund) => ({
|
|
19
|
-
label: `${fund.productName} (${fund.usi})`,
|
|
20
|
-
value: fund.usi
|
|
21
|
-
}));
|
|
22
|
-
return { kind: 'success', value: funds };
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
if (O.isSome(this.myOwnFundForm.fundUsi) && O.isSome(this.myOwnFundForm.fundName)) {
|
|
27
|
-
this.selectedOption = {
|
|
28
|
-
label: this.myOwnFundForm.fundName.value,
|
|
29
|
-
value: this.myOwnFundForm.fundUsi.value
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
render() {
|
|
34
|
-
return (h("div", null,
|
|
35
|
-
h("div", null,
|
|
36
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Fund name"),
|
|
37
|
-
h("div", { class: "mt-1" },
|
|
38
|
-
h("sss-dropdown-async", { testId: "fund-search-input", 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) => {
|
|
39
|
-
this.selectedOption = ev.detail;
|
|
40
|
-
this.updateFund(ev.detail);
|
|
41
|
-
}, showValidationErrors: this.showValidationErrors })),
|
|
42
|
-
O.isSome(this.myOwnFundForm.fundUsi) && (h("div", { class: "mt-3" },
|
|
43
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Fund USI"),
|
|
44
|
-
h("div", { class: "mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm" }, this.myOwnFundForm.fundUsi.value)))),
|
|
45
|
-
h("div", { class: "mt-3" },
|
|
46
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Member number"),
|
|
47
|
-
h("div", { class: "mt-1" },
|
|
48
|
-
h("input", { "data-testid": "member-number-input", type: "text", class: {
|
|
49
|
-
'shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md': true,
|
|
50
|
-
'invalid:border-red-300 invalid:text-red-900 invalid:focus:ring-red-500 invalid:focus:border-red-500': this
|
|
51
|
-
.showValidationErrors
|
|
52
|
-
}, 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()) }),
|
|
53
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid member number (only numbers and / or letters)"))),
|
|
54
|
-
h("div", { class: "flex space-x-4" },
|
|
55
|
-
h("div", { class: "mt-3 w-1/2" },
|
|
56
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Given name(s)"),
|
|
57
|
-
h("div", { class: "mt-1" },
|
|
58
|
-
h("sss-name-input", { testId: "member-given-names-input", name: "memberFirstName", readableName: "Member given name(s)", showValidationErrors: this.showValidationErrors, value: O.toUndefined(customFundState.myOwnFundForm.memberFirstName), onChange: (ev) => this.updateMemberFirstName(ev.target.value.trim()) }))),
|
|
59
|
-
h("div", { class: "mt-3 w-1/2" },
|
|
60
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Last name"),
|
|
61
|
-
h("div", { class: "mt-1" },
|
|
62
|
-
h("sss-name-input", { testId: "member-last-name-input", name: "memberFamilyName", readableName: "Member last name", showValidationErrors: this.showValidationErrors, value: O.toUndefined(customFundState.myOwnFundForm.memberFamilyName), onChange: (ev) => this.updateMemberFamilyName(ev.target.value.trim()) }))))));
|
|
63
|
-
}
|
|
64
|
-
updateFund(fund) {
|
|
65
|
-
this.formChanged.emit({ fundUsi: O.some(fund.value), fundName: O.some(fund.label) });
|
|
66
|
-
}
|
|
67
|
-
updateMemberNumber(memberNumber) {
|
|
68
|
-
this.formChanged.emit({ memberNumber: O.some(memberNumber) });
|
|
69
|
-
}
|
|
70
|
-
updateMemberFirstName(memberFirstName) {
|
|
71
|
-
this.formChanged.emit({ memberFirstName: O.some(memberFirstName) });
|
|
72
|
-
}
|
|
73
|
-
updateMemberFamilyName(memberFamilyName) {
|
|
74
|
-
this.formChanged.emit({ memberFamilyName: O.some(memberFamilyName) });
|
|
75
|
-
}
|
|
76
|
-
static get is() { return "sss-my-own-fund-inputs"; }
|
|
77
|
-
static get properties() { return {
|
|
78
|
-
"myOwnFundForm": {
|
|
79
|
-
"type": "unknown",
|
|
80
|
-
"mutable": false,
|
|
81
|
-
"complexType": {
|
|
82
|
-
"original": "MyOwnFundFormState",
|
|
83
|
-
"resolved": "{ fundUsi: Option<string>; fundName: Option<string>; memberNumber: Option<string>; memberFirstName: Option<string>; memberFamilyName: Option<string>; }",
|
|
84
|
-
"references": {
|
|
85
|
-
"MyOwnFundFormState": {
|
|
86
|
-
"location": "import",
|
|
87
|
-
"path": "../custom-fund.store"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
"required": false,
|
|
92
|
-
"optional": false,
|
|
93
|
-
"docs": {
|
|
94
|
-
"tags": [],
|
|
95
|
-
"text": ""
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
"showValidationErrors": {
|
|
99
|
-
"type": "boolean",
|
|
100
|
-
"mutable": false,
|
|
101
|
-
"complexType": {
|
|
102
|
-
"original": "boolean",
|
|
103
|
-
"resolved": "boolean",
|
|
104
|
-
"references": {}
|
|
105
|
-
},
|
|
106
|
-
"required": false,
|
|
107
|
-
"optional": false,
|
|
108
|
-
"docs": {
|
|
109
|
-
"tags": [],
|
|
110
|
-
"text": ""
|
|
111
|
-
},
|
|
112
|
-
"attribute": "show-validation-errors",
|
|
113
|
-
"reflect": false
|
|
114
|
-
}
|
|
115
|
-
}; }
|
|
116
|
-
static get states() { return {
|
|
117
|
-
"selectedOption": {}
|
|
118
|
-
}; }
|
|
119
|
-
static get events() { return [{
|
|
120
|
-
"method": "formChanged",
|
|
121
|
-
"name": "formChanged",
|
|
122
|
-
"bubbles": true,
|
|
123
|
-
"cancelable": true,
|
|
124
|
-
"composed": true,
|
|
125
|
-
"docs": {
|
|
126
|
-
"tags": [],
|
|
127
|
-
"text": ""
|
|
128
|
-
},
|
|
129
|
-
"complexType": {
|
|
130
|
-
"original": "Partial<MyOwnFundFormState>",
|
|
131
|
-
"resolved": "{ fundUsi?: None | Some<string> | undefined; fundName?: None | Some<string> | undefined; memberNumber?: None | Some<string> | undefined; memberFirstName?: None | Some<string> | undefined; memberFamilyName?: None | Some<string> | undefined; }",
|
|
132
|
-
"references": {
|
|
133
|
-
"Partial": {
|
|
134
|
-
"location": "global"
|
|
135
|
-
},
|
|
136
|
-
"MyOwnFundFormState": {
|
|
137
|
-
"location": "import",
|
|
138
|
-
"path": "../custom-fund.store"
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}]; }
|
|
143
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { Component, getAssetPath, h, Host, Prop, State } from '@stencil/core';
|
|
2
|
-
import { injectHistory } from '@stencil/router';
|
|
3
|
-
import { pipe } from 'fp-ts/lib/function';
|
|
4
|
-
import * as O from 'fp-ts/Option';
|
|
5
|
-
import { EventTrackingService } from '../../../services/event-tracking.service';
|
|
6
|
-
import navigationService from '../../../services/navigation.service';
|
|
7
|
-
import { SuperSelectionAppRoutes } from '../../../services/super-selection-app.routes';
|
|
8
|
-
import superSelectionAppService from '../../../services/super-selection-app.service';
|
|
9
|
-
import customFundChoiceApi from '../api/custom-fund-choice.api';
|
|
10
|
-
import customFundState from '../custom-fund.store';
|
|
11
|
-
export class MyOwnFund {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.isNotAllInformationProvidedMessageVisible = false;
|
|
14
|
-
this.isSubmitDisabled = true;
|
|
15
|
-
this.eventTrackingService = EventTrackingService.Instance;
|
|
16
|
-
}
|
|
17
|
-
componentDidLoad() {
|
|
18
|
-
return this.eventTrackingService.TrackMyOwnSuperFundDetailViewedAsync({
|
|
19
|
-
promotedFundsShown: superSelectionAppService.promotedFunds,
|
|
20
|
-
defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi)
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
const superCampaignCanNotBeActivated = superSelectionAppService.superCampaignCanNotBeActivated;
|
|
25
|
-
return (h(Host, null,
|
|
26
|
-
h("sss-header-section", null),
|
|
27
|
-
h("div", { class: "flex justify-center mt-11" },
|
|
28
|
-
h("sss-custom-fund", null,
|
|
29
|
-
h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: {
|
|
30
|
-
'was-validated': this.formState === 'validated'
|
|
31
|
-
}, ref: (el) => (this.formElement = el), onInput: (_) => (this.isSubmitDisabled = !this.formElement.checkValidity()) },
|
|
32
|
-
h("div", { class: "p-4 sm:p-6 pb-6 sm:pb-8 border shadow-sm rounded-lg" },
|
|
33
|
-
h("p", { class: "sm:text-lg font-bold mb-3" }, "Fund details"),
|
|
34
|
-
h("div", { class: "bg-yellow-50 border-l-4 border-yellow-400 p-4 mb-3 sm:mb-4" },
|
|
35
|
-
h("div", { class: "flex" },
|
|
36
|
-
h("div", { class: "flex-shrink-0" },
|
|
37
|
-
h("img", { class: "h-5 w-5", src: getAssetPath('assets/icon-exclamation.svg') })),
|
|
38
|
-
h("div", { class: "ml-2" },
|
|
39
|
-
h("ul", { class: "list-disc list-outside ml-6 space-y-2 text-sm text-yellow-700 leading-5" },
|
|
40
|
-
h("li", null, "Make sure you are a current member of the fund before completing this step."),
|
|
41
|
-
h("li", null, "Please check that the fund USI is correct as some funds have similar names."))))),
|
|
42
|
-
h("sss-my-own-fund-inputs", { myOwnFundForm: customFundState.myOwnFundForm, showValidationErrors: this.formState === 'validated', onFormChanged: (event) => {
|
|
43
|
-
customFundState.myOwnFundForm = Object.assign(Object.assign({}, customFundState.myOwnFundForm), event.detail);
|
|
44
|
-
this.isNotAllInformationProvidedMessageVisible = false;
|
|
45
|
-
} }),
|
|
46
|
-
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."))),
|
|
47
|
-
h("div", { class: "flex justify-center mt-8" },
|
|
48
|
-
h("div", { class: "sm:max-w-320 w-full" },
|
|
49
|
-
h("div", { class: "mb-4", onClick:
|
|
50
|
-
// user clicks on disabled button (div wrapper) then validation errors will show
|
|
51
|
-
() => (this.formState = 'validated') },
|
|
52
|
-
h("sss-button", { testid: "continue-button", fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Continue")),
|
|
53
|
-
!superCampaignCanNotBeActivated && (h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage },
|
|
54
|
-
h("sss-button", { testid: "back-button", fillWidth: true, variant: "secondary" }, "Back"))))))))));
|
|
55
|
-
}
|
|
56
|
-
async handleSubmitForm() {
|
|
57
|
-
this.formState = 'validated';
|
|
58
|
-
if (!this.formElement.checkValidity()) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const isAllInformationProvided = O.isSome(customFundState.myOwnFundForm.fundUsi) &&
|
|
62
|
-
O.isSome(customFundState.myOwnFundForm.memberNumber) &&
|
|
63
|
-
O.isSome(customFundState.myOwnFundForm.memberFirstName) &&
|
|
64
|
-
O.isSome(customFundState.myOwnFundForm.memberFamilyName);
|
|
65
|
-
if (!isAllInformationProvided) {
|
|
66
|
-
this.isNotAllInformationProvidedMessageVisible = true;
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (superSelectionAppService.isBringYourOwnFundCustomStepEnabled &&
|
|
70
|
-
superSelectionAppService.isUsingSuperCampaign) {
|
|
71
|
-
navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.MyOwnFundEngagementStep);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
navigationService.navigateInternallyToStandardChoice({
|
|
75
|
-
history: this.history,
|
|
76
|
-
fundName: this.getOrError(customFundState.myOwnFundForm.fundName),
|
|
77
|
-
fundDetails: {
|
|
78
|
-
type: 'myOwnFund',
|
|
79
|
-
fundName: this.getOrError(customFundState.myOwnFundForm.fundName),
|
|
80
|
-
fundUsi: this.getOrError(customFundState.myOwnFundForm.fundUsi),
|
|
81
|
-
memberNumber: this.getOrError(customFundState.myOwnFundForm.memberNumber)
|
|
82
|
-
},
|
|
83
|
-
handleSubmitFn: async (standardChoiceFormSignature) => {
|
|
84
|
-
const customFundChoiceDto = Object.assign({ fundUsi: this.getOrError(customFundState.myOwnFundForm.fundUsi), memberNumber: this.getOrError(customFundState.myOwnFundForm.memberNumber), memberFirstName: this.getOrError(customFundState.myOwnFundForm.memberFirstName), memberFamilyName: this.getOrError(customFundState.myOwnFundForm.memberFamilyName), standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
|
|
85
|
-
await customFundChoiceApi.submitCustomFundChoiceAsync(customFundChoiceDto);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
getOrError(option) {
|
|
90
|
-
return pipe(option, O.getOrElse(() => {
|
|
91
|
-
throw new Error('Option value is none.');
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
94
|
-
static get is() { return "sss-my-own-fund"; }
|
|
95
|
-
static get properties() { return {
|
|
96
|
-
"history": {
|
|
97
|
-
"type": "unknown",
|
|
98
|
-
"mutable": false,
|
|
99
|
-
"complexType": {
|
|
100
|
-
"original": "RouterHistory",
|
|
101
|
-
"resolved": "RouterHistory",
|
|
102
|
-
"references": {
|
|
103
|
-
"RouterHistory": {
|
|
104
|
-
"location": "import",
|
|
105
|
-
"path": "@stencil/router"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"required": false,
|
|
110
|
-
"optional": false,
|
|
111
|
-
"docs": {
|
|
112
|
-
"tags": [],
|
|
113
|
-
"text": ""
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}; }
|
|
117
|
-
static get states() { return {
|
|
118
|
-
"formState": {},
|
|
119
|
-
"isNotAllInformationProvidedMessageVisible": {},
|
|
120
|
-
"isSubmitDisabled": {}
|
|
121
|
-
}; }
|
|
122
|
-
}
|
|
123
|
-
injectHistory(MyOwnFund);
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { Component, Event, h, Prop, State } from '@stencil/core';
|
|
2
|
-
import { isNone, isSome, none, some } from 'fp-ts/Option';
|
|
3
|
-
import customFundChoiceApi from '../api/custom-fund-choice.api';
|
|
4
|
-
import customFundState from '../custom-fund.store';
|
|
5
|
-
import { validateAbn } from './abn-validation';
|
|
6
|
-
import bsbNumbers from './bankBsbNumbers';
|
|
7
|
-
var AbnValidationStatus;
|
|
8
|
-
(function (AbnValidationStatus) {
|
|
9
|
-
AbnValidationStatus[AbnValidationStatus["Invalid"] = 1] = "Invalid";
|
|
10
|
-
AbnValidationStatus[AbnValidationStatus["AbnIsUsedForRegulatedFund"] = 2] = "AbnIsUsedForRegulatedFund";
|
|
11
|
-
AbnValidationStatus[AbnValidationStatus["Valid"] = 3] = "Valid";
|
|
12
|
-
})(AbnValidationStatus || (AbnValidationStatus = {}));
|
|
13
|
-
export class SelfManagedFundInputs {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.abnValidationStatus = AbnValidationStatus.Invalid;
|
|
16
|
-
this.isAbnTouched = false;
|
|
17
|
-
this.currentBank = none;
|
|
18
|
-
this.addressErrorMessage = none;
|
|
19
|
-
this.stateOptions = [
|
|
20
|
-
{ value: 'NSW', label: 'NSW' },
|
|
21
|
-
{ value: 'QLD', label: 'QLD' },
|
|
22
|
-
{ value: 'ACT', label: 'ACT' },
|
|
23
|
-
{ value: 'VIC', label: 'VIC' },
|
|
24
|
-
{ value: 'TAS', label: 'TAS' },
|
|
25
|
-
{ value: 'WA', label: 'WA' },
|
|
26
|
-
{ value: 'SA', label: 'SA' },
|
|
27
|
-
{ value: 'NT', label: 'NT' }
|
|
28
|
-
];
|
|
29
|
-
this.bsbRegex = new RegExp(/^[0-9]{3}[0-9]{3}$/);
|
|
30
|
-
this.bankAccountNumberRegex = new RegExp(/^[0-9]{2,10}$/);
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
const inputClass = {
|
|
34
|
-
'relative shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md focus:z-10': true,
|
|
35
|
-
'invalid:border-red-300 invalid:text-red-900 invalid:placeholder-red-300 invalid:focus:ring-red-500 invalid:focus:border-red-500': this
|
|
36
|
-
.showValidationErrors
|
|
37
|
-
};
|
|
38
|
-
return (h("div", null,
|
|
39
|
-
h("div", null,
|
|
40
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Fund name"),
|
|
41
|
-
h("div", { class: "mt-1" },
|
|
42
|
-
h("input", { type: "text", class: inputClass, required: true, minlength: "2", name: "fundName", id: "fundName", value: customFundState.selfManagedFundForm.fundName, onChange: (ev) => this.updateFormField('fundName', ev.target.value.trim()) }),
|
|
43
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid fund name"))),
|
|
44
|
-
h("div", { class: "mt-3" },
|
|
45
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Fund ABN"),
|
|
46
|
-
h("div", { class: "mt-1" },
|
|
47
|
-
h("input", { type: "text", class: inputClass, required: true, minlength: "2", name: "fundAbn", id: "fundAbn", value: customFundState.selfManagedFundForm.fundAbn, inputmode: "numeric", pattern: "[0-9]*", onKeyUp: async (ev) => {
|
|
48
|
-
const abnInput = ev.target;
|
|
49
|
-
this.updateFormField('fundAbn', abnInput.value.trim());
|
|
50
|
-
this.abnValidationStatus = AbnValidationStatus.Invalid;
|
|
51
|
-
if (validateAbn(abnInput.value)) {
|
|
52
|
-
const isAbnUsedForRegulatedFund = await this.isAbnUsedForRegulatedAsync(abnInput.value);
|
|
53
|
-
this.abnValidationStatus = isAbnUsedForRegulatedFund
|
|
54
|
-
? AbnValidationStatus.AbnIsUsedForRegulatedFund
|
|
55
|
-
: AbnValidationStatus.Valid;
|
|
56
|
-
}
|
|
57
|
-
// We need to set a custom validity message to trigger css invalid styles for non valid cases
|
|
58
|
-
const validityMessage = this.abnValidationStatus === AbnValidationStatus.Valid
|
|
59
|
-
? ''
|
|
60
|
-
: 'Enter a valid fund ABN (digits only)';
|
|
61
|
-
abnInput.setCustomValidity(validityMessage);
|
|
62
|
-
this.updateFormField('isAbnValid', this.abnValidationStatus === AbnValidationStatus.Valid);
|
|
63
|
-
}, onBlur: () => (this.isAbnTouched = true) }),
|
|
64
|
-
this.renderAbnValidationError())),
|
|
65
|
-
h("div", { class: "mt-3" },
|
|
66
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Electronic service address alias (ESA)"),
|
|
67
|
-
h("div", { class: "mt-1" },
|
|
68
|
-
h("input", { type: "text", class: inputClass, required: true, minlength: "2", name: "fundEsa", id: "fundEsa", value: customFundState.selfManagedFundForm.fundEsa, onChange: (ev) => this.updateFormField('fundEsa', ev.target.value.trim()) }),
|
|
69
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid fund ESA"))),
|
|
70
|
-
h("div", { class: "mt-3" },
|
|
71
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Fund address"),
|
|
72
|
-
h("div", { class: "mt-1 rounded-md shadow-sm -space-y-px" },
|
|
73
|
-
h("input", { placeholder: "Address line 1", type: "text", class: Object.assign(Object.assign({}, inputClass), { 'rounded-none rounded-t-md shadow-none': true }), required: true, minlength: "2", name: "addressLine1", id: "addressLine1", value: customFundState.selfManagedFundForm.addressLine1, onChange: (ev) => {
|
|
74
|
-
this.updateFormField('addressLine1', ev.target.value.trim());
|
|
75
|
-
this.updateAddressErrorMessage();
|
|
76
|
-
}, ref: (el) => (this.addressLine1Element = el) }),
|
|
77
|
-
h("input", { placeholder: "Address line 2 (optional)", type: "text", class: Object.assign(Object.assign({}, inputClass), { 'rounded-none shadow-none': true }), name: "addressLine2", id: "addressLine2", value: customFundState.selfManagedFundForm.addressLine2, onChange: (ev) => this.updateFormField('addressLine2', ev.target.value.trim()) }),
|
|
78
|
-
h("input", { placeholder: "City/suburb", type: "text", class: Object.assign(Object.assign({}, inputClass), { 'rounded-none shadow-none': true }), name: "city", required: true, id: "city", value: customFundState.selfManagedFundForm.city, onChange: (ev) => {
|
|
79
|
-
this.updateFormField('city', ev.target.value.trim());
|
|
80
|
-
this.updateAddressErrorMessage();
|
|
81
|
-
}, ref: (el) => (this.cityElement = el) }),
|
|
82
|
-
h("div", { class: "flex -space-x-px" },
|
|
83
|
-
h("div", { class: "w-1/2 flex-1 min-w-0" },
|
|
84
|
-
h("input", { placeholder: "Postcode", type: "text", required: true, class: Object.assign(Object.assign({}, inputClass), { 'rounded-none rounded-bl-md shadow-none': true }), name: "postcode", minlength: "4", maxlength: "4", pattern: "[0-9]{4}", id: "postcode", value: customFundState.selfManagedFundForm.postcode, inputmode: "numeric", onChange: (ev) => {
|
|
85
|
-
this.updateFormField('postcode', ev.target.value.trim());
|
|
86
|
-
this.updateAddressErrorMessage();
|
|
87
|
-
}, ref: (el) => (this.postcodeElement = el) })),
|
|
88
|
-
h("div", { class: "flex-1 min-w-0" },
|
|
89
|
-
h("select", { class: Object.assign(Object.assign({}, inputClass), { 'rounded-none rounded-br-md shadow-none': true, 'text-gray-500': this.fundForm.state !== undefined }), name: "state", required: true, id: "state", onChange: (ev) => {
|
|
90
|
-
this.updateFormField('state', ev.target.value.trim());
|
|
91
|
-
this.updateAddressErrorMessage();
|
|
92
|
-
}, ref: (el) => (this.stateElement = el) },
|
|
93
|
-
h("option", { disabled: true, selected: this.fundForm.state !== undefined, value: "" }, "State"),
|
|
94
|
-
this.stateOptions.map((s) => (h("option", { value: s.value, selected: this.fundForm.state === s.value }, s.label))))))),
|
|
95
|
-
isSome(this.addressErrorMessage) && this.showValidationErrors && (h("div", { class: "mt-2 text-sm text-red-600" }, this.addressErrorMessage.value))),
|
|
96
|
-
h("div", { class: "flex space-x-4" },
|
|
97
|
-
h("div", { class: "mt-3 w-1/2" },
|
|
98
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Given name(s)"),
|
|
99
|
-
h("div", { class: "mt-1" },
|
|
100
|
-
h("sss-name-input", { testId: "member-given-names-input", name: "memberFirstName", readableName: "Member given name(s)", showValidationErrors: this.showValidationErrors, value: customFundState.selfManagedFundForm.memberFirstName, onChange: (ev) => this.updateFormField('memberFirstName', ev.target.value.trim()) }))),
|
|
101
|
-
h("div", { class: "mt-3 w-1/2" },
|
|
102
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Last name"),
|
|
103
|
-
h("div", { class: "mt-1" },
|
|
104
|
-
h("sss-name-input", { testId: "member-last-name-input", name: "memberFamilyName", readableName: "Member last name", showValidationErrors: this.showValidationErrors, value: customFundState.selfManagedFundForm.memberFamilyName, onChange: (ev) => this.updateFormField('memberFamilyName', ev.target.value.trim()) })))),
|
|
105
|
-
h("h3", { class: "text-lg font-bold mt-6" }, "Fund bank details"),
|
|
106
|
-
h("div", { class: "mt-3" },
|
|
107
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Account name"),
|
|
108
|
-
h("div", { class: "mt-1" },
|
|
109
|
-
h("input", { type: "text", required: true, class: inputClass, name: "bankAccountName", minlength: "2", id: "bankAccountName", value: customFundState.selfManagedFundForm.bankAccountName, onChange: (ev) => this.updateFormField('bankAccountName', ev.target.value.trim()) }),
|
|
110
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid bank account name"))),
|
|
111
|
-
h("div", { class: "mt-3" },
|
|
112
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "BSB"),
|
|
113
|
-
h("div", { class: "mt-1" },
|
|
114
|
-
h("input", { type: "text", required: true, class: inputClass, name: "bsb", id: "bsb", minlength: "6", maxlength: "7", inputmode: "numeric", onKeyUp: (ev) => this.updateCurrentBank(ev), pattern: this.bsbRegex.source, value: customFundState.selfManagedFundForm.bsb }),
|
|
115
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid BSB"))),
|
|
116
|
-
isSome(this.currentBank) && (h("div", { class: "mt-3" },
|
|
117
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Bank name"),
|
|
118
|
-
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.currentBank.value))),
|
|
119
|
-
h("div", { class: "mt-3" },
|
|
120
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Account number"),
|
|
121
|
-
h("div", { class: "mt-1" },
|
|
122
|
-
h("input", { type: "text", required: true, class: inputClass, name: "bankAccountNumber", id: "bankAccountNumber", minlength: "2", maxlength: "11", pattern: this.bankAccountNumberRegex.source, inputmode: "numeric", value: customFundState.selfManagedFundForm.bankAccountNumber, onKeyUp: (ev) => this.updateCurrentBankAccountNumber(ev), onChange: (ev) => this.updateFormField('bankAccountNumber', ev.target.value.trim()) }),
|
|
123
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid bank account number")))));
|
|
124
|
-
}
|
|
125
|
-
updateFormField(key, value) {
|
|
126
|
-
this.formChanged.emit({ [key]: value });
|
|
127
|
-
}
|
|
128
|
-
async isAbnUsedForRegulatedAsync(abn) {
|
|
129
|
-
return !(await customFundChoiceApi.validateAbnForSMSF(abn));
|
|
130
|
-
}
|
|
131
|
-
renderAbnValidationError() {
|
|
132
|
-
if (this.isAbnTouched || this.showValidationErrors) {
|
|
133
|
-
switch (this.abnValidationStatus) {
|
|
134
|
-
case AbnValidationStatus.Invalid:
|
|
135
|
-
return h("div", { class: "mt-2 text-sm text-red-600" }, "Enter a valid fund ABN (digits only)");
|
|
136
|
-
case AbnValidationStatus.AbnIsUsedForRegulatedFund:
|
|
137
|
-
return (h("div", { class: "mt-2 text-sm text-red-600" }, "The supplied ABN is for a regulated fund"));
|
|
138
|
-
case AbnValidationStatus.Valid:
|
|
139
|
-
return [];
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return [];
|
|
143
|
-
}
|
|
144
|
-
filterDigits(str) {
|
|
145
|
-
return str.replace(/[^0-9]/g, '');
|
|
146
|
-
}
|
|
147
|
-
updateCurrentBank(ev) {
|
|
148
|
-
const value = this.filterDigits(ev.target.value);
|
|
149
|
-
const firstTwoNumbers = value.substring(0, 2);
|
|
150
|
-
const firstThreeNumbers = value.substring(0, 3);
|
|
151
|
-
const firstTwoNumberBankName = bsbNumbers[firstTwoNumbers];
|
|
152
|
-
const firstThreeNumberBankName = bsbNumbers[firstThreeNumbers];
|
|
153
|
-
if (firstTwoNumberBankName)
|
|
154
|
-
this.currentBank = some(firstTwoNumberBankName);
|
|
155
|
-
if (firstThreeNumberBankName)
|
|
156
|
-
this.currentBank = some(firstThreeNumberBankName);
|
|
157
|
-
if (value === '' || value.length > 6)
|
|
158
|
-
this.currentBank = none;
|
|
159
|
-
this.updateFormField('bsb', value);
|
|
160
|
-
}
|
|
161
|
-
updateCurrentBankAccountNumber(ev) {
|
|
162
|
-
const value = this.filterDigits(ev.target.value);
|
|
163
|
-
this.updateFormField('bankAccountNumber', value);
|
|
164
|
-
}
|
|
165
|
-
updateAddressErrorMessage() {
|
|
166
|
-
let message = none;
|
|
167
|
-
if (isNone(message) && !this.addressLine1Element.checkValidity()) {
|
|
168
|
-
message = some('Enter a valid address line 1');
|
|
169
|
-
}
|
|
170
|
-
if (isNone(message) && !this.cityElement.checkValidity()) {
|
|
171
|
-
message = some('Enter a valid city/suburb');
|
|
172
|
-
}
|
|
173
|
-
if (isNone(message) && !this.postcodeElement.checkValidity()) {
|
|
174
|
-
message = some('Enter a valid post code');
|
|
175
|
-
}
|
|
176
|
-
if (isNone(message) && !this.stateElement.checkValidity()) {
|
|
177
|
-
message = some('Select a state');
|
|
178
|
-
}
|
|
179
|
-
this.addressErrorMessage = message;
|
|
180
|
-
}
|
|
181
|
-
static get is() { return "sss-self-managed-fund-inputs"; }
|
|
182
|
-
static get properties() { return {
|
|
183
|
-
"fundForm": {
|
|
184
|
-
"type": "unknown",
|
|
185
|
-
"mutable": false,
|
|
186
|
-
"complexType": {
|
|
187
|
-
"original": "Partial<SelfManagedFundForm>",
|
|
188
|
-
"resolved": "{ fundName?: string | undefined; fundAbn?: string | undefined; fundEsa?: string | undefined; addressLine1?: string | undefined; addressLine2?: string | undefined; state?: string | undefined; postcode?: string | undefined; city?: string | undefined; bankAccountName?: string | undefined; bsb?: string | undefined; bankAccountNumber?: string | undefined; memberFirstName?: string | undefined; memberFamilyName?: string | undefined; }",
|
|
189
|
-
"references": {
|
|
190
|
-
"Partial": {
|
|
191
|
-
"location": "global"
|
|
192
|
-
},
|
|
193
|
-
"SelfManagedFundForm": {
|
|
194
|
-
"location": "import",
|
|
195
|
-
"path": "./self-managed-fund.form"
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
"required": false,
|
|
200
|
-
"optional": false,
|
|
201
|
-
"docs": {
|
|
202
|
-
"tags": [],
|
|
203
|
-
"text": ""
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
"showValidationErrors": {
|
|
207
|
-
"type": "boolean",
|
|
208
|
-
"mutable": false,
|
|
209
|
-
"complexType": {
|
|
210
|
-
"original": "boolean",
|
|
211
|
-
"resolved": "boolean",
|
|
212
|
-
"references": {}
|
|
213
|
-
},
|
|
214
|
-
"required": false,
|
|
215
|
-
"optional": false,
|
|
216
|
-
"docs": {
|
|
217
|
-
"tags": [],
|
|
218
|
-
"text": ""
|
|
219
|
-
},
|
|
220
|
-
"attribute": "show-validation-errors",
|
|
221
|
-
"reflect": false
|
|
222
|
-
}
|
|
223
|
-
}; }
|
|
224
|
-
static get states() { return {
|
|
225
|
-
"abnValidationStatus": {},
|
|
226
|
-
"isAbnTouched": {},
|
|
227
|
-
"currentBank": {},
|
|
228
|
-
"addressErrorMessage": {}
|
|
229
|
-
}; }
|
|
230
|
-
static get events() { return [{
|
|
231
|
-
"method": "formChanged",
|
|
232
|
-
"name": "formChanged",
|
|
233
|
-
"bubbles": true,
|
|
234
|
-
"cancelable": true,
|
|
235
|
-
"composed": true,
|
|
236
|
-
"docs": {
|
|
237
|
-
"tags": [],
|
|
238
|
-
"text": ""
|
|
239
|
-
},
|
|
240
|
-
"complexType": {
|
|
241
|
-
"original": "Partial<FormChangedEvent>",
|
|
242
|
-
"resolved": "{ isAbnValid?: boolean | undefined; fundName?: string | undefined; fundAbn?: string | undefined; fundEsa?: string | undefined; addressLine1?: string | undefined; addressLine2?: string | undefined; state?: string | undefined; postcode?: string | undefined; city?: string | undefined; bankAccountName?: string | undefined; bsb?: string | undefined; bankAccountNumber?: string | undefined; memberFirstName?: string | undefined; memberFamilyName?: string | undefined; }",
|
|
243
|
-
"references": {
|
|
244
|
-
"Partial": {
|
|
245
|
-
"location": "global"
|
|
246
|
-
},
|
|
247
|
-
"FormChangedEvent": {
|
|
248
|
-
"location": "local"
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}]; }
|
|
253
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Component, getAssetPath, h, Host, Prop, State } from '@stencil/core';
|
|
2
|
-
import { injectHistory } from '@stencil/router';
|
|
3
|
-
import * as O from 'fp-ts/Option';
|
|
4
|
-
import { EventTrackingService } from '../../../services/event-tracking.service';
|
|
5
|
-
import navigationService from '../../../services/navigation.service';
|
|
6
|
-
import { SuperSelectionAppRoutes } from '../../../services/super-selection-app.routes';
|
|
7
|
-
import superSelectionAppService from '../../../services/super-selection-app.service';
|
|
8
|
-
import customFundChoiceApi from '../api/custom-fund-choice.api';
|
|
9
|
-
import customFundState from '../custom-fund.store';
|
|
10
|
-
import { validateAbn } from './abn-validation';
|
|
11
|
-
export class SelfManagedFund {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.isSubmitDisabled = true;
|
|
14
|
-
this.isAbnValid = validateAbn(customFundState.selfManagedFundForm.fundAbn);
|
|
15
|
-
this.eventTrackingService = EventTrackingService.Instance;
|
|
16
|
-
this.success = () => {
|
|
17
|
-
navigationService.navigateInternallyToStandardChoice({
|
|
18
|
-
history: this.history,
|
|
19
|
-
fundName: 'Self-managed super fund',
|
|
20
|
-
fundDetails: {
|
|
21
|
-
type: 'smsf',
|
|
22
|
-
fundName: customFundState.selfManagedFundForm.fundName,
|
|
23
|
-
fundEsa: customFundState.selfManagedFundForm.fundEsa
|
|
24
|
-
},
|
|
25
|
-
handleSubmitFn: async (standardChoiceFormSignature) => {
|
|
26
|
-
const requestDto = Object.assign({ smsfChoice: {
|
|
27
|
-
abn: customFundState.selfManagedFundForm.fundAbn,
|
|
28
|
-
fundName: customFundState.selfManagedFundForm.fundName,
|
|
29
|
-
fundAddress: {
|
|
30
|
-
addressLine1: customFundState.selfManagedFundForm.addressLine1,
|
|
31
|
-
addressLine2: customFundState.selfManagedFundForm.addressLine2,
|
|
32
|
-
city: customFundState.selfManagedFundForm.city,
|
|
33
|
-
state: customFundState.selfManagedFundForm.state,
|
|
34
|
-
postcode: customFundState.selfManagedFundForm.postcode
|
|
35
|
-
},
|
|
36
|
-
bsb: customFundState.selfManagedFundForm.bsb,
|
|
37
|
-
bankAccountName: customFundState.selfManagedFundForm.bankAccountName,
|
|
38
|
-
bankAccountNumber: customFundState.selfManagedFundForm.bankAccountNumber,
|
|
39
|
-
electronicServiceAddress: customFundState.selfManagedFundForm.fundEsa,
|
|
40
|
-
memberFirstName: customFundState.selfManagedFundForm.memberFirstName,
|
|
41
|
-
memberFamilyName: customFundState.selfManagedFundForm.memberFamilyName
|
|
42
|
-
}, standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
|
|
43
|
-
await customFundChoiceApi.submitSelfManagedFundChoiceAsync(requestDto);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
componentDidLoad() {
|
|
49
|
-
this.updateIsSubmitDisabled();
|
|
50
|
-
return this.eventTrackingService.TrackSmsfSuperFundDetailViewedAsync({
|
|
51
|
-
promotedFundsShown: superSelectionAppService.promotedFunds,
|
|
52
|
-
defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi)
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
return (h(Host, null,
|
|
57
|
-
h("sss-header-section", null),
|
|
58
|
-
h("div", { class: "flex justify-center mt-11" },
|
|
59
|
-
h("sss-custom-fund", null,
|
|
60
|
-
h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: {
|
|
61
|
-
'was-validated': this.formState === 'validated'
|
|
62
|
-
}, ref: (el) => (this.formElement = el), onInput: (_) => this.updateIsSubmitDisabled() },
|
|
63
|
-
h("div", { class: "p-4 sm:p-6 pb-6 sm:pb-8 border shadow-sm rounded-lg max-w-560" },
|
|
64
|
-
h("p", { class: "sm:text-lg font-bold" }, "Fund details"),
|
|
65
|
-
h("div", { class: "bg-yellow-50 border-l-4 border-yellow-400 p-4 my-3" },
|
|
66
|
-
h("div", { class: "flex" },
|
|
67
|
-
h("div", { class: "flex-shrink-0" },
|
|
68
|
-
h("img", { class: "h-5 w-5", src: getAssetPath('assets/icon-exclamation.svg') })),
|
|
69
|
-
h("div", { class: "ml-3 text-sm text-yellow-700 leading-5" }, "Make sure your Self-managed super fund (SMSF) is a registered fund before completing this step."))),
|
|
70
|
-
h("sss-self-managed-fund-inputs", { fundForm: customFundState.selfManagedFundForm, showValidationErrors: this.formState === 'validated', onFormChanged: (event) => {
|
|
71
|
-
customFundState.selfManagedFundForm = Object.assign(Object.assign({}, customFundState.selfManagedFundForm), event.detail);
|
|
72
|
-
if (event.detail.isAbnValid !== undefined)
|
|
73
|
-
this.isAbnValid = event.detail.isAbnValid;
|
|
74
|
-
this.updateIsSubmitDisabled();
|
|
75
|
-
} })),
|
|
76
|
-
h("div", { class: "flex justify-center mt-8" },
|
|
77
|
-
h("div", { class: "sm:max-w-320 w-full" },
|
|
78
|
-
h("div", { class: "mb-4", onClick:
|
|
79
|
-
// user clicks on disabled button (div wrapper) then validation errors will show
|
|
80
|
-
() => (this.formState = 'validated') },
|
|
81
|
-
h("sss-button", { testid: "continue-button", fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Continue")),
|
|
82
|
-
h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage },
|
|
83
|
-
h("sss-button", { testid: "back-button", fillWidth: true, variant: "secondary" }, "Back")))))))));
|
|
84
|
-
}
|
|
85
|
-
updateIsSubmitDisabled() {
|
|
86
|
-
this.isSubmitDisabled = !this.formElement.checkValidity() || !this.isAbnValid;
|
|
87
|
-
}
|
|
88
|
-
async handleSubmitForm() {
|
|
89
|
-
this.formState = 'validated';
|
|
90
|
-
if (this.formElement.checkValidity())
|
|
91
|
-
this.success();
|
|
92
|
-
}
|
|
93
|
-
static get is() { return "sss-self-managed-fund"; }
|
|
94
|
-
static get properties() { return {
|
|
95
|
-
"history": {
|
|
96
|
-
"type": "unknown",
|
|
97
|
-
"mutable": false,
|
|
98
|
-
"complexType": {
|
|
99
|
-
"original": "RouterHistory",
|
|
100
|
-
"resolved": "RouterHistory",
|
|
101
|
-
"references": {
|
|
102
|
-
"RouterHistory": {
|
|
103
|
-
"location": "import",
|
|
104
|
-
"path": "@stencil/router"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
"required": false,
|
|
109
|
-
"optional": false,
|
|
110
|
-
"docs": {
|
|
111
|
-
"tags": [],
|
|
112
|
-
"text": ""
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}; }
|
|
116
|
-
static get states() { return {
|
|
117
|
-
"formState": {},
|
|
118
|
-
"isSubmitDisabled": {}
|
|
119
|
-
}; }
|
|
120
|
-
}
|
|
121
|
-
injectHistory(SelfManagedFund);
|