@faststore/core 4.4.0-dev.0 → 4.4.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-generate.log +3 -3
- package/.turbo/turbo-test.log +48 -48
- package/CHANGELOG.md +6 -0
- package/README.md +2 -1
- package/cms/faststore/my-account/README.md +36 -0
- package/cms/faststore/my-account/components/cms_component__accountnavigation.jsonc +59 -0
- package/cms/faststore/my-account/components/cms_component__accountorderbudgets.jsonc +39 -0
- package/cms/faststore/my-account/components/cms_component__accountorderdelivery.jsonc +69 -0
- package/cms/faststore/my-account/components/cms_component__accountorderdetails.jsonc +79 -0
- package/cms/faststore/my-account/components/cms_component__accountordermoreinfo.jsonc +19 -0
- package/cms/faststore/my-account/components/cms_component__accountorderorderedby.jsonc +19 -0
- package/cms/faststore/my-account/components/cms_component__accountorderpayment.jsonc +69 -0
- package/cms/faststore/my-account/components/cms_component__accountorderslist.jsonc +154 -0
- package/cms/faststore/my-account/components/cms_component__accountorderstatus.jsonc +44 -0
- package/cms/faststore/my-account/components/cms_component__accountordersummary.jsonc +29 -0
- package/cms/faststore/my-account/components/cms_component__accountprofile.jsonc +39 -0
- package/cms/faststore/my-account/components/cms_component__accountsecurity.jsonc +104 -0
- package/cms/faststore/my-account/components/cms_component__accountunauthorized.jsonc +29 -0
- package/cms/faststore/my-account/components/cms_component__accountuserdetails.jsonc +49 -0
- package/cms/faststore/my-account/pages/cms_content_type__myaccountorderdetails.jsonc +18 -0
- package/cms/faststore/my-account/pages/cms_content_type__myaccountorders.jsonc +18 -0
- package/cms/faststore/my-account/pages/cms_content_type__myaccountprofile.jsonc +18 -0
- package/cms/faststore/my-account/pages/cms_content_type__myaccountsecurity.jsonc +18 -0
- package/cms/faststore/my-account/pages/cms_content_type__myaccountunauthorized.jsonc +18 -0
- package/cms/faststore/my-account/pages/cms_content_type__myaccountuserdetails.jsonc +18 -0
- package/package.json +6 -6
- package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/OrganizationDrawerBody.tsx +15 -3
- package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationSignInButton/OrganizationSignInButton.tsx +5 -1
- package/src/components/account/{MyAccountDrawer → Drawer}/ProfileSummary/ProfileSummary.tsx +12 -2
- package/src/components/account/Layout/Layout.tsx +46 -0
- package/src/components/account/Layout/index.ts +1 -0
- package/src/components/account/{MyAccountLayout → Layout}/styles.scss +2 -2
- package/src/components/account/{MyAccountMenu/MyAccountMenu.tsx → Menu/Menu.tsx} +8 -10
- package/src/components/account/Menu/index.ts +1 -0
- package/src/components/account/UserDetails/UserDetails.tsx +54 -0
- package/src/components/account/UserDetails/index.ts +1 -0
- package/src/components/account/{MyAccountUserDetails → UserDetails}/styles.module.scss +2 -2
- package/src/components/account/UserDetails/userDetailsLabels.ts +25 -0
- package/src/components/account/components/{MyAccountAccordion/MyAccountAccordion.tsx → Accordion/Accordion.tsx} +2 -4
- package/src/components/account/components/{MyAccountAccordion/MyAccountAccordionButton.tsx → Accordion/AccordionButton.tsx} +3 -7
- package/src/components/account/components/{MyAccountAccordion/MyAccountAccordionItem.tsx → Accordion/AccordionItem.tsx} +3 -7
- package/src/components/account/components/{MyAccountAccordion/MyAccountAccordionPanel.tsx → Accordion/AccordionPanel.tsx} +3 -3
- package/src/components/account/components/Accordion/index.ts +4 -0
- package/src/components/account/components/{MyAccountCard/MyAccountCard.tsx → Card/Card.tsx} +2 -4
- package/src/components/account/components/Card/index.ts +1 -0
- package/src/components/account/components/{MyAccountHeader/MyAccountHeader.tsx → Header/Header.tsx} +3 -3
- package/src/components/account/components/Header/index.ts +1 -0
- package/src/components/account/components/StatusBadge/StatusBadge.tsx +43 -0
- package/src/components/account/components/StatusBadge/index.ts +1 -0
- package/src/components/account/components/{MyAccountTable/MyAccountTable.tsx → Table/Table.tsx} +3 -3
- package/src/components/account/components/Table/index.ts +1 -0
- package/src/components/account/components/Tag/index.ts +1 -0
- package/src/components/account/index.ts +2 -2
- package/src/components/account/orders/ListOrders/FilterSlider/FilterFacetDateRange/FilterFacetDateRange.tsx +128 -0
- package/src/components/account/orders/ListOrders/FilterSlider/FilterFacetDateRange/index.ts +2 -0
- package/src/components/account/orders/{MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPendingApproval/MyAccountFilterFacetPendingApproval.tsx → ListOrders/FilterSlider/FilterFacetPendingApproval/FilterFacetPendingApproval.tsx} +4 -4
- package/src/components/account/orders/ListOrders/FilterSlider/FilterFacetPendingApproval/index.ts +2 -0
- package/src/components/account/orders/{MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterSlider.tsx → ListOrders/FilterSlider/FilterSlider.tsx} +13 -4
- package/src/components/account/orders/ListOrders/FilterSlider/index.ts +1 -0
- package/src/components/account/orders/{MyAccountListOrders/MyAccountFilterSlider → ListOrders/FilterSlider}/section.module.scss +2 -2
- package/src/components/account/orders/{MyAccountListOrders/MyAccountListOrders.tsx → ListOrders/ListOrders.tsx} +53 -30
- package/src/components/account/orders/{MyAccountListOrders/MyAccountListOrdersTable → ListOrders/ListOrdersTable}/ExpandButton/ExpandButton.tsx +5 -1
- package/src/components/account/orders/{MyAccountListOrders/MyAccountListOrdersTable/MyAccountListOrdersTable.tsx → ListOrders/ListOrdersTable/ListOrdersTable.tsx} +35 -12
- package/src/components/account/orders/ListOrders/ListOrdersTable/index.ts +1 -0
- package/src/components/account/orders/{MyAccountListOrders/MyAccountSelectedTags/MyAccountSelectedTags.tsx → ListOrders/SelectedTags/SelectedTags.tsx} +24 -14
- package/src/components/account/orders/ListOrders/SelectedTags/index.ts +1 -0
- package/src/components/account/orders/ListOrders/index.ts +1 -0
- package/src/components/account/orders/ListOrders/listOrdersLabels.ts +112 -0
- package/src/components/account/orders/{MyAccountListOrders → ListOrders}/styles.module.scss +3 -3
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountBudgetsCard/MyAccountBudgetsCard.tsx → OrderDetails/BudgetsCard/BudgetsCard.tsx} +18 -11
- package/src/components/account/orders/OrderDetails/BudgetsCard/index.ts +1 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountBuyingPolicyAlert/MyAccountBuyingPolicyAlert.tsx → OrderDetails/BuyingPolicyAlert/BuyingPolicyAlert.tsx} +46 -20
- package/src/components/account/orders/OrderDetails/BuyingPolicyAlert/index.ts +1 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryCard/MyAccountDeliveryCard.tsx → OrderDetails/DeliveryCard/DeliveryCard.tsx} +16 -15
- package/src/components/account/orders/OrderDetails/DeliveryCard/index.ts +1 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/MyAccountDeliveryOptionAccordion.tsx → OrderDetails/DeliveryOptionAccordion/DeliveryOptionAccordion.tsx} +38 -25
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/MyAccountDeliveryOptionAccordionDeliveryInfo.tsx → OrderDetails/DeliveryOptionAccordion/DeliveryOptionAccordionDeliveryInfo.tsx} +4 -4
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/MyAccountDeliveryOptionAccordionProducts.tsx → OrderDetails/DeliveryOptionAccordion/DeliveryOptionAccordionProducts.tsx} +7 -10
- package/src/components/account/orders/OrderDetails/DeliveryOptionAccordion/index.ts +6 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountMoreInformationCard/MyAccountMoreInformationCard.tsx → OrderDetails/MoreInformationCard/MoreInformationCard.tsx} +10 -7
- package/src/components/account/orders/OrderDetails/MoreInformationCard/index.ts +1 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderActionModal/MyAccountOrderActionModal.tsx → OrderDetails/OrderActionModal/OrderActionModal.tsx} +3 -3
- package/src/components/account/orders/OrderDetails/OrderActionModal/index.ts +1 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderActions/MyAccountOrderActions.tsx → OrderDetails/OrderActions/OrderActions.tsx} +19 -12
- package/src/components/account/orders/OrderDetails/OrderActions/index.ts +1 -0
- package/src/components/account/orders/OrderDetails/OrderDetails.tsx +92 -0
- package/src/components/account/orders/OrderDetails/OrderDetailsHeader.tsx +89 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderedByCard/MyAccountOrderedByCard.tsx → OrderDetails/OrderedByCard/OrderedByCard.tsx} +9 -7
- package/src/components/account/orders/OrderDetails/OrderedByCard/index.ts +1 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountPaymentCard/MyAccountPaymentCard.tsx → OrderDetails/PaymentCard/PaymentCard.tsx} +42 -27
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountPaymentCard/MyAccountPaymentFlagsIcon.tsx → OrderDetails/PaymentCard/PaymentFlagsIcon.tsx} +3 -3
- package/src/components/account/orders/OrderDetails/PaymentCard/index.ts +1 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountReorderButton/MyAccountReorderButton.tsx → OrderDetails/ReorderButton/ReorderButton.tsx} +6 -4
- package/src/components/account/orders/OrderDetails/ReorderButton/index.ts +2 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountStatusCard/MyAccountStatusCard.tsx → OrderDetails/StatusCard/StatusCard.tsx} +29 -8
- package/src/components/account/orders/OrderDetails/StatusCard/index.ts +1 -0
- package/src/components/account/orders/{MyAccountOrderDetails/MyAccountSummaryCard/MyAccountSummaryCard.tsx → OrderDetails/SummaryCard/SummaryCard.tsx} +16 -9
- package/src/components/account/orders/OrderDetails/SummaryCard/index.ts +1 -0
- package/src/components/account/orders/OrderDetails/index.ts +10 -0
- package/src/components/account/orders/OrderDetails/orderDetailsLabels.ts +204 -0
- package/src/components/account/orders/{MyAccountOrderDetails → OrderDetails}/section.module.scss +14 -14
- package/src/components/account/profile/profile.module.scss +1 -1
- package/src/components/account/profile/profile.tsx +31 -8
- package/src/components/account/section.module.scss +1 -1
- package/src/components/account/security/SecurityDrawer.tsx +29 -20
- package/src/components/account/security/SecuritySection.tsx +17 -6
- package/src/components/account/security/securityLabels.ts +47 -0
- package/src/components/account/security/styles.module.scss +1 -1
- package/src/components/cms/account/Components.ts +53 -0
- package/src/components/navigation/Navbar/Navbar.tsx +1 -1
- package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +1 -1
- package/src/components/sections/Account/AccountNavigation.tsx +5 -0
- package/src/components/sections/Account/AccountOrderBudgets.tsx +35 -0
- package/src/components/sections/Account/AccountOrderDelivery.tsx +57 -0
- package/src/components/sections/Account/AccountOrderDetails.tsx +57 -0
- package/src/components/sections/Account/AccountOrderMoreInfo.tsx +39 -0
- package/src/components/sections/Account/AccountOrderOrderedBy.tsx +36 -0
- package/src/components/sections/Account/AccountOrderPayment.tsx +36 -0
- package/src/components/sections/Account/AccountOrderStatus.tsx +49 -0
- package/src/components/sections/Account/AccountOrderSummary.tsx +36 -0
- package/src/components/sections/Account/AccountOrdersList.tsx +89 -0
- package/src/components/sections/Account/AccountProfile.tsx +46 -0
- package/src/components/sections/Account/AccountSecurity.tsx +65 -0
- package/src/components/sections/Account/AccountUnauthorized.tsx +40 -0
- package/src/components/sections/Account/AccountUserDetails.tsx +43 -0
- package/src/experimental/index.ts +1 -1
- package/src/pages/_app.tsx +1 -1
- package/src/pages/pvt/account/403.tsx +43 -50
- package/src/pages/pvt/account/404.tsx +3 -3
- package/src/pages/pvt/account/orders/[id].tsx +58 -13
- package/src/pages/pvt/account/orders/index.tsx +59 -48
- package/src/pages/pvt/account/profile.tsx +64 -33
- package/src/pages/pvt/account/security.tsx +66 -32
- package/src/pages/pvt/account/user-details.tsx +67 -37
- package/src/sdk/account/accountPageContext.ts +73 -0
- package/src/sdk/account/getMyAccountRoutes.ts +48 -3
- package/src/sdk/overrides/PageProvider.tsx +3 -1
- package/src/server/cms/fetchMyAccountPageContent.ts +45 -0
- package/src/server/cms/myAccountDefaultSections.ts +73 -0
- package/src/utils/userOrderStatus.ts +129 -0
- package/test/utils/userOrderStatus.test.ts +36 -0
- package/src/components/account/MyAccountLayout/MyAccountLayout.tsx +0 -32
- package/src/components/account/MyAccountLayout/index.ts +0 -1
- package/src/components/account/MyAccountMenu/index.ts +0 -1
- package/src/components/account/MyAccountUserDetails/MyAccountUserDetails.tsx +0 -46
- package/src/components/account/MyAccountUserDetails/index.ts +0 -1
- package/src/components/account/components/MyAccountAccordion/index.ts +0 -4
- package/src/components/account/components/MyAccountCard/index.ts +0 -1
- package/src/components/account/components/MyAccountHeader/index.ts +0 -1
- package/src/components/account/components/MyAccountStatusBadge/MyAccountStatusBadge.tsx +0 -28
- package/src/components/account/components/MyAccountStatusBadge/index.ts +0 -1
- package/src/components/account/components/MyAccountTable/index.ts +0 -1
- package/src/components/account/components/MyAccountTag/index.ts +0 -1
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetDateRange/MyAccountFilterFacetDateRange.tsx +0 -113
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetDateRange/index.ts +0 -2
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPendingApproval/index.ts +0 -2
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/index.ts +0 -1
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/index.ts +0 -1
- package/src/components/account/orders/MyAccountListOrders/MyAccountSelectedTags/index.ts +0 -1
- package/src/components/account/orders/MyAccountListOrders/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountBudgetsCard/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountBuyingPolicyAlert/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryCard/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/index.ts +0 -6
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountMoreInformationCard/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderDetails.tsx +0 -136
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderedByCard/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountPaymentCard/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountReorderButton/index.ts +0 -2
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountStatusCard/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountSummaryCard/index.ts +0 -1
- package/src/components/account/orders/MyAccountOrderDetails/index.ts +0 -1
- package/src/components/account/profile/i18n.ts +0 -7
- /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/OrganizationDrawer.tsx +0 -0
- /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/OrganizationDrawerHeader.tsx +0 -0
- /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/index.ts +0 -0
- /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/section.module.scss +0 -0
- /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationDrawer/useReloadAfterLogoutReturn.ts +0 -0
- /package/src/components/account/{MyAccountDrawer → Drawer}/OrganizationSignInButton/index.ts +0 -0
- /package/src/components/account/{MyAccountDrawer → Drawer}/ProfileSummary/profile-summary.scss +0 -0
- /package/src/components/account/{MyAccountMenu → Menu}/styles.scss +0 -0
- /package/src/components/account/components/{MyAccountAccordion → Accordion}/styles.scss +0 -0
- /package/src/components/account/components/{MyAccountCard → Card}/styles.scss +0 -0
- /package/src/components/account/components/{MyAccountHeader → Header}/styles.scss +0 -0
- /package/src/components/account/components/{MyAccountStatusBadge → StatusBadge}/styles.scss +0 -0
- /package/src/components/account/components/{MyAccountTable → Table}/styles.scss +0 -0
- /package/src/components/account/components/{MyAccountTag/MyAccountTag.tsx → Tag/Tag.tsx} +0 -0
- /package/src/components/account/components/{MyAccountTag → Tag}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetDateRange → ListOrders/FilterSlider/FilterFacetDateRange}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPendingApproval → ListOrders/FilterSlider/FilterFacetPendingApproval}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountListOrders/MyAccountListOrdersTable → ListOrders/ListOrdersTable}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountListOrders/MyAccountSelectedTags → ListOrders/SelectedTags}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountBudgetsCard → OrderDetails/BudgetsCard}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountBuyingPolicyAlert → OrderDetails/BuyingPolicyAlert}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryCard → OrderDetails/DeliveryCard}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountDeliveryOptionAccordion → OrderDetails/DeliveryOptionAccordion}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountMoreInformationCard → OrderDetails/MoreInformationCard}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderActionModal → OrderDetails/OrderActionModal}/styles.module.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderActions → OrderDetails/OrderActions}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountOrderedByCard → OrderDetails/OrderedByCard}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountPaymentCard → OrderDetails/PaymentCard}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountReorderButton → OrderDetails/ReorderButton}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountStatusCard → OrderDetails/StatusCard}/styles.scss +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountStatusCard → OrderDetails/StatusCard}/useConnectorPositioning.ts +0 -0
- /package/src/components/account/orders/{MyAccountOrderDetails/MyAccountSummaryCard → OrderDetails/SummaryCard}/styles.scss +0 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
export type OrderDetailsHeaderLabels = {
|
|
2
|
+
orderNumberPrefix?: string
|
|
3
|
+
goBackLabel?: string
|
|
4
|
+
cancelOrderLabel?: string
|
|
5
|
+
reorderLabel?: string
|
|
6
|
+
notNowLabel?: string
|
|
7
|
+
cancelConfirmMessage?: string
|
|
8
|
+
cancelSuccessToast?: string
|
|
9
|
+
cancelErrorToast?: string
|
|
10
|
+
approveLabel?: string
|
|
11
|
+
rejectLabel?: string
|
|
12
|
+
rejectModalTitle?: string
|
|
13
|
+
/** Supports the `{policy}` placeholder, replaced with the policy name. */
|
|
14
|
+
rejectModalMessage?: string
|
|
15
|
+
rejectModalConfirmText?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type OrderStatusSectionLabels = {
|
|
19
|
+
statusTitle?: string
|
|
20
|
+
orderPlacedStep?: string
|
|
21
|
+
paymentPendingStep?: string
|
|
22
|
+
handlingStep?: string
|
|
23
|
+
invoicedStep?: string
|
|
24
|
+
deliveredStep?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type OrderPaymentSectionLabels = {
|
|
28
|
+
paymentTitle?: string
|
|
29
|
+
billingLabel?: string
|
|
30
|
+
bankInvoiceLabel?: string
|
|
31
|
+
paypalLabel?: string
|
|
32
|
+
giftCardLabel?: string
|
|
33
|
+
endingInLabel?: string
|
|
34
|
+
tidLabel?: string
|
|
35
|
+
authIdLabel?: string
|
|
36
|
+
invoiceNumberLabel?: string
|
|
37
|
+
printBankInvoiceLabel?: string
|
|
38
|
+
installmentCopy?: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type OrderDeliverySectionLabels = {
|
|
42
|
+
deliveryTitle?: string
|
|
43
|
+
recipientLabel?: string
|
|
44
|
+
deliveryAddressLabel?: string
|
|
45
|
+
storeAddressLabel?: string
|
|
46
|
+
storeHoursLabel?: string
|
|
47
|
+
fromLabel?: string
|
|
48
|
+
toLabel?: string
|
|
49
|
+
itemCountTemplate?: string
|
|
50
|
+
eachLabel?: string
|
|
51
|
+
taxesLabel?: string
|
|
52
|
+
totalLabel?: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type OrderSummarySectionLabels = {
|
|
56
|
+
summaryTitle?: string
|
|
57
|
+
totalLabel?: string
|
|
58
|
+
interestLabel?: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type OrderOrderedBySectionLabels = {
|
|
62
|
+
orderedByTitle?: string
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type OrderBudgetsSectionLabels = {
|
|
66
|
+
budgetsTitle?: string
|
|
67
|
+
nameLabel?: string
|
|
68
|
+
availableLabel?: string
|
|
69
|
+
toBeSpentLabel?: string
|
|
70
|
+
remainingLabel?: string
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type OrderMoreInfoSectionLabels = {
|
|
74
|
+
moreInfoTitle?: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const defaultOrderDetailsHeaderLabels: Required<OrderDetailsHeaderLabels> =
|
|
78
|
+
{
|
|
79
|
+
orderNumberPrefix: 'Order #',
|
|
80
|
+
goBackLabel: 'Go back',
|
|
81
|
+
cancelOrderLabel: 'Cancel order',
|
|
82
|
+
reorderLabel: 'Reorder',
|
|
83
|
+
notNowLabel: 'Not now',
|
|
84
|
+
cancelConfirmMessage:
|
|
85
|
+
"Are you sure you want to cancel this order? This action can't be undone.",
|
|
86
|
+
cancelSuccessToast: 'Order canceled successfully',
|
|
87
|
+
cancelErrorToast: "Order couldn't be canceled due to a technical issue.",
|
|
88
|
+
approveLabel: 'Approve',
|
|
89
|
+
rejectLabel: 'Reject',
|
|
90
|
+
rejectModalTitle: 'Reject approval request',
|
|
91
|
+
rejectModalMessage:
|
|
92
|
+
"You're about to reject this approval request, triggered by the {policy} policy. Rejecting any approval request will deny the entire order.\n\nThis action is permanent and cannot be undone.",
|
|
93
|
+
rejectModalConfirmText: 'Reject',
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const defaultOrderStatusLabels: Required<OrderStatusSectionLabels> = {
|
|
97
|
+
statusTitle: 'Status',
|
|
98
|
+
orderPlacedStep: 'Order placed',
|
|
99
|
+
paymentPendingStep: 'Payment Pending',
|
|
100
|
+
handlingStep: 'Handling order',
|
|
101
|
+
invoicedStep: 'Invoiced',
|
|
102
|
+
deliveredStep: 'Delivered',
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const defaultOrderPaymentLabels: Required<OrderPaymentSectionLabels> = {
|
|
106
|
+
paymentTitle: 'Payment',
|
|
107
|
+
billingLabel: 'Billing',
|
|
108
|
+
bankInvoiceLabel: 'Bank Invoice',
|
|
109
|
+
paypalLabel: 'PayPal',
|
|
110
|
+
giftCardLabel: 'Gift Card',
|
|
111
|
+
endingInLabel: 'ending in',
|
|
112
|
+
tidLabel: 'Tid:',
|
|
113
|
+
authIdLabel: 'AuthId:',
|
|
114
|
+
invoiceNumberLabel: 'Invoice Number:',
|
|
115
|
+
printBankInvoiceLabel: 'Print Bank Invoice',
|
|
116
|
+
installmentCopy: '{count}x of {value}',
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const defaultOrderDeliveryLabels: Required<OrderDeliverySectionLabels> =
|
|
120
|
+
{
|
|
121
|
+
deliveryTitle: 'Delivery',
|
|
122
|
+
recipientLabel: 'Recipient',
|
|
123
|
+
deliveryAddressLabel: 'Delivery address',
|
|
124
|
+
storeAddressLabel: 'Store address',
|
|
125
|
+
storeHoursLabel: 'Store Hours',
|
|
126
|
+
fromLabel: 'From:',
|
|
127
|
+
toLabel: 'To:',
|
|
128
|
+
itemCountTemplate: '{count} item(s)',
|
|
129
|
+
eachLabel: 'Each',
|
|
130
|
+
taxesLabel: 'Taxes',
|
|
131
|
+
totalLabel: 'Total',
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const defaultOrderSummaryLabels: Required<OrderSummarySectionLabels> = {
|
|
135
|
+
summaryTitle: 'Summary',
|
|
136
|
+
totalLabel: 'Total',
|
|
137
|
+
interestLabel: 'Interest',
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export const defaultOrderOrderedByLabels: Required<OrderOrderedBySectionLabels> =
|
|
141
|
+
{
|
|
142
|
+
orderedByTitle: 'Ordered by',
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export const defaultOrderBudgetsLabels: Required<OrderBudgetsSectionLabels> = {
|
|
146
|
+
budgetsTitle: 'Budgets',
|
|
147
|
+
nameLabel: 'Name',
|
|
148
|
+
availableLabel: 'Available',
|
|
149
|
+
toBeSpentLabel: 'To be spent',
|
|
150
|
+
remainingLabel: 'Remaining',
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export const defaultOrderMoreInfoLabels: Required<OrderMoreInfoSectionLabels> =
|
|
154
|
+
{
|
|
155
|
+
moreInfoTitle: 'More information',
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function resolveOrderDetailsHeaderLabels(
|
|
159
|
+
labels?: OrderDetailsHeaderLabels
|
|
160
|
+
): Required<OrderDetailsHeaderLabels> {
|
|
161
|
+
return { ...defaultOrderDetailsHeaderLabels, ...labels }
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function resolveOrderStatusLabels(
|
|
165
|
+
labels?: OrderStatusSectionLabels
|
|
166
|
+
): Required<OrderStatusSectionLabels> {
|
|
167
|
+
return { ...defaultOrderStatusLabels, ...labels }
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function resolveOrderPaymentLabels(
|
|
171
|
+
labels?: OrderPaymentSectionLabels
|
|
172
|
+
): Required<OrderPaymentSectionLabels> {
|
|
173
|
+
return { ...defaultOrderPaymentLabels, ...labels }
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function resolveOrderDeliveryLabels(
|
|
177
|
+
labels?: OrderDeliverySectionLabels
|
|
178
|
+
): Required<OrderDeliverySectionLabels> {
|
|
179
|
+
return { ...defaultOrderDeliveryLabels, ...labels }
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function resolveOrderSummaryLabels(
|
|
183
|
+
labels?: OrderSummarySectionLabels
|
|
184
|
+
): Required<OrderSummarySectionLabels> {
|
|
185
|
+
return { ...defaultOrderSummaryLabels, ...labels }
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function resolveOrderOrderedByLabels(
|
|
189
|
+
labels?: OrderOrderedBySectionLabels
|
|
190
|
+
): Required<OrderOrderedBySectionLabels> {
|
|
191
|
+
return { ...defaultOrderOrderedByLabels, ...labels }
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function resolveOrderBudgetsLabels(
|
|
195
|
+
labels?: OrderBudgetsSectionLabels
|
|
196
|
+
): Required<OrderBudgetsSectionLabels> {
|
|
197
|
+
return { ...defaultOrderBudgetsLabels, ...labels }
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function resolveOrderMoreInfoLabels(
|
|
201
|
+
labels?: OrderMoreInfoSectionLabels
|
|
202
|
+
): Required<OrderMoreInfoSectionLabels> {
|
|
203
|
+
return { ...defaultOrderMoreInfoLabels, ...labels }
|
|
204
|
+
}
|
package/src/components/account/orders/{MyAccountOrderDetails → OrderDetails}/section.module.scss
RENAMED
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
@include meta.load-css("~@faststore/ui/src/components/molecules/Card/styles.scss");
|
|
10
10
|
@include meta.load-css("~@faststore/ui/src/components/molecules/Alert/styles.scss");
|
|
11
11
|
@include meta.load-css("~@faststore/ui/src/components/molecules/Dropdown/styles.scss");
|
|
12
|
-
@include meta.load-css("../../components/
|
|
13
|
-
@include meta.load-css("../../components/
|
|
14
|
-
@include meta.load-css("../../components/
|
|
15
|
-
@include meta.load-css("./
|
|
16
|
-
@include meta.load-css("./
|
|
17
|
-
@include meta.load-css("./
|
|
18
|
-
@include meta.load-css("./
|
|
19
|
-
@include meta.load-css("./
|
|
20
|
-
@include meta.load-css("./
|
|
21
|
-
@include meta.load-css("./
|
|
22
|
-
@include meta.load-css("./
|
|
23
|
-
@include meta.load-css("./
|
|
24
|
-
@include meta.load-css("./
|
|
25
|
-
@include meta.load-css("./
|
|
12
|
+
@include meta.load-css("../../components/Accordion/styles.scss");
|
|
13
|
+
@include meta.load-css("../../components/Card/styles.scss");
|
|
14
|
+
@include meta.load-css("../../components/StatusBadge/styles.scss");
|
|
15
|
+
@include meta.load-css("./SummaryCard/styles.scss");
|
|
16
|
+
@include meta.load-css("./OrderedByCard/styles.scss");
|
|
17
|
+
@include meta.load-css("./DeliveryCard/styles.scss");
|
|
18
|
+
@include meta.load-css("./PaymentCard/styles.scss");
|
|
19
|
+
@include meta.load-css("./DeliveryOptionAccordion/styles.scss");
|
|
20
|
+
@include meta.load-css("./OrderActions/styles.scss");
|
|
21
|
+
@include meta.load-css("./ReorderButton/styles.scss");
|
|
22
|
+
@include meta.load-css("./StatusCard/styles.scss");
|
|
23
|
+
@include meta.load-css("./MoreInformationCard/styles.scss");
|
|
24
|
+
@include meta.load-css("./BuyingPolicyAlert/styles.scss");
|
|
25
|
+
@include meta.load-css("./BudgetsCard/styles.scss");
|
|
26
26
|
|
|
27
27
|
// --------------------------------------------------------
|
|
28
28
|
// Design Tokens
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Link } from '@faststore/ui'
|
|
2
|
-
import AccountTable from '../components/
|
|
3
|
-
import AccountHeader from '../components/
|
|
4
|
-
import { strings } from './i18n'
|
|
2
|
+
import AccountTable from '../components/Table'
|
|
3
|
+
import AccountHeader from '../components/Header'
|
|
5
4
|
import styles from './profile.module.scss'
|
|
6
5
|
import { useDateFormatter } from './use-date-formatter'
|
|
7
6
|
|
|
@@ -12,9 +11,26 @@ interface UserProfile {
|
|
|
12
11
|
createdDate?: string | null
|
|
13
12
|
}
|
|
14
13
|
|
|
14
|
+
export type ProfileSectionLabels = {
|
|
15
|
+
pageTitle?: string
|
|
16
|
+
nameLabel?: string
|
|
17
|
+
emailLabel?: string
|
|
18
|
+
idLabel?: string
|
|
19
|
+
createdDateLabel?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const defaultProfileLabels: Required<ProfileSectionLabels> = {
|
|
23
|
+
pageTitle: 'Profile',
|
|
24
|
+
nameLabel: 'Name',
|
|
25
|
+
emailLabel: 'Email',
|
|
26
|
+
idLabel: 'ID',
|
|
27
|
+
createdDateLabel: 'Created date',
|
|
28
|
+
}
|
|
29
|
+
|
|
15
30
|
export interface ProfileSectionProps {
|
|
16
31
|
profile?: UserProfile
|
|
17
32
|
locale?: string
|
|
33
|
+
labels?: ProfileSectionLabels
|
|
18
34
|
}
|
|
19
35
|
|
|
20
36
|
/*
|
|
@@ -23,27 +39,34 @@ export interface ProfileSectionProps {
|
|
|
23
39
|
export function ProfileSection({
|
|
24
40
|
profile,
|
|
25
41
|
locale = 'en-US',
|
|
42
|
+
labels,
|
|
26
43
|
}: ProfileSectionProps) {
|
|
27
44
|
const { formatStringDate } = useDateFormatter(locale)
|
|
45
|
+
const pageTitle = labels?.pageTitle ?? defaultProfileLabels.pageTitle
|
|
46
|
+
const nameLabel = labels?.nameLabel ?? defaultProfileLabels.nameLabel
|
|
47
|
+
const emailLabel = labels?.emailLabel ?? defaultProfileLabels.emailLabel
|
|
48
|
+
const idLabel = labels?.idLabel ?? defaultProfileLabels.idLabel
|
|
49
|
+
const createdDateLabel =
|
|
50
|
+
labels?.createdDateLabel ?? defaultProfileLabels.createdDateLabel
|
|
28
51
|
|
|
29
52
|
return (
|
|
30
53
|
<div data-fs-account-profile-section className={styles.section}>
|
|
31
|
-
<AccountHeader pageTitle={
|
|
54
|
+
<AccountHeader pageTitle={pageTitle} />
|
|
32
55
|
<section data-fs-account-profile-body>
|
|
33
56
|
<AccountTable
|
|
34
57
|
rows={[
|
|
35
|
-
{ heading:
|
|
58
|
+
{ heading: nameLabel, data: profile?.name },
|
|
36
59
|
{
|
|
37
|
-
heading:
|
|
60
|
+
heading: emailLabel,
|
|
38
61
|
data: (
|
|
39
62
|
<Link href={`mailto:${profile?.email}`}>{profile?.email}</Link>
|
|
40
63
|
),
|
|
41
64
|
},
|
|
42
|
-
{ heading:
|
|
65
|
+
{ heading: idLabel, data: profile?.id },
|
|
43
66
|
...(profile?.createdDate
|
|
44
67
|
? [
|
|
45
68
|
{
|
|
46
|
-
heading:
|
|
69
|
+
heading: createdDateLabel,
|
|
47
70
|
data: formatStringDate(profile.createdDate),
|
|
48
71
|
},
|
|
49
72
|
]
|
|
@@ -11,6 +11,10 @@ import {
|
|
|
11
11
|
} from '@faststore/ui'
|
|
12
12
|
|
|
13
13
|
import { useSetPassword } from 'src/sdk/account/useSetPassword'
|
|
14
|
+
import {
|
|
15
|
+
type SecuritySectionLabels,
|
|
16
|
+
resolveSecurityLabels,
|
|
17
|
+
} from './securityLabels'
|
|
14
18
|
import styles from './styles.module.scss'
|
|
15
19
|
|
|
16
20
|
type SecurityDrawerProps = {
|
|
@@ -18,21 +22,24 @@ type SecurityDrawerProps = {
|
|
|
18
22
|
isOpen: boolean
|
|
19
23
|
onClose: () => void
|
|
20
24
|
accountName?: string
|
|
25
|
+
labels?: SecuritySectionLabels
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
const validations = [
|
|
24
|
-
{ label: '8 characters', test: (v: string) => v.length >= 8 },
|
|
25
|
-
{ label: '1 uppercase letter', test: (v: string) => /[A-Z]/.test(v) },
|
|
26
|
-
{ label: '1 lowercase letter', test: (v: string) => /[a-z]/.test(v) },
|
|
27
|
-
{ label: '1 number', test: (v: string) => /\d/.test(v) },
|
|
28
|
-
]
|
|
29
|
-
|
|
30
28
|
export const SecurityDrawer = ({
|
|
31
29
|
userEmail,
|
|
32
30
|
accountName,
|
|
33
31
|
isOpen,
|
|
34
32
|
onClose,
|
|
33
|
+
labels: labelsProp,
|
|
35
34
|
}: SecurityDrawerProps) => {
|
|
35
|
+
const labels = resolveSecurityLabels(labelsProp)
|
|
36
|
+
|
|
37
|
+
const validations = [
|
|
38
|
+
{ label: labels.rule8Chars, test: (v: string) => v.length >= 8 },
|
|
39
|
+
{ label: labels.rule1Uppercase, test: (v: string) => /[A-Z]/.test(v) },
|
|
40
|
+
{ label: labels.rule1Lowercase, test: (v: string) => /[a-z]/.test(v) },
|
|
41
|
+
{ label: labels.rule1Number, test: (v: string) => /\d/.test(v) },
|
|
42
|
+
]
|
|
36
43
|
const { fade, fadeOut } = useFadeEffect()
|
|
37
44
|
const { pushToast } = useUI()
|
|
38
45
|
|
|
@@ -64,17 +71,17 @@ export const SecurityDrawer = ({
|
|
|
64
71
|
|
|
65
72
|
const handleSetPassword = async () => {
|
|
66
73
|
if (!userEmail) {
|
|
67
|
-
setFormError(
|
|
74
|
+
setFormError(labels.emailRequiredError)
|
|
68
75
|
return
|
|
69
76
|
}
|
|
70
77
|
|
|
71
78
|
if (!newPassword || !currentPassword) {
|
|
72
|
-
setFormError(
|
|
79
|
+
setFormError(labels.allFieldsRequiredError)
|
|
73
80
|
return
|
|
74
81
|
}
|
|
75
82
|
|
|
76
83
|
if (newPassword === currentPassword) {
|
|
77
|
-
setFormError(
|
|
84
|
+
setFormError(labels.samePasswordError)
|
|
78
85
|
return
|
|
79
86
|
}
|
|
80
87
|
|
|
@@ -100,7 +107,7 @@ export const SecurityDrawer = ({
|
|
|
100
107
|
pushToast({
|
|
101
108
|
title: 'Success setting password',
|
|
102
109
|
status: 'INFO',
|
|
103
|
-
message:
|
|
110
|
+
message: labels.passwordUpdatedToast,
|
|
104
111
|
icon: <Icon width={30} height={30} name="CircleWavyCheck" />,
|
|
105
112
|
})
|
|
106
113
|
|
|
@@ -111,7 +118,7 @@ export const SecurityDrawer = ({
|
|
|
111
118
|
pushToast({
|
|
112
119
|
title: 'Error setting password',
|
|
113
120
|
status: 'ERROR',
|
|
114
|
-
message:
|
|
121
|
+
message: labels.passwordFailedToast,
|
|
115
122
|
icon: <Icon width={30} height={30} name="CircleWavyWarning" />,
|
|
116
123
|
})
|
|
117
124
|
}
|
|
@@ -129,7 +136,9 @@ export const SecurityDrawer = ({
|
|
|
129
136
|
overlayProps={{ className: styles.section }}
|
|
130
137
|
>
|
|
131
138
|
<SlideOverHeader data-fs-security-drawer-header onClose={handleClose}>
|
|
132
|
-
<h1 data-fs-security-drawer-header-title>
|
|
139
|
+
<h1 data-fs-security-drawer-header-title>
|
|
140
|
+
{labels.resetPasswordLabel}
|
|
141
|
+
</h1>
|
|
133
142
|
</SlideOverHeader>
|
|
134
143
|
|
|
135
144
|
<div data-fs-security-drawer-body>
|
|
@@ -138,7 +147,7 @@ export const SecurityDrawer = ({
|
|
|
138
147
|
data-fs-security-drawer-input
|
|
139
148
|
id="security-drawer-input-current-password"
|
|
140
149
|
type={showCurrentPassword ? 'text' : 'password'}
|
|
141
|
-
placeholder=
|
|
150
|
+
placeholder={labels.currentPasswordLabel}
|
|
142
151
|
inputMode="text"
|
|
143
152
|
value={currentPassword}
|
|
144
153
|
onChange={(e) => {
|
|
@@ -149,7 +158,7 @@ export const SecurityDrawer = ({
|
|
|
149
158
|
<IconButton
|
|
150
159
|
data-fs-security-drawer-input-password-toggle
|
|
151
160
|
size="small"
|
|
152
|
-
aria-label=
|
|
161
|
+
aria-label={labels.showPasswordAria}
|
|
153
162
|
onClick={() => setShowCurrentPassword((prev) => !prev)}
|
|
154
163
|
icon={
|
|
155
164
|
showCurrentPassword ? (
|
|
@@ -166,7 +175,7 @@ export const SecurityDrawer = ({
|
|
|
166
175
|
data-fs-security-drawer-input
|
|
167
176
|
id="security-drawer-input-new-password"
|
|
168
177
|
type={showNewPassword ? 'text' : 'password'}
|
|
169
|
-
placeholder=
|
|
178
|
+
placeholder={labels.newPasswordLabel}
|
|
170
179
|
inputMode="text"
|
|
171
180
|
value={newPassword}
|
|
172
181
|
onChange={(e) => {
|
|
@@ -177,7 +186,7 @@ export const SecurityDrawer = ({
|
|
|
177
186
|
<IconButton
|
|
178
187
|
data-fs-security-drawer-input-password-toggle
|
|
179
188
|
size="small"
|
|
180
|
-
aria-label=
|
|
189
|
+
aria-label={labels.showPasswordAria}
|
|
181
190
|
onClick={() => setShowNewPassword((prev) => !prev)}
|
|
182
191
|
icon={
|
|
183
192
|
showNewPassword ? <Icon name="EyeSlash" /> : <Icon name="Eye" />
|
|
@@ -200,7 +209,7 @@ export const SecurityDrawer = ({
|
|
|
200
209
|
{newPassword.length > 0 && (
|
|
201
210
|
<div data-fs-security-drawer-password-rules-container>
|
|
202
211
|
<p data-fs-security-drawer-password-rules-title>
|
|
203
|
-
|
|
212
|
+
{labels.passwordRulesIntro}
|
|
204
213
|
</p>
|
|
205
214
|
|
|
206
215
|
<ul data-fs-security-drawer-password-rules-list>
|
|
@@ -225,7 +234,7 @@ export const SecurityDrawer = ({
|
|
|
225
234
|
|
|
226
235
|
<footer data-fs-security-drawer-footer>
|
|
227
236
|
<Button variant="secondary" onClick={handleClose}>
|
|
228
|
-
|
|
237
|
+
{labels.cancelLabel}
|
|
229
238
|
</Button>
|
|
230
239
|
|
|
231
240
|
<Button
|
|
@@ -235,7 +244,7 @@ export const SecurityDrawer = ({
|
|
|
235
244
|
disabled={loading || !currentPassword || !newPassword || !allValid}
|
|
236
245
|
onClick={handleSetPassword}
|
|
237
246
|
>
|
|
238
|
-
|
|
247
|
+
{labels.savePasswordLabel}
|
|
239
248
|
</Button>
|
|
240
249
|
</footer>
|
|
241
250
|
</SlideOver>
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
import { Button } from '@faststore/ui'
|
|
3
3
|
|
|
4
|
-
import AccountTable from '../components/
|
|
5
|
-
import AccountHeader from '../components/
|
|
4
|
+
import AccountTable from '../components/Table'
|
|
5
|
+
import AccountHeader from '../components/Header'
|
|
6
6
|
|
|
7
7
|
import { SecurityDrawer } from './SecurityDrawer'
|
|
8
|
+
import {
|
|
9
|
+
type SecuritySectionLabels,
|
|
10
|
+
resolveSecurityLabels,
|
|
11
|
+
} from './securityLabels'
|
|
8
12
|
import styles from './styles.module.scss'
|
|
9
13
|
|
|
10
|
-
type SecuritySectionProps = {
|
|
14
|
+
type SecuritySectionProps = {
|
|
15
|
+
userEmail: string
|
|
16
|
+
accountName?: string
|
|
17
|
+
labels?: SecuritySectionLabels
|
|
18
|
+
}
|
|
11
19
|
|
|
12
20
|
export const SecuritySection = ({
|
|
13
21
|
userEmail,
|
|
14
22
|
accountName,
|
|
23
|
+
labels: labelsProp,
|
|
15
24
|
}: SecuritySectionProps) => {
|
|
25
|
+
const labels = resolveSecurityLabels(labelsProp)
|
|
16
26
|
const [isDrawerOpen, setIsDrawerOpen] = useState(false)
|
|
17
27
|
return (
|
|
18
28
|
<>
|
|
@@ -22,17 +32,18 @@ export const SecuritySection = ({
|
|
|
22
32
|
accountName={accountName}
|
|
23
33
|
isOpen={isDrawerOpen}
|
|
24
34
|
onClose={() => setIsDrawerOpen(false)}
|
|
35
|
+
labels={labels}
|
|
25
36
|
/>
|
|
26
37
|
)}
|
|
27
38
|
|
|
28
39
|
<section data-fs-securiry-section className={styles.section}>
|
|
29
|
-
<AccountHeader pageTitle=
|
|
40
|
+
<AccountHeader pageTitle={labels.pageTitle} />
|
|
30
41
|
|
|
31
42
|
<div data-fs-security-container>
|
|
32
43
|
<AccountTable
|
|
33
44
|
rows={[
|
|
34
45
|
{
|
|
35
|
-
heading:
|
|
46
|
+
heading: labels.passwordLabel,
|
|
36
47
|
data: (
|
|
37
48
|
<>
|
|
38
49
|
<span data-fs-security-table-data-text>••••••••••</span>
|
|
@@ -41,7 +52,7 @@ export const SecuritySection = ({
|
|
|
41
52
|
data-fs-security-table-action-button
|
|
42
53
|
onClick={() => setIsDrawerOpen(true)}
|
|
43
54
|
>
|
|
44
|
-
|
|
55
|
+
{labels.resetPasswordLabel}
|
|
45
56
|
</Button>
|
|
46
57
|
</>
|
|
47
58
|
),
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type SecuritySectionLabels = {
|
|
2
|
+
pageTitle?: string
|
|
3
|
+
passwordLabel?: string
|
|
4
|
+
resetPasswordLabel?: string
|
|
5
|
+
currentPasswordLabel?: string
|
|
6
|
+
newPasswordLabel?: string
|
|
7
|
+
showPasswordAria?: string
|
|
8
|
+
cancelLabel?: string
|
|
9
|
+
savePasswordLabel?: string
|
|
10
|
+
passwordRulesIntro?: string
|
|
11
|
+
rule8Chars?: string
|
|
12
|
+
rule1Uppercase?: string
|
|
13
|
+
rule1Lowercase?: string
|
|
14
|
+
rule1Number?: string
|
|
15
|
+
emailRequiredError?: string
|
|
16
|
+
allFieldsRequiredError?: string
|
|
17
|
+
samePasswordError?: string
|
|
18
|
+
passwordUpdatedToast?: string
|
|
19
|
+
passwordFailedToast?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const defaultSecurityLabels: Required<SecuritySectionLabels> = {
|
|
23
|
+
pageTitle: 'Security',
|
|
24
|
+
passwordLabel: 'Password',
|
|
25
|
+
resetPasswordLabel: 'Reset password',
|
|
26
|
+
currentPasswordLabel: 'Current Password',
|
|
27
|
+
newPasswordLabel: 'New Password',
|
|
28
|
+
showPasswordAria: 'Show Password',
|
|
29
|
+
cancelLabel: 'Cancel',
|
|
30
|
+
savePasswordLabel: 'Save Password',
|
|
31
|
+
passwordRulesIntro: 'Your password must have at least:',
|
|
32
|
+
rule8Chars: '8 characters',
|
|
33
|
+
rule1Uppercase: '1 uppercase letter',
|
|
34
|
+
rule1Lowercase: '1 lowercase letter',
|
|
35
|
+
rule1Number: '1 number',
|
|
36
|
+
emailRequiredError: 'Email is required',
|
|
37
|
+
allFieldsRequiredError: 'All fields are required',
|
|
38
|
+
samePasswordError: 'New password cannot be the same as the current password',
|
|
39
|
+
passwordUpdatedToast: 'Password updated successfully',
|
|
40
|
+
passwordFailedToast: 'Failed to set password.',
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function resolveSecurityLabels(
|
|
44
|
+
labels?: SecuritySectionLabels
|
|
45
|
+
): Required<SecuritySectionLabels> {
|
|
46
|
+
return { ...defaultSecurityLabels, ...labels }
|
|
47
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
@include meta.load-css("~@faststore/ui/src/components/atoms/Input/styles.scss");
|
|
9
9
|
@include meta.load-css("~@faststore/ui/src/components/atoms/Icon/styles.scss");
|
|
10
10
|
@include meta.load-css("~@faststore/ui/src/components/organisms/SlideOver/styles.scss");
|
|
11
|
-
@include meta.load-css("../components/
|
|
11
|
+
@include meta.load-css("../components/Table/styles.scss");
|
|
12
12
|
|
|
13
13
|
// --------------------------------------------------------
|
|
14
14
|
// Design Tokens
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ComponentType } from 'react'
|
|
2
|
+
|
|
3
|
+
import AccountNavigation from 'src/components/sections/Account/AccountNavigation'
|
|
4
|
+
import AccountOrderBudgets from 'src/components/sections/Account/AccountOrderBudgets'
|
|
5
|
+
import AccountOrderDelivery from 'src/components/sections/Account/AccountOrderDelivery'
|
|
6
|
+
import AccountOrderDetails from 'src/components/sections/Account/AccountOrderDetails'
|
|
7
|
+
import AccountOrderMoreInfo from 'src/components/sections/Account/AccountOrderMoreInfo'
|
|
8
|
+
import AccountOrderOrderedBy from 'src/components/sections/Account/AccountOrderOrderedBy'
|
|
9
|
+
import AccountOrderPayment from 'src/components/sections/Account/AccountOrderPayment'
|
|
10
|
+
import AccountOrderStatus from 'src/components/sections/Account/AccountOrderStatus'
|
|
11
|
+
import AccountOrderSummary from 'src/components/sections/Account/AccountOrderSummary'
|
|
12
|
+
import AccountOrdersList from 'src/components/sections/Account/AccountOrdersList'
|
|
13
|
+
import AccountProfile from 'src/components/sections/Account/AccountProfile'
|
|
14
|
+
import AccountSecurity from 'src/components/sections/Account/AccountSecurity'
|
|
15
|
+
import AccountUnauthorized from 'src/components/sections/Account/AccountUnauthorized'
|
|
16
|
+
import AccountUserDetails from 'src/components/sections/Account/AccountUserDetails'
|
|
17
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
18
|
+
import { default as GLOBAL_COMPONENTS } from '../global/Components'
|
|
19
|
+
|
|
20
|
+
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
21
|
+
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
22
|
+
|
|
23
|
+
const ACCOUNT_COMPONENTS: Record<string, ComponentType<any>> = {
|
|
24
|
+
...GLOBAL_COMPONENTS,
|
|
25
|
+
[getComponentKey(AccountNavigation, 'AccountNavigation')]: AccountNavigation,
|
|
26
|
+
[getComponentKey(AccountProfile, 'AccountProfile')]: AccountProfile,
|
|
27
|
+
[getComponentKey(AccountOrdersList, 'AccountOrdersList')]: AccountOrdersList,
|
|
28
|
+
[getComponentKey(AccountUserDetails, 'AccountUserDetails')]:
|
|
29
|
+
AccountUserDetails,
|
|
30
|
+
[getComponentKey(AccountSecurity, 'AccountSecurity')]: AccountSecurity,
|
|
31
|
+
[getComponentKey(AccountOrderDetails, 'AccountOrderDetails')]:
|
|
32
|
+
AccountOrderDetails,
|
|
33
|
+
[getComponentKey(AccountOrderStatus, 'AccountOrderStatus')]:
|
|
34
|
+
AccountOrderStatus,
|
|
35
|
+
[getComponentKey(AccountOrderPayment, 'AccountOrderPayment')]:
|
|
36
|
+
AccountOrderPayment,
|
|
37
|
+
[getComponentKey(AccountOrderDelivery, 'AccountOrderDelivery')]:
|
|
38
|
+
AccountOrderDelivery,
|
|
39
|
+
[getComponentKey(AccountOrderSummary, 'AccountOrderSummary')]:
|
|
40
|
+
AccountOrderSummary,
|
|
41
|
+
[getComponentKey(AccountOrderOrderedBy, 'AccountOrderOrderedBy')]:
|
|
42
|
+
AccountOrderOrderedBy,
|
|
43
|
+
[getComponentKey(AccountOrderBudgets, 'AccountOrderBudgets')]:
|
|
44
|
+
AccountOrderBudgets,
|
|
45
|
+
[getComponentKey(AccountOrderMoreInfo, 'AccountOrderMoreInfo')]:
|
|
46
|
+
AccountOrderMoreInfo,
|
|
47
|
+
[getComponentKey(AccountUnauthorized, 'AccountUnauthorized')]:
|
|
48
|
+
AccountUnauthorized,
|
|
49
|
+
...PLUGINS_COMPONENTS,
|
|
50
|
+
...CUSTOM_COMPONENTS,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default ACCOUNT_COMPONENTS
|
|
@@ -4,7 +4,7 @@ import { useCallback, useRef, useState } from 'react'
|
|
|
4
4
|
import { Icon as UIIcon, useScrollDirection, useUI } from '@faststore/ui'
|
|
5
5
|
|
|
6
6
|
import { Skeleton as UISkeleton } from '@faststore/ui'
|
|
7
|
-
import { OrganizationSignInButton } from 'src/components/account/
|
|
7
|
+
import { OrganizationSignInButton } from 'src/components/account/Drawer/OrganizationSignInButton'
|
|
8
8
|
import CartToggle from 'src/components/cart/CartToggle'
|
|
9
9
|
import type { SearchInputRef } from 'src/components/search/SearchInput'
|
|
10
10
|
import SearchInput from 'src/components/search/SearchInput'
|
|
@@ -10,7 +10,7 @@ import Logo from 'src/components/ui/Logo'
|
|
|
10
10
|
|
|
11
11
|
import type { NavbarProps } from '../Navbar'
|
|
12
12
|
|
|
13
|
-
import { OrganizationSignInButton } from 'src/components/account/
|
|
13
|
+
import { OrganizationSignInButton } from 'src/components/account/Drawer/OrganizationSignInButton'
|
|
14
14
|
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
15
15
|
import { useSession } from 'src/sdk/session'
|
|
16
16
|
import styles from './section.module.scss'
|