@saasquatch/mint-components 1.14.3 → 1.14.5-1
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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_17.cjs.entry.js +158 -5
- package/dist/cjs/sqm-big-stat_41.cjs.entry.js +87 -1
- package/dist/cjs/{sqm-invoice-table-view-16ac73d0.js → sqm-invoice-table-view-0f7fa309.js} +17 -0
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +509 -893
- package/dist/collection/components/sqm-coupon-code/sqm-coupon-code.js +72 -0
- package/dist/collection/components/sqm-coupon-code/useCouponCode.js +72 -3
- package/dist/collection/components/tax-and-cash/BankingForm.stories.js +12 -0
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +16 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/formDefinitions.js +1 -1
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +36 -1
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +106 -3
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +7 -0
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form-view.js +38 -0
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form.js +79 -1
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/useDocusignForm.js +4 -0
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +205 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_17.entry.js +158 -5
- package/dist/esm/sqm-big-stat_41.entry.js +89 -3
- package/dist/esm/{sqm-invoice-table-view-2c726568.js → sqm-invoice-table-view-7f376a75.js} +17 -0
- package/dist/esm/sqm-stencilbook.entry.js +2494 -2878
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_17.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_41.entry.js +1 -1
- package/dist/esm-es5/sqm-invoice-table-view-7f376a75.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/{p-73891ac0.entry.js → p-4034b98f.entry.js} +18 -17
- package/dist/mint-components/{p-b06add5c.entry.js → p-4d7108af.entry.js} +2 -2
- package/dist/mint-components/p-9a1843cb.system.js +1 -0
- package/dist/mint-components/{p-207da855.system.entry.js → p-caca540c.system.entry.js} +1 -1
- package/dist/mint-components/p-ccd60c4b.js +1 -0
- package/dist/mint-components/p-db7d2444.system.entry.js +1 -0
- package/dist/mint-components/p-ebb4922d.entry.js +205 -0
- package/dist/mint-components/p-f06c4835.system.entry.js +1 -0
- package/dist/types/components/sqm-coupon-code/sqm-coupon-code.d.ts +16 -0
- package/dist/types/components/sqm-coupon-code/useCouponCode.d.ts +3 -1
- package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.d.ts +1 -1
- package/dist/types/components/tax-and-cash/BankingForm.stories.d.ts +1 -0
- package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +6 -0
- package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.d.ts +16 -0
- package/dist/types/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form-view.d.ts +6 -0
- package/dist/types/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form.d.ts +12 -0
- package/dist/types/components/tax-and-cash/sqm-docusign-form/useDocusignForm.d.ts +3 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +35 -0
- package/dist/types/components.d.ts +154 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/sqm-invoice-table-view-2c726568.js +0 -1
- package/dist/mint-components/p-0d68b3b1.entry.js +0 -205
- package/dist/mint-components/p-3f067fd5.js +0 -1
- package/dist/mint-components/p-6604658c.system.entry.js +0 -1
- package/dist/mint-components/p-a6178052.system.entry.js +0 -1
- package/dist/mint-components/p-a7746488.system.js +0 -1
- package/dist/mint-components/sqm-stencilbook.entry.js +0 -18989
- package/dist/mint-components/sqm-stencilbook.system.entry.js +0 -1
- package/shoelace/assets/icons/twitter-x.svg +0 -4
|
@@ -89,6 +89,22 @@ export class CouponCode {
|
|
|
89
89
|
* @uiGroup Coupon code error
|
|
90
90
|
*/
|
|
91
91
|
this.pendingErrorText = "Your code will be available on {unpendDate}. Mark your calendar and come back then to redeem your reward!";
|
|
92
|
+
/**
|
|
93
|
+
* Display this message when the code fails to load before retrying.
|
|
94
|
+
*
|
|
95
|
+
* @uiWidget textArea
|
|
96
|
+
* @uiName Code sync error retry message
|
|
97
|
+
* @uiGroup Coupon code error
|
|
98
|
+
*/
|
|
99
|
+
this.codeSyncErrorRetryText = "We're experiencing an issue generating your coupon code. If it doesn't appear shortly, please contact {supportEmail}. Retrying in {timeRemaining} seconds.";
|
|
100
|
+
/**
|
|
101
|
+
* Display this message when the code fails to load after retrying.
|
|
102
|
+
*
|
|
103
|
+
* @uiWidget textArea
|
|
104
|
+
* @uiName Code sync error message
|
|
105
|
+
* @uiGroup Coupon code error
|
|
106
|
+
*/
|
|
107
|
+
this.codeSyncErrorText = "We're still experiencing an issue generating your coupon code. Please contact {supportEmail} for assistance.";
|
|
92
108
|
/**
|
|
93
109
|
* Display this message when the code fails to load due to an unspecified error.
|
|
94
110
|
*
|
|
@@ -419,6 +435,60 @@ export class CouponCode {
|
|
|
419
435
|
"reflect": false,
|
|
420
436
|
"defaultValue": "\"Your code will be available on {unpendDate}. Mark your calendar and come back then to redeem your reward!\""
|
|
421
437
|
},
|
|
438
|
+
"codeSyncErrorRetryText": {
|
|
439
|
+
"type": "string",
|
|
440
|
+
"mutable": false,
|
|
441
|
+
"complexType": {
|
|
442
|
+
"original": "string",
|
|
443
|
+
"resolved": "string",
|
|
444
|
+
"references": {}
|
|
445
|
+
},
|
|
446
|
+
"required": false,
|
|
447
|
+
"optional": false,
|
|
448
|
+
"docs": {
|
|
449
|
+
"tags": [{
|
|
450
|
+
"text": "textArea",
|
|
451
|
+
"name": "uiWidget"
|
|
452
|
+
}, {
|
|
453
|
+
"text": "Code sync error retry message",
|
|
454
|
+
"name": "uiName"
|
|
455
|
+
}, {
|
|
456
|
+
"text": "Coupon code error",
|
|
457
|
+
"name": "uiGroup"
|
|
458
|
+
}],
|
|
459
|
+
"text": "Display this message when the code fails to load before retrying."
|
|
460
|
+
},
|
|
461
|
+
"attribute": "code-sync-error-retry-text",
|
|
462
|
+
"reflect": false,
|
|
463
|
+
"defaultValue": "\"We're experiencing an issue generating your coupon code. If it doesn't appear shortly, please contact {supportEmail}. Retrying in {timeRemaining} seconds.\""
|
|
464
|
+
},
|
|
465
|
+
"codeSyncErrorText": {
|
|
466
|
+
"type": "string",
|
|
467
|
+
"mutable": false,
|
|
468
|
+
"complexType": {
|
|
469
|
+
"original": "string",
|
|
470
|
+
"resolved": "string",
|
|
471
|
+
"references": {}
|
|
472
|
+
},
|
|
473
|
+
"required": false,
|
|
474
|
+
"optional": false,
|
|
475
|
+
"docs": {
|
|
476
|
+
"tags": [{
|
|
477
|
+
"text": "textArea",
|
|
478
|
+
"name": "uiWidget"
|
|
479
|
+
}, {
|
|
480
|
+
"text": "Code sync error message",
|
|
481
|
+
"name": "uiName"
|
|
482
|
+
}, {
|
|
483
|
+
"text": "Coupon code error",
|
|
484
|
+
"name": "uiGroup"
|
|
485
|
+
}],
|
|
486
|
+
"text": "Display this message when the code fails to load after retrying."
|
|
487
|
+
},
|
|
488
|
+
"attribute": "code-sync-error-text",
|
|
489
|
+
"reflect": false,
|
|
490
|
+
"defaultValue": "\"We're still experiencing an issue generating your coupon code. Please contact {supportEmail} for assistance.\""
|
|
491
|
+
},
|
|
422
492
|
"genericErrorText": {
|
|
423
493
|
"type": "string",
|
|
424
494
|
"mutable": false,
|
|
@@ -514,6 +584,8 @@ function useDemoCouponCode(props) {
|
|
|
514
584
|
error: false,
|
|
515
585
|
couponCodePlaceholder: props.couponCodePlaceholder,
|
|
516
586
|
couponCodeLabel: props.couponCodeLabel,
|
|
587
|
+
codeSyncErrorText: props.codeSyncErrorText,
|
|
588
|
+
codeSyncErrorRetryText: props.codeSyncErrorRetryText,
|
|
517
589
|
open,
|
|
518
590
|
onClick: () => {
|
|
519
591
|
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useEngagementMedium, useMutation, useProgramId, useQuery, useUserIdentity, } from "@saasquatch/component-boilerplate";
|
|
2
|
-
import { useState } from "@saasquatch/universal-hooks";
|
|
1
|
+
import { setUserIdentity, useEngagementMedium, useMutation, useProgramId, useQuery, useUserIdentity, } from "@saasquatch/component-boilerplate";
|
|
2
|
+
import { useEffect, useRef, useState } from "@saasquatch/universal-hooks";
|
|
3
3
|
import { gql } from "graphql-request";
|
|
4
|
+
import { intl } from "../../global/global";
|
|
4
5
|
const FuelTankRewardsQuery = gql `
|
|
5
6
|
query fuelTankRewardsQuery($programId: ID!) {
|
|
6
7
|
user: viewer {
|
|
@@ -18,6 +19,7 @@ const FuelTankRewardsQuery = gql `
|
|
|
18
19
|
dateCancelled
|
|
19
20
|
dateScheduledFor
|
|
20
21
|
datePendingForUnhandledError
|
|
22
|
+
pendingReasons
|
|
21
23
|
}
|
|
22
24
|
count
|
|
23
25
|
totalCount
|
|
@@ -37,16 +39,68 @@ export function useCouponCode(props) {
|
|
|
37
39
|
const programId = useProgramId();
|
|
38
40
|
const engagementMedium = useEngagementMedium();
|
|
39
41
|
const [sendLoadEvent] = useMutation(WIDGET_ENGAGEMENT_EVENT);
|
|
42
|
+
const [retried, setRetried] = useState(false);
|
|
43
|
+
const [countdown, setCountdown] = useState(60);
|
|
44
|
+
const timerRef = useRef(undefined);
|
|
45
|
+
const countdownRef = useRef(undefined);
|
|
40
46
|
const { data, loading, refetch, errors } = useQuery(FuelTankRewardsQuery, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
47
|
+
async function checkReward() {
|
|
48
|
+
var _a, _b, _c, _d, _e;
|
|
49
|
+
const data = await refetch();
|
|
50
|
+
setRetried(true);
|
|
51
|
+
if (
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
!((_e = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.instantAccessRewards) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.pendingReasons) === null || _e === void 0 ? void 0 : _e.includes("ERROR_SYNCING_FUEL_TANK_CODE"))) {
|
|
54
|
+
return clearInterval(timerRef.current);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const reward = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.instantAccessRewards) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c[1];
|
|
58
|
+
const startTimer = (countdown = 61000) => setInterval(checkReward, countdown);
|
|
59
|
+
const startCountdown = (countdown) => setInterval(() => setCountdown(countdown), 1000);
|
|
60
|
+
// Refetch reward status timer
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
setUserIdentity({
|
|
64
|
+
jwt: "eyJraWQiOiJJUk1Yc1l5NllZcXE0Njk0MzdtRzhFUlF0OFFvS0ZCYUcxIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJqdGkiOiI2ODgyNzkwODNiMDIzMzg0Yjg3MTU2OTAiLCJpYXQiOjE3NTMzODExMjgsImV4cCI6MTc1MzQ2NzUyOCwic3ViIjoiTTJObVlXTXdOVGt4WWpBMk5tRXhORFE0TTJObE5tRXdaV0U0TkdSaFltUmtOelU0TnpBNE1ETXpNbVl3TTJNNVltTTNNVFpqTm1JNVltWmhZVE5qTVE9PTpNMk5tWVdNd05Ua3hZakEyTm1FeE5EUTRNMk5sTm1Fd1pXRTROR1JoWW1Sa056VTROekE0TURNek1tWXdNMk01WW1NM01UWmpObUk1WW1aaFlUTmpNUT09QGFkY3Rkd3Fya2Yyeng6dXNlcnMiLCJ1c2VyIjp7ImlkIjoiM2NmYWMwNTkxYjA2NmExNDQ4M2NlNmEwZWE4NGRhYmRkNzU4NzA4MDMzMmYwM2M5YmM3MTZjNmI5YmZhYTNjMSIsImFjY291bnRJZCI6IjNjZmFjMDU5MWIwNjZhMTQ0ODNjZTZhMGVhODRkYWJkZDc1ODcwODAzMzJmMDNjOWJjNzE2YzZiOWJmYWEzYzEiLCJkYXRlQmxvY2tlZCI6bnVsbH19.lkoqVrRfzHJXzokOw9werq-en-bWbw3djQsVw9lLF3U",
|
|
65
|
+
id: "3cfac0591b066a14483ce6a0ea84dabdd7587080332f03c9bc716c6b9bfaa3c1",
|
|
66
|
+
accountId: "3cfac0591b066a14483ce6a0ea84dabdd7587080332f03c9bc716c6b9bfaa3c1",
|
|
67
|
+
});
|
|
68
|
+
if (!timerRef.current && ((_a = reward === null || reward === void 0 ? void 0 : reward.statuses) === null || _a === void 0 ? void 0 : _a.includes("PENDING")) && ((_b = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _b === void 0 ? void 0 : _b.includes("ERROR_SYNCING_FUEL_TANK_CODE"))) {
|
|
69
|
+
timerRef.current = startTimer();
|
|
70
|
+
}
|
|
71
|
+
return () => {
|
|
72
|
+
clearInterval(timerRef.current);
|
|
73
|
+
};
|
|
74
|
+
}, []);
|
|
75
|
+
// Countdown timer
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
if (countdown > 0 && ((_a = reward === null || reward === void 0 ? void 0 : reward.statuses) === null || _a === void 0 ? void 0 : _a.includes("PENDING")) && ((_b = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _b === void 0 ? void 0 : _b.includes("ERROR_SYNCING_FUEL_TANK_CODE"))) {
|
|
79
|
+
clearInterval(countdownRef.current);
|
|
80
|
+
countdownRef.current = startCountdown(countdown - 1);
|
|
81
|
+
}
|
|
82
|
+
return () => {
|
|
83
|
+
clearInterval(countdownRef.current);
|
|
84
|
+
};
|
|
85
|
+
}, [countdown, reward]);
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
var _a, _b;
|
|
88
|
+
// Retry after a minute if the reward is pending and has an error syncing the fuel tank code
|
|
89
|
+
if (((_a = reward === null || reward === void 0 ? void 0 : reward.statuses) === null || _a === void 0 ? void 0 : _a.includes("PENDING")) && ((_b = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _b === void 0 ? void 0 : _b.includes("ERROR_SYNCING_FUEL_TANK_CODE"))) {
|
|
90
|
+
startTimer();
|
|
91
|
+
}
|
|
92
|
+
}, [reward]);
|
|
41
93
|
const getStatus = (reward) => {
|
|
42
94
|
if (!reward || !reward.statuses)
|
|
43
95
|
return "ERROR";
|
|
44
96
|
const state = reward.statuses[reward.statuses.length - 1];
|
|
97
|
+
if (state === "PENDING" &&
|
|
98
|
+
reward.pendingReasons.includes("ERROR_SYNCING_FUEL_TANK_CODE"))
|
|
99
|
+
return "ERROR_SYNCING_FUEL_TANK_CODE";
|
|
45
100
|
if (state === "PENDING" && reward.dateScheduledFor === null)
|
|
46
101
|
return "EMPTY_TANK";
|
|
47
102
|
return state;
|
|
48
103
|
};
|
|
49
|
-
const reward = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.instantAccessRewards) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c[0];
|
|
50
104
|
const rewardStatus = getStatus(reward);
|
|
51
105
|
const dateAvailable = rewardStatus === "PENDING" && reward.dateScheduledFor
|
|
52
106
|
? new Date(reward.dateScheduledFor).toLocaleDateString("default", {
|
|
@@ -84,6 +138,21 @@ export function useCouponCode(props) {
|
|
|
84
138
|
return props.expiredErrorText;
|
|
85
139
|
case "EMPTY_TANK":
|
|
86
140
|
return props.fullfillmentErrorText;
|
|
141
|
+
case "ERROR_SYNCING_FUEL_TANK_CODE":
|
|
142
|
+
return retried
|
|
143
|
+
? intl.formatMessage({
|
|
144
|
+
id: "codeSyncErrorText",
|
|
145
|
+
defaultMessage: props.codeSyncErrorText,
|
|
146
|
+
}, {
|
|
147
|
+
supportEmail: "advocate-support@impact.com",
|
|
148
|
+
})
|
|
149
|
+
: intl.formatMessage({
|
|
150
|
+
id: "codeSyncErrorText",
|
|
151
|
+
defaultMessage: props.codeSyncErrorRetryText,
|
|
152
|
+
}, {
|
|
153
|
+
supportEmail: "advocate-support@impact.com",
|
|
154
|
+
timeRemaining: countdown,
|
|
155
|
+
});
|
|
87
156
|
case "PENDING":
|
|
88
157
|
return props.pendingErrorText.replace("{unpendDate}", dateAvailable);
|
|
89
158
|
case "REDEEMED":
|
|
@@ -20,6 +20,7 @@ const bankingFormProps = {
|
|
|
20
20
|
currency: "USD",
|
|
21
21
|
loadingError: false,
|
|
22
22
|
email: "test@example.com",
|
|
23
|
+
showModal: false,
|
|
23
24
|
},
|
|
24
25
|
callbacks: {
|
|
25
26
|
onVerificationHide: () => { },
|
|
@@ -29,6 +30,8 @@ const bankingFormProps = {
|
|
|
29
30
|
setPaymentScheduleChecked: () => { },
|
|
30
31
|
setCountrySearch: () => { },
|
|
31
32
|
onBack: async () => console.log("back"),
|
|
33
|
+
onModalOpen: () => { },
|
|
34
|
+
onModalClose: () => { },
|
|
32
35
|
},
|
|
33
36
|
refs: { formRef: { current: null } },
|
|
34
37
|
};
|
|
@@ -349,3 +352,12 @@ export const BankingInfoFormVerififyIdentityModal = () => {
|
|
|
349
352
|
},
|
|
350
353
|
} }));
|
|
351
354
|
};
|
|
355
|
+
export const BankingInfoFormModalOpen = () => {
|
|
356
|
+
return (h("sqm-banking-info-form", { demoData: {
|
|
357
|
+
...bankingFormProps,
|
|
358
|
+
states: {
|
|
359
|
+
...bankingFormProps.states,
|
|
360
|
+
showModal: true,
|
|
361
|
+
},
|
|
362
|
+
} }));
|
|
363
|
+
};
|
|
@@ -209,6 +209,7 @@ const stepFourProps = {
|
|
|
209
209
|
formState: {
|
|
210
210
|
paymentMethodChecked: "toBankAccount",
|
|
211
211
|
},
|
|
212
|
+
showModal: false,
|
|
212
213
|
},
|
|
213
214
|
callbacks: {
|
|
214
215
|
onVerificationHide: () => { },
|
|
@@ -218,6 +219,8 @@ const stepFourProps = {
|
|
|
218
219
|
setPaymentScheduleChecked: () => { },
|
|
219
220
|
onBack: async () => console.log("back"),
|
|
220
221
|
setCountrySearch: () => { },
|
|
222
|
+
onModalOpen: () => { },
|
|
223
|
+
onModalClose: () => { },
|
|
221
224
|
},
|
|
222
225
|
refs: { formRef: { current: null } },
|
|
223
226
|
};
|
|
@@ -239,12 +242,15 @@ const docusignFormProps = {
|
|
|
239
242
|
errors: {},
|
|
240
243
|
taxFormExpired: false,
|
|
241
244
|
},
|
|
245
|
+
showModal: false,
|
|
242
246
|
},
|
|
243
247
|
callbacks: {
|
|
244
248
|
onExit: () => { },
|
|
245
249
|
completeDocument: async () => { },
|
|
246
250
|
setParticipantType: (p) => console.log({ p }),
|
|
247
251
|
setDocusignStatus: (status) => console.log(status),
|
|
252
|
+
onModalOpen: () => { },
|
|
253
|
+
onModalClose: () => { },
|
|
248
254
|
},
|
|
249
255
|
};
|
|
250
256
|
const dashboardProps = {
|
|
@@ -721,6 +727,16 @@ export const StepThreeDocusignDisabled = () => {
|
|
|
721
727
|
},
|
|
722
728
|
} }));
|
|
723
729
|
};
|
|
730
|
+
export const StepThreeWithDocusignModalOpen = () => {
|
|
731
|
+
return (h("sqm-docusign-form", { demoData: {
|
|
732
|
+
states: {
|
|
733
|
+
documentType: "W9",
|
|
734
|
+
documentTypeString: taxTypeToName("W9"),
|
|
735
|
+
...docusignFormProps.states,
|
|
736
|
+
showModal: true,
|
|
737
|
+
},
|
|
738
|
+
} }));
|
|
739
|
+
};
|
|
724
740
|
// STEP 4
|
|
725
741
|
export const StepFourDefault = () => {
|
|
726
742
|
return h("sqm-banking-info-form", null);
|
|
@@ -5,7 +5,7 @@ export function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
|
5
5
|
const { errors, ...formState } = props.states.formState;
|
|
6
6
|
return {
|
|
7
7
|
0: {
|
|
8
|
-
input: (h("sl-input", Object.assign({ required: true, label: props.text.beneficiaryAccountNameLabel, name: "/beneficiaryAccountName", id: "beneficiaryAccountName", key: "beneficiaryAccountName", type: "text" }, (((_a = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _a === void 0 ? void 0 : _a.beneficiaryAccountName) && {
|
|
8
|
+
input: (h("sl-input", Object.assign({ required: true, label: props.text.beneficiaryAccountNameLabel, name: "/beneficiaryAccountName", id: "beneficiaryAccountName", key: "beneficiaryAccountName", type: "text", "help-text": props.text.beneficiaryAccountNameDescription }, (((_a = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _a === void 0 ? void 0 : _a.beneficiaryAccountName) && {
|
|
9
9
|
class: "error-input",
|
|
10
10
|
helpText: getValidationErrorMessage({
|
|
11
11
|
type: (_c = (_b = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _b === void 0 ? void 0 : _b.beneficiaryAccountName) === null || _c === void 0 ? void 0 : _c.type,
|
package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js
CHANGED
|
@@ -3,6 +3,11 @@ import { intl } from "../../../global/global";
|
|
|
3
3
|
import { createStyleSheet } from "../../../styling/JSS";
|
|
4
4
|
import { FORM_STEPS } from "../sqm-tax-and-cash/data";
|
|
5
5
|
const style = {
|
|
6
|
+
ModalTitleContainer: {
|
|
7
|
+
display: "flex",
|
|
8
|
+
gap: "var(--sl-spacing-small)",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
},
|
|
6
11
|
FormWrapper: {
|
|
7
12
|
display: "flex",
|
|
8
13
|
justifyContent: "flex-start",
|
|
@@ -142,6 +147,28 @@ const style = {
|
|
|
142
147
|
height: "26px",
|
|
143
148
|
width: "26px",
|
|
144
149
|
},
|
|
150
|
+
Dialog: {
|
|
151
|
+
"&::part(panel)": {
|
|
152
|
+
maxWidth: "420px",
|
|
153
|
+
},
|
|
154
|
+
"&::part(title)": {
|
|
155
|
+
fontSize: "var(--sl-font-size-large)",
|
|
156
|
+
fontWeight: "600",
|
|
157
|
+
},
|
|
158
|
+
"&::part(body)": {
|
|
159
|
+
padding: "0 var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
|
|
160
|
+
fontSize: "var(--sl-font-size-small)",
|
|
161
|
+
},
|
|
162
|
+
"&::part(footer)": {
|
|
163
|
+
display: "flex",
|
|
164
|
+
flexDirection: "column",
|
|
165
|
+
gap: "var(--sl-spacing-small)",
|
|
166
|
+
marginBottom: "var(--sl-spacing-xx-small)",
|
|
167
|
+
alignItems: "center",
|
|
168
|
+
flex: "1",
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
DialogButton: { margin: "auto", width: "100%" },
|
|
145
172
|
};
|
|
146
173
|
const sheet = createStyleSheet(style);
|
|
147
174
|
const styleString = sheet.toString();
|
|
@@ -211,6 +238,12 @@ export const BankingInfoFormView = (props) => {
|
|
|
211
238
|
h("style", { type: "text/css" },
|
|
212
239
|
styleString,
|
|
213
240
|
vanillaStyle),
|
|
241
|
+
h("sl-dialog", { class: sheet.classes.Dialog, open: states.showModal, "onSl-hide": callbacks.onModalClose },
|
|
242
|
+
h("div", { class: classes.ModalTitleContainer, slot: "label" },
|
|
243
|
+
h("sl-icon", { name: "info-circle", style: { color: "var(--sl-color-info-500)" } }),
|
|
244
|
+
h("h2", { style: { fontSize: "var(--sl-font-size-large)" } }, text.modalTitle)),
|
|
245
|
+
h("p", null, text.modalDescription),
|
|
246
|
+
h("sl-button", { slot: "footer", type: "primary", class: sheet.classes.DialogButton, submit: true, exportparts: "base: primarybutton-base" }, text.modalButtonText)),
|
|
214
247
|
h("div", { class: classes.TextContainer },
|
|
215
248
|
h("div", null,
|
|
216
249
|
!states.hideSteps && (h("p", null, intl.formatMessage({
|
|
@@ -270,6 +303,8 @@ export const BankingInfoFormView = (props) => {
|
|
|
270
303
|
? getLoadingSkeleton("toPayPalAccount")
|
|
271
304
|
: slots.paymentFixedDaySelectSlot))))),
|
|
272
305
|
h("div", { class: classes.BtnContainer },
|
|
273
|
-
h("sl-button", { type: "primary", disabled: states.disabled || states.saveDisabled, loading: states.saveLoading
|
|
306
|
+
h("sl-button", Object.assign({ type: "primary", disabled: states.disabled || states.saveDisabled, loading: states.saveLoading }, (states.hideSteps
|
|
307
|
+
? { onClick: callbacks.onModalOpen }
|
|
308
|
+
: { submit: "submit" }), { exportparts: "base: primarybutton-base" }), text.continueButton),
|
|
274
309
|
!states.hideBackButton && (h("sl-button", { exportparts: "base: secondarybutton-base", class: classes.SecondaryBtn, type: "text", onClick: callbacks.onBack }, text.backButton))))));
|
|
275
310
|
};
|
package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js
CHANGED
|
@@ -92,7 +92,11 @@ export class BankingInfoForm {
|
|
|
92
92
|
/**
|
|
93
93
|
* @uiName Beneficiary account field label
|
|
94
94
|
*/
|
|
95
|
-
this.beneficiaryAccountNameLabel = "
|
|
95
|
+
this.beneficiaryAccountNameLabel = "Account holder name";
|
|
96
|
+
/**
|
|
97
|
+
* @uiName Beneficiary account field description
|
|
98
|
+
*/
|
|
99
|
+
this.beneficiaryAccountNameDescription = "The beneficiary name of your bank account. Ensure this matches the name on your tax form.";
|
|
96
100
|
/**
|
|
97
101
|
* @uiName Bank account type field label
|
|
98
102
|
*/
|
|
@@ -271,6 +275,18 @@ export class BankingInfoForm {
|
|
|
271
275
|
* @uiWidget textArea
|
|
272
276
|
*/
|
|
273
277
|
this.loadingErrorAlertDescription = "Please refresh the page and try again. If this problem continues, contact Support.";
|
|
278
|
+
/**
|
|
279
|
+
* @uiName Information modal title
|
|
280
|
+
*/
|
|
281
|
+
this.modalTitle = "Important Note";
|
|
282
|
+
/**
|
|
283
|
+
* @uiName Information modal description text
|
|
284
|
+
*/
|
|
285
|
+
this.modalDescription = "Updating payment information places your account and payouts on hold for up to 48 hours while we verify your change. Payments scheduled during the hold period are skipped.";
|
|
286
|
+
/**
|
|
287
|
+
* @uiName Information modal button text
|
|
288
|
+
*/
|
|
289
|
+
this.modalButtonText = "I understand, update my information";
|
|
274
290
|
withHooks(this);
|
|
275
291
|
}
|
|
276
292
|
disconnectedCallback() { }
|
|
@@ -768,7 +784,28 @@ export class BankingInfoForm {
|
|
|
768
784
|
},
|
|
769
785
|
"attribute": "beneficiary-account-name-label",
|
|
770
786
|
"reflect": false,
|
|
771
|
-
"defaultValue": "\"
|
|
787
|
+
"defaultValue": "\"Account holder name\""
|
|
788
|
+
},
|
|
789
|
+
"beneficiaryAccountNameDescription": {
|
|
790
|
+
"type": "string",
|
|
791
|
+
"mutable": false,
|
|
792
|
+
"complexType": {
|
|
793
|
+
"original": "string",
|
|
794
|
+
"resolved": "string",
|
|
795
|
+
"references": {}
|
|
796
|
+
},
|
|
797
|
+
"required": false,
|
|
798
|
+
"optional": false,
|
|
799
|
+
"docs": {
|
|
800
|
+
"tags": [{
|
|
801
|
+
"text": "Beneficiary account field description",
|
|
802
|
+
"name": "uiName"
|
|
803
|
+
}],
|
|
804
|
+
"text": ""
|
|
805
|
+
},
|
|
806
|
+
"attribute": "beneficiary-account-name-description",
|
|
807
|
+
"reflect": false,
|
|
808
|
+
"defaultValue": "\"The beneficiary name of your bank account. Ensure this matches the name on your tax form.\""
|
|
772
809
|
},
|
|
773
810
|
"bankAccountTypeLabel": {
|
|
774
811
|
"type": "string",
|
|
@@ -1607,12 +1644,75 @@ export class BankingInfoForm {
|
|
|
1607
1644
|
"reflect": false,
|
|
1608
1645
|
"defaultValue": "\"Please refresh the page and try again. If this problem continues, contact Support.\""
|
|
1609
1646
|
},
|
|
1647
|
+
"modalTitle": {
|
|
1648
|
+
"type": "string",
|
|
1649
|
+
"mutable": false,
|
|
1650
|
+
"complexType": {
|
|
1651
|
+
"original": "string",
|
|
1652
|
+
"resolved": "string",
|
|
1653
|
+
"references": {}
|
|
1654
|
+
},
|
|
1655
|
+
"required": false,
|
|
1656
|
+
"optional": false,
|
|
1657
|
+
"docs": {
|
|
1658
|
+
"tags": [{
|
|
1659
|
+
"text": "Information modal title",
|
|
1660
|
+
"name": "uiName"
|
|
1661
|
+
}],
|
|
1662
|
+
"text": ""
|
|
1663
|
+
},
|
|
1664
|
+
"attribute": "modal-title",
|
|
1665
|
+
"reflect": false,
|
|
1666
|
+
"defaultValue": "\"Important Note\""
|
|
1667
|
+
},
|
|
1668
|
+
"modalDescription": {
|
|
1669
|
+
"type": "string",
|
|
1670
|
+
"mutable": false,
|
|
1671
|
+
"complexType": {
|
|
1672
|
+
"original": "string",
|
|
1673
|
+
"resolved": "string",
|
|
1674
|
+
"references": {}
|
|
1675
|
+
},
|
|
1676
|
+
"required": false,
|
|
1677
|
+
"optional": false,
|
|
1678
|
+
"docs": {
|
|
1679
|
+
"tags": [{
|
|
1680
|
+
"text": "Information modal description text",
|
|
1681
|
+
"name": "uiName"
|
|
1682
|
+
}],
|
|
1683
|
+
"text": ""
|
|
1684
|
+
},
|
|
1685
|
+
"attribute": "modal-description",
|
|
1686
|
+
"reflect": false,
|
|
1687
|
+
"defaultValue": "\"Updating payment information places your account and payouts on hold for up to 48 hours while we verify your change. Payments scheduled during the hold period are skipped.\""
|
|
1688
|
+
},
|
|
1689
|
+
"modalButtonText": {
|
|
1690
|
+
"type": "string",
|
|
1691
|
+
"mutable": false,
|
|
1692
|
+
"complexType": {
|
|
1693
|
+
"original": "string",
|
|
1694
|
+
"resolved": "string",
|
|
1695
|
+
"references": {}
|
|
1696
|
+
},
|
|
1697
|
+
"required": false,
|
|
1698
|
+
"optional": false,
|
|
1699
|
+
"docs": {
|
|
1700
|
+
"tags": [{
|
|
1701
|
+
"text": "Information modal button text",
|
|
1702
|
+
"name": "uiName"
|
|
1703
|
+
}],
|
|
1704
|
+
"text": ""
|
|
1705
|
+
},
|
|
1706
|
+
"attribute": "modal-button-text",
|
|
1707
|
+
"reflect": false,
|
|
1708
|
+
"defaultValue": "\"I understand, update my information\""
|
|
1709
|
+
},
|
|
1610
1710
|
"demoData": {
|
|
1611
1711
|
"type": "unknown",
|
|
1612
1712
|
"mutable": false,
|
|
1613
1713
|
"complexType": {
|
|
1614
1714
|
"original": "DemoData<BankingInfoFormViewProps>",
|
|
1615
|
-
"resolved": "{ states?: { showVerification: boolean; step?: string; locale?: string; loading: boolean; saveLoading?: boolean; disabled: boolean; saveDisabled: boolean; hideSteps?: boolean; hasPayPal: boolean; hideBanking?: boolean; hidePayPal?: boolean; hideBalanceThreshold?: boolean; hideFixedDay?: boolean; hideBackButton: boolean; feeCap?: string; isPartner: boolean; paymentMethodFeeLabel?: string; loadingError: boolean; formState: BankingInfoFormData & { paymentMethodChecked?: \"toBankAccount\" | \"toPayPalAccount\"; paymentScheduleChecked?: \"BALANCE_THRESHOLD\" | \"FIXED_DAY\"; errors?: { general?: boolean; inputErrors?: { [field: string]: { type: \"required\" | \"invalid\"; }; }; }; }; bitset?: number; currency?: string; thresholds: string[]; countries?: { countryCode: string; displayName: string; }[]; allCountries?: { countryCode: string; displayName: string; }[]; currentPaymentOption?: any; showInputs?: boolean; bankCountry?: string; countrySearch?: string; email?: string; }; slots?: { verificationDialogSlot?: VNode; formInputsSlot?: VNode[]; countryInputSlot?: VNode; paymentMethodSlot?: VNode; paymentThresholdSelectSlot?: VNode; paymentFixedDaySelectSlot?: VNode; paypalInputSlot?: VNode; }; refs?: { formRef: any; }; }",
|
|
1715
|
+
"resolved": "{ states?: { showVerification: boolean; step?: string; locale?: string; loading: boolean; saveLoading?: boolean; disabled: boolean; saveDisabled: boolean; hideSteps?: boolean; hasPayPal: boolean; hideBanking?: boolean; hidePayPal?: boolean; hideBalanceThreshold?: boolean; hideFixedDay?: boolean; hideBackButton: boolean; feeCap?: string; isPartner: boolean; paymentMethodFeeLabel?: string; loadingError: boolean; formState: BankingInfoFormData & { paymentMethodChecked?: \"toBankAccount\" | \"toPayPalAccount\"; paymentScheduleChecked?: \"BALANCE_THRESHOLD\" | \"FIXED_DAY\"; errors?: { general?: boolean; inputErrors?: { [field: string]: { type: \"required\" | \"invalid\"; }; }; }; }; bitset?: number; currency?: string; thresholds: string[]; countries?: { countryCode: string; displayName: string; }[]; allCountries?: { countryCode: string; displayName: string; }[]; currentPaymentOption?: any; showInputs?: boolean; bankCountry?: string; countrySearch?: string; email?: string; showModal: boolean; }; slots?: { verificationDialogSlot?: VNode; formInputsSlot?: VNode[]; countryInputSlot?: VNode; paymentMethodSlot?: VNode; paymentThresholdSelectSlot?: VNode; paymentFixedDaySelectSlot?: VNode; paypalInputSlot?: VNode; }; refs?: { formRef: any; }; }",
|
|
1616
1716
|
"references": {
|
|
1617
1717
|
"DemoData": {
|
|
1618
1718
|
"location": "import",
|
|
@@ -1721,6 +1821,7 @@ function useDemoBankingInfoForm(props) {
|
|
|
1721
1821
|
currency,
|
|
1722
1822
|
setCurrency,
|
|
1723
1823
|
hasPayPal: true,
|
|
1824
|
+
showModal: false,
|
|
1724
1825
|
},
|
|
1725
1826
|
callbacks: {
|
|
1726
1827
|
onVerificationHide: () => { },
|
|
@@ -1733,6 +1834,8 @@ function useDemoBankingInfoForm(props) {
|
|
|
1733
1834
|
setCountrySearch: () => { },
|
|
1734
1835
|
onBack: async () => setStep("/dashboard"),
|
|
1735
1836
|
onVerification: () => { },
|
|
1837
|
+
onModalOpen: () => { },
|
|
1838
|
+
onModalClose: () => { },
|
|
1736
1839
|
},
|
|
1737
1840
|
text: props.getTextProps(),
|
|
1738
1841
|
refs: {
|
|
@@ -105,6 +105,7 @@ export function useBankingInfoForm(props) {
|
|
|
105
105
|
const [paymentScheduleChecked, setPaymentScheduleChecked] = useState(undefined);
|
|
106
106
|
const [countrySearch, setCountrySearch] = useState("");
|
|
107
107
|
const [filteredCountries, setFilteredCountries] = useState(countries || []);
|
|
108
|
+
const [showModal, setShowModal] = useState(false);
|
|
108
109
|
const currency = ((_c = (_b = (_a = userData === null || userData === void 0 ? void 0 : userData.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher) === null || _c === void 0 ? void 0 : _c.currency) || "";
|
|
109
110
|
const isPartner = !!((_f = (_e = (_d = userData === null || userData === void 0 ? void 0 : userData.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher) === null || _f === void 0 ? void 0 : _f.withdrawalSettings);
|
|
110
111
|
const feeCap = paypalFeeMap[currency] || "";
|
|
@@ -276,10 +277,12 @@ export function useBankingInfoForm(props) {
|
|
|
276
277
|
});
|
|
277
278
|
setErrors({ inputErrors: validationErrors });
|
|
278
279
|
if (Object.keys(validationErrors).length) {
|
|
280
|
+
setShowModal(false);
|
|
279
281
|
return;
|
|
280
282
|
}
|
|
281
283
|
let token = undefined;
|
|
282
284
|
if (isPartner) {
|
|
285
|
+
setShowModal(false);
|
|
283
286
|
setShowVerification(true);
|
|
284
287
|
token = await new Promise((res) => {
|
|
285
288
|
const cb = (e) => {
|
|
@@ -292,6 +295,7 @@ export function useBankingInfoForm(props) {
|
|
|
292
295
|
setShowVerification(false);
|
|
293
296
|
}
|
|
294
297
|
await runMutation(formData, token);
|
|
298
|
+
setShowModal(false);
|
|
295
299
|
};
|
|
296
300
|
const onVerification = async (token) => {
|
|
297
301
|
host.dispatchEvent(new CustomEvent(VERIFICATION_EVENT_KEY, {
|
|
@@ -325,6 +329,8 @@ export function useBankingInfoForm(props) {
|
|
|
325
329
|
setCountrySearch,
|
|
326
330
|
onVerification,
|
|
327
331
|
onVerificationHide: () => onVerification(null),
|
|
332
|
+
onModalClose: () => setShowModal(false),
|
|
333
|
+
onModalOpen: () => setShowModal(true),
|
|
328
334
|
},
|
|
329
335
|
states: {
|
|
330
336
|
showVerification,
|
|
@@ -358,6 +364,7 @@ export function useBankingInfoForm(props) {
|
|
|
358
364
|
bankCountry: formState.bankCountry,
|
|
359
365
|
countrySearch,
|
|
360
366
|
email: (_j = userData === null || userData === void 0 ? void 0 : userData.user) === null || _j === void 0 ? void 0 : _j.email,
|
|
367
|
+
showModal,
|
|
361
368
|
},
|
|
362
369
|
refs: {
|
|
363
370
|
formRef,
|
|
@@ -3,6 +3,11 @@ import { intl } from "../../../global/global";
|
|
|
3
3
|
import { createStyleSheet } from "../../../styling/JSS";
|
|
4
4
|
import { FORM_STEPS } from "../sqm-tax-and-cash/data";
|
|
5
5
|
const style = {
|
|
6
|
+
ModalTitleContainer: {
|
|
7
|
+
display: "flex",
|
|
8
|
+
gap: "var(--sl-spacing-small)",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
},
|
|
6
11
|
FormWrapper: {
|
|
7
12
|
display: "flex",
|
|
8
13
|
justifyContent: "flex-start",
|
|
@@ -114,6 +119,28 @@ const style = {
|
|
|
114
119
|
color: "var(--sl-color-neutral-500)",
|
|
115
120
|
fontSize: "var(--sl-font-size-medium)",
|
|
116
121
|
},
|
|
122
|
+
Dialog: {
|
|
123
|
+
"&::part(panel)": {
|
|
124
|
+
maxWidth: "420px",
|
|
125
|
+
},
|
|
126
|
+
"&::part(title)": {
|
|
127
|
+
fontSize: "var(--sl-font-size-large)",
|
|
128
|
+
fontWeight: "600",
|
|
129
|
+
},
|
|
130
|
+
"&::part(body)": {
|
|
131
|
+
padding: "0 var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
|
|
132
|
+
fontSize: "var(--sl-font-size-small)",
|
|
133
|
+
},
|
|
134
|
+
"&::part(footer)": {
|
|
135
|
+
display: "flex",
|
|
136
|
+
flexDirection: "column",
|
|
137
|
+
gap: "var(--sl-spacing-small)",
|
|
138
|
+
marginBottom: "var(--sl-spacing-xx-small)",
|
|
139
|
+
alignItems: "center",
|
|
140
|
+
flex: "1",
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
DialogButton: { margin: "auto", width: "100%" },
|
|
117
144
|
};
|
|
118
145
|
const sheet = createStyleSheet(style);
|
|
119
146
|
const styleString = sheet.toString();
|
|
@@ -147,6 +174,17 @@ export const DocusignFormView = (props) => {
|
|
|
147
174
|
h("style", { type: "text/css" },
|
|
148
175
|
styleString,
|
|
149
176
|
vanillaStyle),
|
|
177
|
+
h("sl-dialog", { class: sheet.classes.Dialog, open: states.showModal, "onSl-hide": callbacks.onModalClose },
|
|
178
|
+
h("div", { class: classes.ModalTitleContainer, slot: "label" },
|
|
179
|
+
h("sl-icon", { name: "info-circle", style: { color: "var(--sl-color-info-500)" } }),
|
|
180
|
+
h("h2", { style: { fontSize: "var(--sl-font-size-large)" } }, text.modalTitle)),
|
|
181
|
+
h("p", null, intl.formatMessage({
|
|
182
|
+
id: "modalText",
|
|
183
|
+
defaultMessage: text.modalDescription,
|
|
184
|
+
}, {
|
|
185
|
+
br: h("br", null),
|
|
186
|
+
})),
|
|
187
|
+
h("sl-button", { slot: "footer", type: "primary", class: sheet.classes.DialogButton, onClick: callbacks.onModalClose, exportparts: "base: primarybutton-base" }, text.modalButtonText)),
|
|
150
188
|
h("div", { class: classes.TextContainer },
|
|
151
189
|
h("div", null,
|
|
152
190
|
!states.hideSteps && (h("p", null, intl.formatMessage({
|