@saasquatch/mint-components 2.4.7 → 2.4.9
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/sqm-banking-info-form_10.cjs.entry.js +4 -3
- package/dist/cjs/sqm-big-stat_47.cjs.entry.js +12 -16
- package/dist/cjs/sqm-email-verification_2.cjs.entry.js +0 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +24 -5
- package/dist/cjs/{sqm-user-info-form-view-9745956d.js → sqm-user-info-form-view-bdb4794c.js} +7 -13
- package/dist/cjs/{subregions-d12829d6.js → subregions-cd5c7ad6.js} +9 -4
- package/dist/cjs/{useIndirectTaxForm-0969e194.js → useIndirectTaxForm-ed4df485.js} +23 -35
- package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +0 -1
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +2 -1
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +10 -1
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +10 -14
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +1 -1
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +22 -34
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories.js +8 -1
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +6 -12
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +1 -1
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +2 -1
- package/dist/collection/components/tax-and-cash/utils.js +9 -4
- package/dist/esm/sqm-banking-info-form_10.entry.js +4 -3
- package/dist/esm/sqm-big-stat_47.entry.js +12 -16
- package/dist/esm/sqm-email-verification_2.entry.js +0 -1
- package/dist/esm/sqm-stencilbook.entry.js +24 -5
- package/dist/esm/{sqm-user-info-form-view-81526655.js → sqm-user-info-form-view-6c7919de.js} +7 -13
- package/dist/esm/{subregions-98789b46.js → subregions-8e84e5fa.js} +10 -5
- package/dist/esm/{useIndirectTaxForm-bbe8779d.js → useIndirectTaxForm-f622ba23.js} +23 -35
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/sqm-user-info-form-view-6c7919de.js +1 -0
- package/dist/esm-es5/{subregions-98789b46.js → subregions-8e84e5fa.js} +1 -1
- package/dist/esm-es5/{useIndirectTaxForm-bbe8779d.js → useIndirectTaxForm-f622ba23.js} +2 -2
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-c006b11d.entry.js → p-097bd078.entry.js} +0 -1
- package/dist/mint-components/{p-549d60ee.system.entry.js → p-23d5b890.system.entry.js} +1 -1
- package/dist/mint-components/p-2e822db5.system.js +1 -0
- package/dist/mint-components/{p-53575d04.js → p-2ec539fc.js} +1 -1
- package/dist/mint-components/p-3ad23a4c.js +1 -0
- package/dist/mint-components/{p-e1b917ff.entry.js → p-49d6f45d.entry.js} +2 -2
- package/dist/mint-components/{p-db25e189.entry.js → p-74ca06a3.entry.js} +2 -2
- package/dist/mint-components/{p-3ebe63f8.system.entry.js → p-7b9a6c30.system.entry.js} +1 -1
- package/dist/mint-components/p-b13f6bb0.system.entry.js +1 -0
- package/dist/mint-components/p-b27f98f1.js +108 -0
- package/dist/mint-components/{p-c4ef1d04.entry.js → p-b8021805.entry.js} +8 -8
- package/dist/mint-components/p-b9793754.system.entry.js +1 -0
- package/dist/mint-components/p-bfb00685.system.js +1 -1
- package/dist/mint-components/{p-826e3db0.system.js → p-c5efdac3.system.js} +1 -1
- package/dist/mint-components/p-ea7218d3.system.js +6 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +2 -1
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +1 -0
- package/dist/types/components/tax-and-cash/utils.d.ts +4 -1
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/esm-es5/sqm-user-info-form-view-81526655.js +0 -1
- package/dist/mint-components/p-07b989a3.system.js +0 -6
- package/dist/mint-components/p-14f4cce8.js +0 -1
- package/dist/mint-components/p-a1b655ba.system.js +0 -1
- package/dist/mint-components/p-a5f2c7e3.system.entry.js +0 -1
- package/dist/mint-components/p-b1feb0f1.js +0 -108
- package/dist/mint-components/p-dc3634cc.system.entry.js +0 -1
|
@@ -12,17 +12,17 @@ const utils = require('./utils-6847bc06.js');
|
|
|
12
12
|
const JSS = require('./JSS-8503a151.js');
|
|
13
13
|
require('./mixins-4761d472.js');
|
|
14
14
|
require('./AsYouType-d15caac8.js');
|
|
15
|
-
const subregions = require('./subregions-
|
|
15
|
+
const subregions = require('./subregions-cd5c7ad6.js');
|
|
16
16
|
const GenericTableView = require('./GenericTableView-4c48c630.js');
|
|
17
17
|
const reRender = require('./re-render-72a0ef45.js');
|
|
18
18
|
const useReferralTable = require('./useReferralTable-06887d9a.js');
|
|
19
19
|
const useChildElements = require('./useChildElements-041127d7.js');
|
|
20
20
|
const luxon = require('./luxon-c1ad356a.js');
|
|
21
|
-
const sqmUserInfoFormView = require('./sqm-user-info-form-view-
|
|
21
|
+
const sqmUserInfoFormView = require('./sqm-user-info-form-view-bdb4794c.js');
|
|
22
22
|
const data = require('./data-04ef5511.js');
|
|
23
23
|
const keys = require('./keys-5a2c9ed2.js');
|
|
24
24
|
const eventKeys = require('./eventKeys-7af4df4d.js');
|
|
25
|
-
const useIndirectTaxForm = require('./useIndirectTaxForm-
|
|
25
|
+
const useIndirectTaxForm = require('./useIndirectTaxForm-ed4df485.js');
|
|
26
26
|
|
|
27
27
|
function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
28
28
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76;
|
|
@@ -3972,6 +3972,7 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
3972
3972
|
showNewFormDialog: showDialog,
|
|
3973
3973
|
hasHold: !!((_o = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _o === void 0 ? void 0 : _o.hold),
|
|
3974
3974
|
payoutStatus,
|
|
3975
|
+
belowPayoutThreshold: subregions.isBalanceUnderPayoutThreshold(publisher),
|
|
3975
3976
|
minPayoutAmount: subregions.formatPayoutThreshold(publisher),
|
|
3976
3977
|
veriffLoading,
|
|
3977
3978
|
enforceUsTaxComplianceOption,
|
|
@@ -15,7 +15,7 @@ require('./mixins-4761d472.js');
|
|
|
15
15
|
const copyTextView = require('./copy-text-view-bb2c0ea7.js');
|
|
16
16
|
require('./sqm-text-span-view-b9e10f5d.js');
|
|
17
17
|
const AsYouType = require('./AsYouType-d15caac8.js');
|
|
18
|
-
const subregions = require('./subregions-
|
|
18
|
+
const subregions = require('./subregions-cd5c7ad6.js');
|
|
19
19
|
const useRegistrationFormState = require('./useRegistrationFormState-4fe5b770.js');
|
|
20
20
|
const sqmPortalRegistrationFormView = require('./sqm-portal-registration-form-view-a45f7a52.js');
|
|
21
21
|
const usePortalRegistrationForm = require('./usePortalRegistrationForm-8a3a14ac.js');
|
|
@@ -34,7 +34,7 @@ require('./sqm-portal-container-view-757f921b.js');
|
|
|
34
34
|
const data = require('./data-04ef5511.js');
|
|
35
35
|
const keys = require('./keys-5a2c9ed2.js');
|
|
36
36
|
require('./eventKeys-7af4df4d.js');
|
|
37
|
-
const useIndirectTaxForm = require('./useIndirectTaxForm-
|
|
37
|
+
const useIndirectTaxForm = require('./useIndirectTaxForm-ed4df485.js');
|
|
38
38
|
const parseStates = require('./parseStates-d1effc19.js');
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -3082,17 +3082,6 @@ function PayoutStatusAlertView(props) {
|
|
|
3082
3082
|
alertType: "warning",
|
|
3083
3083
|
icon: "exclamation-triangle",
|
|
3084
3084
|
};
|
|
3085
|
-
case "BALANCE_UNDER_THRESHOLD":
|
|
3086
|
-
return {
|
|
3087
|
-
header: text.balanceUnderThresholdHeader,
|
|
3088
|
-
description: global.intl.formatMessage({
|
|
3089
|
-
id: "balanceUnderThresholdDescription",
|
|
3090
|
-
defaultMessage: text.balanceUnderThresholdDescription,
|
|
3091
|
-
}, { minPayoutAmount: states.minPayoutAmount }),
|
|
3092
|
-
buttonText: null,
|
|
3093
|
-
alertType: "info",
|
|
3094
|
-
icon: "info-circle",
|
|
3095
|
-
};
|
|
3096
3085
|
case "PAYMENT_HOLD_ON_CHANGE":
|
|
3097
3086
|
return {
|
|
3098
3087
|
header: text.paymentHoldOnChangeHeader,
|
|
@@ -3220,16 +3209,23 @@ function PayoutStatusAlertView(props) {
|
|
|
3220
3209
|
}
|
|
3221
3210
|
}
|
|
3222
3211
|
const alertDetails = getAlert(states.status);
|
|
3223
|
-
|
|
3212
|
+
const showHoldAlert = states.status !== "DONE" && !!alertDetails;
|
|
3213
|
+
if (!showHoldAlert && !states.belowPayoutThreshold) {
|
|
3224
3214
|
return index.h("div", null);
|
|
3225
3215
|
}
|
|
3226
3216
|
return (index.h("div", { part: "sqm-base" },
|
|
3227
3217
|
index.h("style", { type: "text/css" }, styleString$2),
|
|
3228
3218
|
index.h("style", { type: "text/css" }, vanillaStyle$1),
|
|
3229
|
-
index.h("sqm-form-message", { loading: states.loading, type:
|
|
3219
|
+
states.belowPayoutThreshold && (index.h("sqm-form-message", { loading: states.loading, type: "info" },
|
|
3220
|
+
index.h("p", { part: "alert-title" }, text.balanceUnderThresholdHeader),
|
|
3221
|
+
index.h("p", { part: "alert-description" }, global.intl.formatMessage({
|
|
3222
|
+
id: "balanceUnderThresholdDescription",
|
|
3223
|
+
defaultMessage: text.balanceUnderThresholdDescription,
|
|
3224
|
+
}, { minPayoutAmount: states.minPayoutAmount })))),
|
|
3225
|
+
showHoldAlert && (index.h("sqm-form-message", { loading: states.loading, type: alertDetails.alertType },
|
|
3230
3226
|
index.h("p", { part: "alert-title" }, alertDetails.header),
|
|
3231
3227
|
index.h("p", { part: "alert-description" }, alertDetails.description),
|
|
3232
|
-
getButton(states.status))));
|
|
3228
|
+
getButton(states.status)))));
|
|
3233
3229
|
}
|
|
3234
3230
|
|
|
3235
3231
|
const PayoutStatusAlert = class {
|
|
@@ -15,7 +15,7 @@ const copyTextView = require('./copy-text-view-bb2c0ea7.js');
|
|
|
15
15
|
require('./sqm-text-span-view-b9e10f5d.js');
|
|
16
16
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-717d0633.js');
|
|
17
17
|
require('./AsYouType-d15caac8.js');
|
|
18
|
-
const subregions = require('./subregions-
|
|
18
|
+
const subregions = require('./subregions-cd5c7ad6.js');
|
|
19
19
|
const sqmPortalRegistrationFormView = require('./sqm-portal-registration-form-view-a45f7a52.js');
|
|
20
20
|
const GenericTableView = require('./GenericTableView-4c48c630.js');
|
|
21
21
|
require('./useChildElements-041127d7.js');
|
|
@@ -37,7 +37,7 @@ require('./ErrorView-ee7b0f36.js');
|
|
|
37
37
|
const sqmQrCodeView = require('./sqm-qr-code-view-1f2daa76.js');
|
|
38
38
|
const ShadowViewAddon = require('./ShadowViewAddon-ed5d27ef.js');
|
|
39
39
|
const sqmPortalContainerView = require('./sqm-portal-container-view-757f921b.js');
|
|
40
|
-
const sqmUserInfoFormView = require('./sqm-user-info-form-view-
|
|
40
|
+
const sqmUserInfoFormView = require('./sqm-user-info-form-view-bdb4794c.js');
|
|
41
41
|
const sqmLeadInputFieldView = require('./sqm-lead-input-field-view-88de1b78.js');
|
|
42
42
|
require('./data-04ef5511.js');
|
|
43
43
|
const sqmPartnerInfoModalView = require('./sqm-partner-info-modal-view-69b7a8cc.js');
|
|
@@ -16661,7 +16661,14 @@ const AccountUnderReview = () => (index.h(sqmUserInfoFormView.TaxAndCashDashboar
|
|
|
16661
16661
|
const PaymentHoldOnChange = () => (index.h(sqmUserInfoFormView.TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "PAYMENT_HOLD_ON_CHANGE" }, text: defaultText, callbacks: defaultCallbacks$1, slots: defaultSlots }));
|
|
16662
16662
|
const BalanceUnderThreshold = () => (index.h(sqmUserInfoFormView.TaxAndCashDashboardView, { states: {
|
|
16663
16663
|
...baseStates,
|
|
16664
|
-
payoutStatus: "
|
|
16664
|
+
payoutStatus: "DONE",
|
|
16665
|
+
belowPayoutThreshold: true,
|
|
16666
|
+
minPayoutAmount: "USD50.00",
|
|
16667
|
+
}, text: defaultText, callbacks: defaultCallbacks$1, slots: buildSlots({ belowPayoutThreshold: true }) }));
|
|
16668
|
+
const BalanceUnderThresholdWithHold = () => (index.h(sqmUserInfoFormView.TaxAndCashDashboardView, { states: {
|
|
16669
|
+
...baseStates,
|
|
16670
|
+
payoutStatus: "NEW_PAYEE_REVIEW",
|
|
16671
|
+
belowPayoutThreshold: true,
|
|
16665
16672
|
minPayoutAmount: "USD50.00",
|
|
16666
16673
|
}, text: defaultText, callbacks: defaultCallbacks$1, slots: buildSlots({ belowPayoutThreshold: true }) }));
|
|
16667
16674
|
const BeneficiaryNameInvalid = () => (index.h(sqmUserInfoFormView.TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "BENEFICIARY_NAME_INVALID" }, text: defaultText, callbacks: defaultCallbacks$1, slots: defaultSlots }));
|
|
@@ -16696,6 +16703,7 @@ const TaxAndCashDashboardView = /*#__PURE__*/Object.freeze({
|
|
|
16696
16703
|
AccountUnderReview: AccountUnderReview,
|
|
16697
16704
|
PaymentHoldOnChange: PaymentHoldOnChange,
|
|
16698
16705
|
BalanceUnderThreshold: BalanceUnderThreshold,
|
|
16706
|
+
BalanceUnderThresholdWithHold: BalanceUnderThresholdWithHold,
|
|
16699
16707
|
BeneficiaryNameInvalid: BeneficiaryNameInvalid,
|
|
16700
16708
|
BeneficiaryNameMismatch: BeneficiaryNameMismatch,
|
|
16701
16709
|
BankTaxNameMismatch: BankTaxNameMismatch,
|
|
@@ -17927,7 +17935,8 @@ const TaxAndCashDashboardBalanceUnderThreshold = () => {
|
|
|
17927
17935
|
return (index.h("sqm-tax-and-cash-dashboard", { demoData: {
|
|
17928
17936
|
...dashboardProps,
|
|
17929
17937
|
states: {
|
|
17930
|
-
payoutStatus: "
|
|
17938
|
+
payoutStatus: "DONE",
|
|
17939
|
+
belowPayoutThreshold: true,
|
|
17931
17940
|
minPayoutAmount: "USD50.00",
|
|
17932
17941
|
veriffLoading: false,
|
|
17933
17942
|
canEditPayoutInfo: true,
|
|
@@ -18377,7 +18386,16 @@ const PaymentHoldOnChange$1 = () => (index.h("sqm-payout-status-alert", { demoDa
|
|
|
18377
18386
|
const BalanceUnderThreshold$1 = () => (index.h("sqm-payout-status-alert", { demoData: {
|
|
18378
18387
|
states: {
|
|
18379
18388
|
...defaultProps$s,
|
|
18380
|
-
status: "
|
|
18389
|
+
status: "DONE",
|
|
18390
|
+
belowPayoutThreshold: true,
|
|
18391
|
+
minPayoutAmount: "USD50.00",
|
|
18392
|
+
},
|
|
18393
|
+
} }));
|
|
18394
|
+
const BalanceUnderThresholdWithHold$1 = () => (index.h("sqm-payout-status-alert", { demoData: {
|
|
18395
|
+
states: {
|
|
18396
|
+
...defaultProps$s,
|
|
18397
|
+
status: "NEW_PAYEE_REVIEW",
|
|
18398
|
+
belowPayoutThreshold: true,
|
|
18381
18399
|
minPayoutAmount: "USD50.00",
|
|
18382
18400
|
},
|
|
18383
18401
|
} }));
|
|
@@ -18408,6 +18426,7 @@ const PayoutStatusAlert = /*#__PURE__*/Object.freeze({
|
|
|
18408
18426
|
NewPayeeReview: NewPayeeReview,
|
|
18409
18427
|
PaymentHoldOnChange: PaymentHoldOnChange$1,
|
|
18410
18428
|
BalanceUnderThreshold: BalanceUnderThreshold$1,
|
|
18429
|
+
BalanceUnderThresholdWithHold: BalanceUnderThresholdWithHold$1,
|
|
18411
18430
|
BeneficiaryNameInvalid: BeneficiaryNameInvalid$1,
|
|
18412
18431
|
BeneficiaryNameMismatch: BeneficiaryNameMismatch$1,
|
|
18413
18432
|
BankTaxNameMismatch: BankTaxNameMismatch$1,
|
package/dist/cjs/{sqm-user-info-form-view-9745956d.js → sqm-user-info-form-view-bdb4794c.js}
RENAMED
|
@@ -4,7 +4,7 @@ const index = require('./index-8277cbb3.js');
|
|
|
4
4
|
const global = require('./global-258c36b8.js');
|
|
5
5
|
const JSS = require('./JSS-8503a151.js');
|
|
6
6
|
const AsYouType = require('./AsYouType-d15caac8.js');
|
|
7
|
-
const subregions = require('./subregions-
|
|
7
|
+
const subregions = require('./subregions-cd5c7ad6.js');
|
|
8
8
|
const data = require('./data-04ef5511.js');
|
|
9
9
|
|
|
10
10
|
const style = {
|
|
@@ -424,18 +424,6 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
424
424
|
icon: "exclamation-triangle",
|
|
425
425
|
class: sheet.classes.WarningHoldAlertContainer,
|
|
426
426
|
};
|
|
427
|
-
case "BALANCE_UNDER_THRESHOLD":
|
|
428
|
-
return {
|
|
429
|
-
header: text.balanceUnderThresholdHeader,
|
|
430
|
-
description: global.intl.formatMessage({
|
|
431
|
-
id: "balanceUnderThresholdDescription",
|
|
432
|
-
defaultMessage: text.balanceUnderThresholdDescription,
|
|
433
|
-
}, { minPayoutAmount: states.minPayoutAmount }),
|
|
434
|
-
buttonText: null,
|
|
435
|
-
alertType: "info",
|
|
436
|
-
icon: "info-circle",
|
|
437
|
-
class: sheet.classes.InfoHoldAlertContainer,
|
|
438
|
-
};
|
|
439
427
|
case "PAYMENT_HOLD_ON_CHANGE":
|
|
440
428
|
return {
|
|
441
429
|
header: text.paymentHoldOnChangeHeader,
|
|
@@ -679,6 +667,12 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
679
667
|
}, {
|
|
680
668
|
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-payment-support@impact.com` }, text.supportLink)),
|
|
681
669
|
}))),
|
|
670
|
+
states.belowPayoutThreshold && (index.h("sqm-form-message", { loading: states.loading, exportparts: "base: alert-base, icon:alert-icon", type: "info", class: sheet.classes.InfoHoldAlertContainer, icon: "info-circle", transparent: true },
|
|
671
|
+
index.h("strong", null, text.balanceUnderThresholdHeader),
|
|
672
|
+
index.h("p", { style: { margin: "0" } }, global.intl.formatMessage({
|
|
673
|
+
id: "balanceUnderThresholdDescription",
|
|
674
|
+
defaultMessage: text.balanceUnderThresholdDescription,
|
|
675
|
+
}, { minPayoutAmount: states.minPayoutAmount })))),
|
|
682
676
|
alertInfo && (index.h("sqm-form-message", { loading: states.loading, exportparts: "base: alert-base, icon:alert-icon", type: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.alertType, class: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.class, icon: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.icon, transparent: true },
|
|
683
677
|
index.h("strong", null, alertInfo.header),
|
|
684
678
|
index.h("p", { style: { margin: "0" } }, alertInfo.description),
|
|
@@ -643,9 +643,12 @@ function formatPayoutThreshold(publisher) {
|
|
|
643
643
|
return undefined;
|
|
644
644
|
return `${(_b = publisher === null || publisher === void 0 ? void 0 : publisher.currency) !== null && _b !== void 0 ? _b : ""}${threshold}`;
|
|
645
645
|
}
|
|
646
|
-
/**
|
|
646
|
+
/**
|
|
647
|
+
* `payoutsAccount.balance` is a formatted string; only `balanceAmount` (minor units) is comparable.
|
|
648
|
+
* A zero balance gets no notice — there is nothing waiting to pay out.
|
|
649
|
+
*/
|
|
647
650
|
function isBalanceUnderPayoutThreshold(publisher) {
|
|
648
|
-
var _a;
|
|
651
|
+
var _a, _b;
|
|
649
652
|
const rawThreshold = (_a = publisher === null || publisher === void 0 ? void 0 : publisher.withdrawalSettings) === null || _a === void 0 ? void 0 : _a.paymentThreshold;
|
|
650
653
|
const account = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount;
|
|
651
654
|
if (!rawThreshold || !account)
|
|
@@ -653,12 +656,14 @@ function isBalanceUnderPayoutThreshold(publisher) {
|
|
|
653
656
|
const threshold = Number(rawThreshold);
|
|
654
657
|
if (!Number.isFinite(threshold) || !Number.isFinite(account.balanceAmount))
|
|
655
658
|
return false;
|
|
659
|
+
if (account.balanceAmount <= 0)
|
|
660
|
+
return false;
|
|
656
661
|
const currency = account.currencyCode || (publisher === null || publisher === void 0 ? void 0 : publisher.currency);
|
|
657
662
|
if (!currency)
|
|
658
663
|
return false;
|
|
659
664
|
const scale = 10 **
|
|
660
|
-
new Intl.NumberFormat("en-US", { style: "currency", currency })
|
|
661
|
-
.resolvedOptions().maximumFractionDigits;
|
|
665
|
+
((_b = new Intl.NumberFormat("en-US", { style: "currency", currency })
|
|
666
|
+
.resolvedOptions().maximumFractionDigits) !== null && _b !== void 0 ? _b : 2);
|
|
662
667
|
return account.balanceAmount < Math.round(threshold * scale);
|
|
663
668
|
}
|
|
664
669
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const domContextHooks_module = require('./dom-context-hooks.module-e7b6727c.js');
|
|
4
4
|
const index_module = require('./index.module-f8c8495f.js');
|
|
5
5
|
const jsonpointer = require('./jsonpointer-11327262.js');
|
|
6
|
-
const subregions = require('./subregions-
|
|
6
|
+
const subregions = require('./subregions-cd5c7ad6.js');
|
|
7
7
|
const data = require('./data-04ef5511.js');
|
|
8
8
|
const eventKeys = require('./eventKeys-7af4df4d.js');
|
|
9
9
|
|
|
@@ -1013,23 +1013,8 @@ const GET_TAX_SETTING = index_module.dist.gql `
|
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
1015
|
`;
|
|
1016
|
-
/** Transient holds that clear automatically, so a balance under the minimum explains the wait better. */
|
|
1017
|
-
const DISPLACEABLE_STATUSES = [
|
|
1018
|
-
"DONE",
|
|
1019
|
-
"NEW_PAYEE_REVIEW",
|
|
1020
|
-
"PAYMENT_HOLD_ON_CHANGE",
|
|
1021
|
-
];
|
|
1022
1016
|
function getStatus(data) {
|
|
1023
|
-
var _a;
|
|
1024
|
-
const status = getHoldStatus(data);
|
|
1025
|
-
const publisher = (_a = data.user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher;
|
|
1026
|
-
return DISPLACEABLE_STATUSES.includes(status) &&
|
|
1027
|
-
subregions.isBalanceUnderPayoutThreshold(publisher)
|
|
1028
|
-
? "BALANCE_UNDER_THRESHOLD"
|
|
1029
|
-
: status;
|
|
1030
|
-
}
|
|
1031
|
-
function getHoldStatus(data) {
|
|
1032
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
1017
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1033
1018
|
const account = (_b = (_a = data.user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.payoutsAccount;
|
|
1034
1019
|
const hasTransferredReward = (_e = (_d = (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.rewards) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.find((reward) => {
|
|
1035
1020
|
var _a;
|
|
@@ -1039,39 +1024,41 @@ function getHoldStatus(data) {
|
|
|
1039
1024
|
if (!((_g = (_f = data.user) === null || _f === void 0 ? void 0 : _f.impactConnection) === null || _g === void 0 ? void 0 : _g.connected) || !account)
|
|
1040
1025
|
return "INFORMATION_REQUIRED";
|
|
1041
1026
|
const currentTaxDocument = (_j = (_h = data.user.impactConnection) === null || _h === void 0 ? void 0 : _h.publisher) === null || _j === void 0 ? void 0 : _j.currentTaxDocument;
|
|
1042
|
-
|
|
1027
|
+
// A new-payee review only starts once funds reach Impact, so until then nobody can act on it
|
|
1028
|
+
const reviewIsLive = !!hasTransferredReward && account.balanceAmount > 0;
|
|
1029
|
+
const holdReasons = ((_k = account.holdReasons) !== null && _k !== void 0 ? _k : []).filter((reason) => reason !== "NEW_PAYEE_REVIEW" || reviewIsLive);
|
|
1030
|
+
if (holdReasons.includes("NO_W9_DOCUMENT") && !currentTaxDocument)
|
|
1043
1031
|
return "OVER_W9_THRESHOLD";
|
|
1044
|
-
if (
|
|
1032
|
+
if (holdReasons.includes("IDV_CHECK_REQUIRED"))
|
|
1045
1033
|
return "VERIFICATION:REQUIRED";
|
|
1046
|
-
if (
|
|
1034
|
+
if (holdReasons.includes("IDV_CHECK_REQUIRED_INTERNAL"))
|
|
1047
1035
|
return "VERIFICATION:INTERNAL";
|
|
1048
|
-
if (
|
|
1036
|
+
if (holdReasons.includes("IDV_CHECK_REVIEW_INTERNAL"))
|
|
1049
1037
|
return "VERIFICATION:REVIEW";
|
|
1050
|
-
if (
|
|
1038
|
+
if (holdReasons.includes("IDV_CHECK_FAILED_INTERNAL"))
|
|
1051
1039
|
return "VERIFICATION:FAILED";
|
|
1052
|
-
|
|
1053
|
-
if (((_q = account.holdReasons) === null || _q === void 0 ? void 0 : _q.includes("NEW_PAYEE_REVIEW")) && hasTransferredReward)
|
|
1040
|
+
if (holdReasons.includes("NEW_PAYEE_REVIEW"))
|
|
1054
1041
|
return "NEW_PAYEE_REVIEW";
|
|
1055
|
-
if (
|
|
1056
|
-
return "DONE";
|
|
1057
|
-
if ((_s = account.holdReasons) === null || _s === void 0 ? void 0 : _s.includes("PAYMENT_HOLD_ON_CHANGE"))
|
|
1042
|
+
if (holdReasons.includes("PAYMENT_HOLD_ON_CHANGE"))
|
|
1058
1043
|
return "PAYMENT_HOLD_ON_CHANGE";
|
|
1059
|
-
if (
|
|
1044
|
+
if (holdReasons.includes("BENEFICIARY_NAME_INVALID"))
|
|
1060
1045
|
return "BENEFICIARY_NAME_INVALID";
|
|
1061
|
-
if (
|
|
1046
|
+
if (holdReasons.includes("BENEFICIARY_NAME_MISMATCH"))
|
|
1062
1047
|
return "BENEFICIARY_NAME_MISMATCH";
|
|
1063
|
-
if (
|
|
1048
|
+
if (holdReasons.includes("BANK_TAX_NAME_MISMATCH"))
|
|
1064
1049
|
return "BANK_TAX_NAME_MISMATCH";
|
|
1065
|
-
if (
|
|
1050
|
+
if (holdReasons.includes("WITHDRAWAL_SETTINGS_INVALID"))
|
|
1066
1051
|
return "WITHDRAWAL_SETTINGS_INVALID";
|
|
1067
|
-
if (
|
|
1052
|
+
if (holdReasons.includes("PAYMENT_RETURNED"))
|
|
1068
1053
|
return "PAYMENT_RETURNED";
|
|
1069
|
-
|
|
1054
|
+
// A hold whose every reason was suppressed leaves nothing to report
|
|
1055
|
+
const unattributedHold = !((_l = account.holdReasons) === null || _l === void 0 ? void 0 : _l.length);
|
|
1056
|
+
if (account.hold && (holdReasons.length > 0 || unattributedHold))
|
|
1070
1057
|
return "HOLD";
|
|
1071
1058
|
return "DONE";
|
|
1072
1059
|
}
|
|
1073
1060
|
function usePayoutStatus(props) {
|
|
1074
|
-
var _a, _b, _c;
|
|
1061
|
+
var _a, _b, _c, _d, _e;
|
|
1075
1062
|
const { type } = index_module.getEnvironmentSDK();
|
|
1076
1063
|
const { loading, data, errors, refetch } = index_module.wn(GET_USER_STATUS, {});
|
|
1077
1064
|
const { data: taxSettingRes } = index_module.wn(GET_TAX_SETTING, {});
|
|
@@ -1121,7 +1108,8 @@ function usePayoutStatus(props) {
|
|
|
1121
1108
|
status,
|
|
1122
1109
|
error: !!errors,
|
|
1123
1110
|
enforceUsTaxComplianceOption,
|
|
1124
|
-
|
|
1111
|
+
belowPayoutThreshold: subregions.isBalanceUnderPayoutThreshold((_c = (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.impactConnection) === null || _c === void 0 ? void 0 : _c.publisher),
|
|
1112
|
+
minPayoutAmount: subregions.formatPayoutThreshold((_e = (_d = data === null || data === void 0 ? void 0 : data.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher),
|
|
1125
1113
|
},
|
|
1126
1114
|
data: { type },
|
|
1127
1115
|
text: props.getTextProps(),
|
|
@@ -1220,7 +1220,8 @@ export const TaxAndCashDashboardBalanceUnderThreshold = () => {
|
|
|
1220
1220
|
return (h("sqm-tax-and-cash-dashboard", { demoData: {
|
|
1221
1221
|
...dashboardProps,
|
|
1222
1222
|
states: {
|
|
1223
|
-
payoutStatus: "
|
|
1223
|
+
payoutStatus: "DONE",
|
|
1224
|
+
belowPayoutThreshold: true,
|
|
1224
1225
|
minPayoutAmount: "USD50.00",
|
|
1225
1226
|
veriffLoading: false,
|
|
1226
1227
|
canEditPayoutInfo: true,
|
package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js
CHANGED
|
@@ -33,7 +33,16 @@ export const PaymentHoldOnChange = () => (h("sqm-payout-status-alert", { demoDat
|
|
|
33
33
|
export const BalanceUnderThreshold = () => (h("sqm-payout-status-alert", { demoData: {
|
|
34
34
|
states: {
|
|
35
35
|
...defaultProps,
|
|
36
|
-
status: "
|
|
36
|
+
status: "DONE",
|
|
37
|
+
belowPayoutThreshold: true,
|
|
38
|
+
minPayoutAmount: "USD50.00",
|
|
39
|
+
},
|
|
40
|
+
} }));
|
|
41
|
+
export const BalanceUnderThresholdWithHold = () => (h("sqm-payout-status-alert", { demoData: {
|
|
42
|
+
states: {
|
|
43
|
+
...defaultProps,
|
|
44
|
+
status: "NEW_PAYEE_REVIEW",
|
|
45
|
+
belowPayoutThreshold: true,
|
|
37
46
|
minPayoutAmount: "USD50.00",
|
|
38
47
|
},
|
|
39
48
|
} }));
|
|
@@ -145,17 +145,6 @@ export function PayoutStatusAlertView(props) {
|
|
|
145
145
|
alertType: "warning",
|
|
146
146
|
icon: "exclamation-triangle",
|
|
147
147
|
};
|
|
148
|
-
case "BALANCE_UNDER_THRESHOLD":
|
|
149
|
-
return {
|
|
150
|
-
header: text.balanceUnderThresholdHeader,
|
|
151
|
-
description: intl.formatMessage({
|
|
152
|
-
id: "balanceUnderThresholdDescription",
|
|
153
|
-
defaultMessage: text.balanceUnderThresholdDescription,
|
|
154
|
-
}, { minPayoutAmount: states.minPayoutAmount }),
|
|
155
|
-
buttonText: null,
|
|
156
|
-
alertType: "info",
|
|
157
|
-
icon: "info-circle",
|
|
158
|
-
};
|
|
159
148
|
case "PAYMENT_HOLD_ON_CHANGE":
|
|
160
149
|
return {
|
|
161
150
|
header: text.paymentHoldOnChangeHeader,
|
|
@@ -283,14 +272,21 @@ export function PayoutStatusAlertView(props) {
|
|
|
283
272
|
}
|
|
284
273
|
}
|
|
285
274
|
const alertDetails = getAlert(states.status);
|
|
286
|
-
|
|
275
|
+
const showHoldAlert = states.status !== "DONE" && !!alertDetails;
|
|
276
|
+
if (!showHoldAlert && !states.belowPayoutThreshold) {
|
|
287
277
|
return h("div", null);
|
|
288
278
|
}
|
|
289
279
|
return (h("div", { part: "sqm-base" },
|
|
290
280
|
h("style", { type: "text/css" }, styleString),
|
|
291
281
|
h("style", { type: "text/css" }, vanillaStyle),
|
|
292
|
-
h("sqm-form-message", { loading: states.loading, type:
|
|
282
|
+
states.belowPayoutThreshold && (h("sqm-form-message", { loading: states.loading, type: "info" },
|
|
283
|
+
h("p", { part: "alert-title" }, text.balanceUnderThresholdHeader),
|
|
284
|
+
h("p", { part: "alert-description" }, intl.formatMessage({
|
|
285
|
+
id: "balanceUnderThresholdDescription",
|
|
286
|
+
defaultMessage: text.balanceUnderThresholdDescription,
|
|
287
|
+
}, { minPayoutAmount: states.minPayoutAmount })))),
|
|
288
|
+
showHoldAlert && (h("sqm-form-message", { loading: states.loading, type: alertDetails.alertType },
|
|
293
289
|
h("p", { part: "alert-title" }, alertDetails.header),
|
|
294
290
|
h("p", { part: "alert-description" }, alertDetails.description),
|
|
295
|
-
getButton(states.status))));
|
|
291
|
+
getButton(states.status)))));
|
|
296
292
|
}
|
package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js
CHANGED
|
@@ -1076,7 +1076,7 @@ export class PayoutStatusAlert {
|
|
|
1076
1076
|
"mutable": false,
|
|
1077
1077
|
"complexType": {
|
|
1078
1078
|
"original": "DemoData<PayoutStatusAlertViewProps>",
|
|
1079
|
-
"resolved": "{ states?: { error: boolean; loading: boolean; status: PayoutStatus; veriffLoading: boolean; minPayoutAmount?: string; enforceUsTaxComplianceOption?: EnforceUsTaxComplianceOption; }; data?: { type: \"SquatchJS2\" | \"SquatchAndroid\" | \"SquatchIOS\" | \"SquatchPortal\" | \"SquatchAdmin\" | \"None\"; }; }",
|
|
1079
|
+
"resolved": "{ states?: { error: boolean; loading: boolean; status: PayoutStatus; veriffLoading: boolean; belowPayoutThreshold?: boolean; minPayoutAmount?: string; enforceUsTaxComplianceOption?: EnforceUsTaxComplianceOption; }; data?: { type: \"SquatchJS2\" | \"SquatchAndroid\" | \"SquatchIOS\" | \"SquatchPortal\" | \"SquatchAdmin\" | \"None\"; }; }",
|
|
1080
1080
|
"references": {
|
|
1081
1081
|
"DemoData": {
|
|
1082
1082
|
"location": "import",
|
|
@@ -49,23 +49,8 @@ const GET_TAX_SETTING = gql `
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
`;
|
|
52
|
-
/** Transient holds that clear automatically, so a balance under the minimum explains the wait better. */
|
|
53
|
-
const DISPLACEABLE_STATUSES = [
|
|
54
|
-
"DONE",
|
|
55
|
-
"NEW_PAYEE_REVIEW",
|
|
56
|
-
"PAYMENT_HOLD_ON_CHANGE",
|
|
57
|
-
];
|
|
58
52
|
export function getStatus(data) {
|
|
59
|
-
var _a;
|
|
60
|
-
const status = getHoldStatus(data);
|
|
61
|
-
const publisher = (_a = data.user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher;
|
|
62
|
-
return DISPLACEABLE_STATUSES.includes(status) &&
|
|
63
|
-
isBalanceUnderPayoutThreshold(publisher)
|
|
64
|
-
? "BALANCE_UNDER_THRESHOLD"
|
|
65
|
-
: status;
|
|
66
|
-
}
|
|
67
|
-
function getHoldStatus(data) {
|
|
68
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
69
54
|
const account = (_b = (_a = data.user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.payoutsAccount;
|
|
70
55
|
const hasTransferredReward = (_e = (_d = (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.rewards) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.find((reward) => {
|
|
71
56
|
var _a;
|
|
@@ -75,39 +60,41 @@ function getHoldStatus(data) {
|
|
|
75
60
|
if (!((_g = (_f = data.user) === null || _f === void 0 ? void 0 : _f.impactConnection) === null || _g === void 0 ? void 0 : _g.connected) || !account)
|
|
76
61
|
return "INFORMATION_REQUIRED";
|
|
77
62
|
const currentTaxDocument = (_j = (_h = data.user.impactConnection) === null || _h === void 0 ? void 0 : _h.publisher) === null || _j === void 0 ? void 0 : _j.currentTaxDocument;
|
|
78
|
-
|
|
63
|
+
// A new-payee review only starts once funds reach Impact, so until then nobody can act on it
|
|
64
|
+
const reviewIsLive = !!hasTransferredReward && account.balanceAmount > 0;
|
|
65
|
+
const holdReasons = ((_k = account.holdReasons) !== null && _k !== void 0 ? _k : []).filter((reason) => reason !== "NEW_PAYEE_REVIEW" || reviewIsLive);
|
|
66
|
+
if (holdReasons.includes("NO_W9_DOCUMENT") && !currentTaxDocument)
|
|
79
67
|
return "OVER_W9_THRESHOLD";
|
|
80
|
-
if (
|
|
68
|
+
if (holdReasons.includes("IDV_CHECK_REQUIRED"))
|
|
81
69
|
return "VERIFICATION:REQUIRED";
|
|
82
|
-
if (
|
|
70
|
+
if (holdReasons.includes("IDV_CHECK_REQUIRED_INTERNAL"))
|
|
83
71
|
return "VERIFICATION:INTERNAL";
|
|
84
|
-
if (
|
|
72
|
+
if (holdReasons.includes("IDV_CHECK_REVIEW_INTERNAL"))
|
|
85
73
|
return "VERIFICATION:REVIEW";
|
|
86
|
-
if (
|
|
74
|
+
if (holdReasons.includes("IDV_CHECK_FAILED_INTERNAL"))
|
|
87
75
|
return "VERIFICATION:FAILED";
|
|
88
|
-
|
|
89
|
-
if (((_q = account.holdReasons) === null || _q === void 0 ? void 0 : _q.includes("NEW_PAYEE_REVIEW")) && hasTransferredReward)
|
|
76
|
+
if (holdReasons.includes("NEW_PAYEE_REVIEW"))
|
|
90
77
|
return "NEW_PAYEE_REVIEW";
|
|
91
|
-
if (
|
|
92
|
-
return "DONE";
|
|
93
|
-
if ((_s = account.holdReasons) === null || _s === void 0 ? void 0 : _s.includes("PAYMENT_HOLD_ON_CHANGE"))
|
|
78
|
+
if (holdReasons.includes("PAYMENT_HOLD_ON_CHANGE"))
|
|
94
79
|
return "PAYMENT_HOLD_ON_CHANGE";
|
|
95
|
-
if (
|
|
80
|
+
if (holdReasons.includes("BENEFICIARY_NAME_INVALID"))
|
|
96
81
|
return "BENEFICIARY_NAME_INVALID";
|
|
97
|
-
if (
|
|
82
|
+
if (holdReasons.includes("BENEFICIARY_NAME_MISMATCH"))
|
|
98
83
|
return "BENEFICIARY_NAME_MISMATCH";
|
|
99
|
-
if (
|
|
84
|
+
if (holdReasons.includes("BANK_TAX_NAME_MISMATCH"))
|
|
100
85
|
return "BANK_TAX_NAME_MISMATCH";
|
|
101
|
-
if (
|
|
86
|
+
if (holdReasons.includes("WITHDRAWAL_SETTINGS_INVALID"))
|
|
102
87
|
return "WITHDRAWAL_SETTINGS_INVALID";
|
|
103
|
-
if (
|
|
88
|
+
if (holdReasons.includes("PAYMENT_RETURNED"))
|
|
104
89
|
return "PAYMENT_RETURNED";
|
|
105
|
-
|
|
90
|
+
// A hold whose every reason was suppressed leaves nothing to report
|
|
91
|
+
const unattributedHold = !((_l = account.holdReasons) === null || _l === void 0 ? void 0 : _l.length);
|
|
92
|
+
if (account.hold && (holdReasons.length > 0 || unattributedHold))
|
|
106
93
|
return "HOLD";
|
|
107
94
|
return "DONE";
|
|
108
95
|
}
|
|
109
96
|
export function usePayoutStatus(props) {
|
|
110
|
-
var _a, _b, _c;
|
|
97
|
+
var _a, _b, _c, _d, _e;
|
|
111
98
|
const { type } = getEnvironmentSDK();
|
|
112
99
|
const { loading, data, errors, refetch } = useQuery(GET_USER_STATUS, {});
|
|
113
100
|
const { data: taxSettingRes } = useQuery(GET_TAX_SETTING, {});
|
|
@@ -157,7 +144,8 @@ export function usePayoutStatus(props) {
|
|
|
157
144
|
status,
|
|
158
145
|
error: !!errors,
|
|
159
146
|
enforceUsTaxComplianceOption,
|
|
160
|
-
|
|
147
|
+
belowPayoutThreshold: isBalanceUnderPayoutThreshold((_c = (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.impactConnection) === null || _c === void 0 ? void 0 : _c.publisher),
|
|
148
|
+
minPayoutAmount: formatPayoutThreshold((_e = (_d = data === null || data === void 0 ? void 0 : data.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher),
|
|
161
149
|
},
|
|
162
150
|
data: { type },
|
|
163
151
|
text: props.getTextProps(),
|
|
@@ -131,7 +131,14 @@ export const AccountUnderReview = () => (h(TaxAndCashDashboardView, { states: {
|
|
|
131
131
|
export const PaymentHoldOnChange = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "PAYMENT_HOLD_ON_CHANGE" }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
|
|
132
132
|
export const BalanceUnderThreshold = () => (h(TaxAndCashDashboardView, { states: {
|
|
133
133
|
...baseStates,
|
|
134
|
-
payoutStatus: "
|
|
134
|
+
payoutStatus: "DONE",
|
|
135
|
+
belowPayoutThreshold: true,
|
|
136
|
+
minPayoutAmount: "USD50.00",
|
|
137
|
+
}, text: defaultText, callbacks: defaultCallbacks, slots: buildSlots({ belowPayoutThreshold: true }) }));
|
|
138
|
+
export const BalanceUnderThresholdWithHold = () => (h(TaxAndCashDashboardView, { states: {
|
|
139
|
+
...baseStates,
|
|
140
|
+
payoutStatus: "NEW_PAYEE_REVIEW",
|
|
141
|
+
belowPayoutThreshold: true,
|
|
135
142
|
minPayoutAmount: "USD50.00",
|
|
136
143
|
}, text: defaultText, callbacks: defaultCallbacks, slots: buildSlots({ belowPayoutThreshold: true }) }));
|
|
137
144
|
export const BeneficiaryNameInvalid = () => (h(TaxAndCashDashboardView, { states: { ...baseStates, payoutStatus: "BENEFICIARY_NAME_INVALID" }, text: defaultText, callbacks: defaultCallbacks, slots: defaultSlots }));
|
|
@@ -364,18 +364,6 @@ export const TaxAndCashDashboardView = (props) => {
|
|
|
364
364
|
icon: "exclamation-triangle",
|
|
365
365
|
class: sheet.classes.WarningHoldAlertContainer,
|
|
366
366
|
};
|
|
367
|
-
case "BALANCE_UNDER_THRESHOLD":
|
|
368
|
-
return {
|
|
369
|
-
header: text.balanceUnderThresholdHeader,
|
|
370
|
-
description: intl.formatMessage({
|
|
371
|
-
id: "balanceUnderThresholdDescription",
|
|
372
|
-
defaultMessage: text.balanceUnderThresholdDescription,
|
|
373
|
-
}, { minPayoutAmount: states.minPayoutAmount }),
|
|
374
|
-
buttonText: null,
|
|
375
|
-
alertType: "info",
|
|
376
|
-
icon: "info-circle",
|
|
377
|
-
class: sheet.classes.InfoHoldAlertContainer,
|
|
378
|
-
};
|
|
379
367
|
case "PAYMENT_HOLD_ON_CHANGE":
|
|
380
368
|
return {
|
|
381
369
|
header: text.paymentHoldOnChangeHeader,
|
|
@@ -619,6 +607,12 @@ export const TaxAndCashDashboardView = (props) => {
|
|
|
619
607
|
}, {
|
|
620
608
|
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-payment-support@impact.com` }, text.supportLink)),
|
|
621
609
|
}))),
|
|
610
|
+
states.belowPayoutThreshold && (h("sqm-form-message", { loading: states.loading, exportparts: "base: alert-base, icon:alert-icon", type: "info", class: sheet.classes.InfoHoldAlertContainer, icon: "info-circle", transparent: true },
|
|
611
|
+
h("strong", null, text.balanceUnderThresholdHeader),
|
|
612
|
+
h("p", { style: { margin: "0" } }, intl.formatMessage({
|
|
613
|
+
id: "balanceUnderThresholdDescription",
|
|
614
|
+
defaultMessage: text.balanceUnderThresholdDescription,
|
|
615
|
+
}, { minPayoutAmount: states.minPayoutAmount })))),
|
|
622
616
|
alertInfo && (h("sqm-form-message", { loading: states.loading, exportparts: "base: alert-base, icon:alert-icon", type: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.alertType, class: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.class, icon: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.icon, transparent: true },
|
|
623
617
|
h("strong", null, alertInfo.header),
|
|
624
618
|
h("p", { style: { margin: "0" } }, alertInfo.description),
|
|
@@ -2225,7 +2225,7 @@ export class TaxAndCashDashboard {
|
|
|
2225
2225
|
"mutable": false,
|
|
2226
2226
|
"complexType": {
|
|
2227
2227
|
"original": "DemoData<UseTaxAndCashDashboardResult>",
|
|
2228
|
-
"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; minPayoutAmount?: string; veriffLoading: boolean; errors?: { general?: boolean; }; enforceUsTaxComplianceOption?: string; }; }",
|
|
2228
|
+
"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; belowPayoutThreshold?: boolean; minPayoutAmount?: string; veriffLoading: boolean; errors?: { general?: boolean; }; enforceUsTaxComplianceOption?: string; }; }",
|
|
2229
2229
|
"references": {
|
|
2230
2230
|
"DemoData": {
|
|
2231
2231
|
"location": "import",
|
package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getStatus, } from "../sqm-payout-status-alert/usePayoutStatus";
|
|
|
6
6
|
import { TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../data";
|
|
7
7
|
import { INDIRECT_TAX_PROVINCES, INDIRECT_TAX_SPAIN_REGIONS, } from "../subregions";
|
|
8
8
|
import { useVeriffApp, VERIFF_COMPLETE_EVENT_KEY } from "../useVeriffApp";
|
|
9
|
-
import { formatPayoutThreshold, taxTypeToName } from "../utils";
|
|
9
|
+
import { formatPayoutThreshold, isBalanceUnderPayoutThreshold, taxTypeToName, } from "../utils";
|
|
10
10
|
import { gql } from "graphql-request";
|
|
11
11
|
const GET_TAX_SETTING = gql `
|
|
12
12
|
query getTenantSettings {
|
|
@@ -126,6 +126,7 @@ export const useTaxAndCashDashboard = (props) => {
|
|
|
126
126
|
showNewFormDialog: showDialog,
|
|
127
127
|
hasHold: !!((_o = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _o === void 0 ? void 0 : _o.hold),
|
|
128
128
|
payoutStatus,
|
|
129
|
+
belowPayoutThreshold: isBalanceUnderPayoutThreshold(publisher),
|
|
129
130
|
minPayoutAmount: formatPayoutThreshold(publisher),
|
|
130
131
|
veriffLoading,
|
|
131
132
|
enforceUsTaxComplianceOption,
|