@saasquatch/mint-components 1.16.0-2 → 1.16.0-20
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 +106 -22
- package/dist/cjs/sqm-big-stat_43.cjs.entry.js +50 -4
- package/dist/cjs/sqm-qr-code.cjs.entry.js +1 -13
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +2 -2
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +2 -2
- package/dist/cjs/{usePayoutStatus-c84a7d98.js → usePayoutStatus-d459ddde.js} +32 -11
- package/dist/collection/components/sqm-name-fields/sqm-name-fields.js +1 -1
- package/dist/collection/components/sqm-qr-code/useQRCode.js +1 -13
- package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.js +2 -2
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.js +3 -3
- package/dist/collection/components/sqm-referral-table/sqm-referral-table.js +1 -1
- package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-source-column.js +1 -1
- package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-status-column.js +3 -3
- package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +1 -1
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +4 -0
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form.js +2 -2
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +4 -0
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +41 -3
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +51 -1
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +32 -11
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +81 -2
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +47 -10
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +76 -1
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +22 -11
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +4 -0
- 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 +107 -23
- package/dist/esm/sqm-big-stat_43.entry.js +50 -4
- package/dist/esm/sqm-qr-code.entry.js +1 -13
- package/dist/esm/sqm-referral-table_11.entry.js +2 -2
- package/dist/esm/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +2 -2
- package/dist/esm/{usePayoutStatus-f07bcf90.js → usePayoutStatus-4a7625b9.js} +32 -11
- 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_43.entry.js +1 -1
- package/dist/esm-es5/sqm-qr-code.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/{usePayoutStatus-f07bcf90.js → usePayoutStatus-4a7625b9.js} +2 -2
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-0309fdfa.entry.js +1 -0
- package/dist/mint-components/{p-9a176cdf.entry.js → p-05389a8e.entry.js} +7 -7
- package/dist/mint-components/{p-c46a0007.entry.js → p-1a838f4d.entry.js} +1 -1
- package/dist/mint-components/{p-eff2e68b.entry.js → p-267c8f8c.entry.js} +2 -2
- package/dist/mint-components/p-2d7f9c4e.system.entry.js +1 -0
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/{p-776733b5.system.entry.js → p-37a4452c.system.entry.js} +1 -1
- package/dist/mint-components/{p-6bb25c02.js → p-3b2f1211.js} +9 -3
- package/dist/mint-components/p-8b584c46.system.entry.js +1 -0
- package/dist/mint-components/p-986d4c17.system.entry.js +1 -0
- package/dist/mint-components/{p-0c9debc1.system.js → p-9f22f58a.system.js} +2 -2
- package/dist/mint-components/p-a12f854d.system.entry.js +1 -0
- package/dist/mint-components/{p-0e864c3c.system.entry.js → p-beba8f57.system.entry.js} +1 -1
- package/dist/mint-components/p-c9b08184.entry.js +17 -0
- package/dist/mint-components/p-e69a0b40.entry.js +211 -0
- package/dist/types/components/sqm-name-fields/sqm-name-fields.d.ts +1 -1
- package/dist/types/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.d.ts +1 -1
- package/dist/types/components/sqm-referral-table/sqm-referral-table.d.ts +1 -1
- package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-source-column.d.ts +1 -1
- package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-status-column.d.ts +1 -1
- package/dist/types/components/sqm-rewards-table/sqm-rewards-table.d.ts +1 -1
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +4 -1
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +8 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +8 -1
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +13 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +4 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +12 -0
- package/dist/types/components.d.ts +66 -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/mint-components/p-0c78815e.system.entry.js +0 -1
- package/dist/mint-components/p-1c67bf1c.system.entry.js +0 -1
- package/dist/mint-components/p-43b4bb99.entry.js +0 -1
- package/dist/mint-components/p-47bd2d7a.entry.js +0 -205
- package/dist/mint-components/p-53730ffe.entry.js +0 -17
- package/dist/mint-components/p-6f65f9e1.system.entry.js +0 -1
- package/dist/mint-components/p-ef75f3a9.system.entry.js +0 -1
|
@@ -130,10 +130,46 @@ export function PayoutStatusAlertView(props) {
|
|
|
130
130
|
class: sheet.classes.ErrorAlertContainer,
|
|
131
131
|
};
|
|
132
132
|
case "OVER_W9_THRESHOLD":
|
|
133
|
+
if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
|
|
134
|
+
return {
|
|
135
|
+
header: text.w9RequiredHeader,
|
|
136
|
+
description: intl.formatMessage({
|
|
137
|
+
id: "w9RequiredDescription",
|
|
138
|
+
defaultMessage: text.w9RequiredDescription,
|
|
139
|
+
}, {
|
|
140
|
+
termsAndConditions: (h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
|
|
141
|
+
}),
|
|
142
|
+
buttonText: text.w9RequiredButtonText,
|
|
143
|
+
alertType: "warning",
|
|
144
|
+
icon: "exclamation-triangle",
|
|
145
|
+
class: sheet.classes.WarningAlertContainer,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
return {
|
|
150
|
+
header: text.holdHeader,
|
|
151
|
+
description: intl.formatMessage({
|
|
152
|
+
id: "holdDescription",
|
|
153
|
+
defaultMessage: text.holdDescription,
|
|
154
|
+
}, {
|
|
155
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
156
|
+
}),
|
|
157
|
+
buttonText: null,
|
|
158
|
+
alertType: "warning",
|
|
159
|
+
icon: "exclamation-triangle",
|
|
160
|
+
class: sheet.classes.WarningAlertContainer,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
case "ACCOUNT_REVIEW":
|
|
133
164
|
return {
|
|
134
|
-
header: text.
|
|
135
|
-
description: intl.formatMessage({
|
|
136
|
-
|
|
165
|
+
header: text.accountReviewHeader,
|
|
166
|
+
description: intl.formatMessage({
|
|
167
|
+
id: "accountReviewDescription",
|
|
168
|
+
defaultMessage: text.accountReviewDescription,
|
|
169
|
+
}, {
|
|
170
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
171
|
+
}),
|
|
172
|
+
buttonText: null,
|
|
137
173
|
alertType: "warning",
|
|
138
174
|
icon: "exclamation-triangle",
|
|
139
175
|
class: sheet.classes.WarningAlertContainer,
|
|
@@ -159,6 +195,8 @@ export function PayoutStatusAlertView(props) {
|
|
|
159
195
|
function getButton(status) {
|
|
160
196
|
switch (status) {
|
|
161
197
|
case "OVER_W9_THRESHOLD":
|
|
198
|
+
if (states.enforceUsTaxComplianceOption === "CASH_ONLY")
|
|
199
|
+
return;
|
|
162
200
|
return data.type === "SquatchJS2" ? (h("sqm-scroll", { "scroll-tag-name": "sqm-tabs", "button-text": text.w9RequiredButtonText, "scroll-animation": "smooth" })) : data.type === "SquatchPortal" ? (h("sl-button", { type: "default", onClick: callbacks.onTermsClick }, text.w9RequiredButtonText)) : (
|
|
163
201
|
// Demo case
|
|
164
202
|
h("sl-button", { type: "default" }, text.w9RequiredButtonText));
|
package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js
CHANGED
|
@@ -60,6 +60,14 @@ export class PayoutStatusAlert {
|
|
|
60
60
|
* @uiName Verification failed internal alert description
|
|
61
61
|
*/
|
|
62
62
|
this.verificationFailedInternalDescription = "Identity verification has failed. Our team is reviewing the report and will contact you with further information. If you don't hear from us contact our {supportLink}.";
|
|
63
|
+
/**
|
|
64
|
+
* @uiName Account review alert header
|
|
65
|
+
*/
|
|
66
|
+
this.accountReviewHeader = "Your account is under review";
|
|
67
|
+
/**
|
|
68
|
+
* @uiName Account review alert description
|
|
69
|
+
*/
|
|
70
|
+
this.accountReviewDescription = "This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.";
|
|
63
71
|
/**
|
|
64
72
|
* @uiName W9 payment threshold alert header
|
|
65
73
|
*/
|
|
@@ -367,6 +375,48 @@ export class PayoutStatusAlert {
|
|
|
367
375
|
"reflect": false,
|
|
368
376
|
"defaultValue": "\"Identity verification has failed. Our team is reviewing the report and will contact you with further information. If you don't hear from us contact our {supportLink}.\""
|
|
369
377
|
},
|
|
378
|
+
"accountReviewHeader": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"mutable": false,
|
|
381
|
+
"complexType": {
|
|
382
|
+
"original": "string",
|
|
383
|
+
"resolved": "string",
|
|
384
|
+
"references": {}
|
|
385
|
+
},
|
|
386
|
+
"required": false,
|
|
387
|
+
"optional": false,
|
|
388
|
+
"docs": {
|
|
389
|
+
"tags": [{
|
|
390
|
+
"text": "Account review alert header",
|
|
391
|
+
"name": "uiName"
|
|
392
|
+
}],
|
|
393
|
+
"text": ""
|
|
394
|
+
},
|
|
395
|
+
"attribute": "account-review-header",
|
|
396
|
+
"reflect": false,
|
|
397
|
+
"defaultValue": "\"Your account is under review\""
|
|
398
|
+
},
|
|
399
|
+
"accountReviewDescription": {
|
|
400
|
+
"type": "string",
|
|
401
|
+
"mutable": false,
|
|
402
|
+
"complexType": {
|
|
403
|
+
"original": "string",
|
|
404
|
+
"resolved": "string",
|
|
405
|
+
"references": {}
|
|
406
|
+
},
|
|
407
|
+
"required": false,
|
|
408
|
+
"optional": false,
|
|
409
|
+
"docs": {
|
|
410
|
+
"tags": [{
|
|
411
|
+
"text": "Account review alert description",
|
|
412
|
+
"name": "uiName"
|
|
413
|
+
}],
|
|
414
|
+
"text": ""
|
|
415
|
+
},
|
|
416
|
+
"attribute": "account-review-description",
|
|
417
|
+
"reflect": false,
|
|
418
|
+
"defaultValue": "\"This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.\""
|
|
419
|
+
},
|
|
370
420
|
"w9RequiredHeader": {
|
|
371
421
|
"type": "string",
|
|
372
422
|
"mutable": false,
|
|
@@ -582,7 +632,7 @@ export class PayoutStatusAlert {
|
|
|
582
632
|
"mutable": false,
|
|
583
633
|
"complexType": {
|
|
584
634
|
"original": "DemoData<PayoutStatusAlertViewProps>",
|
|
585
|
-
"resolved": "{ states?: { error: boolean; loading: boolean; status: PayoutStatus; veriffLoading: boolean; }; data?: { type: \"SquatchJS2\" | \"SquatchAndroid\" | \"SquatchIOS\" | \"SquatchPortal\" | \"SquatchAdmin\" | \"None\"; }; }",
|
|
635
|
+
"resolved": "{ states?: { error: boolean; loading: boolean; status: PayoutStatus; veriffLoading: boolean; enforceUsTaxComplianceOption?: EnforceUsTaxComplianceOption; }; data?: { type: \"SquatchJS2\" | \"SquatchAndroid\" | \"SquatchIOS\" | \"SquatchPortal\" | \"SquatchAdmin\" | \"None\"; }; }",
|
|
586
636
|
"references": {
|
|
587
637
|
"DemoData": {
|
|
588
638
|
"location": "import",
|
|
@@ -22,34 +22,43 @@ const GET_USER_STATUS = gql `
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
`;
|
|
25
|
+
const GET_TAX_SETTING = gql `
|
|
26
|
+
query getTenantSettings {
|
|
27
|
+
tenantSettings {
|
|
28
|
+
enforceUsTaxCompliance
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
25
32
|
export function getStatus(data) {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
27
34
|
const account = (_b = (_a = data.user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.payoutsAccount;
|
|
28
35
|
if (!((_d = (_c = data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.connected) || !account)
|
|
29
36
|
return "INFORMATION_REQUIRED";
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
const currentTaxDocument = (_h = (_g = data.user.impactConnection) === null || _g === void 0 ? void 0 : _g.publisher) === null || _h === void 0 ? void 0 : _h.currentTaxDocument;
|
|
34
|
-
if (((_j = account.holdReasons) === null || _j === void 0 ? void 0 : _j.includes("NO_W9_DOCUMENT")) && !currentTaxDocument)
|
|
37
|
+
const currentTaxDocument = (_f = (_e = data.user.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher) === null || _f === void 0 ? void 0 : _f.currentTaxDocument;
|
|
38
|
+
if (((_g = account.holdReasons) === null || _g === void 0 ? void 0 : _g.includes("NO_W9_DOCUMENT")) && !currentTaxDocument)
|
|
35
39
|
return "OVER_W9_THRESHOLD";
|
|
36
|
-
if ((
|
|
40
|
+
if ((_h = account.holdReasons) === null || _h === void 0 ? void 0 : _h.includes("IDV_CHECK_REQUIRED"))
|
|
37
41
|
return "VERIFICATION:REQUIRED";
|
|
38
|
-
if ((
|
|
42
|
+
if ((_j = account.holdReasons) === null || _j === void 0 ? void 0 : _j.includes("IDV_CHECK_REQUIRED_INTERNAL"))
|
|
39
43
|
return "VERIFICATION:INTERNAL";
|
|
40
|
-
if ((
|
|
44
|
+
if ((_k = account.holdReasons) === null || _k === void 0 ? void 0 : _k.includes("IDV_CHECK_REVIEW_INTERNAL"))
|
|
41
45
|
return "VERIFICATION:REVIEW";
|
|
42
|
-
if ((
|
|
46
|
+
if ((_l = account.holdReasons) === null || _l === void 0 ? void 0 : _l.includes("IDV_CHECK_FAILED_INTERNAL"))
|
|
43
47
|
return "VERIFICATION:FAILED";
|
|
48
|
+
if ((_m = account.holdReasons) === null || _m === void 0 ? void 0 : _m.includes("NEW_PAYEE_REVIEW"))
|
|
49
|
+
return "ACCOUNT_REVIEW";
|
|
44
50
|
if (account.hold)
|
|
45
51
|
return "HOLD";
|
|
46
52
|
return "DONE";
|
|
47
53
|
}
|
|
48
54
|
export function usePayoutStatus(props) {
|
|
55
|
+
var _a;
|
|
49
56
|
const { type } = getEnvironmentSDK();
|
|
50
57
|
const { loading, data, errors, refetch } = useQuery(GET_USER_STATUS, {});
|
|
58
|
+
const { data: taxSettingRes } = useQuery(GET_TAX_SETTING, {});
|
|
51
59
|
const { render, loading: veriffLoading, errors: veriffErrors, } = useVeriffApp();
|
|
52
60
|
const [status, setStatus] = useState(undefined);
|
|
61
|
+
const enforceUsTaxComplianceOption = (_a = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _a === void 0 ? void 0 : _a.enforceUsTaxCompliance;
|
|
53
62
|
useEffect(() => {
|
|
54
63
|
if (!data)
|
|
55
64
|
return;
|
|
@@ -65,17 +74,29 @@ export function usePayoutStatus(props) {
|
|
|
65
74
|
window.removeEventListener(VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
66
75
|
};
|
|
67
76
|
}, []);
|
|
77
|
+
const onTermsClick = () => {
|
|
78
|
+
let url = props.cashPayoutsPageUrl;
|
|
79
|
+
if (url.includes("#"))
|
|
80
|
+
url = url.split("#")[0];
|
|
81
|
+
if (status === "INFORMATION_REQUIRED")
|
|
82
|
+
url += "#1";
|
|
83
|
+
else if (status === "OVER_W9_THRESHOLD" &&
|
|
84
|
+
enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9")
|
|
85
|
+
url += "#3";
|
|
86
|
+
window.history.pushState(null, "", url);
|
|
87
|
+
};
|
|
68
88
|
return {
|
|
69
89
|
states: {
|
|
70
90
|
loading,
|
|
71
91
|
veriffLoading,
|
|
72
92
|
status,
|
|
73
93
|
error: !!errors,
|
|
94
|
+
enforceUsTaxComplianceOption,
|
|
74
95
|
},
|
|
75
96
|
data: { type },
|
|
76
97
|
text: props.getTextProps(),
|
|
77
98
|
callbacks: {
|
|
78
|
-
onTermsClick
|
|
99
|
+
onTermsClick,
|
|
79
100
|
onClick: render,
|
|
80
101
|
},
|
|
81
102
|
};
|
|
@@ -272,7 +272,7 @@ export class TaxAndCashMonolith {
|
|
|
272
272
|
* @uiGroup Step 3 Properties
|
|
273
273
|
* @uiWidget textArea
|
|
274
274
|
*/
|
|
275
|
-
this.step3_taxFormDescriptionBusinessEntity = "Participants residing outside of the US
|
|
275
|
+
this.step3_taxFormDescriptionBusinessEntity = "Participants residing outside of the US working with a US Brand need to submit a {documentType} form.";
|
|
276
276
|
/**
|
|
277
277
|
* This appears inside the Docusign frame.
|
|
278
278
|
* @uiName Docusign session expired message
|
|
@@ -931,6 +931,19 @@ export class TaxAndCashMonolith {
|
|
|
931
931
|
* @uiWidget textArea
|
|
932
932
|
*/
|
|
933
933
|
this.dashboard_w9RequiredDescription = "You have surpassed the $600 threshold for a W9 tax form. To remove the hold, you need to submit a W9 tax form as outlined in our {termsAndConditions}. Please click 'Submit W9' to start the process.";
|
|
934
|
+
/**
|
|
935
|
+
* @uiName Account review alert header
|
|
936
|
+
*/
|
|
937
|
+
this.dashboard_accountReviewHeader = "Your account is under review";
|
|
938
|
+
/**
|
|
939
|
+
* @uiName Account review alert description
|
|
940
|
+
*/
|
|
941
|
+
this.dashboard_accountReviewDescription = "This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.";
|
|
942
|
+
/**
|
|
943
|
+
* @uiName Terms and Conditions text
|
|
944
|
+
* @uiGroup Dashboard Properties
|
|
945
|
+
*/
|
|
946
|
+
this.dashboard_termsAndConditions = "Terms and Conditions";
|
|
934
947
|
/**
|
|
935
948
|
* @uiName W9 payment threshold alert button text
|
|
936
949
|
* @uiGroup Dashboard Properties
|
|
@@ -2164,7 +2177,7 @@ export class TaxAndCashMonolith {
|
|
|
2164
2177
|
},
|
|
2165
2178
|
"attribute": "step-3_tax-form-description-business-entity",
|
|
2166
2179
|
"reflect": false,
|
|
2167
|
-
"defaultValue": "\"Participants residing outside of the US
|
|
2180
|
+
"defaultValue": "\"Participants residing outside of the US working with a US Brand need to submit a {documentType} form.\""
|
|
2168
2181
|
},
|
|
2169
2182
|
"step3_docusignExpired": {
|
|
2170
2183
|
"type": "string",
|
|
@@ -4947,6 +4960,72 @@ export class TaxAndCashMonolith {
|
|
|
4947
4960
|
"reflect": false,
|
|
4948
4961
|
"defaultValue": "\"You have surpassed the $600 threshold for a W9 tax form. To remove the hold, you need to submit a W9 tax form as outlined in our {termsAndConditions}. Please click 'Submit W9' to start the process.\""
|
|
4949
4962
|
},
|
|
4963
|
+
"dashboard_accountReviewHeader": {
|
|
4964
|
+
"type": "string",
|
|
4965
|
+
"mutable": false,
|
|
4966
|
+
"complexType": {
|
|
4967
|
+
"original": "string",
|
|
4968
|
+
"resolved": "string",
|
|
4969
|
+
"references": {}
|
|
4970
|
+
},
|
|
4971
|
+
"required": false,
|
|
4972
|
+
"optional": false,
|
|
4973
|
+
"docs": {
|
|
4974
|
+
"tags": [{
|
|
4975
|
+
"text": "Account review alert header",
|
|
4976
|
+
"name": "uiName"
|
|
4977
|
+
}],
|
|
4978
|
+
"text": ""
|
|
4979
|
+
},
|
|
4980
|
+
"attribute": "dashboard_account-review-header",
|
|
4981
|
+
"reflect": false,
|
|
4982
|
+
"defaultValue": "\"Your account is under review\""
|
|
4983
|
+
},
|
|
4984
|
+
"dashboard_accountReviewDescription": {
|
|
4985
|
+
"type": "string",
|
|
4986
|
+
"mutable": false,
|
|
4987
|
+
"complexType": {
|
|
4988
|
+
"original": "string",
|
|
4989
|
+
"resolved": "string",
|
|
4990
|
+
"references": {}
|
|
4991
|
+
},
|
|
4992
|
+
"required": false,
|
|
4993
|
+
"optional": false,
|
|
4994
|
+
"docs": {
|
|
4995
|
+
"tags": [{
|
|
4996
|
+
"text": "Account review alert description",
|
|
4997
|
+
"name": "uiName"
|
|
4998
|
+
}],
|
|
4999
|
+
"text": ""
|
|
5000
|
+
},
|
|
5001
|
+
"attribute": "dashboard_account-review-description",
|
|
5002
|
+
"reflect": false,
|
|
5003
|
+
"defaultValue": "\"This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.\""
|
|
5004
|
+
},
|
|
5005
|
+
"dashboard_termsAndConditions": {
|
|
5006
|
+
"type": "string",
|
|
5007
|
+
"mutable": false,
|
|
5008
|
+
"complexType": {
|
|
5009
|
+
"original": "string",
|
|
5010
|
+
"resolved": "string",
|
|
5011
|
+
"references": {}
|
|
5012
|
+
},
|
|
5013
|
+
"required": false,
|
|
5014
|
+
"optional": false,
|
|
5015
|
+
"docs": {
|
|
5016
|
+
"tags": [{
|
|
5017
|
+
"text": "Terms and Conditions text",
|
|
5018
|
+
"name": "uiName"
|
|
5019
|
+
}, {
|
|
5020
|
+
"text": "Dashboard Properties",
|
|
5021
|
+
"name": "uiGroup"
|
|
5022
|
+
}],
|
|
5023
|
+
"text": ""
|
|
5024
|
+
},
|
|
5025
|
+
"attribute": "dashboard_terms-and-conditions",
|
|
5026
|
+
"reflect": false,
|
|
5027
|
+
"defaultValue": "\"Terms and Conditions\""
|
|
5028
|
+
},
|
|
4950
5029
|
"dashboard_w9RequiredButtonText": {
|
|
4951
5030
|
"type": "string",
|
|
4952
5031
|
"mutable": false,
|
|
@@ -200,14 +200,36 @@ export const TaxAndCashDashboardView = (props) => {
|
|
|
200
200
|
function getAlert(status) {
|
|
201
201
|
switch (status) {
|
|
202
202
|
case "OVER_W9_THRESHOLD":
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
203
|
+
if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
|
|
204
|
+
return {
|
|
205
|
+
header: text.w9RequiredHeader,
|
|
206
|
+
description: intl.formatMessage({
|
|
207
|
+
id: "w9RequiredDescription",
|
|
208
|
+
defaultMessage: text.w9RequiredDescription,
|
|
209
|
+
}, {
|
|
210
|
+
termsAndConditions: (h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
|
|
211
|
+
}),
|
|
212
|
+
button: (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
|
|
213
|
+
alertType: "info",
|
|
214
|
+
icon: "info-circle",
|
|
215
|
+
class: sheet.classes.WarningHoldAlertContainer,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
return {
|
|
220
|
+
header: text.payoutHoldAlertHeader,
|
|
221
|
+
description: intl.formatMessage({
|
|
222
|
+
id: "payoutHoldAlertDescription",
|
|
223
|
+
defaultMessage: text.payoutHoldAlertDescription,
|
|
224
|
+
}, {
|
|
225
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
226
|
+
}),
|
|
227
|
+
buttonText: null,
|
|
228
|
+
alertType: "warning",
|
|
229
|
+
icon: "exclamation-triangle",
|
|
230
|
+
class: sheet.classes.WarningHoldAlertContainer,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
211
233
|
case "VERIFICATION:REQUIRED":
|
|
212
234
|
return {
|
|
213
235
|
header: text.verificationRequiredHeader,
|
|
@@ -261,6 +283,20 @@ export const TaxAndCashDashboardView = (props) => {
|
|
|
261
283
|
icon: "exclamation-octagon",
|
|
262
284
|
class: sheet.classes.ErrorHoldAlertContainer,
|
|
263
285
|
};
|
|
286
|
+
case "ACCOUNT_REVIEW":
|
|
287
|
+
return {
|
|
288
|
+
header: text.accountReviewHeader,
|
|
289
|
+
description: intl.formatMessage({
|
|
290
|
+
id: "accountReviewDescription",
|
|
291
|
+
defaultMessage: text.accountReviewDescription,
|
|
292
|
+
}, {
|
|
293
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
294
|
+
}),
|
|
295
|
+
buttonText: null,
|
|
296
|
+
alertType: "warning",
|
|
297
|
+
icon: "exclamation-triangle",
|
|
298
|
+
class: sheet.classes.WarningHoldAlertContainer,
|
|
299
|
+
};
|
|
264
300
|
case "HOLD":
|
|
265
301
|
return {
|
|
266
302
|
header: text.payoutHoldAlertHeader,
|
|
@@ -402,7 +438,7 @@ export const TaxAndCashDashboardView = (props) => {
|
|
|
402
438
|
slots.payoutDetailsCardSlot,
|
|
403
439
|
!states.loading && (h("p", { class: sheet.classes.DescriptionText }, text.payoutFromImpact)),
|
|
404
440
|
states.canEditPayoutInfo && (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)))),
|
|
405
|
-
!states.noFormNeeded && (h("div", { class: sheet.classes.TaxDocumentsContainer },
|
|
441
|
+
(!states.noFormNeeded || states.status === "NOT_VERIFIED") && (h("div", { class: sheet.classes.TaxDocumentsContainer },
|
|
406
442
|
h("div", null, states.loading ? (h("div", { class: sheet.classes.TaxSectionSkeletonContainer },
|
|
407
443
|
h("sl-skeleton", { class: sheet.classes.SkeletonOne }),
|
|
408
444
|
h("sl-skeleton", { class: sheet.classes.SkeletonTwo }))) : (h("div", null,
|
|
@@ -416,7 +452,8 @@ export const TaxAndCashDashboardView = (props) => {
|
|
|
416
452
|
documentType: states.documentTypeString,
|
|
417
453
|
})),
|
|
418
454
|
h("span", { class: sheet.classes.StatusAlert }, statusMap[states.status]))),
|
|
419
|
-
states.
|
|
455
|
+
states.noFormNeeded &&
|
|
456
|
+
states.status !== "NOT_VERIFIED" && (h("sl-button", { disabled: states.disabled || states.loading, onClick: callbacks.onClick, type: "default", class: sheet.classes.NewFormButton, exportparts: "base: primarybutton-base" }, text.newFormButton)))))))),
|
|
420
457
|
h("div", { class: sheet.classes.IndirectTaxPreviewContainer }, states.loading ? (h("div", { class: sheet.classes.TaxSectionSkeletonContainer },
|
|
421
458
|
h("sl-skeleton", { class: sheet.classes.SkeletonOne }),
|
|
422
459
|
h("sl-skeleton", { class: sheet.classes.SkeletonTwo }))) : (h("div", null,
|
|
@@ -239,6 +239,18 @@ export class TaxAndCashDashboard {
|
|
|
239
239
|
* @uiName W9 payment threshold alert description
|
|
240
240
|
*/
|
|
241
241
|
this.w9RequiredDescription = "You have surpassed the $600 threshold for a W9 tax form. To remove the hold, you need to submit a W9 tax form as outlined in our {termsAndConditions}. Please click 'Submit W9' to start the process.";
|
|
242
|
+
/**
|
|
243
|
+
* @uiName Account review alert header
|
|
244
|
+
*/
|
|
245
|
+
this.accountReviewHeader = "Your account is under review";
|
|
246
|
+
/**
|
|
247
|
+
* @uiName Account review alert description
|
|
248
|
+
*/
|
|
249
|
+
this.accountReviewDescription = "This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.";
|
|
250
|
+
/**
|
|
251
|
+
* @uiName Terms and Conditions text
|
|
252
|
+
*/
|
|
253
|
+
this.termsAndConditions = "Terms and Conditions";
|
|
242
254
|
/**
|
|
243
255
|
* @uiName W9 payment threshold alert button text
|
|
244
256
|
*/
|
|
@@ -1312,6 +1324,69 @@ export class TaxAndCashDashboard {
|
|
|
1312
1324
|
"reflect": false,
|
|
1313
1325
|
"defaultValue": "\"You have surpassed the $600 threshold for a W9 tax form. To remove the hold, you need to submit a W9 tax form as outlined in our {termsAndConditions}. Please click 'Submit W9' to start the process.\""
|
|
1314
1326
|
},
|
|
1327
|
+
"accountReviewHeader": {
|
|
1328
|
+
"type": "string",
|
|
1329
|
+
"mutable": false,
|
|
1330
|
+
"complexType": {
|
|
1331
|
+
"original": "string",
|
|
1332
|
+
"resolved": "string",
|
|
1333
|
+
"references": {}
|
|
1334
|
+
},
|
|
1335
|
+
"required": false,
|
|
1336
|
+
"optional": false,
|
|
1337
|
+
"docs": {
|
|
1338
|
+
"tags": [{
|
|
1339
|
+
"text": "Account review alert header",
|
|
1340
|
+
"name": "uiName"
|
|
1341
|
+
}],
|
|
1342
|
+
"text": ""
|
|
1343
|
+
},
|
|
1344
|
+
"attribute": "account-review-header",
|
|
1345
|
+
"reflect": false,
|
|
1346
|
+
"defaultValue": "\"Your account is under review\""
|
|
1347
|
+
},
|
|
1348
|
+
"accountReviewDescription": {
|
|
1349
|
+
"type": "string",
|
|
1350
|
+
"mutable": false,
|
|
1351
|
+
"complexType": {
|
|
1352
|
+
"original": "string",
|
|
1353
|
+
"resolved": "string",
|
|
1354
|
+
"references": {}
|
|
1355
|
+
},
|
|
1356
|
+
"required": false,
|
|
1357
|
+
"optional": false,
|
|
1358
|
+
"docs": {
|
|
1359
|
+
"tags": [{
|
|
1360
|
+
"text": "Account review alert description",
|
|
1361
|
+
"name": "uiName"
|
|
1362
|
+
}],
|
|
1363
|
+
"text": ""
|
|
1364
|
+
},
|
|
1365
|
+
"attribute": "account-review-description",
|
|
1366
|
+
"reflect": false,
|
|
1367
|
+
"defaultValue": "\"This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.\""
|
|
1368
|
+
},
|
|
1369
|
+
"termsAndConditions": {
|
|
1370
|
+
"type": "string",
|
|
1371
|
+
"mutable": false,
|
|
1372
|
+
"complexType": {
|
|
1373
|
+
"original": "string",
|
|
1374
|
+
"resolved": "string",
|
|
1375
|
+
"references": {}
|
|
1376
|
+
},
|
|
1377
|
+
"required": false,
|
|
1378
|
+
"optional": false,
|
|
1379
|
+
"docs": {
|
|
1380
|
+
"tags": [{
|
|
1381
|
+
"text": "Terms and Conditions text",
|
|
1382
|
+
"name": "uiName"
|
|
1383
|
+
}],
|
|
1384
|
+
"text": ""
|
|
1385
|
+
},
|
|
1386
|
+
"attribute": "terms-and-conditions",
|
|
1387
|
+
"reflect": false,
|
|
1388
|
+
"defaultValue": "\"Terms and Conditions\""
|
|
1389
|
+
},
|
|
1315
1390
|
"w9RequiredButtonText": {
|
|
1316
1391
|
"type": "string",
|
|
1317
1392
|
"mutable": false,
|
|
@@ -1794,7 +1869,7 @@ export class TaxAndCashDashboard {
|
|
|
1794
1869
|
"mutable": false,
|
|
1795
1870
|
"complexType": {
|
|
1796
1871
|
"original": "DemoData<UseTaxAndCashDashboardResult>",
|
|
1797
|
-
"resolved": "{ states?: { status?: string; documentType: TaxDocumentType; documentTypeString: string; canEditPayoutInfo: boolean; disabled?: boolean; dateSubmitted?: string; noFormNeeded?: boolean; indirectTaxType?: string; qstNumber?: string; subRegionTaxNumber?: string; subRegion?: string; indirectTaxNumber?: string; province?: string; country?: string; notRegistered?: boolean; isBusinessEntity?: boolean; loading?: boolean; loadingError?: boolean; showNewFormDialog: boolean; hasHold: boolean; payoutStatus: PayoutStatus; veriffLoading: boolean; errors?: { general?: boolean; }; }; }",
|
|
1872
|
+
"resolved": "{ states?: { status?: string; documentType: TaxDocumentType; documentTypeString: string; canEditPayoutInfo: boolean; disabled?: boolean; dateSubmitted?: string; noFormNeeded?: boolean; indirectTaxType?: string; qstNumber?: string; subRegionTaxNumber?: string; subRegion?: string; indirectTaxNumber?: string; province?: string; country?: string; notRegistered?: boolean; isBusinessEntity?: boolean; loading?: boolean; loadingError?: boolean; showNewFormDialog: boolean; hasHold: boolean; payoutStatus: PayoutStatus; veriffLoading: boolean; errors?: { general?: boolean; }; enforceUsTaxComplianceOption?: string; }; }",
|
|
1798
1873
|
"references": {
|
|
1799
1874
|
"DemoData": {
|
|
1800
1875
|
"location": "import",
|
package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { useLocale, useParentQueryValue, useSetParent, } from "@saasquatch/component-boilerplate";
|
|
1
|
+
import { useLocale, useParentQueryValue, useQuery, useSetParent, } from "@saasquatch/component-boilerplate";
|
|
2
2
|
import { useEffect, useState } from "@saasquatch/universal-hooks";
|
|
3
3
|
import { DateTime } from "luxon";
|
|
4
4
|
import { vatLabels } from "../countries";
|
|
5
|
-
import { getStatus } from "../sqm-payout-status-alert/usePayoutStatus";
|
|
5
|
+
import { getStatus, } from "../sqm-payout-status-alert/usePayoutStatus";
|
|
6
6
|
import { TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../sqm-tax-and-cash/data";
|
|
7
7
|
import { INDIRECT_TAX_PROVINCES, INDIRECT_TAX_SPAIN_REGIONS, } from "../subregions";
|
|
8
8
|
import { useVeriffApp, VERIFF_COMPLETE_EVENT_KEY } from "../useVeriffApp";
|
|
9
9
|
import { taxTypeToName } from "../utils";
|
|
10
|
+
import { gql } from "graphql-request";
|
|
11
|
+
const GET_TAX_SETTING = gql `
|
|
12
|
+
query getTenantSettings {
|
|
13
|
+
tenantSettings {
|
|
14
|
+
enforceUsTaxCompliance
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
10
18
|
function getCountryName(countryCode, locale) {
|
|
11
19
|
if (!countryCode)
|
|
12
20
|
return undefined;
|
|
@@ -42,11 +50,12 @@ function getIndirectTaxType(taxInformation) {
|
|
|
42
50
|
return "Indirect Tax";
|
|
43
51
|
}
|
|
44
52
|
export const useTaxAndCashDashboard = (props) => {
|
|
45
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
46
54
|
const setStep = useSetParent(TAX_CONTEXT_NAMESPACE);
|
|
47
55
|
const setContext = useSetParent(TAX_FORM_CONTEXT_NAMESPACE);
|
|
48
56
|
const [showDialog, setShowDialog] = useState(false);
|
|
49
57
|
const { render, loading: veriffLoading, errors: veriffErrors, } = useVeriffApp();
|
|
58
|
+
const { data: taxSettingRes } = useQuery(GET_TAX_SETTING, {});
|
|
50
59
|
const locale = useLocale();
|
|
51
60
|
useEffect(() => {
|
|
52
61
|
// Clear override context once on submitted
|
|
@@ -87,30 +96,32 @@ export const useTaxAndCashDashboard = (props) => {
|
|
|
87
96
|
window.removeEventListener(VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
88
97
|
};
|
|
89
98
|
}, []);
|
|
99
|
+
const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
|
|
90
100
|
return {
|
|
91
101
|
states: {
|
|
92
102
|
dateSubmitted,
|
|
93
103
|
documentType,
|
|
94
104
|
canEditPayoutInfo: publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup,
|
|
95
105
|
documentTypeString: taxTypeToName(documentType),
|
|
96
|
-
status: (
|
|
97
|
-
subRegion: getSubRegionName((
|
|
98
|
-
subRegionTaxNumber: (
|
|
99
|
-
qstNumber: (
|
|
106
|
+
status: (_f = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _f === void 0 ? void 0 : _f.status,
|
|
107
|
+
subRegion: getSubRegionName((_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.indirectTaxRegion),
|
|
108
|
+
subRegionTaxNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.withholdingTaxId,
|
|
109
|
+
qstNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.additionalTaxId,
|
|
100
110
|
indirectTaxType: getIndirectTaxType(publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation),
|
|
101
|
-
indirectTaxNumber: (
|
|
111
|
+
indirectTaxNumber: (_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxId,
|
|
102
112
|
isBusinessEntity: (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) === "W8BENE",
|
|
103
113
|
province: provinceName,
|
|
104
|
-
country: getCountryName((
|
|
105
|
-
notRegistered: !((
|
|
114
|
+
country: getCountryName((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxCountryCode, locale),
|
|
115
|
+
notRegistered: !((_m = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _m === void 0 ? void 0 : _m.indirectTaxId),
|
|
106
116
|
noFormNeeded: !documentType,
|
|
107
117
|
disabled: loading,
|
|
108
118
|
loading,
|
|
109
119
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
110
120
|
showNewFormDialog: showDialog,
|
|
111
|
-
hasHold: !!((
|
|
121
|
+
hasHold: !!((_o = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _o === void 0 ? void 0 : _o.hold),
|
|
112
122
|
payoutStatus,
|
|
113
123
|
veriffLoading,
|
|
124
|
+
enforceUsTaxComplianceOption,
|
|
114
125
|
},
|
|
115
126
|
callbacks: {
|
|
116
127
|
onClick: () => setShowDialog(true),
|
|
@@ -23,6 +23,10 @@ export function useUserInfoForm(props) {
|
|
|
23
23
|
const [currencySearch, setCurrencySearch] = useState("");
|
|
24
24
|
const [filteredCurrencies, setFilteredCurrencies] = useState(currencies || []);
|
|
25
25
|
const [formErrors, setErrors] = useState({});
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
// reset redirect hash
|
|
28
|
+
window.location.hash = "";
|
|
29
|
+
}, []);
|
|
26
30
|
useEffect(() => {
|
|
27
31
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
28
32
|
const user = data === null || data === void 0 ? void 0 : data.user;
|