@flarehr/apollo-super-selection 4.33.32977 → 4.34.34409
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/assets/logo-unisuper.svg +15 -0
- package/dist/lib/apollo-super-selection/p-64f29eca.system.entry.js +69 -0
- package/dist/lib/apollo-super-selection/p-95403f2f.entry.js +14 -0
- package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -1
- package/dist/lib/cjs/apollo-super-selection.cjs.js +1 -1
- package/dist/lib/cjs/loader.cjs.js +1 -1
- package/dist/lib/cjs/{sss-button_30.cjs.entry.js → sss-button_38.cjs.entry.js} +932 -9
- package/dist/lib/collection/apollo-super-selection.css +1 -1
- package/dist/lib/collection/collection-manifest.json +16 -0
- package/dist/lib/collection/components/app-host/super-selection-app-host.css +2 -2
- package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +1 -1
- package/dist/lib/collection/components/super-selection-app/funds/constants.js +3 -1
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/unisuper-default.js +49 -0
- package/dist/lib/collection/components/super-selection-app/misc/button.js +2 -1
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-common.js +22 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-display-field.js +41 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-error-box.js +76 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.js +121 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-smsf.js +144 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-my-own-fund.js +217 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-smsf.js +355 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-types.js +281 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-warning-box.js +46 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill.js +73 -0
- 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 +10 -0
- package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +1 -0
- package/dist/lib/collection/components/super-selection-app/services/super-selection.store.js +1 -0
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-unisuper.svg +15 -0
- package/dist/lib/collection/components/super-selection-app/super-selection-app.js +4 -1
- package/dist/lib/esm/apollo-super-selection.js +1 -1
- package/dist/lib/esm/loader.js +1 -1
- package/dist/lib/esm/{sss-button_30.entry.js → sss-button_38.entry.js} +925 -10
- package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
- package/dist/lib/esm-es5/loader.js +1 -1
- package/dist/lib/esm-es5/sss-button_38.entry.js +69 -0
- package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +20 -0
- package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +39 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.dto.d.ts +1 -1
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/unisuper-default.d.ts +3 -0
- package/dist/lib/types/components/super-selection-app/misc/button.d.ts +1 -1
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-common.d.ts +9 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-display-field.d.ts +5 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-error-box.d.ts +5 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.d.ts +18 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-invalid-smsf.d.ts +28 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-my-own-fund.d.ts +30 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-smsf.d.ts +48 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-types.d.ts +90 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-warning-box.d.ts +4 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill.d.ts +11 -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 +5 -0
- package/dist/lib/types/components/super-selection-app/services/super-selection.store.d.ts +2 -1
- package/dist/lib/types/components.d.ts +132 -0
- package/package.json +2 -2
- package/dist/lib/apollo-super-selection/p-1dca1954.system.entry.js +0 -69
- package/dist/lib/apollo-super-selection/p-6292b3a9.entry.js +0 -14
- package/dist/lib/esm-es5/sss-button_30.entry.js +0 -69
package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-smsf.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Component, h, Prop, State } from '@stencil/core';
|
|
2
|
+
import { EventTrackingService } from '../services/event-tracking.service';
|
|
3
|
+
import navigationService from '../services/navigation.service';
|
|
4
|
+
import { SuperSelectionAppRoutes } from '../services/super-selection-app.routes';
|
|
5
|
+
import { Header, isNullOrWhitespace } from './prefill-common';
|
|
6
|
+
import { BankAccountBsb, BankAccountName, BankAccountNumber, FundAbn, FundAddress, FundAddressCity, FundAddressLine1, FundAddressLine2, FundAddressPostcode, FundAddressState, FundEsa, MemberGivenNames, MemberLastName, SmsfFundName } from './prefill-types';
|
|
7
|
+
export class PrefillInvalidSMSF {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.eventTrackingService = EventTrackingService.Instance;
|
|
10
|
+
this.createSuperFundPrefillDeclinedDetail = (prefill) => {
|
|
11
|
+
return {
|
|
12
|
+
fundType: 'SMSF',
|
|
13
|
+
isAbnValid: prefill.fundAbn.valid,
|
|
14
|
+
isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
|
|
15
|
+
isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
this.createSuperFundPrefillViewedDetail = (prefill) => {
|
|
19
|
+
return {
|
|
20
|
+
fundType: 'SMSF',
|
|
21
|
+
isAbnValid: prefill.fundAbn.valid,
|
|
22
|
+
isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
|
|
23
|
+
isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
componentDidLoad() {
|
|
28
|
+
const detail = this.createSuperFundPrefillViewedDetail(this.prefill);
|
|
29
|
+
return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(detail);
|
|
30
|
+
}
|
|
31
|
+
async componentWillLoad() {
|
|
32
|
+
if (this.prefill && !this.prefill.fundAbn.valid) {
|
|
33
|
+
this.initialiseComponent(this.prefill);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// If prefill does not exist, or is valid we should
|
|
37
|
+
// not have landed on this page, navigate to consent page
|
|
38
|
+
navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.PrefillInvalidMyOwnFundPage);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return (h("div", null,
|
|
43
|
+
h(Header, null),
|
|
44
|
+
h("div", { class: "flex flex-col items-center gap-8 mt-8 sm:mt-12" },
|
|
45
|
+
h("div", { class: "flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg" },
|
|
46
|
+
h("div", { class: "flex flex-col items-start gap-3 self-stretch" },
|
|
47
|
+
h("div", { class: "self-stretch text-grey-900 text-lg not-italic font-bold leading-7" }, "Your self-managed super fund (SMSF) details"),
|
|
48
|
+
h("sss-prefill-error-box", { class: "self-stretch", notificationList: [
|
|
49
|
+
'The fund ABN is invalid. You are required to choose another fund to continue with your super nomination.'
|
|
50
|
+
] }),
|
|
51
|
+
h("div", { class: "flex flex-col gap-3 self-stretch mt-4" },
|
|
52
|
+
h("sss-prefill-display-field", { field: this.fundName }),
|
|
53
|
+
h("sss-prefill-display-field", { field: this.fundAbn }),
|
|
54
|
+
h("sss-prefill-display-field", { field: this.fundEsa }),
|
|
55
|
+
h("sss-prefill-display-field", { field: this.fundAddress }),
|
|
56
|
+
h("sss-prefill-display-field", { field: this.memberLastName }),
|
|
57
|
+
h("sss-prefill-display-field", { field: this.memberGivenNames }),
|
|
58
|
+
h("sss-prefill-display-field", { field: this.bankAccountName }),
|
|
59
|
+
h("sss-prefill-display-field", { field: this.bankAccountBsb }),
|
|
60
|
+
h("sss-prefill-display-field", { field: this.bankAccountNumber })))),
|
|
61
|
+
h("div", { class: "flex w-80 flex-col items-start gap-4" },
|
|
62
|
+
h("sss-button", { class: "self-stretch", fillWidth: true, variant: "primary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund")))));
|
|
63
|
+
}
|
|
64
|
+
initialiseComponent(prefill) {
|
|
65
|
+
this.fundName = new SmsfFundName(prefill.fundName);
|
|
66
|
+
this.fundAbn = new FundAbn(prefill.fundAbn.value, prefill.fundAbn.valid);
|
|
67
|
+
this.fundEsa = new FundEsa(prefill.electronicServiceAddress);
|
|
68
|
+
this.fundAddressLine1 = new FundAddressLine1(prefill.addressLine1);
|
|
69
|
+
this.fundAddressLine2 = new FundAddressLine2(prefill.addressLine2);
|
|
70
|
+
this.fundAddressCity = new FundAddressCity(prefill.addressCity);
|
|
71
|
+
this.fundAddressPostcode = new FundAddressPostcode(prefill.addressPostcode);
|
|
72
|
+
this.fundAddressState = new FundAddressState(prefill.addressState);
|
|
73
|
+
this.fundAddress = new FundAddress(this.fundAddressLine1, this.fundAddressLine2, this.fundAddressCity, this.fundAddressState, this.fundAddressPostcode);
|
|
74
|
+
this.memberGivenNames = new MemberGivenNames(prefill.memberFirstName);
|
|
75
|
+
this.memberLastName = new MemberLastName(prefill.memberFamilyName);
|
|
76
|
+
this.bankAccountName = new BankAccountName(prefill.bankAccountName);
|
|
77
|
+
this.bankAccountBsb = new BankAccountBsb(prefill.bankAccountBsb);
|
|
78
|
+
this.bankAccountNumber = new BankAccountNumber(prefill.bankAccountNumber);
|
|
79
|
+
}
|
|
80
|
+
async handleFundNominationDeclined() {
|
|
81
|
+
const detail = this.createSuperFundPrefillDeclinedDetail(this.prefill);
|
|
82
|
+
await this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(detail);
|
|
83
|
+
return navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ConsentPage);
|
|
84
|
+
}
|
|
85
|
+
static get is() { return "sss-prefill-invalid-smsf"; }
|
|
86
|
+
static get properties() { return {
|
|
87
|
+
"history": {
|
|
88
|
+
"type": "unknown",
|
|
89
|
+
"mutable": false,
|
|
90
|
+
"complexType": {
|
|
91
|
+
"original": "RouterHistory",
|
|
92
|
+
"resolved": "RouterHistory",
|
|
93
|
+
"references": {
|
|
94
|
+
"RouterHistory": {
|
|
95
|
+
"location": "import",
|
|
96
|
+
"path": "@stencil/router"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": ""
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"prefill": {
|
|
108
|
+
"type": "unknown",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "PrefillSMSFChoiceDto",
|
|
112
|
+
"resolved": "{ fundAbn: { valid: boolean; value: string; }; fundName: string | null; addressLine1: string | null; addressLine2: string | null; addressCity: string | null; addressState: string | null; addressPostcode: string | null; bankAccountBsb: string | null; bankAccountName: string | null; bankAccountNumber: string | null; electronicServiceAddress: string | null; memberFirstName: string | null; memberFamilyName: string | null; }",
|
|
113
|
+
"references": {
|
|
114
|
+
"PrefillSMSFChoiceDto": {
|
|
115
|
+
"location": "import",
|
|
116
|
+
"path": "../api/super-selection.api.dto"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": ""
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}; }
|
|
128
|
+
static get states() { return {
|
|
129
|
+
"fundName": {},
|
|
130
|
+
"fundAbn": {},
|
|
131
|
+
"fundEsa": {},
|
|
132
|
+
"fundAddressLine1": {},
|
|
133
|
+
"fundAddressLine2": {},
|
|
134
|
+
"fundAddressCity": {},
|
|
135
|
+
"fundAddressPostcode": {},
|
|
136
|
+
"fundAddressState": {},
|
|
137
|
+
"fundAddress": {},
|
|
138
|
+
"memberGivenNames": {},
|
|
139
|
+
"memberLastName": {},
|
|
140
|
+
"bankAccountName": {},
|
|
141
|
+
"bankAccountBsb": {},
|
|
142
|
+
"bankAccountNumber": {}
|
|
143
|
+
}; }
|
|
144
|
+
}
|
package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-my-own-fund.js
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Component, h, Prop, State } from '@stencil/core';
|
|
2
|
+
import customFundChoiceApi from '../funds/custom-fund/api/custom-fund-choice.api';
|
|
3
|
+
import { EventTrackingService } from '../services/event-tracking.service';
|
|
4
|
+
import navigationService from '../services/navigation.service';
|
|
5
|
+
import { SuperSelectionAppRoutes } from '../services/super-selection-app.routes';
|
|
6
|
+
import superSelectionAppService from '../services/super-selection-app.service';
|
|
7
|
+
import { DisabledField, Header, isNullOrWhitespace, Style } from './prefill-common';
|
|
8
|
+
import { FundName, FundUsi, MemberGivenNames, MemberLastName, MemberNumber, NAME_PATTERN } from './prefill-types';
|
|
9
|
+
export class PrefillMyOwnFund {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.mode = 'review';
|
|
12
|
+
this.formState = 'pristine';
|
|
13
|
+
this.isSubmitDisabled = true;
|
|
14
|
+
this.eventTrackingService = EventTrackingService.Instance;
|
|
15
|
+
this.createSuperFundPrefillDeclinedDetail = (prefill) => {
|
|
16
|
+
return {
|
|
17
|
+
fundType: 'My Own Fund',
|
|
18
|
+
isUsiValid: prefill.fundDetail.type === 'Valid',
|
|
19
|
+
isMemberNumberPresent: !isNullOrWhitespace(prefill.memberNumber),
|
|
20
|
+
isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
|
|
21
|
+
isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
this.createSuperFundPrefillViewedDetail = (prefill) => {
|
|
25
|
+
return {
|
|
26
|
+
fundType: 'My Own Fund',
|
|
27
|
+
isUsiValid: prefill.fundDetail.type === 'Valid',
|
|
28
|
+
isMemberNumberPresent: !isNullOrWhitespace(prefill.memberNumber),
|
|
29
|
+
isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
|
|
30
|
+
isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
componentDidLoad() {
|
|
35
|
+
const detail = this.createSuperFundPrefillViewedDetail(this.prefill);
|
|
36
|
+
return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(detail);
|
|
37
|
+
}
|
|
38
|
+
async componentWillLoad() {
|
|
39
|
+
if (this.prefill && this.prefill.fundDetail.type === 'Valid') {
|
|
40
|
+
this.initialiseComponent(this.prefill.fundDetail.fundName, this.prefill);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// If prefill does not exist, or is invalid we should
|
|
44
|
+
// not have landed on this page, navigate to consent page
|
|
45
|
+
navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ConsentPage);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
const errorMessages = [
|
|
50
|
+
this.memberNumber.errorMessage,
|
|
51
|
+
this.memberLastName.errorMessage,
|
|
52
|
+
this.memberGivenNames.errorMessage
|
|
53
|
+
].filter((err) => err !== null);
|
|
54
|
+
return (h("div", null,
|
|
55
|
+
h(Header, null),
|
|
56
|
+
h("div", { class: "flex flex-col items-center gap-8 mt-8 sm:mt-12" },
|
|
57
|
+
h("div", { class: "flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg" },
|
|
58
|
+
h("div", { class: "flex flex-col items-start gap-3.5 self-stretch" },
|
|
59
|
+
h("div", { class: "self-stretch text-grey-900 text-lg not-italic font-bold leading-7" }, "Your fund details"),
|
|
60
|
+
h("sss-prefill-warning-box", { class: "self-stretch", notificationList: [
|
|
61
|
+
'Make sure you are a current member of the fund before completing this step.',
|
|
62
|
+
'Please check that the fund USI is correct as some funds have similar names.'
|
|
63
|
+
] }),
|
|
64
|
+
this.mode === 'review' && errorMessages.length > 0 && (h("sss-prefill-error-box", { class: "self-stretch", notificationList: errorMessages, withHeader: true })),
|
|
65
|
+
this.mode === 'review' && (h("div", { class: "flex flex-col gap-3 self-stretch mt-4" },
|
|
66
|
+
h("sss-prefill-display-field", { field: this.fundUsi }),
|
|
67
|
+
h("sss-prefill-display-field", { field: this.fundName }),
|
|
68
|
+
h("sss-prefill-display-field", { field: this.memberNumber }),
|
|
69
|
+
h("sss-prefill-display-field", { field: this.memberLastName }),
|
|
70
|
+
h("sss-prefill-display-field", { field: this.memberGivenNames }))),
|
|
71
|
+
this.mode === 'review' && (h("sss-button", { class: "self-stretch", fillWidth: true, variant: "light", promiseFn: () => this.setModeToEdit() },
|
|
72
|
+
h("div", { class: "flex flex-row gap-2" },
|
|
73
|
+
h("div", { class: "text-sm not-italic font-medium leading-4" }, "Edit details"),
|
|
74
|
+
h("div", { class: "w-4 h-4 relative" },
|
|
75
|
+
h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17", height: "16", viewBox: "0 0 17 16", fill: "currentColor" },
|
|
76
|
+
h("path", { d: "M11.369 2.86865C11.9939 2.24381 13.0069 2.24381 13.6318 2.86865C14.2566 3.49349 14.2566 4.50656 13.6318 5.1314L12.9974 5.76571L10.7347 3.50297L11.369 2.86865Z" }),
|
|
77
|
+
h("path", { d: "M9.60334 4.63434L2.90039 11.3373V13.6H5.16313L11.8661 6.89708L9.60334 4.63434Z" })))))),
|
|
78
|
+
this.mode === 'edit' && (h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: { 'was-validated': this.formState === 'validated' }, ref: (el) => (this.formElement = el), onInput: (_) => (this.isSubmitDisabled = this.formHasMissingData()) },
|
|
79
|
+
DisabledField(this.fundName.name, this.fundName.value),
|
|
80
|
+
DisabledField(this.fundUsi.name, this.fundUsi.value),
|
|
81
|
+
h("div", { class: "mt-3" },
|
|
82
|
+
h("label", { class: "text-sm font-medium text-gray-700" }, this.memberNumber.name),
|
|
83
|
+
h("div", { class: "mt-1" },
|
|
84
|
+
h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, pattern: "[A-Za-z0-9]{4,16}", value: this.memberNumber.value, onInput: (ev) => {
|
|
85
|
+
this.updateMemberNumber(ev.target.value);
|
|
86
|
+
} }),
|
|
87
|
+
h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberNumber.errorMessage))),
|
|
88
|
+
h("div", { class: "flex gap-x-4 flex-col sm:flex-row" },
|
|
89
|
+
h("div", { class: "mt-3 w-full sm:w-1/2" },
|
|
90
|
+
h("label", { class: "text-sm font-medium text-gray-700" }, this.memberGivenNames.name),
|
|
91
|
+
h("div", { class: "mt-1" },
|
|
92
|
+
h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, pattern: NAME_PATTERN, value: this.memberGivenNames.value, onInput: (ev) => {
|
|
93
|
+
this.updateMemberGivenNames(ev.target.value);
|
|
94
|
+
} }),
|
|
95
|
+
h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberGivenNames.errorMessage))),
|
|
96
|
+
h("div", { class: "mt-3 w-full sm:w-1/2" },
|
|
97
|
+
h("label", { class: "text-sm font-medium text-gray-700" }, this.memberLastName.name),
|
|
98
|
+
h("div", { class: "mt-1" },
|
|
99
|
+
h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, pattern: NAME_PATTERN, value: this.memberLastName.value, onInput: (ev) => {
|
|
100
|
+
this.updateMemberLastName(ev.target.value);
|
|
101
|
+
} }),
|
|
102
|
+
h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberLastName.errorMessage)))))))),
|
|
103
|
+
h("div", { class: "flex w-80 flex-col items-start gap-4" },
|
|
104
|
+
h("sss-button", { class: "self-stretch", fillWidth: true, variant: "primary", disabled: this.isSubmitDisabled, promiseFn: () => this.handleSubmitForm() }, "Continue"),
|
|
105
|
+
h("sss-button", { class: "self-stretch", fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund")))));
|
|
106
|
+
}
|
|
107
|
+
initialiseComponent(fundName, prefill) {
|
|
108
|
+
this.fundUsi = new FundUsi(prefill.fundDetail.fundUsi, true);
|
|
109
|
+
this.fundName = new FundName(fundName, true);
|
|
110
|
+
this.memberNumber = new MemberNumber(prefill.memberNumber);
|
|
111
|
+
this.memberGivenNames = new MemberGivenNames(prefill.memberFirstName);
|
|
112
|
+
this.memberLastName = new MemberLastName(prefill.memberFamilyName);
|
|
113
|
+
this.isSubmitDisabled = this.formHasMissingData();
|
|
114
|
+
}
|
|
115
|
+
isFormValid() {
|
|
116
|
+
return (this.fundUsi.isValid &&
|
|
117
|
+
this.fundName.isValid &&
|
|
118
|
+
this.memberNumber.isValid &&
|
|
119
|
+
this.memberGivenNames.isValid &&
|
|
120
|
+
this.memberLastName.isValid);
|
|
121
|
+
}
|
|
122
|
+
formHasMissingData() {
|
|
123
|
+
return (this.fundUsi.isEmpty ||
|
|
124
|
+
this.fundName.isEmpty ||
|
|
125
|
+
this.memberNumber.isEmpty ||
|
|
126
|
+
this.memberGivenNames.isEmpty ||
|
|
127
|
+
this.memberLastName.isEmpty);
|
|
128
|
+
}
|
|
129
|
+
setModeToEdit() {
|
|
130
|
+
this.mode = 'edit';
|
|
131
|
+
return Promise.resolve();
|
|
132
|
+
}
|
|
133
|
+
updateMemberNumber(memberNumber) {
|
|
134
|
+
this.memberNumber = new MemberNumber(memberNumber.trim());
|
|
135
|
+
}
|
|
136
|
+
updateMemberGivenNames(memberGivenNames) {
|
|
137
|
+
this.memberGivenNames = new MemberGivenNames(memberGivenNames.trimStart());
|
|
138
|
+
}
|
|
139
|
+
updateMemberLastName(memberLastName) {
|
|
140
|
+
this.memberLastName = new MemberLastName(memberLastName.trim());
|
|
141
|
+
}
|
|
142
|
+
async handleSubmitForm() {
|
|
143
|
+
this.formState = 'validated';
|
|
144
|
+
if (!this.isFormValid()) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (this.mode === 'edit' && !this.formElement.checkValidity()) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
navigationService.navigateInternallyToStandardChoice({
|
|
151
|
+
history: this.history,
|
|
152
|
+
fundName: this.fundName.value,
|
|
153
|
+
handleSubmitFn: async (standardChoiceFormSignature) => {
|
|
154
|
+
const customFundChoiceDto = Object.assign({ fundUsi: this.fundUsi.value, memberNumber: this.memberNumber.value, memberFirstName: this.memberGivenNames.value, memberFamilyName: this.memberLastName.value, standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
|
|
155
|
+
await customFundChoiceApi.submitCustomFundChoiceAsync(customFundChoiceDto);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
async handleFundNominationDeclined() {
|
|
160
|
+
const detail = this.createSuperFundPrefillDeclinedDetail(this.prefill);
|
|
161
|
+
await this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(detail);
|
|
162
|
+
return navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ConsentPage);
|
|
163
|
+
}
|
|
164
|
+
static get is() { return "sss-prefill-my-own-fund"; }
|
|
165
|
+
static get properties() { return {
|
|
166
|
+
"history": {
|
|
167
|
+
"type": "unknown",
|
|
168
|
+
"mutable": false,
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "RouterHistory",
|
|
171
|
+
"resolved": "RouterHistory",
|
|
172
|
+
"references": {
|
|
173
|
+
"RouterHistory": {
|
|
174
|
+
"location": "import",
|
|
175
|
+
"path": "@stencil/router"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"optional": false,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": ""
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"prefill": {
|
|
187
|
+
"type": "unknown",
|
|
188
|
+
"mutable": false,
|
|
189
|
+
"complexType": {
|
|
190
|
+
"original": "PrefillOwnFundChoiceDto",
|
|
191
|
+
"resolved": "{ fundDetail: { type: \"Valid\"; fundUsi: string; fundName: string; } | { type: \"Invalid\"; fundUsi: string; }; memberNumber: string | null; memberFirstName: string | null; memberFamilyName: string | null; }",
|
|
192
|
+
"references": {
|
|
193
|
+
"PrefillOwnFundChoiceDto": {
|
|
194
|
+
"location": "import",
|
|
195
|
+
"path": "../api/super-selection.api.dto"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"required": false,
|
|
200
|
+
"optional": false,
|
|
201
|
+
"docs": {
|
|
202
|
+
"tags": [],
|
|
203
|
+
"text": ""
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}; }
|
|
207
|
+
static get states() { return {
|
|
208
|
+
"mode": {},
|
|
209
|
+
"formState": {},
|
|
210
|
+
"isSubmitDisabled": {},
|
|
211
|
+
"fundUsi": {},
|
|
212
|
+
"fundName": {},
|
|
213
|
+
"memberNumber": {},
|
|
214
|
+
"memberGivenNames": {},
|
|
215
|
+
"memberLastName": {}
|
|
216
|
+
}; }
|
|
217
|
+
}
|