@faststore/core 3.64.1 → 3.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +49 -49
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/webpack/client-production/0.pack +0 -0
  6. package/.next/cache/webpack/client-production/index.pack +0 -0
  7. package/.next/cache/webpack/server-production/0.pack +0 -0
  8. package/.next/cache/webpack/server-production/index.pack +0 -0
  9. package/.next/prerender-manifest.js +1 -1
  10. package/.next/prerender-manifest.json +1 -1
  11. package/.next/react-loadable-manifest.json +3 -2
  12. package/.next/routes-manifest.json +1 -1
  13. package/.next/server/chunks/2778.js +1 -1
  14. package/.next/server/chunks/4365.js +1 -0
  15. package/.next/server/chunks/5244.js +1 -0
  16. package/.next/server/chunks/6011.js +2 -2
  17. package/.next/server/chunks/6886.js +1 -1
  18. package/.next/server/chunks/7692.js +1 -1
  19. package/.next/server/chunks/{7819.js → 8130.js} +1 -6
  20. package/.next/server/chunks/83.js +1 -1
  21. package/.next/server/chunks/{1650.js → 8404.js} +1 -6
  22. package/.next/server/chunks/948.js +2 -2
  23. package/.next/server/chunks/9563.js +2 -2
  24. package/.next/server/middleware-build-manifest.js +1 -1
  25. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  26. package/.next/server/pages/404.js.nft.json +1 -1
  27. package/.next/server/pages/500.js.nft.json +1 -1
  28. package/.next/server/pages/[...slug].js +1 -1
  29. package/.next/server/pages/[...slug].js.nft.json +1 -1
  30. package/.next/server/pages/[slug]/p.js +1 -1
  31. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  32. package/.next/server/pages/_app.js.nft.json +1 -1
  33. package/.next/server/pages/_document.js.nft.json +1 -1
  34. package/.next/server/pages/_error.js.nft.json +1 -1
  35. package/.next/server/pages/account/403.js +1 -1
  36. package/.next/server/pages/account/403.js.nft.json +1 -1
  37. package/.next/server/pages/account/404.js +1 -1
  38. package/.next/server/pages/account/404.js.nft.json +1 -1
  39. package/.next/server/pages/account/[...unknown].js.nft.json +1 -1
  40. package/.next/server/pages/account/orders/[id].js +1 -1
  41. package/.next/server/pages/account/orders/[id].js.nft.json +1 -1
  42. package/.next/server/pages/account/orders.js +1 -1
  43. package/.next/server/pages/account/orders.js.nft.json +1 -1
  44. package/.next/server/pages/account/profile.js +1 -1
  45. package/.next/server/pages/account/profile.js.nft.json +1 -1
  46. package/.next/server/pages/account/security.js +1 -1
  47. package/.next/server/pages/account/security.js.nft.json +1 -1
  48. package/.next/server/pages/account/user-details.js +1 -1
  49. package/.next/server/pages/account/user-details.js.nft.json +1 -1
  50. package/.next/server/pages/account.js +1 -1
  51. package/.next/server/pages/account.js.nft.json +1 -1
  52. package/.next/server/pages/api/graphql.js +2 -2
  53. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  54. package/.next/server/pages/api/health/live.js.nft.json +1 -1
  55. package/.next/server/pages/api/health/ready.js.nft.json +1 -1
  56. package/.next/server/pages/api/preview.js.nft.json +1 -1
  57. package/.next/server/pages/checkout.js.nft.json +1 -1
  58. package/.next/server/pages/en-US/404.html +2 -2
  59. package/.next/server/pages/en-US/500.html +2 -2
  60. package/.next/server/pages/en-US/checkout.html +2 -2
  61. package/.next/server/pages/en-US/login.html +2 -2
  62. package/.next/server/pages/en-US/s.html +2 -2
  63. package/.next/server/pages/en-US.html +2 -2
  64. package/.next/server/pages/index.js.nft.json +1 -1
  65. package/.next/server/pages/login.js.nft.json +1 -1
  66. package/.next/server/pages/s.js.nft.json +1 -1
  67. package/.next/server/pages-manifest.json +1 -1
  68. package/.next/static/chunks/{4803.82e70544e5ad3f13.js → 4803.de5b14237d616808.js} +1 -1
  69. package/.next/static/chunks/4949.ea0775ca3029fb98.js +1 -0
  70. package/.next/static/chunks/{7692.a2ae6dca22038761.js → 7692.1597d1d292a09609.js} +1 -1
  71. package/.next/static/chunks/7861.3fe27a385fea2fb7.js +6 -0
  72. package/.next/static/chunks/9173-c1819846b9006c7a.js +1 -0
  73. package/.next/static/chunks/941.80a0abd58f11d696.js +1 -0
  74. package/.next/static/chunks/pages/{[...slug]-72047653203f9fd2.js → [...slug]-0db18c1c0920e8d2.js} +1 -1
  75. package/.next/static/chunks/pages/_app-1c533ab202b7acef.js +1 -0
  76. package/.next/static/chunks/pages/account/403-c791997011f970b6.js +1 -0
  77. package/.next/static/chunks/pages/account/404-74e64bb12e8f5a68.js +1 -0
  78. package/.next/static/chunks/pages/account/orders/[id]-b9feb0c860ff1cec.js +1 -0
  79. package/.next/static/chunks/pages/account/orders-1d8409a8b4b0e581.js +1 -0
  80. package/.next/static/chunks/pages/account/profile-5a919fa02b76a422.js +1 -0
  81. package/.next/static/chunks/pages/account/security-b5ab3d1ecbbea9d9.js +1 -0
  82. package/.next/static/chunks/pages/account/user-details-6f9fe72e02f5c5df.js +1 -0
  83. package/.next/static/chunks/webpack-a24b8ac1ca628dfe.js +1 -0
  84. package/.next/static/css/32b1696118552960.css +1 -0
  85. package/.next/static/css/{84d35f475d0dc928.css → 831a1f72fe4b2d80.css} +1 -1
  86. package/.next/static/css/ba1d8927d8745656.css +1 -0
  87. package/.next/static/css/e46393a76c5d93a9.css +1 -0
  88. package/.next/static/czdZM7l3yYhwzU9FTEtWh/_buildManifest.js +1 -0
  89. package/.next/trace +131 -129
  90. package/.turbo/turbo-build.log +24 -21
  91. package/.turbo/turbo-test.log +5 -5
  92. package/@generated/gql.ts +14 -6
  93. package/@generated/graphql.ts +372 -5
  94. package/@generated/persisted-documents.json +4 -3
  95. package/@generated/schema.graphql +249 -0
  96. package/CHANGELOG.md +6 -0
  97. package/package.json +6 -4
  98. package/public/icons.svg +26 -0
  99. package/src/components/account/MyAccountDrawer/OrganizationDrawer/OrganizationDrawer.tsx +3 -1
  100. package/src/components/account/MyAccountDrawer/OrganizationDrawer/OrganizationDrawerBody.tsx +12 -2
  101. package/src/components/account/MyAccountDrawer/OrganizationSignInButton/OrganizationSignInButton.tsx +7 -1
  102. package/src/components/account/MyAccountLayout/MyAccountLayout.tsx +12 -2
  103. package/src/components/account/MyAccountMenu/styles.scss +1 -1
  104. package/src/components/account/MyAccountUserDetails/MyAccountUserDetails.tsx +61 -0
  105. package/src/components/account/MyAccountUserDetails/index.ts +1 -0
  106. package/src/components/account/MyAccountUserDetails/styles.module.scss +108 -0
  107. package/src/components/account/components/MyAccountTag/MyAccountTag.tsx +13 -0
  108. package/src/components/account/components/MyAccountTag/index.ts +1 -0
  109. package/src/components/account/components/MyAccountTag/styles.scss +23 -0
  110. package/src/components/account/orders/MyAccountOrderDetails/MyAccountBuyingPolicyAlert/MyAccountBuyingPolicyAlert.tsx +153 -0
  111. package/src/components/account/orders/MyAccountOrderDetails/MyAccountBuyingPolicyAlert/index.ts +1 -0
  112. package/src/components/account/orders/MyAccountOrderDetails/MyAccountBuyingPolicyAlert/styles.scss +72 -0
  113. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/MyAccountOrderActionModal.tsx +41 -88
  114. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/index.ts +0 -1
  115. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/styles.module.scss +29 -16
  116. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/MyAccountOrderActions.tsx +54 -107
  117. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/styles.scss +5 -28
  118. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderDetails.tsx +16 -3
  119. package/src/components/account/orders/MyAccountOrderDetails/MyAccountPaymentCard/MyAccountPaymentCard.tsx +1 -3
  120. package/src/components/account/orders/MyAccountOrderDetails/section.module.scss +13 -2
  121. package/src/components/account/profile/i18n.ts +7 -0
  122. package/src/components/account/profile/index.ts +1 -0
  123. package/src/components/account/profile/profile.module.scss +89 -0
  124. package/src/components/account/profile/profile.tsx +63 -0
  125. package/src/components/account/profile/use-date-formatter.ts +25 -0
  126. package/src/components/account/security/SecurityDrawer.tsx +160 -0
  127. package/src/components/account/security/SecuritySection.tsx +45 -0
  128. package/src/components/account/security/index.ts +2 -0
  129. package/src/components/account/security/styles.module.scss +263 -0
  130. package/src/components/navigation/Navbar/Navbar.tsx +4 -1
  131. package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +4 -1
  132. package/src/experimental/myAccountSeverSideProps.ts +9 -0
  133. package/src/pages/account/orders/[id].tsx +61 -5
  134. package/src/pages/account/orders/index.tsx +14 -2
  135. package/src/pages/account/profile.tsx +31 -5
  136. package/src/pages/account/security.tsx +15 -4
  137. package/src/pages/account/user-details.tsx +54 -17
  138. package/src/sdk/account/getIsRepresentative.ts +20 -0
  139. package/src/sdk/account/getMyAccountRoutes.ts +17 -13
  140. package/src/sdk/account/useOrderAuthorization.ts +79 -0
  141. package/src/utils/getCookie.ts +7 -0
  142. package/src/utils/userOrderStatus.ts +4 -0
  143. package/test/server/index.test.ts +3 -0
  144. package/.next/server/chunks/2570.js +0 -1
  145. package/.next/server/chunks/941.js +0 -1
  146. package/.next/static/chunks/4949.58cc42cd6109f59a.js +0 -6
  147. package/.next/static/chunks/9173-94386b70c1626a31.js +0 -1
  148. package/.next/static/chunks/941.6fb7ccae2268ce5d.js +0 -1
  149. package/.next/static/chunks/pages/_app-c3dce4c45c6c6b35.js +0 -1
  150. package/.next/static/chunks/pages/account/403-6f4addf9a9d54a1c.js +0 -1
  151. package/.next/static/chunks/pages/account/404-9e8ca6ee5f981dae.js +0 -1
  152. package/.next/static/chunks/pages/account/orders/[id]-0780c7252aa3283f.js +0 -1
  153. package/.next/static/chunks/pages/account/orders-df4fc9cd58141910.js +0 -1
  154. package/.next/static/chunks/pages/account/profile-adfe3518bdab5463.js +0 -1
  155. package/.next/static/chunks/pages/account/security-ea5c8811b3e6e415.js +0 -1
  156. package/.next/static/chunks/pages/account/user-details-9309d14f4e59f398.js +0 -1
  157. package/.next/static/chunks/webpack-c76f1cac87402029.js +0 -1
  158. package/.next/static/css/506442c818624bd2.css +0 -1
  159. package/.next/static/xxciKxTM3tLvpTyfanFWB/_buildManifest.js +0 -1
  160. package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/useOrderActionModal.ts +0 -38
  161. package/src/sdk/account/useApproveOrder.ts +0 -53
  162. package/src/sdk/account/useRejectOrder.ts +0 -53
  163. /package/.next/static/{xxciKxTM3tLvpTyfanFWB → czdZM7l3yYhwzU9FTEtWh}/_ssgManifest.js +0 -0
@@ -0,0 +1,160 @@
1
+ import { useEffect, useState } from 'react'
2
+ import {
3
+ Button,
4
+ Icon,
5
+ IconButton,
6
+ Input,
7
+ SlideOver,
8
+ SlideOverHeader,
9
+ useFadeEffect,
10
+ } from '@faststore/ui'
11
+
12
+ import styles from './styles.module.scss'
13
+
14
+ type SecurityDrawerProps = {
15
+ isOpen: boolean
16
+ onClose: () => void
17
+ }
18
+
19
+ const validations = [
20
+ { label: '8 characters', test: (v: string) => v.length >= 8 },
21
+ { label: '1 uppercase letter', test: (v: string) => /[A-Z]/.test(v) },
22
+ { label: '1 lowercase letter', test: (v: string) => /[a-z]/.test(v) },
23
+ { label: '1 number', test: (v: string) => /\d/.test(v) },
24
+ ]
25
+
26
+ export const SecurityDrawer = ({ isOpen, onClose }: SecurityDrawerProps) => {
27
+ const { fade, fadeOut } = useFadeEffect()
28
+
29
+ const [currentPassword, setCurrentPassword] = useState('')
30
+ const [showCurrentPassword, setShowCurrentPassword] = useState(false)
31
+
32
+ const [newPassword, setNewPassword] = useState('')
33
+ const [showNewPassword, setShowNewPassword] = useState(false)
34
+
35
+ const newPasswordValidations = validations.map((rule) => ({
36
+ label: rule.label,
37
+ isValid: rule.test(newPassword),
38
+ }))
39
+
40
+ const allValid = newPasswordValidations.every((r) => r.isValid)
41
+
42
+ const handleClose = () => {
43
+ setCurrentPassword('')
44
+ setShowCurrentPassword(false)
45
+ setNewPassword('')
46
+ setShowNewPassword(false)
47
+ onClose()
48
+ }
49
+
50
+ return (
51
+ <SlideOver
52
+ data-fs-security-drawer
53
+ fade={fade}
54
+ onDismiss={fadeOut}
55
+ onTransitionEnd={() => fade === 'out' && handleClose()}
56
+ isOpen={isOpen}
57
+ size="partial"
58
+ direction="rightSide"
59
+ overlayProps={{ className: styles.section }}
60
+ >
61
+ <SlideOverHeader data-fs-security-drawer-header onClose={handleClose}>
62
+ <h1 data-fs-security-drawer-header-title>Reset password</h1>
63
+ </SlideOverHeader>
64
+
65
+ <div data-fs-security-drawer-body>
66
+ <div data-fs-security-drawer-body-form>
67
+ <div data-fs-security-drawer-body-current-password>
68
+ <Input
69
+ data-fs-security-drawer-input
70
+ id="security-drawer-input-current-password"
71
+ type={showCurrentPassword ? 'text' : 'password'}
72
+ placeholder="Current Password"
73
+ inputMode="text"
74
+ value={currentPassword}
75
+ onChange={(e) => setCurrentPassword(e.target.value)}
76
+ />
77
+ <IconButton
78
+ data-fs-security-drawer-input-password-toggle
79
+ size="small"
80
+ aria-label="Show Password"
81
+ onClick={() => setShowCurrentPassword((prev) => !prev)}
82
+ icon={
83
+ showCurrentPassword ? (
84
+ <Icon name="EyeSlash" />
85
+ ) : (
86
+ <Icon name="Eye" />
87
+ )
88
+ }
89
+ />
90
+ </div>
91
+
92
+ <div data-fs-security-drawer-body-new-password>
93
+ <Input
94
+ data-fs-security-drawer-input
95
+ id="security-drawer-input-new-password"
96
+ type={showNewPassword ? 'text' : 'password'}
97
+ placeholder="New Password"
98
+ inputMode="text"
99
+ value={newPassword}
100
+ onChange={(e) => setNewPassword(e.target.value)}
101
+ />
102
+ <IconButton
103
+ data-fs-security-drawer-input-password-toggle
104
+ size="small"
105
+ aria-label="Show Password"
106
+ onClick={() => setShowNewPassword((prev) => !prev)}
107
+ icon={
108
+ showNewPassword ? <Icon name="EyeSlash" /> : <Icon name="Eye" />
109
+ }
110
+ />
111
+ </div>
112
+
113
+ {newPassword.length > 0 && (
114
+ <div data-fs-security-drawer-input-password-rules-container>
115
+ <p data-fs-security-drawer-input-password-rules-title>
116
+ Your password must have at least:
117
+ </p>
118
+
119
+ <ul data-fs-security-drawer-input-password-rules-list>
120
+ {newPasswordValidations.map((rule, index) => (
121
+ <li
122
+ key={index}
123
+ data-fs-security-drawer-input-password-rule-item
124
+ data-status={rule.isValid ? 'success' : 'error'}
125
+ >
126
+ <Icon
127
+ name={rule.isValid ? 'CheckCircle' : 'XCircle'}
128
+ width={20}
129
+ height={20}
130
+ />
131
+ {rule.label}
132
+ </li>
133
+ ))}
134
+ </ul>
135
+ </div>
136
+ )}
137
+ </div>
138
+ </div>
139
+
140
+ <footer data-fs-security-drawer-footer>
141
+ <Button variant="tertiary" onClick={handleClose}>
142
+ Cancel
143
+ </Button>
144
+
145
+ <Button
146
+ data-fs-security-drawer-footer-button
147
+ variant="primary"
148
+ disabled={!currentPassword || !newPassword || !allValid}
149
+ onClick={() => {
150
+ // TODO: Handle password save logic here
151
+ console.log('Saving new password')
152
+ handleClose()
153
+ }}
154
+ >
155
+ Save Password
156
+ </Button>
157
+ </footer>
158
+ </SlideOver>
159
+ )
160
+ }
@@ -0,0 +1,45 @@
1
+ import { useState } from 'react'
2
+ import { Button } from '@faststore/ui'
3
+
4
+ import { SecurityDrawer } from './SecurityDrawer'
5
+ import styles from './styles.module.scss'
6
+
7
+ export const SecuritySection = () => {
8
+ const [isDrawerOpen, setIsDrawerOpen] = useState(false)
9
+ return (
10
+ <>
11
+ {isDrawerOpen && (
12
+ <SecurityDrawer
13
+ isOpen={isDrawerOpen}
14
+ onClose={() => setIsDrawerOpen(false)}
15
+ />
16
+ )}
17
+
18
+ <section data-fs-securiry-section className={styles.section}>
19
+ <header data-fs-security-header>
20
+ <h1 data-fs-security-title>Security</h1>
21
+ </header>
22
+
23
+ <div data-fs-security-container>
24
+ <table data-fs-security-table>
25
+ <tbody data-fs-security-table-body>
26
+ <tr data-fs-security-table-row>
27
+ <th data-fs-security-table-heading>Password</th>
28
+ <td data-fs-security-table-data>
29
+ <span data-fs-security-table-data-text>••••••••••</span>
30
+ <Button
31
+ variant="tertiary"
32
+ data-fs-security-table-action-button
33
+ onClick={() => setIsDrawerOpen(true)}
34
+ >
35
+ Reset password
36
+ </Button>
37
+ </td>
38
+ </tr>
39
+ </tbody>
40
+ </table>
41
+ </div>
42
+ </section>
43
+ </>
44
+ )
45
+ }
@@ -0,0 +1,2 @@
1
+ export * from './SecuritySection'
2
+ export * from './SecurityDrawer'
@@ -0,0 +1,263 @@
1
+ @layer components {
2
+ .section {
3
+ @import "@faststore/ui/src/components/atoms/Overlay/styles.scss";
4
+ @import "@faststore/ui/src/components/atoms/Button/styles.scss";
5
+ @import "@faststore/ui/src/components/atoms/Input/styles.scss";
6
+ @import "@faststore/ui/src/components/atoms/Icon/styles.scss";
7
+ @import "@faststore/ui/src/components/organisms/SlideOver/styles.scss";
8
+
9
+ // --------------------------------------------------------
10
+ // Design Tokens
11
+ // --------------------------------------------------------
12
+
13
+ // Default properties
14
+ --fs-security-drawer-color-error: #940303;
15
+ --fs-security-drawer-color-success: #015132;
16
+
17
+ // --------------------------------------------------------
18
+ // Structural Styles
19
+ // --------------------------------------------------------
20
+
21
+ [data-fs-security-drawer] {
22
+ display: flex;
23
+ flex-direction: column;
24
+ }
25
+
26
+ [data-fs-security-drawer-header] {
27
+ display: flex;
28
+ align-items: center;
29
+ justify-content: space-between;
30
+ width: 100%;
31
+ border-bottom: var(--fs-border-width) solid var(--fs-border-color-light);
32
+ }
33
+
34
+ [data-fs-security-drawer-header-title] {
35
+ font-size: var(--fs-text-size-3);
36
+ font-weight: var(--fs-text-weight-bold);
37
+ color: var(--fs-color-text);
38
+ }
39
+
40
+ [data-fs-security-drawer-body] {
41
+ display: flex;
42
+ flex: 1;
43
+ flex-direction: column;
44
+ gap: var(--fs-spacing-6);
45
+ padding: var(--fs-spacing-6);
46
+ }
47
+
48
+ [data-fs-security-drawer-body-form] {
49
+ display: flex;
50
+ flex-direction: column;
51
+ gap: var(--fs-spacing-3);
52
+ }
53
+
54
+ [data-fs-security-drawer-footer] {
55
+ display: flex;
56
+ gap: var(--fs-spacing-2);
57
+ align-items: center;
58
+ justify-content: center;
59
+ padding: var(--fs-spacing-3);
60
+ border-top: var(--fs-border-width) solid var(--fs-border-color-light);
61
+ }
62
+
63
+ [data-fs-security-drawer-input] {
64
+ width: 100%;
65
+ padding: var(--fs-spacing-2);
66
+ padding-right: var(--fs-spacing-8);
67
+ font-size: var(--fs-text-size-2);
68
+ font-weight: var(--fs-text-weight-regular);
69
+ }
70
+
71
+ [data-fs-security-drawer-input-password-rules-container] {
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: var(--fs-spacing-2);
75
+ padding-block: var(--fs-spacing-2);
76
+ }
77
+
78
+ [data-fs-security-drawer-input-password-rules-title] {
79
+ margin-bottom: var(--fs-spacing-2);
80
+ font-size: var(--fs-text-size-1);
81
+ font-weight: var(--fs-text-weight-semibold);
82
+ color: var(--fs-color-text-light);
83
+ }
84
+
85
+ [data-fs-security-drawer-input-password-rules-list] {
86
+ display: grid;
87
+ grid-template-columns: 1fr 1fr;
88
+ gap: var(--fs-spacing-1);
89
+ padding: 0;
90
+ list-style: none;
91
+ }
92
+
93
+ [data-fs-security-drawer-input-password-rule-item] {
94
+ display: flex;
95
+ gap: var(--fs-spacing-1);
96
+ align-items: center;
97
+ font-size: var(--fs-text-size-1);
98
+ font-weight: var(--fs-text-weight-regular);
99
+ color: var(--fs-color-danger-text);
100
+ }
101
+
102
+ [data-fs-security-drawer-input-password-rule-item][data-status="success"] {
103
+ color: var(--fs-security-drawer-color-success);
104
+ }
105
+
106
+ [data-fs-security-drawer-input-password-rule-item][data-status="error"] {
107
+ color: var(--fs-security-drawer-color-error);
108
+ }
109
+
110
+ [data-fs-security-drawer-body-info] {
111
+ display: flex;
112
+ gap: var(--fs-spacing-1);
113
+ align-items: center;
114
+ padding-block: var(--fs-spacing-2);
115
+ font-size: var(--fs-text-size-1);
116
+ font-weight: var(--fs-text-weight-regular);
117
+ color: var(--fs-color-text-light);
118
+ }
119
+
120
+ [data-fs-security-drawer-resend] {
121
+ font-size: var(--fs-text-size-1);
122
+ font-weight: var(--fs-text-weight-regular);
123
+ color: var(--fs-color-text-light);
124
+ }
125
+
126
+ [data-fs-security-drawer-body-new-password] {
127
+ position: relative;
128
+ display: flex;
129
+ flex-direction: column;
130
+ gap: var(--fs-spacing-1);
131
+ width: 100%;
132
+ }
133
+
134
+ [data-fs-security-drawer-body-current-password] {
135
+ position: relative;
136
+ display: flex;
137
+ flex-direction: column;
138
+ gap: var(--fs-spacing-1);
139
+ width: 100%;
140
+ }
141
+
142
+ [data-fs-security-drawer-input-password-toggle] {
143
+ position: absolute;
144
+ top: 50%;
145
+ right: 0;
146
+ z-index: 1;
147
+ display: flex;
148
+ align-items: center;
149
+ justify-content: center;
150
+ width: 2rem;
151
+ height: 2rem;
152
+ cursor: pointer;
153
+ background-color: transparent;
154
+ border-radius: 50%;
155
+ transform: translateY(-50%);
156
+ }
157
+
158
+ display: flex;
159
+ flex-direction: column;
160
+ gap: var(--fs-spacing-6);
161
+
162
+ [data-fs-security-header] {
163
+ padding-block: var(--fs-spacing-6);
164
+ padding-inline: var(--fs-spacing-11);
165
+ }
166
+
167
+ [data-fs-security-title] {
168
+ font-family: var(--fs-text-face-title);
169
+ font-size: var(--fs-text-size-3);
170
+ font-weight: var(--fs-text-weight-semibold);
171
+ }
172
+
173
+ [data-fs-security-container] {
174
+ display: flex;
175
+ flex-direction: column;
176
+ gap: var(--fs-spacing-6);
177
+ }
178
+
179
+ [data-fs-security-table] {
180
+ display: grid;
181
+ grid-template-columns: minmax(11.25rem, auto) 1fr;
182
+ width: 100%;
183
+ padding-inline: var(--fs-spacing-11);
184
+ border-spacing: 0;
185
+ border-collapse: collapse;
186
+ }
187
+
188
+ [data-fs-security-table-body] {
189
+ display: contents;
190
+ }
191
+
192
+ [data-fs-security-table-row] {
193
+ display: contents;
194
+ border-bottom: var(--fs-border-width) solid var(--fs-border-color-light);
195
+ }
196
+
197
+ [data-fs-security-table-heading] {
198
+ display: flex;
199
+ align-items: center;
200
+ padding-block: var(--fs-spacing-4);
201
+ font-family: var(--fs-text-face-body);
202
+ font-size: var(--fs-text-size-2);
203
+ font-weight: var(--fs-text-weight-regular);
204
+ color: var(--fs-color-text-light);
205
+ text-align: left;
206
+ border-bottom: var(--fs-border-width) solid var(--fs-border-color-light);
207
+ }
208
+
209
+ [data-fs-security-table-data] {
210
+ display: flex;
211
+ align-items: center;
212
+ justify-content: space-between;
213
+ padding-block: var(--fs-spacing-4);
214
+ padding-inline: var(--fs-spacing-1);
215
+ border-bottom: var(--fs-border-width) solid var(--fs-border-color-light);
216
+
217
+ [data-fs-security-table-data-text] {
218
+ padding-block: var(--fs-spacing-4);
219
+ padding-inline: var(--fs-spacing-1);
220
+ font-family: var(--fs-text-face-body);
221
+ font-size: var(--fs-text-size-2);
222
+ font-weight: var(--fs-text-weight-semibold);
223
+ color: var(--fs-color-text);
224
+ }
225
+ }
226
+
227
+ [data-fs-security-table-action] {
228
+ display: flex;
229
+ align-items: center;
230
+ justify-content: flex-end;
231
+ padding-inline: var(--fs-spacing-1);
232
+ }
233
+
234
+ @include media("<notebook") {
235
+ [data-fs-security-header] {
236
+ padding-inline: var(--fs-spacing-4);
237
+ }
238
+
239
+ [data-fs-security-body] {
240
+ padding-inline: var(--fs-spacing-4);
241
+ }
242
+
243
+ [data-fs-security-table] {
244
+ grid-template-columns: 1fr;
245
+ }
246
+
247
+ [data-fs-security-table-heading] {
248
+ padding-block: var(--fs-spacing-4) 0;
249
+ border-bottom: none;
250
+ }
251
+
252
+ [data-fs-security-table-data] {
253
+ padding-block: var(--fs-spacing-1) var(--fs-spacing-4);
254
+ padding-inline: 0;
255
+ }
256
+
257
+ [data-fs-security-drawer-footer] {
258
+ align-items: center;
259
+ justify-content: flex-end;
260
+ }
261
+ }
262
+ }
263
+ }
@@ -188,7 +188,10 @@ function Navbar({
188
188
  )}
189
189
  {!isMobile &&
190
190
  (isOrganizationEnabled ? (
191
- <OrganizationSignInButton icon={signInButton.icon} />
191
+ <OrganizationSignInButton
192
+ icon={signInButton.icon}
193
+ isRepresentative={isRepresentative}
194
+ />
192
195
  ) : (
193
196
  <ButtonSignIn.Component {...signInButton} />
194
197
  ))}
@@ -77,7 +77,10 @@ function NavbarSlider({
77
77
  <NavbarSliderFooter.Component {...NavbarSliderFooter.props}>
78
78
  <Suspense fallback={<ButtonSignInFallback />}>
79
79
  {isOrganizationEnabled ? (
80
- <OrganizationSignInButton icon={signInButton.icon} />
80
+ <OrganizationSignInButton
81
+ icon={signInButton.icon}
82
+ isRepresentative={isRepresentative}
83
+ />
81
84
  ) : (
82
85
  <ButtonSignIn.Component {...signInButton} />
83
86
  )}
@@ -11,14 +11,17 @@ import {
11
11
  getGlobalSectionsData,
12
12
  } from 'src/components/cms/GlobalSections'
13
13
  import { execute } from 'src/server'
14
+ import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
14
15
 
15
16
  import { injectGlobalSections } from 'src/server/cms/global'
16
17
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
17
18
  import { validateUser } from 'src/sdk/account/validateUser'
19
+ import storeConfig from '../../discovery.config'
18
20
 
19
21
  export type MyAccountProps = {
20
22
  globalSections: GlobalSectionsData
21
23
  accountName: string
24
+ isRepresentative?: boolean
22
25
  }
23
26
 
24
27
  const query = gql(`
@@ -43,6 +46,11 @@ export const getServerSideProps: GetServerSideProps<
43
46
  }
44
47
  }
45
48
 
49
+ const isRepresentative = getIsRepresentative({
50
+ headers: context.req.headers as Record<string, string>,
51
+ account: storeConfig.api.storeId,
52
+ })
53
+
46
54
  const { isFaststoreMyAccountEnabled, redirect } = getMyAccountRedirect({
47
55
  query: context.query,
48
56
  })
@@ -84,6 +92,7 @@ export const getServerSideProps: GetServerSideProps<
84
92
  props: {
85
93
  globalSections: globalSectionsResult,
86
94
  accountName: account.data.accountName,
95
+ isRepresentative,
87
96
  },
88
97
  }
89
98
  }
@@ -11,17 +11,19 @@ import type { MyAccountProps } from 'src/experimental/myAccountSeverSideProps'
11
11
  import { validateUser } from 'src/sdk/account/validateUser'
12
12
 
13
13
  import { gql } from '@generated'
14
- import type {
15
- ServerOrderDetailsQueryQuery,
16
- ServerOrderDetailsQueryQueryVariables,
17
- } from '@generated/graphql'
18
14
  import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
19
15
  import { default as AfterSection } from 'src/customizations/src/myAccount/extensions/orders/[id]/after'
20
16
  import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/orders/[id]/before'
17
+ import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
21
18
  import { execute } from 'src/server'
22
19
  import { injectGlobalSections } from 'src/server/cms/global'
23
20
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
24
21
  import { extractStatusFromError } from 'src/utils/utilities'
22
+ import storeConfig from '../../../../discovery.config'
23
+ import type {
24
+ ServerOrderDetailsQueryQuery,
25
+ ServerOrderDetailsQueryQueryVariables,
26
+ } from '@generated/graphql'
25
27
 
26
28
  const COMPONENTS: Record<string, ComponentType<any>> = {
27
29
  ...GLOBAL_COMPONENTS,
@@ -36,6 +38,7 @@ export default function OrderDetailsPage({
36
38
  globalSections,
37
39
  order,
38
40
  accountName,
41
+ isRepresentative,
39
42
  }: OrderDetailsPageProps) {
40
43
  return (
41
44
  <RenderSections
@@ -44,7 +47,10 @@ export default function OrderDetailsPage({
44
47
  >
45
48
  <NextSeo noindex nofollow />
46
49
 
47
- <MyAccountLayout accountName={accountName}>
50
+ <MyAccountLayout
51
+ isRepresentative={isRepresentative}
52
+ accountName={accountName}
53
+ >
48
54
  <BeforeSection />
49
55
  <MyAccountOrderDetails order={order} />
50
56
  <AfterSection />
@@ -73,8 +79,52 @@ const query = gql(`
73
79
  userOrder(orderId: $orderId) {
74
80
  orderId
75
81
  status
82
+ canProcessOrderAuthorization
76
83
  statusDescription
77
84
  allowCancellation
85
+ ruleForAuthorization {
86
+ orderAuthorizationId
87
+ dimensionId
88
+ rule {
89
+ id
90
+ name
91
+ status
92
+ doId
93
+ authorizedEmails
94
+ priority
95
+ trigger {
96
+ condition {
97
+ conditionType
98
+ description
99
+ lessThan
100
+ greatherThan
101
+ expression
102
+ }
103
+ effect {
104
+ description
105
+ effectType
106
+ funcPath
107
+ }
108
+ }
109
+ timeout
110
+ notification
111
+ scoreInterval {
112
+ accept
113
+ deny
114
+ }
115
+ authorizationData {
116
+ requireAllApprovals
117
+ authorizers {
118
+ id
119
+ email
120
+ type
121
+ authorizationDate
122
+ }
123
+ }
124
+ isUserAuthorized
125
+ isUserNextAuthorizer
126
+ }
127
+ }
78
128
  storePreferencesData {
79
129
  currencyCode
80
130
  }
@@ -217,6 +267,11 @@ export const getServerSideProps: GetServerSideProps<
217
267
  }
218
268
  }
219
269
 
270
+ const isRepresentative = getIsRepresentative({
271
+ headers: context.req.headers as Record<string, string>,
272
+ account: storeConfig.api.storeId,
273
+ })
274
+
220
275
  const { isFaststoreMyAccountEnabled, redirect } = getMyAccountRedirect({
221
276
  query: context.query,
222
277
  })
@@ -281,6 +336,7 @@ export const getServerSideProps: GetServerSideProps<
281
336
  globalSections: globalSectionsResult,
282
337
  order: orderDetails.data.userOrder,
283
338
  accountName: orderDetails.data.accountName,
339
+ isRepresentative,
284
340
  },
285
341
  }
286
342
  }
@@ -23,8 +23,10 @@ import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
23
23
  import { groupOrderStatusByLabel } from 'src/utils/userOrderStatus'
24
24
 
25
25
  import { MyAccountListOrders } from 'src/components/account/orders/MyAccountListOrders'
26
- import { extractStatusFromError } from 'src/utils/utilities'
26
+ import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
27
+ import storeConfig from '../../../../discovery.config'
27
28
  import { validateUser } from 'src/sdk/account/validateUser'
29
+ import { extractStatusFromError } from 'src/utils/utilities'
28
30
 
29
31
  /* A list of components that can be used in the CMS. */
30
32
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -53,6 +55,7 @@ export default function ListOrdersPage({
53
55
  total,
54
56
  perPage,
55
57
  filters,
58
+ isRepresentative,
56
59
  }: ListOrdersPageProps) {
57
60
  return (
58
61
  <RenderSections
@@ -61,7 +64,10 @@ export default function ListOrdersPage({
61
64
  >
62
65
  <NextSeo noindex nofollow />
63
66
 
64
- <MyAccountLayout accountName={accountName}>
67
+ <MyAccountLayout
68
+ isRepresentative={isRepresentative}
69
+ accountName={accountName}
70
+ >
65
71
  <BeforeSection />
66
72
  <MyAccountListOrders
67
73
  listOrders={listOrders}
@@ -130,6 +136,11 @@ export const getServerSideProps: GetServerSideProps<
130
136
  }
131
137
  }
132
138
 
139
+ const isRepresentative = getIsRepresentative({
140
+ headers: context.req.headers as Record<string, string>,
141
+ account: storeConfig.api.storeId,
142
+ })
143
+
133
144
  const { previewData } = context
134
145
 
135
146
  const { isFaststoreMyAccountEnabled, redirect } = getMyAccountRedirect({
@@ -233,6 +244,7 @@ export const getServerSideProps: GetServerSideProps<
233
244
  text,
234
245
  clientEmail,
235
246
  },
247
+ isRepresentative,
236
248
  },
237
249
  }
238
250
  }