@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,92 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ServerOrderDetailsQueryQuery,
|
|
3
|
+
UserOrderDeliveryOption,
|
|
4
|
+
UserOrderDeliveryOptionsData,
|
|
5
|
+
} from '@generated/graphql'
|
|
6
|
+
import type { OrderStatusKey } from 'src/utils/userOrderStatus'
|
|
7
|
+
import BudgetsCard from './BudgetsCard'
|
|
8
|
+
import DeliveryCard from './DeliveryCard'
|
|
9
|
+
import { DeliveryOptionAccordion } from './DeliveryOptionAccordion'
|
|
10
|
+
import MoreInformationCard from './MoreInformationCard'
|
|
11
|
+
import OrderedByCard from './OrderedByCard'
|
|
12
|
+
import PaymentCard from './PaymentCard'
|
|
13
|
+
import StatusCard from './StatusCard'
|
|
14
|
+
import SummaryCard from './SummaryCard'
|
|
15
|
+
import { OrderDetailsHeader, OrderDetailsPageShell } from './OrderDetailsHeader'
|
|
16
|
+
|
|
17
|
+
export interface OrderDetailsProps {
|
|
18
|
+
order: ServerOrderDetailsQueryQuery['userOrder']
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use CMS section wrappers (AccountOrderDetails, AccountOrderStatus, …)
|
|
23
|
+
* rendered via RenderSectionsBase on the order details page.
|
|
24
|
+
*/
|
|
25
|
+
export default function OrderDetails({ order }: OrderDetailsProps) {
|
|
26
|
+
const moreInformationCustomFields = order?.customFields?.find(
|
|
27
|
+
(field) => field.type === 'order'
|
|
28
|
+
)?.fields
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<OrderDetailsPageShell>
|
|
32
|
+
<OrderDetailsHeader order={order} />
|
|
33
|
+
|
|
34
|
+
<main data-fs-order-details-content>
|
|
35
|
+
<OrderedByCard
|
|
36
|
+
clientProfileData={order.clientProfileData}
|
|
37
|
+
shopper={order.shopper}
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
<DeliveryCard
|
|
41
|
+
deliveryOptionsData={
|
|
42
|
+
order.deliveryOptionsData as UserOrderDeliveryOptionsData
|
|
43
|
+
}
|
|
44
|
+
fields={
|
|
45
|
+
order?.customFields?.find((field) => field.type === 'address')
|
|
46
|
+
?.fields || []
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
<StatusCard
|
|
51
|
+
status={order.status as OrderStatusKey}
|
|
52
|
+
creationDate={order.creationDate}
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
<PaymentCard
|
|
56
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
57
|
+
paymentData={order.paymentData}
|
|
58
|
+
allowCancellation={order.allowCancellation}
|
|
59
|
+
/>
|
|
60
|
+
|
|
61
|
+
<SummaryCard
|
|
62
|
+
totals={order.totals}
|
|
63
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
64
|
+
transactions={order.paymentData.transactions}
|
|
65
|
+
/>
|
|
66
|
+
|
|
67
|
+
{order.deliveryOptionsData.deliveryOptions.map((option) => (
|
|
68
|
+
<DeliveryOptionAccordion
|
|
69
|
+
key={option.friendlyDeliveryOptionName}
|
|
70
|
+
deliveryOption={option as UserOrderDeliveryOption}
|
|
71
|
+
contact={order.deliveryOptionsData.contact}
|
|
72
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
73
|
+
customFields={order.customFields.filter(
|
|
74
|
+
(field) => field.type === 'item'
|
|
75
|
+
)}
|
|
76
|
+
/>
|
|
77
|
+
))}
|
|
78
|
+
|
|
79
|
+
{moreInformationCustomFields?.length > 0 && (
|
|
80
|
+
<MoreInformationCard fields={moreInformationCustomFields} />
|
|
81
|
+
)}
|
|
82
|
+
|
|
83
|
+
{order.budgetData && (
|
|
84
|
+
<BudgetsCard
|
|
85
|
+
budgetData={order.budgetData}
|
|
86
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
87
|
+
/>
|
|
88
|
+
)}
|
|
89
|
+
</main>
|
|
90
|
+
</OrderDetailsPageShell>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Icon as UIIcon, IconButton as UIIconButton } from '@faststore/ui'
|
|
2
|
+
import type { PropsWithChildren } from 'react'
|
|
3
|
+
import type { ServerOrderDetailsQueryQuery } from '@generated/graphql'
|
|
4
|
+
import type { OrderStatusCmsLabels } from 'src/utils/userOrderStatus'
|
|
5
|
+
import StatusBadge from '../../components/StatusBadge'
|
|
6
|
+
import BuyingPolicyAlert from './BuyingPolicyAlert'
|
|
7
|
+
import OrderActions from './OrderActions'
|
|
8
|
+
import ReorderButton from './ReorderButton'
|
|
9
|
+
import {
|
|
10
|
+
type OrderDetailsHeaderLabels,
|
|
11
|
+
resolveOrderDetailsHeaderLabels,
|
|
12
|
+
} from './orderDetailsLabels'
|
|
13
|
+
import styles from './section.module.scss'
|
|
14
|
+
|
|
15
|
+
export type OrderDetailsHeaderProps = {
|
|
16
|
+
order: ServerOrderDetailsQueryQuery['userOrder']
|
|
17
|
+
labels?: OrderDetailsHeaderLabels
|
|
18
|
+
statusLabels?: OrderStatusCmsLabels
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function OrderDetailsHeader({
|
|
22
|
+
order,
|
|
23
|
+
labels: labelsProp,
|
|
24
|
+
statusLabels,
|
|
25
|
+
}: OrderDetailsHeaderProps) {
|
|
26
|
+
const labels = resolveOrderDetailsHeaderLabels(labelsProp)
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<header data-fs-order-details-header>
|
|
31
|
+
<div data-fs-order-details-header-title>
|
|
32
|
+
<a href="/pvt/account/orders">
|
|
33
|
+
<UIIconButton
|
|
34
|
+
data-fs-order-details-header-back-button
|
|
35
|
+
size="small"
|
|
36
|
+
aria-label={labels.goBackLabel}
|
|
37
|
+
icon={<UIIcon name="ArrowLeft" />}
|
|
38
|
+
type="button"
|
|
39
|
+
/>
|
|
40
|
+
</a>
|
|
41
|
+
<div data-fs-order-details-header-title-wrapper>
|
|
42
|
+
<h1 data-fs-order-details-header-title-text>
|
|
43
|
+
{labels.orderNumberPrefix}
|
|
44
|
+
{order.orderId}
|
|
45
|
+
</h1>
|
|
46
|
+
<StatusBadge
|
|
47
|
+
status={order.status}
|
|
48
|
+
statusFallback={order.statusDescription}
|
|
49
|
+
statusLabels={statusLabels}
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div data-fs-order-details-header-actions>
|
|
55
|
+
<ReorderButton order={order} label={labels.reorderLabel} />
|
|
56
|
+
<OrderActions
|
|
57
|
+
allowCancellation={order.allowCancellation}
|
|
58
|
+
orderId={order.orderId}
|
|
59
|
+
customerEmail={order.clientProfileData?.email}
|
|
60
|
+
order={order}
|
|
61
|
+
labels={labels}
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</header>
|
|
65
|
+
|
|
66
|
+
{order.ruleForAuthorization && (
|
|
67
|
+
<BuyingPolicyAlert
|
|
68
|
+
ruleForAuthorization={order.ruleForAuthorization}
|
|
69
|
+
onAuthorizationComplete={() => window.location.reload()}
|
|
70
|
+
labels={{
|
|
71
|
+
approveLabel: labels.approveLabel,
|
|
72
|
+
rejectLabel: labels.rejectLabel,
|
|
73
|
+
rejectModalTitle: labels.rejectModalTitle,
|
|
74
|
+
rejectModalMessage: labels.rejectModalMessage,
|
|
75
|
+
rejectModalConfirmText: labels.rejectModalConfirmText,
|
|
76
|
+
}}
|
|
77
|
+
/>
|
|
78
|
+
)}
|
|
79
|
+
</>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function OrderDetailsPageShell({ children }: PropsWithChildren) {
|
|
84
|
+
return (
|
|
85
|
+
<div className={styles.page} data-fs-order-details>
|
|
86
|
+
{children}
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ServerOrderDetailsQueryQuery } from '@generated/graphql'
|
|
2
|
-
import
|
|
2
|
+
import Card from '../../../components/Card'
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
interface OrderedByCardProps {
|
|
5
|
+
title?: string
|
|
5
6
|
clientProfileData: Pick<
|
|
6
7
|
ServerOrderDetailsQueryQuery['userOrder']['clientProfileData'],
|
|
7
8
|
| 'firstName'
|
|
@@ -19,10 +20,11 @@ interface MyAccountOrderedByCardProps {
|
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
function
|
|
23
|
+
function OrderedByCard({
|
|
24
|
+
title = 'Ordered by',
|
|
23
25
|
clientProfileData,
|
|
24
26
|
shopper,
|
|
25
|
-
}:
|
|
27
|
+
}: OrderedByCardProps) {
|
|
26
28
|
const shopperNameExists = Boolean(shopper?.firstName)
|
|
27
29
|
const firstName =
|
|
28
30
|
(shopperNameExists ? shopper?.firstName : clientProfileData?.firstName) ??
|
|
@@ -39,7 +41,7 @@ function MyAccountOrderedByCard({
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
return (
|
|
42
|
-
<
|
|
44
|
+
<Card title={title} data-fs-order-ordered-by-card>
|
|
43
45
|
{isCorporate && corporateName && (
|
|
44
46
|
<div data-fs-ordered-by-org>
|
|
45
47
|
<div data-fs-ordered-by-avatar>{getFirstLetter(corporateName)}</div>
|
|
@@ -58,8 +60,8 @@ function MyAccountOrderedByCard({
|
|
|
58
60
|
</p>
|
|
59
61
|
)}
|
|
60
62
|
</div>
|
|
61
|
-
</
|
|
63
|
+
</Card>
|
|
62
64
|
)
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
export default
|
|
67
|
+
export default OrderedByCard
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './OrderedByCard'
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import Card from '../../../components/Card'
|
|
2
|
+
import PaymentFlagsIcon from './PaymentFlagsIcon'
|
|
3
3
|
import { Link } from '@faststore/ui'
|
|
4
4
|
import { useFormatPrice } from '../../../utils/useFormatPrice'
|
|
5
5
|
import type { ServerOrderDetailsQueryQuery } from '@generated/graphql'
|
|
6
|
+
import {
|
|
7
|
+
type OrderPaymentSectionLabels,
|
|
8
|
+
resolveOrderPaymentLabels,
|
|
9
|
+
} from '../orderDetailsLabels'
|
|
6
10
|
|
|
7
11
|
export type OrderPaymentData =
|
|
8
12
|
ServerOrderDetailsQueryQuery['userOrder']['paymentData']
|
|
@@ -11,17 +15,19 @@ export type OrderPaymentDataTransaction =
|
|
|
11
15
|
export type OrderPaymentDataTransactionPayment =
|
|
12
16
|
OrderPaymentDataTransaction['payments'][number]
|
|
13
17
|
|
|
14
|
-
interface
|
|
18
|
+
interface PaymentCardProps {
|
|
15
19
|
paymentData?: OrderPaymentData
|
|
16
20
|
currencyCode: string
|
|
17
21
|
allowCancellation?: boolean
|
|
22
|
+
labels?: OrderPaymentSectionLabels
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
const getPaymentMethodInfo = (
|
|
21
|
-
payment: OrderPaymentDataTransaction['payments'][number]
|
|
26
|
+
payment: OrderPaymentDataTransaction['payments'][number],
|
|
27
|
+
labels: Required<OrderPaymentSectionLabels>
|
|
22
28
|
) => {
|
|
23
29
|
const baseInfo = {
|
|
24
|
-
type:
|
|
30
|
+
type: labels.billingLabel,
|
|
25
31
|
methodName: '',
|
|
26
32
|
icon: payment.paymentSystemName,
|
|
27
33
|
}
|
|
@@ -31,24 +37,24 @@ const getPaymentMethodInfo = (
|
|
|
31
37
|
case 'debitCard':
|
|
32
38
|
return {
|
|
33
39
|
...baseInfo,
|
|
34
|
-
methodName: `${payment.paymentSystemName}
|
|
40
|
+
methodName: `${payment.paymentSystemName} ${labels.endingInLabel} ${payment.lastDigits}`,
|
|
35
41
|
}
|
|
36
42
|
case 'bankInvoice':
|
|
37
43
|
return {
|
|
38
44
|
...baseInfo,
|
|
39
|
-
type:
|
|
40
|
-
methodName:
|
|
45
|
+
type: labels.bankInvoiceLabel,
|
|
46
|
+
methodName: labels.bankInvoiceLabel,
|
|
41
47
|
}
|
|
42
48
|
case 'payPal':
|
|
43
49
|
return {
|
|
44
50
|
...baseInfo,
|
|
45
|
-
methodName:
|
|
51
|
+
methodName: labels.paypalLabel,
|
|
46
52
|
}
|
|
47
53
|
case 'giftCard':
|
|
48
54
|
return {
|
|
49
55
|
...baseInfo,
|
|
50
|
-
type:
|
|
51
|
-
methodName:
|
|
56
|
+
type: labels.giftCardLabel,
|
|
57
|
+
methodName: labels.giftCardLabel,
|
|
52
58
|
}
|
|
53
59
|
default:
|
|
54
60
|
return {
|
|
@@ -70,11 +76,13 @@ const getBankInvoiceUrl = (transactions: OrderPaymentDataTransaction[]) => {
|
|
|
70
76
|
return null
|
|
71
77
|
}
|
|
72
78
|
|
|
73
|
-
function
|
|
79
|
+
function PaymentCard({
|
|
74
80
|
paymentData,
|
|
75
81
|
currencyCode,
|
|
76
82
|
allowCancellation = false,
|
|
77
|
-
|
|
83
|
+
labels: labelsProp,
|
|
84
|
+
}: PaymentCardProps) {
|
|
85
|
+
const labels = resolveOrderPaymentLabels(labelsProp)
|
|
78
86
|
const formatPrice = useFormatPrice()
|
|
79
87
|
|
|
80
88
|
const bankInvoiceUrl = getBankInvoiceUrl(paymentData?.transactions)
|
|
@@ -82,10 +90,10 @@ function MyAccountPaymentCard({
|
|
|
82
90
|
const showPrintBankInvoiceButton = allowCancellation && bankInvoiceUrl
|
|
83
91
|
|
|
84
92
|
return (
|
|
85
|
-
<
|
|
93
|
+
<Card title={labels.paymentTitle} data-fs-order-payment-card>
|
|
86
94
|
<div data-fs-payment-details>
|
|
87
95
|
{paymentData?.transactions[0]?.payments.map((payment) => {
|
|
88
|
-
const methodInfo = getPaymentMethodInfo(payment)
|
|
96
|
+
const methodInfo = getPaymentMethodInfo(payment, labels)
|
|
89
97
|
// Check if redemptionCode exists on payment
|
|
90
98
|
const hasRedemptionCode =
|
|
91
99
|
payment.group === 'giftCard' && payment.redemptionCode
|
|
@@ -95,7 +103,7 @@ function MyAccountPaymentCard({
|
|
|
95
103
|
<div data-fs-payment-method>
|
|
96
104
|
<div data-fs-payment-method-info>
|
|
97
105
|
<p data-fs-payment-name>{methodInfo.methodName}</p>
|
|
98
|
-
<
|
|
106
|
+
<PaymentFlagsIcon payment={payment} />
|
|
99
107
|
</div>
|
|
100
108
|
<div data-fs-payment-value>
|
|
101
109
|
{hasRedemptionCode ? (
|
|
@@ -105,11 +113,15 @@ function MyAccountPaymentCard({
|
|
|
105
113
|
</span>
|
|
106
114
|
) : payment.installments > 1 ? (
|
|
107
115
|
<span>
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
{labels.installmentCopy
|
|
117
|
+
.replace('{count}', String(payment.installments))
|
|
118
|
+
.replace(
|
|
119
|
+
'{value}',
|
|
120
|
+
formatPrice(
|
|
121
|
+
payment.value / payment.installments,
|
|
122
|
+
currencyCode
|
|
123
|
+
)
|
|
124
|
+
)}
|
|
113
125
|
</span>
|
|
114
126
|
) : (
|
|
115
127
|
<span>{formatPrice(payment.value, currencyCode)}</span>
|
|
@@ -119,17 +131,20 @@ function MyAccountPaymentCard({
|
|
|
119
131
|
|
|
120
132
|
<div data-fs-payment-transaction-info>
|
|
121
133
|
{payment.tid && (
|
|
122
|
-
<span data-fs-payment-tid>
|
|
134
|
+
<span data-fs-payment-tid>
|
|
135
|
+
{labels.tidLabel} {payment.tid}
|
|
136
|
+
</span>
|
|
123
137
|
)}
|
|
124
138
|
{payment.connectorResponses?.authId && (
|
|
125
139
|
<span data-fs-payment-authid>
|
|
126
|
-
|
|
140
|
+
{labels.authIdLabel}{' '}
|
|
141
|
+
{String(payment.connectorResponses.authId)}
|
|
127
142
|
</span>
|
|
128
143
|
)}
|
|
129
144
|
<div data-fs-payment-bank-invoice>
|
|
130
145
|
{payment.bankIssuedInvoiceIdentificationNumber && (
|
|
131
146
|
<span data-fs-payment-bank-invoice-number>
|
|
132
|
-
|
|
147
|
+
{labels.invoiceNumberLabel}{' '}
|
|
133
148
|
{payment.bankIssuedInvoiceIdentificationNumber}
|
|
134
149
|
</span>
|
|
135
150
|
)}
|
|
@@ -139,7 +154,7 @@ function MyAccountPaymentCard({
|
|
|
139
154
|
href={bankInvoiceUrl}
|
|
140
155
|
target="_blank"
|
|
141
156
|
>
|
|
142
|
-
|
|
157
|
+
{labels.printBankInvoiceLabel}
|
|
143
158
|
</Link>
|
|
144
159
|
)}
|
|
145
160
|
</div>
|
|
@@ -148,8 +163,8 @@ function MyAccountPaymentCard({
|
|
|
148
163
|
)
|
|
149
164
|
})}
|
|
150
165
|
</div>
|
|
151
|
-
</
|
|
166
|
+
</Card>
|
|
152
167
|
)
|
|
153
168
|
}
|
|
154
169
|
|
|
155
|
-
export default
|
|
170
|
+
export default PaymentCard
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Icon as UIIcon } from '@faststore/ui'
|
|
2
|
-
import type { OrderPaymentDataTransactionPayment } from './
|
|
2
|
+
import type { OrderPaymentDataTransactionPayment } from './PaymentCard'
|
|
3
3
|
|
|
4
4
|
interface PaymentFlagsIconProps {
|
|
5
5
|
payment: Pick<
|
|
@@ -45,7 +45,7 @@ function shouldShowFlag(
|
|
|
45
45
|
return true
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
function
|
|
48
|
+
function PaymentFlagsIcon({ payment }: PaymentFlagsIconProps) {
|
|
49
49
|
const getPaymentFlag = () => {
|
|
50
50
|
const { group, paymentSystemName, paymentOrigin } = payment
|
|
51
51
|
|
|
@@ -103,4 +103,4 @@ function MyAccountPaymentFlagsIcon({ payment }: PaymentFlagsIconProps) {
|
|
|
103
103
|
)
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
export default
|
|
106
|
+
export default PaymentFlagsIcon
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './PaymentCard'
|
|
@@ -4,15 +4,17 @@ import type { ServerOrderDetailsQueryQuery } from '@generated/graphql'
|
|
|
4
4
|
|
|
5
5
|
type Order = ServerOrderDetailsQueryQuery['userOrder']
|
|
6
6
|
|
|
7
|
-
export interface
|
|
7
|
+
export interface ReorderButtonProps {
|
|
8
8
|
order: Order
|
|
9
9
|
onClick?: () => void
|
|
10
|
+
label?: string
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export default function
|
|
13
|
+
export default function ReorderButton({
|
|
13
14
|
order,
|
|
14
15
|
onClick,
|
|
15
|
-
|
|
16
|
+
label = 'Reorder',
|
|
17
|
+
}: ReorderButtonProps) {
|
|
16
18
|
const { reorder, loading } = useReorder()
|
|
17
19
|
|
|
18
20
|
const handleClick = async () => {
|
|
@@ -31,7 +33,7 @@ export default function MyAccountReorderButton({
|
|
|
31
33
|
onClick={handleClick}
|
|
32
34
|
disabled={loading}
|
|
33
35
|
>
|
|
34
|
-
|
|
36
|
+
{label}
|
|
35
37
|
</Button>
|
|
36
38
|
)
|
|
37
39
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Icon as UIIcon, Skeleton as UISkeleton } from '@faststore/ui'
|
|
2
2
|
import { useRef, type ReactNode } from 'react'
|
|
3
|
-
import
|
|
3
|
+
import Card from 'src/components/account/components/Card'
|
|
4
4
|
import { orderStatusMap, type OrderStatusKey } from 'src/utils/userOrderStatus'
|
|
5
5
|
import { useConnectorPositioning } from './useConnectorPositioning'
|
|
6
6
|
import type { ServerOrderDetailsQueryQuery } from '@generated/graphql'
|
|
7
|
+
import {
|
|
8
|
+
type OrderStatusSectionLabels,
|
|
9
|
+
resolveOrderStatusLabels,
|
|
10
|
+
} from '../orderDetailsLabels'
|
|
7
11
|
|
|
8
12
|
export type StepStatus = 'completed' | 'loading' | 'not-started' | 'failed'
|
|
9
13
|
export type StepKey =
|
|
@@ -19,9 +23,10 @@ interface Step {
|
|
|
19
23
|
completedAt?: string
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
interface
|
|
26
|
+
interface StatusCardProps {
|
|
23
27
|
status: OrderStatusKey
|
|
24
28
|
creationDate: ServerOrderDetailsQueryQuery['userOrder']['creationDate']
|
|
29
|
+
labels?: OrderStatusSectionLabels
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
// Define custom labels for each step based on their status
|
|
@@ -212,10 +217,12 @@ const getStepStatus = ({
|
|
|
212
217
|
return thisStepIndex < currentStepIndex ? 'completed' : 'not-started'
|
|
213
218
|
}
|
|
214
219
|
|
|
215
|
-
function
|
|
220
|
+
function StatusCard({
|
|
216
221
|
status,
|
|
217
222
|
creationDate,
|
|
218
|
-
|
|
223
|
+
labels: labelsProp,
|
|
224
|
+
}: StatusCardProps) {
|
|
225
|
+
const labels = resolveOrderStatusLabels(labelsProp)
|
|
219
226
|
const containerRef = useRef<HTMLDivElement>(null)
|
|
220
227
|
|
|
221
228
|
useConnectorPositioning(containerRef)
|
|
@@ -237,12 +244,26 @@ function MyAccountStatusCard({
|
|
|
237
244
|
isFailed,
|
|
238
245
|
})
|
|
239
246
|
|
|
240
|
-
|
|
247
|
+
let stepLabel = isCanceled
|
|
241
248
|
? step.key === 'payment'
|
|
242
249
|
? currentStatusLabel
|
|
243
250
|
: '—' // prevent hydration mismatch
|
|
244
251
|
: step.label(stepStatus)
|
|
245
252
|
|
|
253
|
+
if (!isCanceled) {
|
|
254
|
+
if (step.key === 'order') {
|
|
255
|
+
stepLabel = labels.orderPlacedStep
|
|
256
|
+
} else if (step.key === 'payment' && stepStatus === 'loading') {
|
|
257
|
+
stepLabel = labels.paymentPendingStep
|
|
258
|
+
} else if (step.key === 'processing' && stepStatus === 'loading') {
|
|
259
|
+
stepLabel = labels.handlingStep
|
|
260
|
+
} else if (step.key === 'shipping' && stepStatus === 'completed') {
|
|
261
|
+
stepLabel = labels.invoicedStep
|
|
262
|
+
} else if (step.key === 'shipping' && stepStatus === 'loading') {
|
|
263
|
+
stepLabel = labels.deliveredStep
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
246
267
|
// Add creation date to the order step when it's completed or failed
|
|
247
268
|
let completedAt: string | undefined
|
|
248
269
|
if (
|
|
@@ -261,7 +282,7 @@ function MyAccountStatusCard({
|
|
|
261
282
|
})
|
|
262
283
|
|
|
263
284
|
return (
|
|
264
|
-
<
|
|
285
|
+
<Card title={labels.statusTitle} data-fs-order-status-card>
|
|
265
286
|
<div data-fs-order-status-content ref={containerRef}>
|
|
266
287
|
{steps.map((step, index) => (
|
|
267
288
|
<div
|
|
@@ -300,8 +321,8 @@ function MyAccountStatusCard({
|
|
|
300
321
|
</div>
|
|
301
322
|
))}
|
|
302
323
|
</div>
|
|
303
|
-
</
|
|
324
|
+
</Card>
|
|
304
325
|
)
|
|
305
326
|
}
|
|
306
327
|
|
|
307
|
-
export default
|
|
328
|
+
export default StatusCard
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './StatusCard'
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Card from 'src/components/account/components/Card'
|
|
2
2
|
import { useFormatPrice } from 'src/components/account/utils/useFormatPrice'
|
|
3
|
+
import {
|
|
4
|
+
type OrderSummarySectionLabels,
|
|
5
|
+
resolveOrderSummaryLabels,
|
|
6
|
+
} from '../orderDetailsLabels'
|
|
3
7
|
|
|
4
8
|
// Interface for order totals (items, shipping, discounts)
|
|
5
9
|
// TODO: Use type from API
|
|
@@ -19,17 +23,20 @@ interface Transaction {
|
|
|
19
23
|
}>
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
interface
|
|
26
|
+
interface SummaryCardProps {
|
|
23
27
|
totals: Total[]
|
|
24
28
|
currencyCode: string
|
|
25
29
|
transactions: Transaction[]
|
|
30
|
+
labels?: OrderSummarySectionLabels
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
function
|
|
33
|
+
function SummaryCard({
|
|
29
34
|
totals,
|
|
30
35
|
currencyCode,
|
|
31
36
|
transactions,
|
|
32
|
-
|
|
37
|
+
labels: labelsProp,
|
|
38
|
+
}: SummaryCardProps) {
|
|
39
|
+
const labels = resolveOrderSummaryLabels(labelsProp)
|
|
33
40
|
const formatPrice = useFormatPrice()
|
|
34
41
|
|
|
35
42
|
// Calculate any payment surcharges from active transactions
|
|
@@ -58,7 +65,7 @@ function MyAccountSummaryCard({
|
|
|
58
65
|
if (surchargeAmount > 0) {
|
|
59
66
|
const interestLineItem = {
|
|
60
67
|
id: 'Interest',
|
|
61
|
-
name:
|
|
68
|
+
name: labels.interestLabel,
|
|
62
69
|
value: surchargeAmount,
|
|
63
70
|
}
|
|
64
71
|
|
|
@@ -73,7 +80,7 @@ function MyAccountSummaryCard({
|
|
|
73
80
|
const totalAmount = displayTotals.reduce((sum, total) => sum + total.value, 0)
|
|
74
81
|
|
|
75
82
|
return (
|
|
76
|
-
<
|
|
83
|
+
<Card title={labels.summaryTitle} data-fs-order-summary-card>
|
|
77
84
|
{displayTotals.map((total) => (
|
|
78
85
|
<div key={total.id} data-fs-order-summary-item>
|
|
79
86
|
<span>{total.name}</span>
|
|
@@ -81,11 +88,11 @@ function MyAccountSummaryCard({
|
|
|
81
88
|
</div>
|
|
82
89
|
))}
|
|
83
90
|
<div data-fs-order-summary-item data-fs-order-summary-total>
|
|
84
|
-
<span>
|
|
91
|
+
<span>{labels.totalLabel}</span>
|
|
85
92
|
<span>{formatPrice(totalAmount, currencyCode)}</span>
|
|
86
93
|
</div>
|
|
87
|
-
</
|
|
94
|
+
</Card>
|
|
88
95
|
)
|
|
89
96
|
}
|
|
90
97
|
|
|
91
|
-
export default
|
|
98
|
+
export default SummaryCard
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SummaryCard'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default } from './OrderDetails'
|
|
2
|
+
export { OrderDetailsHeader, OrderDetailsPageShell } from './OrderDetailsHeader'
|
|
3
|
+
export { default as StatusCard } from './StatusCard'
|
|
4
|
+
export { default as PaymentCard } from './PaymentCard'
|
|
5
|
+
export { default as DeliveryCard } from './DeliveryCard'
|
|
6
|
+
export { DeliveryOptionAccordion } from './DeliveryOptionAccordion'
|
|
7
|
+
export { default as SummaryCard } from './SummaryCard'
|
|
8
|
+
export { default as OrderedByCard } from './OrderedByCard'
|
|
9
|
+
export { default as BudgetsCard } from './BudgetsCard'
|
|
10
|
+
export { default as MoreInformationCard } from './MoreInformationCard'
|