@saasquatch/mint-components 2.0.11-2 → 2.1.0-0
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_10.cjs.entry.js +16 -13
- package/dist/cjs/sqm-big-stat_49.cjs.entry.js +1 -1
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +11 -7
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +13 -8
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +167 -167
- package/dist/cjs/{usePayoutStatus-98f2ca76.js → usePayoutStatus-4cd81495.js} +3 -0
- package/dist/collection/components/sqm-referral-table/TaxAndCashReferralTableRewardsCell.stories.js +1 -1
- package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.js +11 -7
- package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.js +6 -7
- package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-status-column.js +31 -4
- package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +1 -1
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -2
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +3 -0
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +15 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_10.entry.js +16 -13
- package/dist/esm/sqm-big-stat_49.entry.js +1 -1
- package/dist/esm/sqm-referral-table_11.entry.js +11 -7
- package/dist/esm/sqm-rewards-table_9.entry.js +13 -8
- package/dist/esm/sqm-stencilbook.entry.js +167 -167
- package/dist/esm/{usePayoutStatus-6be47a64.js → usePayoutStatus-203c2b2b.js} +3 -0
- 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_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_49.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-6be47a64.js → usePayoutStatus-203c2b2b.js} +2 -2
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-517c454d.entry.js → p-1c427858.entry.js} +1 -1
- package/dist/mint-components/{p-25474a76.system.entry.js → p-670869ab.system.entry.js} +1 -1
- package/dist/mint-components/{p-3fede0f7.js → p-7d54fe67.js} +5 -2
- package/dist/mint-components/{p-23c58c4f.system.js → p-8785a98e.system.js} +2 -2
- package/dist/mint-components/{p-d693782f.entry.js → p-900e4bb2.entry.js} +1 -1
- package/dist/mint-components/{p-190769c2.entry.js → p-9537742d.entry.js} +2 -2
- package/dist/mint-components/p-af123d2b.system.js +1 -1
- package/dist/mint-components/{p-ef8b63cd.system.entry.js → p-b39ad42c.system.entry.js} +1 -1
- package/dist/mint-components/{p-e971050e.entry.js → p-b5c942ea.entry.js} +2 -2
- package/dist/mint-components/p-c7a4a0ae.entry.js +1 -0
- package/dist/mint-components/{p-25703088.system.entry.js → p-d7c9d0f4.system.entry.js} +1 -1
- package/dist/mint-components/{p-1086ca86.system.entry.js → p-e9dd0d9a.system.entry.js} +1 -1
- package/dist/mint-components/{p-c0f50724.system.entry.js → p-f4bc425e.system.entry.js} +1 -1
- package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-status-column.d.ts +7 -1
- package/dist/types/components/sqm-rewards-table/sqm-rewards-table.d.ts +1 -1
- package/dist/types/components.d.ts +10 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/mint-components/p-9c116b6b.entry.js +0 -1
- package/dist/types/global/android.d.ts +0 -7
- package/dist/types/global/demo.d.ts +0 -2
- package/dist/types/stories/features.d.ts +0 -4
- package/dist/types/stories/templates.d.ts +0 -4
|
@@ -858,7 +858,7 @@ const RewardTableStatusCell = class {
|
|
|
858
858
|
this.pendingUnhandled = "Fulfillment error";
|
|
859
859
|
this.pendingReviewText = "Awaiting review";
|
|
860
860
|
this.deniedText = "Detected self-referral";
|
|
861
|
-
this.payoutFailed = "Payout failed due to a fulfillment issue and is
|
|
861
|
+
this.payoutFailed = "Payout failed due to a fulfillment issue and is currently being retried.";
|
|
862
862
|
this.payoutApproved = "Payout approved and scheduled for payment based on your settings.";
|
|
863
863
|
this.payoutCancelled = "If you think this is a mistake, contact our Support team.";
|
|
864
864
|
this.payoutProcessing = "Processing until {date}. Payout is then scheduled based on your settings.";
|
|
@@ -875,19 +875,18 @@ const RewardTableStatusCell = class {
|
|
|
875
875
|
return "PENDING_REVIEW";
|
|
876
876
|
const partnerTransferStatus = (_e = reward.partnerFundsTransfer) === null || _e === void 0 ? void 0 : _e.status;
|
|
877
877
|
if (reward.partnerFundsTransfer) {
|
|
878
|
-
console.log({
|
|
879
|
-
isProcessing: reward.partnerFundsTransfer.dateScheduled > Date.now(),
|
|
880
|
-
});
|
|
881
878
|
if (partnerTransferStatus === "REVERSED")
|
|
882
879
|
return "PAYOUT_CANCELLED";
|
|
883
880
|
if (partnerTransferStatus === "OVERDUE")
|
|
884
881
|
return "PAYOUT_FAILED";
|
|
885
|
-
if (reward.partnerFundsTransfer.dateScheduled
|
|
882
|
+
if (reward.partnerFundsTransfer.dateScheduled &&
|
|
883
|
+
reward.partnerFundsTransfer.dateScheduled > Date.now()) {
|
|
886
884
|
return "PROCESSING";
|
|
887
885
|
}
|
|
888
886
|
if (partnerTransferStatus === "TRANSFERRED" ||
|
|
889
887
|
partnerTransferStatus === "NOT_YET_DUE" ||
|
|
890
|
-
(reward.partnerFundsTransfer.dateScheduled
|
|
888
|
+
(reward.partnerFundsTransfer.dateScheduled &&
|
|
889
|
+
reward.partnerFundsTransfer.dateScheduled < Date.now() &&
|
|
891
890
|
partnerTransferStatus !== "OVERDUE" &&
|
|
892
891
|
partnerTransferStatus !== "REVERSED"))
|
|
893
892
|
return "PAYOUT_APPROVED";
|
|
@@ -1125,7 +1124,13 @@ const RewardTableStatusColumn = class {
|
|
|
1125
1124
|
*
|
|
1126
1125
|
* @uiName Payout failed text
|
|
1127
1126
|
*/
|
|
1128
|
-
this.payoutFailed = "Payout failed due to a fulfillment issue and is
|
|
1127
|
+
this.payoutFailed = "Payout failed due to a fulfillment issue and is currently being retried.";
|
|
1128
|
+
/**
|
|
1129
|
+
* Displayed when a reward payout is processing.
|
|
1130
|
+
*
|
|
1131
|
+
* @uiName Payout processing text
|
|
1132
|
+
*/
|
|
1133
|
+
this.payoutProcessing = "Processing until {date}. Payout is then scheduled based on your settings.";
|
|
1129
1134
|
/**
|
|
1130
1135
|
* Displayed when reward payout was reversed (based on Impact cash payout configuration).
|
|
1131
1136
|
*
|
|
@@ -1142,7 +1147,7 @@ const RewardTableStatusColumn = class {
|
|
|
1142
1147
|
}
|
|
1143
1148
|
disconnectedCallback() { }
|
|
1144
1149
|
async renderCell(data, options) {
|
|
1145
|
-
return (index.h("sqm-rewards-table-status-cell", { statusText: this.statusText, reward: data, taxConnection: options === null || options === void 0 ? void 0 : options.taxConnection, expiryText: this.expiryText, pendingScheduled: this.pendingScheduled, pendingUsTax: this.pendingUsTax, pendingUnhandled: this.pendingUnhandled, pendingReviewText: this.pendingReviewText, payoutFailed: this.payoutFailed, payoutApproved: this.payoutApproved, payoutCancelled: this.payoutCancelled, deniedText: this.deniedText, locale: options === null || options === void 0 ? void 0 : options.locale }));
|
|
1150
|
+
return (index.h("sqm-rewards-table-status-cell", { statusText: this.statusText, reward: data, taxConnection: options === null || options === void 0 ? void 0 : options.taxConnection, expiryText: this.expiryText, pendingScheduled: this.pendingScheduled, pendingUsTax: this.pendingUsTax, pendingUnhandled: this.pendingUnhandled, pendingReviewText: this.pendingReviewText, payoutFailed: this.payoutFailed, payoutApproved: this.payoutApproved, payoutProcessing: this.payoutProcessing, payoutCancelled: this.payoutCancelled, deniedText: this.deniedText, locale: options === null || options === void 0 ? void 0 : options.locale }));
|
|
1146
1151
|
}
|
|
1147
1152
|
async renderLabel() {
|
|
1148
1153
|
return this.columnTitle;
|
|
@@ -10719,7 +10719,7 @@ const column = "@author:noah\n@owner:noah\nFeature: Referral Table User Column\n
|
|
|
10719
10719
|
|
|
10720
10720
|
const date = "@author:noah\n@owner:noah\nFeature: Referral Table Date Column\n\n Shows the date of each referral\n\n Background:\n Given the date column is included in the referral table\n\n @motivating\n @ui\n Scenario Outline: The title of the date column is configurable\n Given the \"column-title\" prop is set to <value>\n Then the date column is shown with <columTitle>\n Examples:\n | value | columnTitle |\n | | Date Converted |\n | My column title | My column title |\n\n @motivating\n Scenario Outline: A configurable date associated with the referral is shown for each referral\n Given the \"date-shown\" prop is set to <dateType>\n And referrals exist\n Then for each referral the <referralDate> is shown in the table\n And the date is localized to the users locale\n Examples:\n | dateType | referralDate |\n | dateReferralStarted | date referral started |\n | dateReferralPaid | date referral paid |\n | dateReferralEnded | date referral ended |\n | dateModerated | date moderated |\n | dateUserModified | date user modified |\n | dateConverted | date converted |\n | dateModified | date modified |\n | | date converted |";
|
|
10721
10721
|
|
|
10722
|
-
const rewards = "@author:noah @owner:noah\nFeature: Referral Table Reward Column\n Shows the reward associated with each referral\n\n Background: \n Given the status column is included in the referral table\n And at least one referral exists\n\n\n\n @motivating @ui\n Scenario Outline: The referral reward and its status are shown for each referral\n Then for each referral reward there exists a reward cell\n And the reward type and value is displayed in the cell\n And the status of each reward is displayed as a pill in the cell\n And rewards of <status> have a <pillColour> pill with the text <statusText>\n\n Examples: \n | status | pillColour | statusText |\n | Available | success | Available |\n | Pending | warning | Pending |\n | Pending Fraud Review | warning | Pending |\n | Pending Tax Review | warning | Pending |\n | Pending New Tax Form | warning | Pending |\n | Pending Tax Submission | warning | Pending |\n | Pending Partner Creation | warning | Pending |\n | Cancelled | danger | Cancelled |\n | Payout Overdue | danger | Payout Failed |\n | Payout Reversed | danger | Payout Cancelled |\n | Expired | danger | Expired |\n | Denied | danger | Denied |\n | Redeemed | primary | Redeemed |\n | Payout Transferred | primary | Payout Approved |\n | Payout Not Yet Due | primary | Payout Approved |\n | Payout Processing | primary | Payment Processing |\n\n @motivating\n Scenario: The pending period of a referral reward is shown inside the pill if scheduled\n Given a reward that is pending\n And the reward has a scheduled date in the future\n Then the status pill of the reward will contain the text \"Pending for <relativeTime>\"\n And the date is localized to the user's locale\n\n Examples: \n | relativeTime |\n | 2 days |\n | 1 week |\n | 3 months |\n\n @motivating\n Scenario: The expiry date of a reward is shown in a secondary pill\n Given a reward that is available\n And the reward has a set expiry date\n Then an additional info pill will appear next to the status pill with the text \"Expiring in <relativeTime>\"\n And the date is localized to the user's locale\n\n Examples: \n | relativeTime |\n | 2 days |\n | 1 week |\n\n @motivating @ui\n Scenario Outline: Expanding the reward cell shows specific detailed status messages\n When a reward cell is clicked\n Then it expands to show the detail view\n And if the reward status is <status>\n Then the detail text displays <detailMessage>\n\n Examples: Payout States\n | status | detailMessage |\n | Payout Approved | Processing until {date}. Payout is then scheduled based your settings.
|
|
10722
|
+
const rewards = "@author:noah @owner:noah\nFeature: Referral Table Reward Column\n Shows the reward associated with each referral\n\n Background: \n Given the status column is included in the referral table\n And at least one referral exists\n\n\n\n @motivating @ui\n Scenario Outline: The referral reward and its status are shown for each referral\n Then for each referral reward there exists a reward cell\n And the reward type and value is displayed in the cell\n And the status of each reward is displayed as a pill in the cell\n And rewards of <status> have a <pillColour> pill with the text <statusText>\n\n Examples: \n | status | pillColour | statusText |\n | Available | success | Available |\n | Pending | warning | Pending |\n | Pending Fraud Review | warning | Pending |\n | Pending Tax Review | warning | Pending |\n | Pending New Tax Form | warning | Pending |\n | Pending Tax Submission | warning | Pending |\n | Pending Partner Creation | warning | Pending |\n | Cancelled | danger | Cancelled |\n | Payout Overdue | danger | Payout Failed |\n | Payout Reversed | danger | Payout Cancelled |\n | Expired | danger | Expired |\n | Denied | danger | Denied |\n | Redeemed | primary | Redeemed |\n | Payout Transferred | primary | Payout Approved |\n | Payout Not Yet Due | primary | Payout Approved |\n | Payout Processing | primary | Payment Processing |\n\n @motivating\n Scenario: The pending period of a referral reward is shown inside the pill if scheduled\n Given a reward that is pending\n And the reward has a scheduled date in the future\n Then the status pill of the reward will contain the text \"Pending for <relativeTime>\"\n And the date is localized to the user's locale\n\n Examples: \n | relativeTime |\n | 2 days |\n | 1 week |\n | 3 months |\n\n @motivating\n Scenario: The expiry date of a reward is shown in a secondary pill\n Given a reward that is available\n And the reward has a set expiry date\n Then an additional info pill will appear next to the status pill with the text \"Expiring in <relativeTime>\"\n And the date is localized to the user's locale\n\n Examples: \n | relativeTime |\n | 2 days |\n | 1 week |\n\n @motivating @ui\n Scenario Outline: Expanding the reward cell shows specific detailed status messages\n When a reward cell is clicked\n Then it expands to show the detail view\n And if the reward status is <status>\n Then the detail text displays <detailMessage>\n\n Examples: Payout States\n | status | detailMessage |\n | Payout Approved | Processing until {date}. Payout is then scheduled based on your settings. |\n | Payout Failed | Payout failed due to a fulfillment issue and is currently being retried. |\n | Payout Cancelled | If you think this is a mistake, contact our Support team. |\n | Processing | Processing until {date}. Payout is then scheduled based on your settings. |\n\n Examples: Tax Compliance States\n | status | detailMessage |\n | Pending Tax Review | Awaiting tax form review |\n | Pending New Tax Form | Invalid tax form. Submit a new form to receive your rewards. |\n | Pending Tax Submission | Submit your tax documents to receive your rewards |\n | Pending Partner Creation | Complete your tax and cash payout setup to receive your rewards |\n\n Examples: Standard States\n | status | detailMessage |\n | Available | Reward expiring on |\n | Cancelled | Reward cancelled on |\n | Pending | Available on |\n | Pending Review | Pending since |\n | Denied | Denied on |\n | Expired | Reward expired on |\n | Redeemed | Redeemed |\n\n @motivating\n Scenario: Fuel Tank codes are displayed in the expanded view\n Given a reward has a Fuel Tank code\n When the reward cell is clicked\n Then the expanded details display the text \"Your code is\"\n And the code <fuelTankCode> is displayed in bold\n\n @motivating\n Scenario: Fraud denial help text is displayed\n Given a reward has been denied due to fraud\n And the component has \"deniedHelpText\" configured\n When the reward cell is clicked\n Then the expanded details display the denied help text next to the denial date\n\n @minutia\n Scenario: Payout-related reward statuses are determined by the state of the Paid Funds Transfer\n Given a reward exists\n And the reward has a connected Paid Funds Transfer (PFT)\n When the PFT is in <pftState>\n Then the reward's status is <status>\n And the status text displays <text>\n And the status is displayed in a <pillColour> pill\n\n Examples:\n | pftState | status | text | pillColour |\n | transfer date is in the future | PROCESSING | Payment Processing | primary |\n | successfully transferred to payment provider | PAYOUT_TRANSFERRED | Payout Approved | primary |\n | approved but payout scheduled date not yet arrived | PAYOUT_NOT_YET_DUE | Payout Approved | primary |\n | failed due to fulfillment issue and retrying | PAYOUT_OVERDUE | Payout Failed | danger |\n | reversed or cancelled after being processed | PAYOUT_REVERSED | Payout Cancelled | danger |\n";
|
|
10723
10723
|
|
|
10724
10724
|
const status = "@author:noah\n@owner:noah\nFeature: Referral Table Status Column\n\n Shows the status of each referral\n\n Background:\n Given the status column is included in the referral table\n\n @motivating\n @ui\n Scenario: The title of the date column is configurable\n Given the \"column-title\" prop is set to \"My column title\"\n Then the date column is shown with \"My column title\"\n\n @motivating\n Scenario: The status column's fraudStatus maps to the fraud status of the referral\n Given at least one referral\n Then the referral cell fraud status is set to `moderationStatus` of the referral\n\n @motivating\n Scenario Outline: The status column displays the status of each referral\n Given referrals exist\n Then the status of each referral is displayed\n And the status <status> is displayed as text from <statusTextProp> in a <pillColour> pill\n\n Examples:\n | status | statusTextProp | pillColour |\n | In Progress | inProgressStatusText | Orange |\n | Converted | convertedStatusText | Green |\n | Pending | pendingReviewStatusText | Orange |\n | Denied | deniedStatusText | Red |\n";
|
|
10725
10725
|
|
|
@@ -11854,7 +11854,7 @@ const defaultTaxDocument = {
|
|
|
11854
11854
|
};
|
|
11855
11855
|
const defaultProps$o = {
|
|
11856
11856
|
statusText: "{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }",
|
|
11857
|
-
statusLongText: "{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }",
|
|
11857
|
+
statusLongText: "{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }",
|
|
11858
11858
|
rewardReceivedText: "Reward received on",
|
|
11859
11859
|
hideDetails: false,
|
|
11860
11860
|
};
|
|
@@ -12417,7 +12417,7 @@ const scenario2 = "@author:derek\n@owner:derek\nFeature: Reward Table reward Col
|
|
|
12417
12417
|
|
|
12418
12418
|
const scenario4 = "@author:derek @owner:derek\nFeature: Reward Table Source Column\n Shows the source of each reward\n\n @motivating @ui\n Scenario Outline: The title of the source column is configurable\n Given the \"column-title\" prop is set to <value>\n Then the source column is shown with <columnTitle>\n\n Examples:\n | value | columnTitle |\n | Source | |\n | My column title | My column title |\n\n @motivating @ui\n Scenario: The source column displays manual if the reward is caused by a manual action\n Given a user with a \"MANUAL\" reward\n When they view the rewards table\n Then the source of their reward is displayed as \"Manual\"\n\n @motivating @ui\n Scenario: The source column displays the program name if the reward is caused automatically by a program\n Given a user with a \"AUTOMATED\" program reward\n And the program has name \"Loyalty Program\"\n When they view the rewards table\n Then the source of their reward is displayed as \"Loyalty Program\"\n\n @motivating @ui\n Scenario Outline: The source column displays customizable reward exchange text with amount if the reward is caused by reward exchange\n Given the \"reward-exchange-text\" prop is <propValue>\n And a user with a \"MANUAL\" reward\n But it was created by a reward exchange\n Then they view the rewards table\n Then the source displays <exchangeText>\n And under it displays the following\n | prettyRedeemedCredit → prettyValue |\n\n Examples:\n | propValue | exchangeText |\n | | Reward Exchange |\n | Exchanged | Exchanged |\n\n @motivating @ui\n Scenario Outline: The source column displays customizable referral information if the reward is from a referral\n Given the \"reward-source-text\" prop is <propValue>\n And a user with a referral reward\n And that reward has <rewardSource>\n When they view the rewards table\n Then then source displays <referralText>\n And under it displays the full name of the <referralUser>\n\n Examples:\n | propValue | rewardSource | referralText | referralUser |\n | | REFERRED | Referred by | referrer user |\n | | FRIEND_SIGNUP | Referral to | referred user |\n | {rewardSource, select, FRIEND_SIGNUP {You Referred} REFERRED {Referred you} other {}} | REFERRED | Referred you | referrer user |\n | {rewardSource, select, FRIEND_SIGNUP {You Referred} REFERRED {Referred you} other {}} | FRIEND_SIGNUP | You Referred | referred user |\n\n @motivating @ui\n Scenario Outline: The source column displays the existing name for a referral if either the first name or last name does not exist\n Given a user with a referral reward\n And referral user exists\n And referral user has <name>\n But referral user has no <otherName>\n When they view the rewards table\n Then referral user's name is displayed as <name>\n\n Examples:\n | name | otherName |\n | first.name | last.name |\n | last.name | first.name |\n\n @motivating @ui\n Scenario Outline: The source column displays referral as \"Anonymous User\" if the referral user has no names\n Given a user with a referral reward\n And that reward has <rewardSource>\n And the <referralUser> has no first name\n And the <referralUser> has no last name\n When they view the rewards table\n Then then source displays <sourceText>\n And under it displays \"Anonymous User\"\n\n Examples:\n | rewardSource | referralUser | sourceText |\n | FRIEND_SIGNUP | referrer | Referral to |\n | REFERRED | referred user | Referred by |\n\n @motivating @ui\n Scenario Outline: The source column displays referral as \"Deleted User\" if the referral user is deleted in the system\n Given a user with a referral reward\n And that reward has <rewardSource>\n But <referral> user was deleted\n When they view the rewards table\n Then the source displays <sourceText>\n And under it displays \"Deleted User\"\n\n Examples:\n | rewardSource | referral | sourceText |\n | \"FRIEND_SIGNUP\" | referrer | Referral to |\n | \"REFERRED\" | referred | Referred by |\n\n @motivating @ui\n Scenario Outline: The source column displays referral as \"Deleted referral\" if the referral user is deleted in the system\n Given a user with a referral reward\n And that reward has <rewardSource>\n But <referral> user was deleted\n When they view the rewards table\n Then the source displays <sourceText>\n And under it displays \"Deleted referral\"\n\n Examples:\n | rewardSource | referral | sourceText |\n | \"FRIEND_SIGNUP\" | referrer | Referral to |\n | \"REFERRED\" | referred | Referred by |\n\n @minutia @ui\n Scenario Outline: Name fallbacks for referral users without names are customizable\n Given <prop> with <value>\n And a user with a referral reward\n But the referral user <hadAction>\n When they view the rewards table\n Then the source displays <value> as the referral user\n\n Examples:\n | prop | value | hadAction |\n | deleted-user | Former Customer | was deleted |\n | anonymous-user | Nameless User | had first and last name deleted |\n\n @motivating\n Scenario Outline: Source text can be customized\n Given the \"reward-source-text\" prop is \"{rewardSource, select, MANUAL {Support} AUTOMATED {Loyalty Program} other {}}\"\n And a user with a <rewardSource> reward\n When they view the rewards table\n Then the source is <sourceText>\n\n Examples:\n | rewardSource | sourceText |\n | MANUAL | Support |\n | AUTOMATED | Loyalty Program |\n";
|
|
12419
12419
|
|
|
12420
|
-
const scenario3 = "@author:derek @owner:derek\nFeature: Reward Table Status Column\n Shows the status of each reward\n\n Background:\n Given the status column is included in the reward table\n\n @motivating @ui\n Scenario Outline: The title of the status column is configurable\n Given the \"column-title\" prop is set to <value>\n Then the status column is shown with <columnTitle>\n\n Examples:\n | value | columnTitle |\n | Status | |\n | My column title | My column title |\n\n @motivating @ui\n Scenario Outline: The status column displays the status of each reward\n Given a user\n And they have a <status> reward\n When they view the reward table\n Then the status of their reward is displayed in <pillColour> pill with <text>\n\n Examples:\n | status | text | pillColour |\n | AVAILABLE | Available | success |\n | CANCELLED | Cancelled | danger |\n | PENDING | Pending | warning |\n | EXPIRED | Expired | danger |\n | REDEEMED | Redeemed | primary |\n | PENDING_REVIEW | Pending | warning |\n | PAYOUT_TRANSFERRED | Payout Approved | primary |\n | PAYOUT_NOT_YET_DUE | Payout Approved | primary |\n | PAYOUT_OVERDUE | Payout Failed | danger |\n | PAYOUT_REVERSED | Payout Cancelled | danger |\n |
|
|
12420
|
+
const scenario3 = "@author:derek @owner:derek\nFeature: Reward Table Status Column\n Shows the status of each reward\n\n Background:\n Given the status column is included in the reward table\n\n @motivating @ui\n Scenario Outline: The title of the status column is configurable\n Given the \"column-title\" prop is set to <value>\n Then the status column is shown with <columnTitle>\n\n Examples:\n | value | columnTitle |\n | Status | |\n | My column title | My column title |\n\n @motivating @ui\n Scenario Outline: The status column displays the status of each reward\n Given a user\n And they have a <status> reward\n When they view the reward table\n Then the status of their reward is displayed in <pillColour> pill with <text>\n\n Examples:\n | status | text | pillColour |\n | AVAILABLE | Available | success |\n | CANCELLED | Cancelled | danger |\n | PENDING | Pending | warning |\n | EXPIRED | Expired | danger |\n | REDEEMED | Redeemed | primary |\n | PENDING_REVIEW | Pending | warning |\n | PAYOUT_TRANSFERRED | Payout Approved | primary |\n | PAYOUT_NOT_YET_DUE | Payout Approved | primary |\n | PAYOUT_OVERDUE | Payout Failed | danger |\n | PAYOUT_REVERSED | Payout Cancelled | danger |\n | PROCESSING | Processing | warning |\n | PENDING_TAX_REVIEW | Pending | warning |\n | PENDING_NEW_TAX_FORM | Pending | warning |\n | PENDING_TAX_SUBMISSION | Pending | warning |\n | PENDING_PARTNER_CREATION | Pending | warning |\n | DENIED | Denied | danger |\n\n @motivating\n Scenario Outline: Reward status related information is displayed under status pills\n Given a user\n And they have a <reward>\n And their program is\n When they view the reward table\n Then they see their reward\n And under the pill is <text>\n And the date is localized to the users locale\n\n Examples: Standard Rewards\n | reward | text |\n | available reward with an expiry date | Expires <localized date> |\n | redeemed reward | <localized date> |\n | expired reward | <localized date> |\n | cancelled reward | <localized date> |\n | pending reward with a scheduled date | Until <localized date> |\n \n Examples: Tax & Payout Rewards\n | reward | text |\n | pending reward due to W9 | W-9 required |\n | pending reward due to fulfillment error | Fulfillment error |\n | reward pending review of referral | Awaiting review |\n | pending reward due to no connected Impact partner | Complete your tax and cash payout setup to receive your rewards. |\n | pending reward due to an invalid tax document | Invalid tax form. Submit a new form to receive your rewards. |\n | pending reward due to user required to submit a tax document | Submit your tax documents to receive your rewards. |\n | pending reward due to tax document being in review | Awaiting tax form review. |\n | reward whose payout is processing | Processing until <localized date>. Payout is then scheduled based on your settings. |\n | reward whose payout failed | Payout failed due to a fulfillment issue and is currently being retried. |\n | reward whose payout was approved | Payout approved and scheduled for payment based on your settings. |\n | reward whose payout was cancelled | If you think this is a mistake, contact our Support team. |\n | cancelled reward from denied referral | Detected self-referral |\n\n @minutia\n Scenario Outline: Tax-related reward statuses are based on the user's Impact tax connection\n Given a user\n And they are in a program that has Impact tax handling enabled\n And they have at least one pending reward\n And the reward's pending reasons include \"MISSING_PAYOUT_CONFIGURATION\"\n Then the status description will be\n \"\"\"\n Complete your tax and cash payout setup to receive your rewards.\n \"\"\"\n\n @motivating\n Scenario Outline: Statuses can be customized via ICU format\n Given the \"status-text\" prop is \"{status, select, AVAILABLE {Redeem me!} CANCELLED {Unavailable} PENDING {Coming soon!} EXPIRED {Past due} REDEEMED {Spent} PENDING_REVIEW {Pending Review!} PAYOUT_SENT {Payout Sent!} PAYOUT_FAILED {Payout Failed!} PENDING_TAX_REVIEW {Pending Tax Review!} PENDING_NEW_TAX_FORM {Pending new tax form!} PENDING_TAX_SUBMISSION {Pending tax submission!} PENDING_PARTNER_CREATION {Pending partner creation!} DENIED {Unlucky!}}\"\n And a user\n And they have a <status> reward\n When they view the reward table\n Then the status of their reward is displayed in <pillColour> pill with <text>\n\n Examples:\n | status | text | pillColour |\n | AVAILABLE | Redeem me! | success |\n | CANCELLED | Unavailable | danger |\n | PENDING | Coming soon! | warning |\n | EXPIRED | Past due | danger |\n | REDEEMED | Spent | primary |\n | PENDING_REVIEW | Pending Review! | warning |\n | PAYOUT_TRANSFERRED | Payout Approved! | primary |\n | PAYOUT_NOT_YET_DUE | Payout Approved! | primary |\n | PAYOUT_OVERDUE | Payout Failed! | danger |\n | PAYOUT_REVERSED | Payout Cancelled! | danger |\n | DENIED | Unlucky! | danger |\n\n @minutia @ui\n Scenario Outline: Expiry status date text can be configured\n Given the \"expiry-text\" prop has <value>\n And a user with an available reward with an expiry date\n When they view the reward table\n Then they see <text> under the Available Status pill\n\n Examples:\n | value | text |\n | Expires | Expires <localized date> |\n | Redeem before | Redeem before <localized date> |\n\n @motivating\n Scenario: Payout-related reward statuses are determined by the state of the Paid Funds Transfer\n Given a user has a reward with a connected Paid Funds Transfer (PFT)\n When the PFT is in <pftState>\n Then the reward's status is <status>\n And the status is displayed in a <pillColour> pill with <text>\n And under the pill is <description>\n\n Examples:\n | pftState | status | text | pillColour | description |\n | transfer date is in the future | PROCESSING | Processing | warning | Processing until <localized date>. Payout is then scheduled based on your settings. |\n | successfully transferred to payment provider | PAYOUT_TRANSFERRED | Payout Approved | primary | Payout approved and scheduled for payment based on your settings. |\n | approved but payout scheduled date not yet arrived | PAYOUT_NOT_YET_DUE | Payout Approved | primary | Payout approved and scheduled for payment based on your settings. |\n | failed due to fulfillment issue and retrying | PAYOUT_OVERDUE | Payout Failed | danger | Payout failed due to a fulfillment issue and is currently being retried. |\n | reversed or cancelled after being processed | PAYOUT_REVERSED | Payout Cancelled | danger | If you think this is a mistake, contact our Support team. |";
|
|
12421
12421
|
|
|
12422
12422
|
const scenario$x = scenario1 + scenario2 + scenario3 + scenario4;
|
|
12423
12423
|
const RewardsTableCell_stories = {
|
|
@@ -12783,6 +12783,165 @@ const RewardsTableCell = /*#__PURE__*/Object.freeze({
|
|
|
12783
12783
|
EmptyCell: EmptyCell$3
|
|
12784
12784
|
});
|
|
12785
12785
|
|
|
12786
|
+
const scenario$y = "@owner:sam\n@author:sam\nFeature: Rewards Table\n\n Shows a list of rewards as a table\n\n @motivating\n @ui\n Scenario: The empty state is shown if there are no rewards\n Given a user with rewards\n When they view the reward table\n Then no rewards are displayed\n And they see an image with a user icon\n And \"View your rewards\" in bold\n And \"See all the rewards you have earned from referring friends and completing tasks\" below the bolded text\n And the pagination buttons are disabled\n\n @minutia\n @ui\n Scenario: A custom empty state can be provided\n Given a user with no rewards\n And a custom empty state has been supplied in the \"empty\" slot\n When they view the reward table\n Then they see the custom empty state\n\n @minutia\n @ui\n Scenario: The loading state is shown while rewards are loading\n Given the table is loading\n Then the loading state is shown in the table\n And a custom loading state can be supplied in the \"loading\" slot\n And the pagination buttons are disabled\n\n @motivating\n @ui\n Scenario Outline: The table becomes paginated when the number of rewards exceeds the per page limit\n Given the user has <number of rewards>\n And the table is configured to show <page limit> rewards per page\n Then the table will have <number of pages> page(s)\n And pagination buttons will allow users to navigate between pages\n And the pagination button to go to the next page is disabled on the last page of rewards\n And the pagination button to go to the previous page is disabled on the first page of rewards\n Examples:\n | number of rewards | page limit | number of pages |\n | 0 | 4 | 1 |\n | 1 | 4 | 1 |\n | 3 | 4 | 1 |\n | 5 | 4 | 2 |\n | 42 | 4 | 11 |\n\n @motivating\n @ui\n Scenario: The table converts to a card view on tablet and mobile window sizes\n Given a user with rewards\n When they view the table\n And their window size is smaller than \"799px\"\n Then rewards are displayed as cards\n And they are in two columns\n When their window size is smaller than \"599px\"\n Then the rewards are displayed as cards in a singular column\n\n @motivating\n @ui\n Scenario: Table and Mobile beakpoints can be configured\n Given the reward table has been configured with the following props\n | prop | value |\n | smBreakpoint | 599 |\n | mdBreakpoint | 799 |\n And a user with rewards\n When they view the table\n And their window size is smaller than \"799px\"\n Then rewards are displayed as cards\n And they are in two columns\n When their window size is smaller than \"599px\"\n Then the rewards are displayed as cards in a singular column\n\n @motivating\n @ui\n Scenario Outline: By default the first column heading is hidden in mobile\n Given a reward table with 4 columns\n And prop \"hidden-columns\" with <hideColumnValue>\n And a user with rewards\n When they view the reward table\n And their window size is below the tablet breakpoint\n Then reward cards are displayed\n And the titles of <columnsArehidden> within the card\n Examples:\n | hideColumnValue | columnsArehidden |\n | | the first column |\n | 0,1,2 | the first, second and third columns |\n | 3 | the fourth column |\n\n @motivating\n Scenario: Only rewards which occured in the program specific by \"program-id\" are shown\n Given the table is configured with \"program-id\"\n Then only rewards from the program with \"program-id\" are shown\n\n @landmine\n Scenario: When a `classic` program Id is set then any reward without a programId is shown\n There is no easy way for the backend to filter for \"classic\" programs,\n thus we are filtering for rewards without programId's.\n\n Given the \"program-id\" of the table is set to \"classic\"\n Then rewards from classic programs are shown\n And manual rewards are shown\n\n @minutia\n @ui\n Scenario: Column heading can be hidden\n Given the table is configured with \"hide-labels\" set to \"true\"\n Then the table is displayed without column headings";
|
|
12787
|
+
|
|
12788
|
+
const RewardsTable_stories = {
|
|
12789
|
+
title: "Components/Rewards Table",
|
|
12790
|
+
parameters: {
|
|
12791
|
+
scenario: scenario$y,
|
|
12792
|
+
},
|
|
12793
|
+
};
|
|
12794
|
+
const loadingElement$2 = (index.h("div", { slot: "loading", style: { display: "contents" } },
|
|
12795
|
+
index.h("sqm-table-row", null,
|
|
12796
|
+
index.h("sqm-table-cell", { colspan: 5 },
|
|
12797
|
+
index.h("sl-skeleton", null))),
|
|
12798
|
+
index.h("sqm-table-row", null,
|
|
12799
|
+
index.h("sqm-table-cell", { colspan: 5 },
|
|
12800
|
+
index.h("sl-skeleton", null))),
|
|
12801
|
+
index.h("sqm-table-row", null,
|
|
12802
|
+
index.h("sqm-table-cell", { colspan: 5 },
|
|
12803
|
+
index.h("sl-skeleton", null))),
|
|
12804
|
+
index.h("sqm-table-row", null,
|
|
12805
|
+
index.h("sqm-table-cell", { colspan: 5 },
|
|
12806
|
+
index.h("sl-skeleton", null))),
|
|
12807
|
+
index.h("sqm-table-row", null,
|
|
12808
|
+
index.h("sqm-table-cell", { colspan: 5 },
|
|
12809
|
+
index.h("sl-skeleton", null)))));
|
|
12810
|
+
const emptyElement$2 = (index.h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_reward2.png", "empty-state-header": "View your rewards", "empty-state-text": "See all the rewards you have earned from referring friends and completing tasks" }));
|
|
12811
|
+
const rewardsTableProps = (rows, empty = false, loading = false, prev = "Prev", next = "Next", hidden = "") => ({
|
|
12812
|
+
states: {
|
|
12813
|
+
hasPrev: false,
|
|
12814
|
+
hasNext: true,
|
|
12815
|
+
show: empty
|
|
12816
|
+
? "empty"
|
|
12817
|
+
: loading
|
|
12818
|
+
? "loading"
|
|
12819
|
+
: "rows",
|
|
12820
|
+
namespace: "sqm-rewards-table",
|
|
12821
|
+
},
|
|
12822
|
+
data: {
|
|
12823
|
+
textOverrides: {
|
|
12824
|
+
showLabels: true,
|
|
12825
|
+
prevLabel: prev,
|
|
12826
|
+
moreLabel: next,
|
|
12827
|
+
},
|
|
12828
|
+
hiddenColumns: hidden,
|
|
12829
|
+
mdBreakpoint: 799,
|
|
12830
|
+
smBreakpoint: 599,
|
|
12831
|
+
},
|
|
12832
|
+
callbacks: {
|
|
12833
|
+
prevPage: () => console.log("Prev"),
|
|
12834
|
+
nextPage: () => console.log("Next"),
|
|
12835
|
+
},
|
|
12836
|
+
elements: {
|
|
12837
|
+
columns: ["Rewards", "Status", "Source", "Date received"],
|
|
12838
|
+
rows: rows,
|
|
12839
|
+
emptyElement: emptyElement$2,
|
|
12840
|
+
loadingElement: loadingElement$2,
|
|
12841
|
+
},
|
|
12842
|
+
});
|
|
12843
|
+
const r_available = [
|
|
12844
|
+
index.h(RewardsCellCreditFull, null),
|
|
12845
|
+
index.h(StatusCellAvailable, null),
|
|
12846
|
+
index.h(SourceCellReferral, null),
|
|
12847
|
+
index.h(DateCell$2, null),
|
|
12848
|
+
];
|
|
12849
|
+
const r_expired = [
|
|
12850
|
+
index.h(RewardsCellCreditPartial, null),
|
|
12851
|
+
index.h(StatusCellAvailableExpiry, null),
|
|
12852
|
+
index.h(SourceCellReferred, null),
|
|
12853
|
+
index.h(DateCell$2, null),
|
|
12854
|
+
];
|
|
12855
|
+
const r_deleted = [
|
|
12856
|
+
index.h(RewardsCellCreditCancelled, null),
|
|
12857
|
+
index.h(StatusCellCancelled, null),
|
|
12858
|
+
index.h(SourceCellDeletedReferral, null),
|
|
12859
|
+
index.h(DateCell$2, null),
|
|
12860
|
+
];
|
|
12861
|
+
const r_cancelled = [
|
|
12862
|
+
index.h(RewardsCellCreditCancelled, null),
|
|
12863
|
+
index.h(StatusCellCancelled, null),
|
|
12864
|
+
index.h(SourceCellDeletedUser, null),
|
|
12865
|
+
index.h(DateCell$2, null),
|
|
12866
|
+
];
|
|
12867
|
+
const r_redeemed = [
|
|
12868
|
+
index.h(RewardsCellCreditRedeemed, null),
|
|
12869
|
+
index.h(StatusCellRedeemed, null),
|
|
12870
|
+
index.h(SourceCellManual, null),
|
|
12871
|
+
index.h(DateCell$2, null),
|
|
12872
|
+
];
|
|
12873
|
+
const r_denied = [
|
|
12874
|
+
index.h(RewardsCellCreditRedeemed, null),
|
|
12875
|
+
index.h(StatusCellDenied, null),
|
|
12876
|
+
index.h(SourceCellManual, null),
|
|
12877
|
+
index.h(DateCell$2, null),
|
|
12878
|
+
];
|
|
12879
|
+
const r_pending_review = [
|
|
12880
|
+
index.h(RewardsCellCreditRedeemed, null),
|
|
12881
|
+
index.h(StatusCellPendingReview, null),
|
|
12882
|
+
index.h(SourceCellManual, null),
|
|
12883
|
+
index.h(DateCell$2, null),
|
|
12884
|
+
];
|
|
12885
|
+
const r_long = [
|
|
12886
|
+
index.h(RewardsCellCreditLong, null),
|
|
12887
|
+
index.h(StatusCellAvailableExpiry, null),
|
|
12888
|
+
index.h(SourceCellReferred, null),
|
|
12889
|
+
index.h(DateCell$2, null),
|
|
12890
|
+
];
|
|
12891
|
+
const r_fueltank = [
|
|
12892
|
+
index.h(RewardsCellFueltank, null),
|
|
12893
|
+
index.h(StatusCellPending, null),
|
|
12894
|
+
index.h(SourceCellManual, null),
|
|
12895
|
+
index.h(DateCell$2, null),
|
|
12896
|
+
];
|
|
12897
|
+
const r_fueltank_long = [
|
|
12898
|
+
index.h(RewardsCellFueltankLong, null),
|
|
12899
|
+
index.h(StatusCellPendingUnhandled, null),
|
|
12900
|
+
index.h(SourceCellManual, null),
|
|
12901
|
+
index.h(DateCell$2, null),
|
|
12902
|
+
];
|
|
12903
|
+
const RewardsTable = () => {
|
|
12904
|
+
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps([
|
|
12905
|
+
r_available,
|
|
12906
|
+
r_redeemed,
|
|
12907
|
+
r_cancelled,
|
|
12908
|
+
r_deleted,
|
|
12909
|
+
r_expired,
|
|
12910
|
+
r_denied,
|
|
12911
|
+
r_pending_review,
|
|
12912
|
+
]))));
|
|
12913
|
+
};
|
|
12914
|
+
const RewardsTableSingle = () => {
|
|
12915
|
+
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps([r_fueltank]))));
|
|
12916
|
+
};
|
|
12917
|
+
const RewardsTableLong = () => {
|
|
12918
|
+
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps([r_fueltank_long, r_long]))));
|
|
12919
|
+
};
|
|
12920
|
+
const RewardsTableEmpty = () => {
|
|
12921
|
+
return index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps([], true)));
|
|
12922
|
+
};
|
|
12923
|
+
const RewardsTableLoading = () => {
|
|
12924
|
+
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps([], false, true))));
|
|
12925
|
+
};
|
|
12926
|
+
const CustomButtonTextTable$1 = () => {
|
|
12927
|
+
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps([r_available, r_redeemed, r_cancelled, r_expired], false, false, "CUSTOM PREVIOUS TEXT", "CUSTOM NEXT TEXT"))));
|
|
12928
|
+
};
|
|
12929
|
+
const ColumnsMobileHidden$1 = () => {
|
|
12930
|
+
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps([r_available, r_redeemed, r_cancelled, r_expired], false, false, undefined, undefined, "0,1,2,3"))));
|
|
12931
|
+
};
|
|
12932
|
+
|
|
12933
|
+
const RewardsTable$1 = /*#__PURE__*/Object.freeze({
|
|
12934
|
+
__proto__: null,
|
|
12935
|
+
'default': RewardsTable_stories,
|
|
12936
|
+
RewardsTable: RewardsTable,
|
|
12937
|
+
RewardsTableSingle: RewardsTableSingle,
|
|
12938
|
+
RewardsTableLong: RewardsTableLong,
|
|
12939
|
+
RewardsTableEmpty: RewardsTableEmpty,
|
|
12940
|
+
RewardsTableLoading: RewardsTableLoading,
|
|
12941
|
+
CustomButtonTextTable: CustomButtonTextTable$1,
|
|
12942
|
+
ColumnsMobileHidden: ColumnsMobileHidden$1
|
|
12943
|
+
});
|
|
12944
|
+
|
|
12786
12945
|
const TaxAndCashRewardsTableCell_stories = {
|
|
12787
12946
|
title: "Components/Tax And Cash Rewards Table Cell",
|
|
12788
12947
|
};
|
|
@@ -13004,7 +13163,7 @@ const TaxAndCashRewardsTableCell = /*#__PURE__*/Object.freeze({
|
|
|
13004
13163
|
const TaxAndCashRewardsTable_stories = {
|
|
13005
13164
|
title: "Components/Tax And Cash Rewards Table",
|
|
13006
13165
|
};
|
|
13007
|
-
const rewardsTableProps = (rows, empty = false, loading = false, prev = "Prev", next = "Next", hidden = "") => ({
|
|
13166
|
+
const rewardsTableProps$1 = (rows, empty = false, loading = false, prev = "Prev", next = "Next", hidden = "") => ({
|
|
13008
13167
|
states: {
|
|
13009
13168
|
hasPrev: false,
|
|
13010
13169
|
hasNext: true,
|
|
@@ -13097,8 +13256,8 @@ const r_payout_cancelled = [
|
|
|
13097
13256
|
index.h(SourceCellReferral, null),
|
|
13098
13257
|
index.h(DateCell$2, null),
|
|
13099
13258
|
];
|
|
13100
|
-
const RewardsTable = () => {
|
|
13101
|
-
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps([
|
|
13259
|
+
const RewardsTable$2 = () => {
|
|
13260
|
+
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps$1([
|
|
13102
13261
|
r_pending_new_tax_form,
|
|
13103
13262
|
r_pending_tax_submission,
|
|
13104
13263
|
r_pending_tax_review,
|
|
@@ -13111,169 +13270,10 @@ const RewardsTable = () => {
|
|
|
13111
13270
|
]))));
|
|
13112
13271
|
};
|
|
13113
13272
|
|
|
13114
|
-
const RewardsTable$1 = /*#__PURE__*/Object.freeze({
|
|
13115
|
-
__proto__: null,
|
|
13116
|
-
'default': TaxAndCashRewardsTable_stories,
|
|
13117
|
-
RewardsTable: RewardsTable
|
|
13118
|
-
});
|
|
13119
|
-
|
|
13120
|
-
const scenario$y = "@owner:sam\n@author:sam\nFeature: Rewards Table\n\n Shows a list of rewards as a table\n\n @motivating\n @ui\n Scenario: The empty state is shown if there are no rewards\n Given a user with rewards\n When they view the reward table\n Then no rewards are displayed\n And they see an image with a user icon\n And \"View your rewards\" in bold\n And \"See all the rewards you have earned from referring friends and completing tasks\" below the bolded text\n And the pagination buttons are disabled\n\n @minutia\n @ui\n Scenario: A custom empty state can be provided\n Given a user with no rewards\n And a custom empty state has been supplied in the \"empty\" slot\n When they view the reward table\n Then they see the custom empty state\n\n @minutia\n @ui\n Scenario: The loading state is shown while rewards are loading\n Given the table is loading\n Then the loading state is shown in the table\n And a custom loading state can be supplied in the \"loading\" slot\n And the pagination buttons are disabled\n\n @motivating\n @ui\n Scenario Outline: The table becomes paginated when the number of rewards exceeds the per page limit\n Given the user has <number of rewards>\n And the table is configured to show <page limit> rewards per page\n Then the table will have <number of pages> page(s)\n And pagination buttons will allow users to navigate between pages\n And the pagination button to go to the next page is disabled on the last page of rewards\n And the pagination button to go to the previous page is disabled on the first page of rewards\n Examples:\n | number of rewards | page limit | number of pages |\n | 0 | 4 | 1 |\n | 1 | 4 | 1 |\n | 3 | 4 | 1 |\n | 5 | 4 | 2 |\n | 42 | 4 | 11 |\n\n @motivating\n @ui\n Scenario: The table converts to a card view on tablet and mobile window sizes\n Given a user with rewards\n When they view the table\n And their window size is smaller than \"799px\"\n Then rewards are displayed as cards\n And they are in two columns\n When their window size is smaller than \"599px\"\n Then the rewards are displayed as cards in a singular column\n\n @motivating\n @ui\n Scenario: Table and Mobile beakpoints can be configured\n Given the reward table has been configured with the following props\n | prop | value |\n | smBreakpoint | 599 |\n | mdBreakpoint | 799 |\n And a user with rewards\n When they view the table\n And their window size is smaller than \"799px\"\n Then rewards are displayed as cards\n And they are in two columns\n When their window size is smaller than \"599px\"\n Then the rewards are displayed as cards in a singular column\n\n @motivating\n @ui\n Scenario Outline: By default the first column heading is hidden in mobile\n Given a reward table with 4 columns\n And prop \"hidden-columns\" with <hideColumnValue>\n And a user with rewards\n When they view the reward table\n And their window size is below the tablet breakpoint\n Then reward cards are displayed\n And the titles of <columnsArehidden> within the card\n Examples:\n | hideColumnValue | columnsArehidden |\n | | the first column |\n | 0,1,2 | the first, second and third columns |\n | 3 | the fourth column |\n\n @motivating\n Scenario: Only rewards which occured in the program specific by \"program-id\" are shown\n Given the table is configured with \"program-id\"\n Then only rewards from the program with \"program-id\" are shown\n\n @landmine\n Scenario: When a `classic` program Id is set then any reward without a programId is shown\n There is no easy way for the backend to filter for \"classic\" programs,\n thus we are filtering for rewards without programId's.\n\n Given the \"program-id\" of the table is set to \"classic\"\n Then rewards from classic programs are shown\n And manual rewards are shown\n\n @minutia\n @ui\n Scenario: Column heading can be hidden\n Given the table is configured with \"hide-labels\" set to \"true\"\n Then the table is displayed without column headings";
|
|
13121
|
-
|
|
13122
|
-
const RewardsTable_stories = {
|
|
13123
|
-
title: "Components/Rewards Table",
|
|
13124
|
-
parameters: {
|
|
13125
|
-
scenario: scenario$y,
|
|
13126
|
-
},
|
|
13127
|
-
};
|
|
13128
|
-
const loadingElement$2 = (index.h("div", { slot: "loading", style: { display: "contents" } },
|
|
13129
|
-
index.h("sqm-table-row", null,
|
|
13130
|
-
index.h("sqm-table-cell", { colspan: 5 },
|
|
13131
|
-
index.h("sl-skeleton", null))),
|
|
13132
|
-
index.h("sqm-table-row", null,
|
|
13133
|
-
index.h("sqm-table-cell", { colspan: 5 },
|
|
13134
|
-
index.h("sl-skeleton", null))),
|
|
13135
|
-
index.h("sqm-table-row", null,
|
|
13136
|
-
index.h("sqm-table-cell", { colspan: 5 },
|
|
13137
|
-
index.h("sl-skeleton", null))),
|
|
13138
|
-
index.h("sqm-table-row", null,
|
|
13139
|
-
index.h("sqm-table-cell", { colspan: 5 },
|
|
13140
|
-
index.h("sl-skeleton", null))),
|
|
13141
|
-
index.h("sqm-table-row", null,
|
|
13142
|
-
index.h("sqm-table-cell", { colspan: 5 },
|
|
13143
|
-
index.h("sl-skeleton", null)))));
|
|
13144
|
-
const emptyElement$2 = (index.h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_reward2.png", "empty-state-header": "View your rewards", "empty-state-text": "See all the rewards you have earned from referring friends and completing tasks" }));
|
|
13145
|
-
const rewardsTableProps$1 = (rows, empty = false, loading = false, prev = "Prev", next = "Next", hidden = "") => ({
|
|
13146
|
-
states: {
|
|
13147
|
-
hasPrev: false,
|
|
13148
|
-
hasNext: true,
|
|
13149
|
-
show: empty
|
|
13150
|
-
? "empty"
|
|
13151
|
-
: loading
|
|
13152
|
-
? "loading"
|
|
13153
|
-
: "rows",
|
|
13154
|
-
namespace: "sqm-rewards-table",
|
|
13155
|
-
},
|
|
13156
|
-
data: {
|
|
13157
|
-
textOverrides: {
|
|
13158
|
-
showLabels: true,
|
|
13159
|
-
prevLabel: prev,
|
|
13160
|
-
moreLabel: next,
|
|
13161
|
-
},
|
|
13162
|
-
hiddenColumns: hidden,
|
|
13163
|
-
mdBreakpoint: 799,
|
|
13164
|
-
smBreakpoint: 599,
|
|
13165
|
-
},
|
|
13166
|
-
callbacks: {
|
|
13167
|
-
prevPage: () => console.log("Prev"),
|
|
13168
|
-
nextPage: () => console.log("Next"),
|
|
13169
|
-
},
|
|
13170
|
-
elements: {
|
|
13171
|
-
columns: ["Rewards", "Status", "Source", "Date received"],
|
|
13172
|
-
rows: rows,
|
|
13173
|
-
emptyElement: emptyElement$2,
|
|
13174
|
-
loadingElement: loadingElement$2,
|
|
13175
|
-
},
|
|
13176
|
-
});
|
|
13177
|
-
const r_available = [
|
|
13178
|
-
index.h(RewardsCellCreditFull, null),
|
|
13179
|
-
index.h(StatusCellAvailable, null),
|
|
13180
|
-
index.h(SourceCellReferral, null),
|
|
13181
|
-
index.h(DateCell$2, null),
|
|
13182
|
-
];
|
|
13183
|
-
const r_expired = [
|
|
13184
|
-
index.h(RewardsCellCreditPartial, null),
|
|
13185
|
-
index.h(StatusCellAvailableExpiry, null),
|
|
13186
|
-
index.h(SourceCellReferred, null),
|
|
13187
|
-
index.h(DateCell$2, null),
|
|
13188
|
-
];
|
|
13189
|
-
const r_deleted = [
|
|
13190
|
-
index.h(RewardsCellCreditCancelled, null),
|
|
13191
|
-
index.h(StatusCellCancelled, null),
|
|
13192
|
-
index.h(SourceCellDeletedReferral, null),
|
|
13193
|
-
index.h(DateCell$2, null),
|
|
13194
|
-
];
|
|
13195
|
-
const r_cancelled = [
|
|
13196
|
-
index.h(RewardsCellCreditCancelled, null),
|
|
13197
|
-
index.h(StatusCellCancelled, null),
|
|
13198
|
-
index.h(SourceCellDeletedUser, null),
|
|
13199
|
-
index.h(DateCell$2, null),
|
|
13200
|
-
];
|
|
13201
|
-
const r_redeemed = [
|
|
13202
|
-
index.h(RewardsCellCreditRedeemed, null),
|
|
13203
|
-
index.h(StatusCellRedeemed, null),
|
|
13204
|
-
index.h(SourceCellManual, null),
|
|
13205
|
-
index.h(DateCell$2, null),
|
|
13206
|
-
];
|
|
13207
|
-
const r_denied = [
|
|
13208
|
-
index.h(RewardsCellCreditRedeemed, null),
|
|
13209
|
-
index.h(StatusCellDenied, null),
|
|
13210
|
-
index.h(SourceCellManual, null),
|
|
13211
|
-
index.h(DateCell$2, null),
|
|
13212
|
-
];
|
|
13213
|
-
const r_pending_review = [
|
|
13214
|
-
index.h(RewardsCellCreditRedeemed, null),
|
|
13215
|
-
index.h(StatusCellPendingReview, null),
|
|
13216
|
-
index.h(SourceCellManual, null),
|
|
13217
|
-
index.h(DateCell$2, null),
|
|
13218
|
-
];
|
|
13219
|
-
const r_long = [
|
|
13220
|
-
index.h(RewardsCellCreditLong, null),
|
|
13221
|
-
index.h(StatusCellAvailableExpiry, null),
|
|
13222
|
-
index.h(SourceCellReferred, null),
|
|
13223
|
-
index.h(DateCell$2, null),
|
|
13224
|
-
];
|
|
13225
|
-
const r_fueltank = [
|
|
13226
|
-
index.h(RewardsCellFueltank, null),
|
|
13227
|
-
index.h(StatusCellPending, null),
|
|
13228
|
-
index.h(SourceCellManual, null),
|
|
13229
|
-
index.h(DateCell$2, null),
|
|
13230
|
-
];
|
|
13231
|
-
const r_fueltank_long = [
|
|
13232
|
-
index.h(RewardsCellFueltankLong, null),
|
|
13233
|
-
index.h(StatusCellPendingUnhandled, null),
|
|
13234
|
-
index.h(SourceCellManual, null),
|
|
13235
|
-
index.h(DateCell$2, null),
|
|
13236
|
-
];
|
|
13237
|
-
const RewardsTable$2 = () => {
|
|
13238
|
-
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps$1([
|
|
13239
|
-
r_available,
|
|
13240
|
-
r_redeemed,
|
|
13241
|
-
r_cancelled,
|
|
13242
|
-
r_deleted,
|
|
13243
|
-
r_expired,
|
|
13244
|
-
r_denied,
|
|
13245
|
-
r_pending_review,
|
|
13246
|
-
]))));
|
|
13247
|
-
};
|
|
13248
|
-
const RewardsTableSingle = () => {
|
|
13249
|
-
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps$1([r_fueltank]))));
|
|
13250
|
-
};
|
|
13251
|
-
const RewardsTableLong = () => {
|
|
13252
|
-
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps$1([r_fueltank_long, r_long]))));
|
|
13253
|
-
};
|
|
13254
|
-
const RewardsTableEmpty = () => {
|
|
13255
|
-
return index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps$1([], true)));
|
|
13256
|
-
};
|
|
13257
|
-
const RewardsTableLoading = () => {
|
|
13258
|
-
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps$1([], false, true))));
|
|
13259
|
-
};
|
|
13260
|
-
const CustomButtonTextTable$1 = () => {
|
|
13261
|
-
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps$1([r_available, r_redeemed, r_cancelled, r_expired], false, false, "CUSTOM PREVIOUS TEXT", "CUSTOM NEXT TEXT"))));
|
|
13262
|
-
};
|
|
13263
|
-
const ColumnsMobileHidden$1 = () => {
|
|
13264
|
-
return (index.h(GenericTableView.GenericTableView, Object.assign({}, rewardsTableProps$1([r_available, r_redeemed, r_cancelled, r_expired], false, false, undefined, undefined, "0,1,2,3"))));
|
|
13265
|
-
};
|
|
13266
|
-
|
|
13267
13273
|
const TaxAndCashRewardsTable = /*#__PURE__*/Object.freeze({
|
|
13268
13274
|
__proto__: null,
|
|
13269
|
-
'default':
|
|
13270
|
-
RewardsTable: RewardsTable$2
|
|
13271
|
-
RewardsTableSingle: RewardsTableSingle,
|
|
13272
|
-
RewardsTableLong: RewardsTableLong,
|
|
13273
|
-
RewardsTableEmpty: RewardsTableEmpty,
|
|
13274
|
-
RewardsTableLoading: RewardsTableLoading,
|
|
13275
|
-
CustomButtonTextTable: CustomButtonTextTable$1,
|
|
13276
|
-
ColumnsMobileHidden: ColumnsMobileHidden$1
|
|
13275
|
+
'default': TaxAndCashRewardsTable_stories,
|
|
13276
|
+
RewardsTable: RewardsTable$2
|
|
13277
13277
|
});
|
|
13278
13278
|
|
|
13279
13279
|
const UseRewardsTable_stories = {
|
package/dist/collection/components/sqm-referral-table/TaxAndCashReferralTableRewardsCell.stories.js
CHANGED
|
@@ -56,7 +56,7 @@ const defaultTaxDocument = {
|
|
|
56
56
|
};
|
|
57
57
|
const defaultProps = {
|
|
58
58
|
statusText: "{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }",
|
|
59
|
-
statusLongText: "{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }",
|
|
59
|
+
statusLongText: "{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }",
|
|
60
60
|
rewardReceivedText: "Reward received on",
|
|
61
61
|
hideDetails: false,
|
|
62
62
|
};
|
package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.js
CHANGED
|
@@ -144,12 +144,16 @@ export class ReferralTableRewardsCell {
|
|
|
144
144
|
return "PAYOUT_CANCELLED";
|
|
145
145
|
if (partnerFundsStatus === "OVERDUE")
|
|
146
146
|
return "PAYOUT_FAILED";
|
|
147
|
-
if (reward.partnerFundsTransfer.dateScheduled
|
|
147
|
+
if (reward.partnerFundsTransfer.dateScheduled &&
|
|
148
|
+
reward.partnerFundsTransfer.dateScheduled > Date.now()) {
|
|
148
149
|
return "PROCESSING";
|
|
149
150
|
}
|
|
150
151
|
if (partnerFundsStatus === "TRANSFERRED" ||
|
|
151
152
|
partnerFundsStatus === "NOT_YET_DUE" ||
|
|
152
|
-
reward.partnerFundsTransfer.dateScheduled
|
|
153
|
+
(reward.partnerFundsTransfer.dateScheduled &&
|
|
154
|
+
reward.partnerFundsTransfer.dateScheduled < Date.now() &&
|
|
155
|
+
partnerFundsStatus !== "OVERDUE" &&
|
|
156
|
+
partnerFundsStatus !== "REVERSED"))
|
|
153
157
|
return "PAYOUT_APPROVED";
|
|
154
158
|
}
|
|
155
159
|
if ((_h = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _h === void 0 ? void 0 : _h.includes("US_TAX")) {
|
|
@@ -210,8 +214,9 @@ export class ReferralTableRewardsCell {
|
|
|
210
214
|
.trim();
|
|
211
215
|
};
|
|
212
216
|
return (_a = this.rewards) === null || _a === void 0 ? void 0 : _a.map((reward) => {
|
|
213
|
-
var _a, _b, _c;
|
|
217
|
+
var _a, _b, _c, _d;
|
|
214
218
|
const state = getState(reward, this.taxConnection);
|
|
219
|
+
console.log({ state, reward });
|
|
215
220
|
const slBadgeType = getSLBadgeType(state);
|
|
216
221
|
const badgeText = intl.formatMessage({ id: "statusShortMessage", defaultMessage: this.statusText }, {
|
|
217
222
|
status: state,
|
|
@@ -221,8 +226,7 @@ export class ReferralTableRewardsCell {
|
|
|
221
226
|
defaultMessage: this.statusLongText,
|
|
222
227
|
}, {
|
|
223
228
|
status: state,
|
|
224
|
-
scheduledPayoutDate: reward.partnerFundsTransfer
|
|
225
|
-
? (_a = DateTime.fromMillis(reward.partnerFundsTransfer.dateScheduled)) === null || _a === void 0 ? void 0 : _a.setLocale(luxonLocale(this.locale)).toLocaleString(DateTime.DATE_MED) : null,
|
|
229
|
+
scheduledPayoutDate: ((_a = reward.partnerFundsTransfer) === null || _a === void 0 ? void 0 : _a.dateScheduled) ? (_b = DateTime.fromMillis(reward.partnerFundsTransfer.dateScheduled)) === null || _b === void 0 ? void 0 : _b.setLocale(luxonLocale(this.locale)).toLocaleString(DateTime.DATE_MED) : null,
|
|
226
230
|
});
|
|
227
231
|
return (h("sl-details", { class: sheet.classes.Details, disabled: this.hideDetails },
|
|
228
232
|
h("style", { type: "text/css" }, styleString),
|
|
@@ -241,7 +245,7 @@ export class ReferralTableRewardsCell {
|
|
|
241
245
|
this.expiringText,
|
|
242
246
|
` ${getTimeDiff(reward.dateExpires)}`)))),
|
|
243
247
|
h("div", null,
|
|
244
|
-
state === "PENDING_REVIEW" && ((
|
|
248
|
+
state === "PENDING_REVIEW" && ((_c = reward.referral) === null || _c === void 0 ? void 0 : _c.dateModerated) && (h("div", null,
|
|
245
249
|
h(TextSpanView, { type: "p" },
|
|
246
250
|
statusText,
|
|
247
251
|
" ",
|
|
@@ -264,7 +268,7 @@ export class ReferralTableRewardsCell {
|
|
|
264
268
|
h(TextSpanView, { type: "p" }, statusText))),
|
|
265
269
|
state === "PENDING_PARTNER_CREATION" && (h("div", null,
|
|
266
270
|
h(TextSpanView, { type: "p" }, statusText))),
|
|
267
|
-
state === "DENIED" && ((
|
|
271
|
+
state === "DENIED" && ((_d = reward.referral) === null || _d === void 0 ? void 0 : _d.dateModerated) && (h("div", null,
|
|
268
272
|
h(TextSpanView, { type: "p" },
|
|
269
273
|
statusText,
|
|
270
274
|
" ",
|