@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,35 @@
|
|
|
1
|
+
import BudgetsCard from 'src/components/account/orders/OrderDetails/BudgetsCard'
|
|
2
|
+
import {
|
|
3
|
+
type OrderBudgetsSectionLabels,
|
|
4
|
+
defaultOrderBudgetsLabels,
|
|
5
|
+
} from 'src/components/account/orders/OrderDetails/orderDetailsLabels'
|
|
6
|
+
import {
|
|
7
|
+
type AccountOrderDetailsPageData,
|
|
8
|
+
useAccountPageData,
|
|
9
|
+
} from 'src/sdk/account/accountPageContext'
|
|
10
|
+
import Section from '../Section'
|
|
11
|
+
|
|
12
|
+
export type AccountOrderBudgetsProps = OrderBudgetsSectionLabels
|
|
13
|
+
|
|
14
|
+
const AccountOrderBudgets = (props: AccountOrderBudgetsProps) => {
|
|
15
|
+
const labels = { ...defaultOrderBudgetsLabels, ...props }
|
|
16
|
+
const { order } = useAccountPageData<AccountOrderDetailsPageData>()
|
|
17
|
+
|
|
18
|
+
if (!order?.budgetData) {
|
|
19
|
+
return null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Section className="section-account-order-budgets">
|
|
24
|
+
<BudgetsCard
|
|
25
|
+
budgetData={order.budgetData}
|
|
26
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
27
|
+
labels={labels}
|
|
28
|
+
/>
|
|
29
|
+
</Section>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
AccountOrderBudgets.$componentKey = 'AccountOrderBudgets'
|
|
34
|
+
|
|
35
|
+
export default AccountOrderBudgets
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import DeliveryCard from 'src/components/account/orders/OrderDetails/DeliveryCard'
|
|
2
|
+
import { DeliveryOptionAccordion } from 'src/components/account/orders/OrderDetails/DeliveryOptionAccordion'
|
|
3
|
+
import {
|
|
4
|
+
type OrderDeliverySectionLabels,
|
|
5
|
+
defaultOrderDeliveryLabels,
|
|
6
|
+
} from 'src/components/account/orders/OrderDetails/orderDetailsLabels'
|
|
7
|
+
import type {
|
|
8
|
+
UserOrderDeliveryOption,
|
|
9
|
+
UserOrderDeliveryOptionsData,
|
|
10
|
+
} from '@generated/graphql'
|
|
11
|
+
import {
|
|
12
|
+
type AccountOrderDetailsPageData,
|
|
13
|
+
useAccountPageData,
|
|
14
|
+
} from 'src/sdk/account/accountPageContext'
|
|
15
|
+
import Section from '../Section'
|
|
16
|
+
|
|
17
|
+
export type AccountOrderDeliveryProps = OrderDeliverySectionLabels
|
|
18
|
+
|
|
19
|
+
const AccountOrderDelivery = (props: AccountOrderDeliveryProps) => {
|
|
20
|
+
const labels = { ...defaultOrderDeliveryLabels, ...props }
|
|
21
|
+
const { order } = useAccountPageData<AccountOrderDetailsPageData>()
|
|
22
|
+
|
|
23
|
+
if (!order?.deliveryOptionsData) {
|
|
24
|
+
return null
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Section className="section-account-order-delivery">
|
|
29
|
+
<DeliveryCard
|
|
30
|
+
deliveryOptionsData={
|
|
31
|
+
order.deliveryOptionsData as UserOrderDeliveryOptionsData
|
|
32
|
+
}
|
|
33
|
+
fields={
|
|
34
|
+
order.customFields?.find((field) => field.type === 'address')
|
|
35
|
+
?.fields || []
|
|
36
|
+
}
|
|
37
|
+
title={labels.deliveryTitle}
|
|
38
|
+
/>
|
|
39
|
+
{order.deliveryOptionsData.deliveryOptions.map((option) => (
|
|
40
|
+
<DeliveryOptionAccordion
|
|
41
|
+
key={option.friendlyDeliveryOptionName}
|
|
42
|
+
deliveryOption={option as UserOrderDeliveryOption}
|
|
43
|
+
contact={order.deliveryOptionsData.contact}
|
|
44
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
45
|
+
customFields={order.customFields.filter(
|
|
46
|
+
(field) => field.type === 'item'
|
|
47
|
+
)}
|
|
48
|
+
labels={labels}
|
|
49
|
+
/>
|
|
50
|
+
))}
|
|
51
|
+
</Section>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
AccountOrderDelivery.$componentKey = 'AccountOrderDelivery'
|
|
56
|
+
|
|
57
|
+
export default AccountOrderDelivery
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OrderDetailsHeader,
|
|
3
|
+
type OrderDetailsHeaderProps,
|
|
4
|
+
} from 'src/components/account/orders/OrderDetails/OrderDetailsHeader'
|
|
5
|
+
import { defaultOrderDetailsHeaderLabels } from 'src/components/account/orders/OrderDetails/orderDetailsLabels'
|
|
6
|
+
import {
|
|
7
|
+
type AccountOrderDetailsPageData,
|
|
8
|
+
useAccountPageData,
|
|
9
|
+
} from 'src/sdk/account/accountPageContext'
|
|
10
|
+
import Section from '../Section'
|
|
11
|
+
|
|
12
|
+
export type AccountOrderDetailsProps = OrderDetailsHeaderProps['labels']
|
|
13
|
+
|
|
14
|
+
const AccountOrderDetails = ({
|
|
15
|
+
orderNumberPrefix = defaultOrderDetailsHeaderLabels.orderNumberPrefix,
|
|
16
|
+
goBackLabel = defaultOrderDetailsHeaderLabels.goBackLabel,
|
|
17
|
+
cancelOrderLabel = defaultOrderDetailsHeaderLabels.cancelOrderLabel,
|
|
18
|
+
reorderLabel = defaultOrderDetailsHeaderLabels.reorderLabel,
|
|
19
|
+
notNowLabel = defaultOrderDetailsHeaderLabels.notNowLabel,
|
|
20
|
+
cancelConfirmMessage = defaultOrderDetailsHeaderLabels.cancelConfirmMessage,
|
|
21
|
+
cancelSuccessToast = defaultOrderDetailsHeaderLabels.cancelSuccessToast,
|
|
22
|
+
cancelErrorToast = defaultOrderDetailsHeaderLabels.cancelErrorToast,
|
|
23
|
+
approveLabel = defaultOrderDetailsHeaderLabels.approveLabel,
|
|
24
|
+
rejectLabel = defaultOrderDetailsHeaderLabels.rejectLabel,
|
|
25
|
+
}: AccountOrderDetailsProps) => {
|
|
26
|
+
const { order, orderStatusLabels } =
|
|
27
|
+
useAccountPageData<AccountOrderDetailsPageData>()
|
|
28
|
+
|
|
29
|
+
if (!order) {
|
|
30
|
+
return null
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Section className="section-account-order-details">
|
|
35
|
+
<OrderDetailsHeader
|
|
36
|
+
order={order}
|
|
37
|
+
statusLabels={orderStatusLabels}
|
|
38
|
+
labels={{
|
|
39
|
+
orderNumberPrefix,
|
|
40
|
+
goBackLabel,
|
|
41
|
+
cancelOrderLabel,
|
|
42
|
+
reorderLabel,
|
|
43
|
+
notNowLabel,
|
|
44
|
+
cancelConfirmMessage,
|
|
45
|
+
cancelSuccessToast,
|
|
46
|
+
cancelErrorToast,
|
|
47
|
+
approveLabel,
|
|
48
|
+
rejectLabel,
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
</Section>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
AccountOrderDetails.$componentKey = 'AccountOrderDetails'
|
|
56
|
+
|
|
57
|
+
export default AccountOrderDetails
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import MoreInformationCard from 'src/components/account/orders/OrderDetails/MoreInformationCard'
|
|
2
|
+
import {
|
|
3
|
+
type OrderMoreInfoSectionLabels,
|
|
4
|
+
defaultOrderMoreInfoLabels,
|
|
5
|
+
} from 'src/components/account/orders/OrderDetails/orderDetailsLabels'
|
|
6
|
+
import {
|
|
7
|
+
type AccountOrderDetailsPageData,
|
|
8
|
+
useAccountPageData,
|
|
9
|
+
} from 'src/sdk/account/accountPageContext'
|
|
10
|
+
import Section from '../Section'
|
|
11
|
+
|
|
12
|
+
export type AccountOrderMoreInfoProps = OrderMoreInfoSectionLabels
|
|
13
|
+
|
|
14
|
+
const AccountOrderMoreInfo = ({
|
|
15
|
+
moreInfoTitle = defaultOrderMoreInfoLabels.moreInfoTitle,
|
|
16
|
+
}: AccountOrderMoreInfoProps) => {
|
|
17
|
+
const { order } = useAccountPageData<AccountOrderDetailsPageData>()
|
|
18
|
+
|
|
19
|
+
const moreInformationCustomFields = order?.customFields?.find(
|
|
20
|
+
(field) => field.type === 'order'
|
|
21
|
+
)?.fields
|
|
22
|
+
|
|
23
|
+
if (!moreInformationCustomFields?.length) {
|
|
24
|
+
return null
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Section className="section-account-order-more-info">
|
|
29
|
+
<MoreInformationCard
|
|
30
|
+
fields={moreInformationCustomFields}
|
|
31
|
+
title={moreInfoTitle}
|
|
32
|
+
/>
|
|
33
|
+
</Section>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
AccountOrderMoreInfo.$componentKey = 'AccountOrderMoreInfo'
|
|
38
|
+
|
|
39
|
+
export default AccountOrderMoreInfo
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import OrderedByCard from 'src/components/account/orders/OrderDetails/OrderedByCard'
|
|
2
|
+
import {
|
|
3
|
+
type OrderOrderedBySectionLabels,
|
|
4
|
+
defaultOrderOrderedByLabels,
|
|
5
|
+
} from 'src/components/account/orders/OrderDetails/orderDetailsLabels'
|
|
6
|
+
import {
|
|
7
|
+
type AccountOrderDetailsPageData,
|
|
8
|
+
useAccountPageData,
|
|
9
|
+
} from 'src/sdk/account/accountPageContext'
|
|
10
|
+
import Section from '../Section'
|
|
11
|
+
|
|
12
|
+
export type AccountOrderOrderedByProps = OrderOrderedBySectionLabels
|
|
13
|
+
|
|
14
|
+
const AccountOrderOrderedBy = ({
|
|
15
|
+
orderedByTitle = defaultOrderOrderedByLabels.orderedByTitle,
|
|
16
|
+
}: AccountOrderOrderedByProps) => {
|
|
17
|
+
const { order } = useAccountPageData<AccountOrderDetailsPageData>()
|
|
18
|
+
|
|
19
|
+
if (!order) {
|
|
20
|
+
return null
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Section className="section-account-order-ordered-by">
|
|
25
|
+
<OrderedByCard
|
|
26
|
+
clientProfileData={order.clientProfileData}
|
|
27
|
+
shopper={order.shopper}
|
|
28
|
+
title={orderedByTitle}
|
|
29
|
+
/>
|
|
30
|
+
</Section>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
AccountOrderOrderedBy.$componentKey = 'AccountOrderOrderedBy'
|
|
35
|
+
|
|
36
|
+
export default AccountOrderOrderedBy
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import PaymentCard from 'src/components/account/orders/OrderDetails/PaymentCard'
|
|
2
|
+
import {
|
|
3
|
+
type OrderPaymentSectionLabels,
|
|
4
|
+
defaultOrderPaymentLabels,
|
|
5
|
+
} from 'src/components/account/orders/OrderDetails/orderDetailsLabels'
|
|
6
|
+
import {
|
|
7
|
+
type AccountOrderDetailsPageData,
|
|
8
|
+
useAccountPageData,
|
|
9
|
+
} from 'src/sdk/account/accountPageContext'
|
|
10
|
+
import Section from '../Section'
|
|
11
|
+
|
|
12
|
+
export type AccountOrderPaymentProps = OrderPaymentSectionLabels
|
|
13
|
+
|
|
14
|
+
const AccountOrderPayment = (props: AccountOrderPaymentProps) => {
|
|
15
|
+
const labels = { ...defaultOrderPaymentLabels, ...props }
|
|
16
|
+
const { order } = useAccountPageData<AccountOrderDetailsPageData>()
|
|
17
|
+
|
|
18
|
+
if (!order) {
|
|
19
|
+
return null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Section className="section-account-order-payment">
|
|
24
|
+
<PaymentCard
|
|
25
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
26
|
+
paymentData={order.paymentData}
|
|
27
|
+
allowCancellation={order.allowCancellation}
|
|
28
|
+
labels={labels}
|
|
29
|
+
/>
|
|
30
|
+
</Section>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
AccountOrderPayment.$componentKey = 'AccountOrderPayment'
|
|
35
|
+
|
|
36
|
+
export default AccountOrderPayment
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import StatusCard from 'src/components/account/orders/OrderDetails/StatusCard'
|
|
2
|
+
import {
|
|
3
|
+
type OrderStatusSectionLabels,
|
|
4
|
+
defaultOrderStatusLabels,
|
|
5
|
+
} from 'src/components/account/orders/OrderDetails/orderDetailsLabels'
|
|
6
|
+
import {
|
|
7
|
+
type AccountOrderDetailsPageData,
|
|
8
|
+
useAccountPageData,
|
|
9
|
+
} from 'src/sdk/account/accountPageContext'
|
|
10
|
+
import type { OrderStatusKey } from 'src/utils/userOrderStatus'
|
|
11
|
+
import Section from '../Section'
|
|
12
|
+
|
|
13
|
+
export type AccountOrderStatusProps = OrderStatusSectionLabels
|
|
14
|
+
|
|
15
|
+
const AccountOrderStatus = ({
|
|
16
|
+
statusTitle = defaultOrderStatusLabels.statusTitle,
|
|
17
|
+
orderPlacedStep = defaultOrderStatusLabels.orderPlacedStep,
|
|
18
|
+
paymentPendingStep = defaultOrderStatusLabels.paymentPendingStep,
|
|
19
|
+
handlingStep = defaultOrderStatusLabels.handlingStep,
|
|
20
|
+
invoicedStep = defaultOrderStatusLabels.invoicedStep,
|
|
21
|
+
deliveredStep = defaultOrderStatusLabels.deliveredStep,
|
|
22
|
+
}: AccountOrderStatusProps) => {
|
|
23
|
+
const { order } = useAccountPageData<AccountOrderDetailsPageData>()
|
|
24
|
+
|
|
25
|
+
if (!order) {
|
|
26
|
+
return null
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Section className="section-account-order-status">
|
|
31
|
+
<StatusCard
|
|
32
|
+
status={order.status as OrderStatusKey}
|
|
33
|
+
creationDate={order.creationDate}
|
|
34
|
+
labels={{
|
|
35
|
+
statusTitle,
|
|
36
|
+
orderPlacedStep,
|
|
37
|
+
paymentPendingStep,
|
|
38
|
+
handlingStep,
|
|
39
|
+
invoicedStep,
|
|
40
|
+
deliveredStep,
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
</Section>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
AccountOrderStatus.$componentKey = 'AccountOrderStatus'
|
|
48
|
+
|
|
49
|
+
export default AccountOrderStatus
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import SummaryCard from 'src/components/account/orders/OrderDetails/SummaryCard'
|
|
2
|
+
import {
|
|
3
|
+
type OrderSummarySectionLabels,
|
|
4
|
+
defaultOrderSummaryLabels,
|
|
5
|
+
} from 'src/components/account/orders/OrderDetails/orderDetailsLabels'
|
|
6
|
+
import {
|
|
7
|
+
type AccountOrderDetailsPageData,
|
|
8
|
+
useAccountPageData,
|
|
9
|
+
} from 'src/sdk/account/accountPageContext'
|
|
10
|
+
import Section from '../Section'
|
|
11
|
+
|
|
12
|
+
export type AccountOrderSummaryProps = OrderSummarySectionLabels
|
|
13
|
+
|
|
14
|
+
const AccountOrderSummary = (props: AccountOrderSummaryProps) => {
|
|
15
|
+
const labels = { ...defaultOrderSummaryLabels, ...props }
|
|
16
|
+
const { order } = useAccountPageData<AccountOrderDetailsPageData>()
|
|
17
|
+
|
|
18
|
+
if (!order) {
|
|
19
|
+
return null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Section className="section-account-order-summary">
|
|
24
|
+
<SummaryCard
|
|
25
|
+
totals={order.totals}
|
|
26
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
27
|
+
transactions={order.paymentData.transactions}
|
|
28
|
+
labels={labels}
|
|
29
|
+
/>
|
|
30
|
+
</Section>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
AccountOrderSummary.$componentKey = 'AccountOrderSummary'
|
|
35
|
+
|
|
36
|
+
export default AccountOrderSummary
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ListOrders } from 'src/components/account/orders/ListOrders'
|
|
2
|
+
import type { ListOrdersSectionLabels } from 'src/components/account/orders/ListOrders/listOrdersLabels'
|
|
3
|
+
import { defaultListOrdersLabels } from 'src/components/account/orders/ListOrders/listOrdersLabels'
|
|
4
|
+
import {
|
|
5
|
+
type AccountOrdersListPageData,
|
|
6
|
+
useAccountPageData,
|
|
7
|
+
} from 'src/sdk/account/accountPageContext'
|
|
8
|
+
import Section from '../Section'
|
|
9
|
+
|
|
10
|
+
export type AccountOrdersListProps = ListOrdersSectionLabels
|
|
11
|
+
|
|
12
|
+
const AccountOrdersList = ({
|
|
13
|
+
pageTitle = defaultListOrdersLabels.pageTitle,
|
|
14
|
+
searchPlaceholder = defaultListOrdersLabels.searchPlaceholder,
|
|
15
|
+
filtersLabel = defaultListOrdersLabels.filtersLabel,
|
|
16
|
+
clearAllLabel = defaultListOrdersLabels.clearAllLabel,
|
|
17
|
+
viewResultsLabel = defaultListOrdersLabels.viewResultsLabel,
|
|
18
|
+
noResultsLabel = defaultListOrdersLabels.noResultsLabel,
|
|
19
|
+
noOrdersLabel = defaultListOrdersLabels.noOrdersLabel,
|
|
20
|
+
startShoppingLabel = defaultListOrdersLabels.startShoppingLabel,
|
|
21
|
+
placedOnLabel = defaultListOrdersLabels.placedOnLabel,
|
|
22
|
+
deliveryByLabel = defaultListOrdersLabels.deliveryByLabel,
|
|
23
|
+
pendingApprovalLabel = defaultListOrdersLabels.pendingApprovalLabel,
|
|
24
|
+
paginationOfLabel = defaultListOrdersLabels.paginationOfLabel,
|
|
25
|
+
previousPageLabel = defaultListOrdersLabels.previousPageLabel,
|
|
26
|
+
nextPageLabel = defaultListOrdersLabels.nextPageLabel,
|
|
27
|
+
viewAllLabel = defaultListOrdersLabels.viewAllLabel,
|
|
28
|
+
viewLessLabel = defaultListOrdersLabels.viewLessLabel,
|
|
29
|
+
fromLabel = defaultListOrdersLabels.fromLabel,
|
|
30
|
+
toLabel = defaultListOrdersLabels.toLabel,
|
|
31
|
+
invalidDateRangeLabel = defaultListOrdersLabels.invalidDateRangeLabel,
|
|
32
|
+
orderPlacedStatus = defaultListOrdersLabels.orderPlacedStatus,
|
|
33
|
+
pendingApprovalStatus = defaultListOrdersLabels.pendingApprovalStatus,
|
|
34
|
+
paymentPendingStatus = defaultListOrdersLabels.paymentPendingStatus,
|
|
35
|
+
paymentApprovedStatus = defaultListOrdersLabels.paymentApprovedStatus,
|
|
36
|
+
paymentDeniedStatus = defaultListOrdersLabels.paymentDeniedStatus,
|
|
37
|
+
readyForDeliveryStatus = defaultListOrdersLabels.readyForDeliveryStatus,
|
|
38
|
+
invoicedStatus = defaultListOrdersLabels.invoicedStatus,
|
|
39
|
+
cancellationRequestedStatus = defaultListOrdersLabels.cancellationRequestedStatus,
|
|
40
|
+
canceledStatus = defaultListOrdersLabels.canceledStatus,
|
|
41
|
+
}: AccountOrdersListProps) => {
|
|
42
|
+
const { listOrders, total, perPage, filters } =
|
|
43
|
+
useAccountPageData<AccountOrdersListPageData>()
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Section className="section-account-orders-list">
|
|
47
|
+
<ListOrders
|
|
48
|
+
listOrders={listOrders}
|
|
49
|
+
total={total}
|
|
50
|
+
perPage={perPage}
|
|
51
|
+
filters={filters}
|
|
52
|
+
labels={{
|
|
53
|
+
pageTitle,
|
|
54
|
+
searchPlaceholder,
|
|
55
|
+
filtersLabel,
|
|
56
|
+
clearAllLabel,
|
|
57
|
+
viewResultsLabel,
|
|
58
|
+
noResultsLabel,
|
|
59
|
+
noOrdersLabel,
|
|
60
|
+
startShoppingLabel,
|
|
61
|
+
placedOnLabel,
|
|
62
|
+
deliveryByLabel,
|
|
63
|
+
pendingApprovalLabel,
|
|
64
|
+
paginationOfLabel,
|
|
65
|
+
previousPageLabel,
|
|
66
|
+
nextPageLabel,
|
|
67
|
+
viewAllLabel,
|
|
68
|
+
viewLessLabel,
|
|
69
|
+
fromLabel,
|
|
70
|
+
toLabel,
|
|
71
|
+
invalidDateRangeLabel,
|
|
72
|
+
orderPlacedStatus,
|
|
73
|
+
pendingApprovalStatus,
|
|
74
|
+
paymentPendingStatus,
|
|
75
|
+
paymentApprovedStatus,
|
|
76
|
+
paymentDeniedStatus,
|
|
77
|
+
readyForDeliveryStatus,
|
|
78
|
+
invoicedStatus,
|
|
79
|
+
cancellationRequestedStatus,
|
|
80
|
+
canceledStatus,
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
</Section>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
AccountOrdersList.$componentKey = 'AccountOrdersList'
|
|
88
|
+
|
|
89
|
+
export default AccountOrdersList
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProfileSection,
|
|
3
|
+
type ProfileSectionLabels,
|
|
4
|
+
} from 'src/components/account/profile'
|
|
5
|
+
import { useAccountPageData } from 'src/sdk/account/accountPageContext'
|
|
6
|
+
import type { AccountProfilePageData } from 'src/sdk/account/accountPageContext'
|
|
7
|
+
import Section from '../Section'
|
|
8
|
+
|
|
9
|
+
export type AccountProfileProps = ProfileSectionLabels
|
|
10
|
+
|
|
11
|
+
const defaultLabels: Required<ProfileSectionLabels> = {
|
|
12
|
+
pageTitle: 'Profile',
|
|
13
|
+
nameLabel: 'Name',
|
|
14
|
+
emailLabel: 'Email',
|
|
15
|
+
idLabel: 'ID',
|
|
16
|
+
createdDateLabel: 'Created date',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const AccountProfile = ({
|
|
20
|
+
pageTitle = defaultLabels.pageTitle,
|
|
21
|
+
nameLabel = defaultLabels.nameLabel,
|
|
22
|
+
emailLabel = defaultLabels.emailLabel,
|
|
23
|
+
idLabel = defaultLabels.idLabel,
|
|
24
|
+
createdDateLabel = defaultLabels.createdDateLabel,
|
|
25
|
+
}: AccountProfileProps) => {
|
|
26
|
+
const { profile } = useAccountPageData<AccountProfilePageData>()
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Section className="section-account-profile">
|
|
30
|
+
<ProfileSection
|
|
31
|
+
profile={profile}
|
|
32
|
+
labels={{
|
|
33
|
+
pageTitle,
|
|
34
|
+
nameLabel,
|
|
35
|
+
emailLabel,
|
|
36
|
+
idLabel,
|
|
37
|
+
createdDateLabel,
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
</Section>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
AccountProfile.$componentKey = 'AccountProfile'
|
|
45
|
+
|
|
46
|
+
export default AccountProfile
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { SecuritySection } from 'src/components/account/security'
|
|
2
|
+
import type { SecuritySectionLabels } from 'src/components/account/security/securityLabels'
|
|
3
|
+
import { defaultSecurityLabels } from 'src/components/account/security/securityLabels'
|
|
4
|
+
import {
|
|
5
|
+
type AccountSecurityPageData,
|
|
6
|
+
useAccountPageData,
|
|
7
|
+
} from 'src/sdk/account/accountPageContext'
|
|
8
|
+
import Section from '../Section'
|
|
9
|
+
|
|
10
|
+
export type AccountSecurityProps = SecuritySectionLabels
|
|
11
|
+
|
|
12
|
+
const AccountSecurity = ({
|
|
13
|
+
pageTitle = defaultSecurityLabels.pageTitle,
|
|
14
|
+
passwordLabel = defaultSecurityLabels.passwordLabel,
|
|
15
|
+
resetPasswordLabel = defaultSecurityLabels.resetPasswordLabel,
|
|
16
|
+
currentPasswordLabel = defaultSecurityLabels.currentPasswordLabel,
|
|
17
|
+
newPasswordLabel = defaultSecurityLabels.newPasswordLabel,
|
|
18
|
+
showPasswordAria = defaultSecurityLabels.showPasswordAria,
|
|
19
|
+
cancelLabel = defaultSecurityLabels.cancelLabel,
|
|
20
|
+
savePasswordLabel = defaultSecurityLabels.savePasswordLabel,
|
|
21
|
+
passwordRulesIntro = defaultSecurityLabels.passwordRulesIntro,
|
|
22
|
+
rule8Chars = defaultSecurityLabels.rule8Chars,
|
|
23
|
+
rule1Uppercase = defaultSecurityLabels.rule1Uppercase,
|
|
24
|
+
rule1Lowercase = defaultSecurityLabels.rule1Lowercase,
|
|
25
|
+
rule1Number = defaultSecurityLabels.rule1Number,
|
|
26
|
+
emailRequiredError = defaultSecurityLabels.emailRequiredError,
|
|
27
|
+
allFieldsRequiredError = defaultSecurityLabels.allFieldsRequiredError,
|
|
28
|
+
samePasswordError = defaultSecurityLabels.samePasswordError,
|
|
29
|
+
passwordUpdatedToast = defaultSecurityLabels.passwordUpdatedToast,
|
|
30
|
+
passwordFailedToast = defaultSecurityLabels.passwordFailedToast,
|
|
31
|
+
}: AccountSecurityProps) => {
|
|
32
|
+
const { userEmail } = useAccountPageData<AccountSecurityPageData>()
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Section className="section-account-security">
|
|
36
|
+
<SecuritySection
|
|
37
|
+
userEmail={userEmail}
|
|
38
|
+
labels={{
|
|
39
|
+
pageTitle,
|
|
40
|
+
passwordLabel,
|
|
41
|
+
resetPasswordLabel,
|
|
42
|
+
currentPasswordLabel,
|
|
43
|
+
newPasswordLabel,
|
|
44
|
+
showPasswordAria,
|
|
45
|
+
cancelLabel,
|
|
46
|
+
savePasswordLabel,
|
|
47
|
+
passwordRulesIntro,
|
|
48
|
+
rule8Chars,
|
|
49
|
+
rule1Uppercase,
|
|
50
|
+
rule1Lowercase,
|
|
51
|
+
rule1Number,
|
|
52
|
+
emailRequiredError,
|
|
53
|
+
allFieldsRequiredError,
|
|
54
|
+
samePasswordError,
|
|
55
|
+
passwordUpdatedToast,
|
|
56
|
+
passwordFailedToast,
|
|
57
|
+
}}
|
|
58
|
+
/>
|
|
59
|
+
</Section>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
AccountSecurity.$componentKey = 'AccountSecurity'
|
|
64
|
+
|
|
65
|
+
export default AccountSecurity
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LinkButton } from '@faststore/ui'
|
|
2
|
+
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
3
|
+
import Section from '../Section'
|
|
4
|
+
|
|
5
|
+
export type AccountUnauthorizedProps = {
|
|
6
|
+
title?: string
|
|
7
|
+
subtitle?: string
|
|
8
|
+
backLabel?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const defaultLabels = {
|
|
12
|
+
title: 'Unauthorized Access',
|
|
13
|
+
subtitle: "You don't have permission to access this page.",
|
|
14
|
+
backLabel: 'Back to Account',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const AccountUnauthorized = ({
|
|
18
|
+
title = defaultLabels.title,
|
|
19
|
+
subtitle = defaultLabels.subtitle,
|
|
20
|
+
backLabel = defaultLabels.backLabel,
|
|
21
|
+
}: AccountUnauthorizedProps) => {
|
|
22
|
+
return (
|
|
23
|
+
<Section className="section-account-unauthorized">
|
|
24
|
+
<EmptyState
|
|
25
|
+
title={title}
|
|
26
|
+
titleIcon={{ icon: 'ShoppingCart', alt: 'Shopping Cart' }}
|
|
27
|
+
subtitle={subtitle}
|
|
28
|
+
showLoader={false}
|
|
29
|
+
>
|
|
30
|
+
<LinkButton variant="secondary" href="/pvt/account">
|
|
31
|
+
{backLabel}
|
|
32
|
+
</LinkButton>
|
|
33
|
+
</EmptyState>
|
|
34
|
+
</Section>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
AccountUnauthorized.$componentKey = 'AccountUnauthorized'
|
|
39
|
+
|
|
40
|
+
export default AccountUnauthorized
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import UserDetails from 'src/components/account/UserDetails/UserDetails'
|
|
2
|
+
import type { UserDetailsSectionLabels } from 'src/components/account/UserDetails/userDetailsLabels'
|
|
3
|
+
import { defaultUserDetailsLabels } from 'src/components/account/UserDetails/userDetailsLabels'
|
|
4
|
+
import {
|
|
5
|
+
type AccountUserDetailsPageData,
|
|
6
|
+
useAccountPageData,
|
|
7
|
+
} from 'src/sdk/account/accountPageContext'
|
|
8
|
+
import Section from '../Section'
|
|
9
|
+
|
|
10
|
+
export type AccountUserDetailsProps = UserDetailsSectionLabels
|
|
11
|
+
|
|
12
|
+
const AccountUserDetails = ({
|
|
13
|
+
pageTitle = defaultUserDetailsLabels.pageTitle,
|
|
14
|
+
nameLabel = defaultUserDetailsLabels.nameLabel,
|
|
15
|
+
usernameLabel = defaultUserDetailsLabels.usernameLabel,
|
|
16
|
+
emailLabel = defaultUserDetailsLabels.emailLabel,
|
|
17
|
+
phoneLabel = defaultUserDetailsLabels.phoneLabel,
|
|
18
|
+
roleLabel = defaultUserDetailsLabels.roleLabel,
|
|
19
|
+
orgUnitLabel = defaultUserDetailsLabels.orgUnitLabel,
|
|
20
|
+
}: AccountUserDetailsProps) => {
|
|
21
|
+
const { userDetails } = useAccountPageData<AccountUserDetailsPageData>()
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Section className="section-account-user-details">
|
|
25
|
+
<UserDetails
|
|
26
|
+
userDetails={userDetails}
|
|
27
|
+
labels={{
|
|
28
|
+
pageTitle,
|
|
29
|
+
nameLabel,
|
|
30
|
+
usernameLabel,
|
|
31
|
+
emailLabel,
|
|
32
|
+
phoneLabel,
|
|
33
|
+
roleLabel,
|
|
34
|
+
orgUnitLabel,
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
</Section>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
AccountUserDetails.$componentKey = 'AccountUserDetails'
|
|
42
|
+
|
|
43
|
+
export default AccountUserDetails
|
|
@@ -41,7 +41,7 @@ export { useShippingSimulation as useShippingSimulation_unstable } from '../../s
|
|
|
41
41
|
export { default as useScreenResize_unstable } from '../../src/sdk/ui/useScreenResize'
|
|
42
42
|
|
|
43
43
|
// Components
|
|
44
|
-
export { OrganizationSignInButton as OrganizationSignInButton_unstable } from '../../src/components/account/
|
|
44
|
+
export { OrganizationSignInButton as OrganizationSignInButton_unstable } from '../../src/components/account/Drawer/OrganizationSignInButton'
|
|
45
45
|
export { ProfileChallenge as ProfileChallenge_unstable } from '../../src/components/auth/ProfileChallenge'
|
|
46
46
|
export { ButtonSignIn as ButtonSignIn_unstable } from '../../src/components/ui/Button'
|
|
47
47
|
|
package/src/pages/_app.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { useRouter } from 'next/router'
|
|
|
6
6
|
import { useSearch } from '@faststore/sdk'
|
|
7
7
|
import { UIProvider } from '@faststore/ui'
|
|
8
8
|
|
|
9
|
-
import { useReloadAfterLogoutReturn } from 'src/components/account/
|
|
9
|
+
import { useReloadAfterLogoutReturn } from 'src/components/account/Drawer/OrganizationDrawer/useReloadAfterLogoutReturn'
|
|
10
10
|
import ThirdPartyScripts from 'src/components/ThirdPartyScripts'
|
|
11
11
|
import Layout from 'src/Layout'
|
|
12
12
|
import AnalyticsHandler from 'src/sdk/analytics'
|