@faststore/core 3.75.0 → 3.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +24 -24
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/account/orders.js +1 -1
- package/.next/server/pages/account/security.js +1 -1
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/pages/account/orders-7e9738a62542bd48.js +1 -0
- package/.next/static/chunks/pages/account/security-7d12dd7a4ca973e6.js +1 -0
- package/.next/static/chunks/{webpack-3154bd2292a6ff53.js → webpack-b6bad1900f53d6e6.js} +1 -1
- package/.next/static/css/{3d41485722b4e3f5.css → 38e3a4a55b13b062.css} +1 -1
- package/.next/static/{hFo9Wcpbmu-Dxoo5xhC5c → naUI3eBajLdiLSfzUOpMz}/_buildManifest.js +1 -1
- package/.next/trace +135 -134
- package/.turbo/turbo-build.log +12 -12
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +10 -0
- package/package.json +2 -2
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/MyAccountFilterFacetPlacedBy.tsx +172 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/index.ts +2 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/styles.scss +96 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterSlider.tsx +8 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/section.module.scss +2 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrders.tsx +16 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountSelectedTags/MyAccountSelectedTags.tsx +20 -3
- package/src/components/account/security/SecurityDrawer.tsx +2 -6
- package/src/pages/account/orders/index.tsx +6 -0
- package/src/sdk/account/useSetPassword.ts +59 -48
- package/src/sdk/account/useShopperSuggestions.ts +151 -0
- package/src/sdk/search/useMyAccountFilter.ts +7 -0
- package/.next/static/chunks/pages/account/orders-692ad278b72ea12c.js +0 -1
- package/.next/static/chunks/pages/account/security-8ea4d1e2aba1bfb7.js +0 -1
- /package/.next/static/{hFo9Wcpbmu-Dxoo5xhC5c → naUI3eBajLdiLSfzUOpMz}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.75.1 prebuild /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> na run partytown && na run generate
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@3.
|
|
6
|
+
> @faststore/core@3.75.1 partytown /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> partytown copylib ./public/~partytown
|
|
8
8
|
|
|
9
9
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
10
10
|
|
|
11
|
-
> @faststore/core@3.
|
|
11
|
+
> @faststore/core@3.75.1 generate /home/runner/work/faststore/faststore/packages/core
|
|
12
12
|
> na run generate:schema && na run generate:codegen && na run format:generated
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
> @faststore/core@3.
|
|
15
|
+
> @faststore/core@3.75.1 generate:schema /home/runner/work/faststore/faststore/packages/core
|
|
16
16
|
> tsx src/server/generator/generateGraphQLSchemaFile.ts
|
|
17
17
|
|
|
18
18
|
Schema GraphQL file generated successfully
|
|
19
19
|
|
|
20
|
-
> @faststore/core@3.
|
|
20
|
+
> @faststore/core@3.75.1 generate:codegen /home/runner/work/faststore/faststore/packages/core
|
|
21
21
|
> graphql-codegen
|
|
22
22
|
|
|
23
23
|
[STARTED] Parse Configuration
|
|
@@ -37,11 +37,11 @@ Running lifecycle hook "afterStart" scripts...
|
|
|
37
37
|
[CLI] Loading Documents
|
|
38
38
|
[CLI] Generating output
|
|
39
39
|
|
|
40
|
-
> @faststore/core@3.
|
|
40
|
+
> @faststore/core@3.75.1 format:generated /home/runner/work/faststore/faststore/packages/core
|
|
41
41
|
> prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
> @faststore/core@3.
|
|
44
|
+
> @faststore/core@3.75.1 build /home/runner/work/faststore/faststore/packages/core
|
|
45
45
|
> next build
|
|
46
46
|
|
|
47
47
|
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
|
|
@@ -65,8 +65,8 @@ Browserslist: browsers data (caniuse-lite) is 7 months old. Please run:
|
|
|
65
65
|
Collecting page data ...
|
|
66
66
|
Generating static pages (0/6) ...
|
|
67
67
|
|
|
68
68
|
Generating static pages (1/6)
|
|
69
|
-
Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.
|
|
70
69
|
|
|
71
70
|
Generating static pages (2/6)
|
|
71
|
+
Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.
|
|
72
72
|
|
|
73
73
|
Generating static pages (4/6)
|
|
74
74
|
|
|
75
75
|
✓ Generating static pages (6/6)
|
|
76
76
|
Finalizing page optimization ...
|
|
@@ -89,13 +89,13 @@ Route (pages) Size First Load JS
|
|
|
89
89
|
├ └ css/b7bba8fce075688b.css 4.2 kB
|
|
90
90
|
├ λ /account/404 2.13 kB 138 kB
|
|
91
91
|
├ └ css/5347dbc8b71de47d.css 4.25 kB
|
|
92
|
-
├ λ /account/orders
|
|
93
|
-
├ └ css/
|
|
92
|
+
├ λ /account/orders 10.1 kB 146 kB
|
|
93
|
+
├ └ css/38e3a4a55b13b062.css 12.7 kB
|
|
94
94
|
├ λ /account/orders/[id] 12.1 kB 148 kB
|
|
95
95
|
├ └ css/70353bf19c496790.css 12.6 kB
|
|
96
96
|
├ λ /account/profile 1.79 kB 138 kB
|
|
97
97
|
├ └ css/831a1f72fe4b2d80.css 3.97 kB
|
|
98
|
-
├ λ /account/security 3.
|
|
98
|
+
├ λ /account/security 3.76 kB 140 kB
|
|
99
99
|
├ └ css/ec7fdad03808422d.css 5.22 kB
|
|
100
100
|
├ λ /account/user-details 1.74 kB 138 kB
|
|
101
101
|
├ └ css/e46393a76c5d93a9.css 4.17 kB
|
|
@@ -110,7 +110,7 @@ Route (pages) Size First Load JS
|
|
|
110
110
|
├ chunks/framework-807b0f81cbc129f0.js 45.4 kB
|
|
111
111
|
├ chunks/main-f658704b53a96ab1.js 33.1 kB
|
|
112
112
|
├ chunks/pages/_app-36fb57bc394108e6.js 23.6 kB
|
|
113
|
-
├ chunks/webpack-
|
|
113
|
+
├ chunks/webpack-b6bad1900f53d6e6.js 3.81 kB
|
|
114
114
|
└ css/0a57ee6c7a57788c.css 3.49 kB
|
|
115
115
|
|
|
116
116
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.75.1 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> jest
|
|
4
4
|
|
|
5
|
-
PASS test/server/cms/global.test.ts (
|
|
6
|
-
PASS test/utils/multipleTemplates.test.ts (
|
|
5
|
+
PASS test/server/cms/global.test.ts (26.589 s)
|
|
6
|
+
PASS test/utils/multipleTemplates.test.ts (26.928 s)
|
|
7
7
|
PASS test/server/cms/index.test.ts
|
|
8
|
-
PASS test/server/index.test.ts (
|
|
8
|
+
PASS test/server/index.test.ts (29.677 s)
|
|
9
9
|
|
|
10
10
|
Test Suites: 4 passed, 4 total
|
|
11
11
|
Tests: 22 passed, 22 total
|
|
12
12
|
Snapshots: 0 total
|
|
13
|
-
Time:
|
|
13
|
+
Time: 31.008 s
|
|
14
14
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.76.0](https://github.com/vtex/faststore/compare/v3.75.1...v3.76.0) (2025-08-14)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- order list placed by filter-SFS-2702 ([#2988](https://github.com/vtex/faststore/issues/2988)) ([1c9b557](https://github.com/vtex/faststore/commit/1c9b557a3fd2310ca4d1ffb7fd4135f60a44109d))
|
|
11
|
+
|
|
12
|
+
## [3.75.1](https://github.com/vtex/faststore/compare/v3.75.0...v3.75.1) (2025-08-08)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @faststore/core
|
|
15
|
+
|
|
6
16
|
# [3.75.0](https://github.com/vtex/faststore/compare/v3.74.0...v3.75.0) (2025-08-07)
|
|
7
17
|
|
|
8
18
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.76.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"ts-jest": "29.1.1",
|
|
109
109
|
"typescript": "5.3.2"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "a79eae5d9804c203cec696627ed5751f9df4c528"
|
|
112
112
|
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
2
|
+
import { Input, IconButton, Icon, Loader } from '@faststore/ui'
|
|
3
|
+
import type { SelectedFacet } from 'src/sdk/search/useMyAccountFilter'
|
|
4
|
+
import useShopperSuggestions from 'src/sdk/account/useShopperSuggestions'
|
|
5
|
+
import type { Shopper } from 'src/sdk/account/useShopperSuggestions'
|
|
6
|
+
|
|
7
|
+
export interface MyAccountFilterFacetPlacedByProps {
|
|
8
|
+
/**
|
|
9
|
+
* Current selected facets from filter context
|
|
10
|
+
*/
|
|
11
|
+
selected: SelectedFacet[]
|
|
12
|
+
/**
|
|
13
|
+
* Dispatch from filter context
|
|
14
|
+
*/
|
|
15
|
+
dispatch: (action: { type: 'toggleFacet' | 'setFacet'; payload: any }) => void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function MyAccountFilterFacetPlacedBy({
|
|
19
|
+
selected,
|
|
20
|
+
dispatch,
|
|
21
|
+
}: MyAccountFilterFacetPlacedByProps) {
|
|
22
|
+
const inputRef = useRef<HTMLInputElement>(null)
|
|
23
|
+
const [query, setQuery] = useState('')
|
|
24
|
+
const [selectedShopper, setSelectedShopper] = useState<Shopper | null>(null)
|
|
25
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
26
|
+
|
|
27
|
+
// Use the new hook for shoppers suggestions
|
|
28
|
+
const { data, isLoading, findShopperById } = useShopperSuggestions(query)
|
|
29
|
+
|
|
30
|
+
// Get the filtered shoppers from hook data
|
|
31
|
+
const filteredShoppers = data?.shoppers || []
|
|
32
|
+
|
|
33
|
+
const selectedId = useMemo(
|
|
34
|
+
() => selected.find((f) => f.key === 'purchaseAgentId')?.value,
|
|
35
|
+
[selected]
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
const clearAll = () => {
|
|
39
|
+
setQuery('')
|
|
40
|
+
setSelectedShopper(null)
|
|
41
|
+
if (inputRef.current) inputRef.current.value = ''
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (selectedId && !selectedShopper) {
|
|
46
|
+
const found = findShopperById(selectedId)
|
|
47
|
+
if (found) setSelectedShopper(found)
|
|
48
|
+
} else if (!selectedId) {
|
|
49
|
+
clearAll()
|
|
50
|
+
}
|
|
51
|
+
}, [selectedId, selectedShopper])
|
|
52
|
+
|
|
53
|
+
function handleSearchOnChange(value: string) {
|
|
54
|
+
setQuery(value)
|
|
55
|
+
setIsOpen(true)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const isSearchEmpty = useMemo(
|
|
59
|
+
() => !isLoading && query && filteredShoppers.length === 0,
|
|
60
|
+
[isLoading, query, filteredShoppers]
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
function handleSelect(shopper: Shopper) {
|
|
64
|
+
setSelectedShopper(shopper)
|
|
65
|
+
setIsOpen(false)
|
|
66
|
+
dispatch({
|
|
67
|
+
type: 'setFacet',
|
|
68
|
+
payload: {
|
|
69
|
+
facet: { key: 'purchaseAgentId', value: shopper.purchase_agent_id },
|
|
70
|
+
unique: true,
|
|
71
|
+
},
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function handleClearTag() {
|
|
76
|
+
if (selectedShopper) {
|
|
77
|
+
// Using toggleFacet here removes the purchaseAgentId from selected facets
|
|
78
|
+
// because toggleFacet will remove the facet if it already exists in the selected facets
|
|
79
|
+
dispatch({
|
|
80
|
+
type: 'toggleFacet',
|
|
81
|
+
payload: {
|
|
82
|
+
key: 'purchaseAgentId',
|
|
83
|
+
value: selectedShopper.purchase_agent_id,
|
|
84
|
+
},
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
clearAll()
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<div data-fs-list-orders-filters-placed-by>
|
|
92
|
+
<div data-fs-list-orders-filters-placed-by-input>
|
|
93
|
+
<Input
|
|
94
|
+
id="placed-by-input"
|
|
95
|
+
placeholder="Enter the shopper's name..."
|
|
96
|
+
ref={inputRef}
|
|
97
|
+
value={selectedShopper ? selectedShopper.name : query}
|
|
98
|
+
readOnly={Boolean(selectedShopper)}
|
|
99
|
+
onFocus={() => {
|
|
100
|
+
if (!selectedShopper) setIsOpen(true)
|
|
101
|
+
}}
|
|
102
|
+
onChange={(e) => {
|
|
103
|
+
if (selectedShopper) return
|
|
104
|
+
handleSearchOnChange(e.target.value)
|
|
105
|
+
}}
|
|
106
|
+
onBlur={() => {
|
|
107
|
+
// delay close to allow click selection
|
|
108
|
+
setTimeout(() => {
|
|
109
|
+
setIsOpen(false)
|
|
110
|
+
if (!selectedShopper) {
|
|
111
|
+
setQuery('')
|
|
112
|
+
if (inputRef.current) inputRef.current.value = ''
|
|
113
|
+
}
|
|
114
|
+
}, 100)
|
|
115
|
+
}}
|
|
116
|
+
type="text"
|
|
117
|
+
inputMode="text"
|
|
118
|
+
/>
|
|
119
|
+
{isLoading && (
|
|
120
|
+
<div data-fs-list-orders-filters-placed-by-loader>
|
|
121
|
+
<Loader />
|
|
122
|
+
</div>
|
|
123
|
+
)}
|
|
124
|
+
{selectedShopper && (
|
|
125
|
+
<IconButton
|
|
126
|
+
size="small"
|
|
127
|
+
aria-label="Clear shopper"
|
|
128
|
+
data-fs-list-orders-filters-placed-by-clear
|
|
129
|
+
icon={<Icon name="X" />}
|
|
130
|
+
onClick={handleClearTag}
|
|
131
|
+
/>
|
|
132
|
+
)}
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
{isOpen && isSearchEmpty && (
|
|
136
|
+
<div
|
|
137
|
+
data-fs-list-orders-filters-placed-by-dropdown
|
|
138
|
+
data-fs-list-orders-filters-placed-by-empty
|
|
139
|
+
aria-label="No shoppers found with query"
|
|
140
|
+
>
|
|
141
|
+
<p>No shoppers found with "{query}"</p>
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
|
|
145
|
+
{isOpen && filteredShoppers.length > 0 && (
|
|
146
|
+
<div
|
|
147
|
+
data-fs-list-orders-filters-placed-by-dropdown
|
|
148
|
+
aria-label="Shopper selection dropdown"
|
|
149
|
+
>
|
|
150
|
+
<ul>
|
|
151
|
+
{filteredShoppers.map((s) => (
|
|
152
|
+
<li key={s.purchase_agent_id}>
|
|
153
|
+
<button
|
|
154
|
+
type="button"
|
|
155
|
+
onMouseDown={(e) => e.preventDefault()}
|
|
156
|
+
onClick={() => handleSelect(s)}
|
|
157
|
+
data-fs-list-orders-filters-placed-by-option
|
|
158
|
+
>
|
|
159
|
+
<span data-fs-list-orders-filters-placed-by-option-name>
|
|
160
|
+
{s.name}
|
|
161
|
+
</span>
|
|
162
|
+
</button>
|
|
163
|
+
</li>
|
|
164
|
+
))}
|
|
165
|
+
</ul>
|
|
166
|
+
</div>
|
|
167
|
+
)}
|
|
168
|
+
</div>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export default MyAccountFilterFacetPlacedBy
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
[data-fs-list-orders-filters-placed-by] {
|
|
2
|
+
--fs-list-orders-filters-placed-by-dropdown-bkg : var(--fs-color-neutral-0);
|
|
3
|
+
--fs-list-orders-filters-placed-by-dropdown-border : 1px solid var(--fs-border-color-light);
|
|
4
|
+
--fs-list-orders-filters-placed-by-dropdown-radius : var(--fs-border-radius);
|
|
5
|
+
--fs-list-orders-filters-placed-by-option-padding : var(--fs-spacing-2) var(--fs-spacing-3);
|
|
6
|
+
--fs-list-orders-filters-placed-by-selected-height : var(--fs-control-height);
|
|
7
|
+
--fs-list-orders-filters-placed-by-selected-padding : 0 var(--fs-spacing-3);
|
|
8
|
+
--fs-list-orders-filters-placed-by-selected-border : var(--fs-input-border-width) solid var(--fs-input-border-color);
|
|
9
|
+
--fs-list-orders-filters-placed-by-selected-radius : var(--fs-input-border-radius);
|
|
10
|
+
--fs-list-orders-filters-placed-by-empty-text-color : var(--fs-color-text-light);
|
|
11
|
+
--fs-list-orders-filters-placed-by-loader-size : 1.25rem;
|
|
12
|
+
--fs-list-orders-filters-placed-by-dropdown-shadow : 0 2px 8px rgb(0 0 0 / 10%);
|
|
13
|
+
|
|
14
|
+
position: relative;
|
|
15
|
+
|
|
16
|
+
// Clear icon inside input when actionable
|
|
17
|
+
[data-fs-list-orders-filters-placed-by-input] {
|
|
18
|
+
position: relative;
|
|
19
|
+
|
|
20
|
+
[data-fs-input] {
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[data-fs-icon-button] {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 50%;
|
|
27
|
+
right: var(--fs-spacing-2);
|
|
28
|
+
transform: translateY(-50%);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-fs-list-orders-filters-placed-by-loader] {
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 50%;
|
|
34
|
+
right: var(--fs-spacing-2);
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
transform: translateY(-50%);
|
|
39
|
+
|
|
40
|
+
[data-fs-loader] {
|
|
41
|
+
width: var(--fs-list-orders-filters-placed-by-loader-size);
|
|
42
|
+
height: var(--fs-list-orders-filters-placed-by-loader-size);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[data-fs-list-orders-filters-placed-by-dropdown] {
|
|
48
|
+
position: absolute;
|
|
49
|
+
z-index: 10;
|
|
50
|
+
width: 100%;
|
|
51
|
+
margin-top: var(--fs-spacing-1);
|
|
52
|
+
background: var(--fs-list-orders-filters-placed-by-dropdown-bkg);
|
|
53
|
+
border: var(--fs-list-orders-filters-placed-by-dropdown-border);
|
|
54
|
+
border-radius: var(--fs-list-orders-filters-placed-by-dropdown-radius);
|
|
55
|
+
box-shadow: var(--fs-list-orders-filters-placed-by-dropdown-shadow);
|
|
56
|
+
|
|
57
|
+
&[data-fs-list-orders-filters-placed-by-empty] {
|
|
58
|
+
padding: var(--fs-spacing-3);
|
|
59
|
+
|
|
60
|
+
p {
|
|
61
|
+
margin: 0;
|
|
62
|
+
font-size: var(--fs-text-size-body);
|
|
63
|
+
font-style: italic;
|
|
64
|
+
color: var(--fs-list-orders-filters-placed-by-empty-text-color);
|
|
65
|
+
text-align: center;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
ul {
|
|
70
|
+
max-height: 220px;
|
|
71
|
+
padding: 0;
|
|
72
|
+
margin: 0;
|
|
73
|
+
overflow: auto;
|
|
74
|
+
list-style: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[data-fs-list-orders-filters-placed-by-option] {
|
|
78
|
+
display: flex;
|
|
79
|
+
justify-content: flex-start;
|
|
80
|
+
width: 100%;
|
|
81
|
+
padding: var(--fs-list-orders-filters-placed-by-option-padding);
|
|
82
|
+
text-align: left;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
background: transparent;
|
|
85
|
+
border: 0;
|
|
86
|
+
|
|
87
|
+
&:hover, &:focus {
|
|
88
|
+
background: var(--fs-color-neutral-bkg);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[data-fs-list-orders-filters-placed-by-option-name] {
|
|
92
|
+
font-weight: var(--fs-text-weight-regular);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -13,6 +13,7 @@ import type {
|
|
|
13
13
|
useMyAccountFilter,
|
|
14
14
|
} from 'src/sdk/search/useMyAccountFilter'
|
|
15
15
|
import FilterFacetDateRange from './MyAccountFilterFacetDateRange'
|
|
16
|
+
import FilterFacetPlacedBy from './MyAccountFilterFacetPlacedBy'
|
|
16
17
|
import styles from './section.module.scss'
|
|
17
18
|
|
|
18
19
|
export interface FilterSliderProps {
|
|
@@ -91,6 +92,10 @@ function MyAccountFilterSlider({
|
|
|
91
92
|
: [value]
|
|
92
93
|
}
|
|
93
94
|
|
|
95
|
+
if (key === 'purchaseAgentId') {
|
|
96
|
+
acc['purchaseAgentId'] = value
|
|
97
|
+
}
|
|
98
|
+
|
|
94
99
|
return acc
|
|
95
100
|
},
|
|
96
101
|
{} as Record<string, string | string[]>
|
|
@@ -197,6 +202,9 @@ function MyAccountFilterSlider({
|
|
|
197
202
|
))}
|
|
198
203
|
</UIFilterFacetBoolean>
|
|
199
204
|
)}
|
|
205
|
+
{type === 'StoreFacetPlacedBy' && isExpanded && (
|
|
206
|
+
<FilterFacetPlacedBy selected={selected} dispatch={dispatch} />
|
|
207
|
+
)}
|
|
200
208
|
{type === 'StoreFacetRange' && isExpanded && (
|
|
201
209
|
<FilterFacetDateRange
|
|
202
210
|
ref={dateRangeInputRef}
|
package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/section.module.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.section {
|
|
2
2
|
@import "@faststore/ui/src/components/atoms/Button/styles.scss";
|
|
3
|
+
@import "@faststore/ui/src/components/atoms/Loader/styles.scss";
|
|
3
4
|
@import "@faststore/ui/src/components/atoms/Badge/styles.scss";
|
|
4
5
|
@import "@faststore/ui/src/components/atoms/Checkbox/styles.scss";
|
|
5
6
|
@import "@faststore/ui/src/components/atoms/Icon/styles.scss";
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
@import "@faststore/ui/src/components/organisms/FilterSlider/styles.scss";
|
|
17
18
|
@import "@faststore/ui/src/components/organisms/SlideOver/styles.scss";
|
|
18
19
|
@import "./MyAccountFilterFacetDateRange/styles.scss";
|
|
20
|
+
@import "./MyAccountFilterFacetPlacedBy/styles.scss";
|
|
19
21
|
|
|
20
22
|
[data-fs-badge] {
|
|
21
23
|
display: none;
|
|
@@ -39,6 +39,7 @@ export type MyAccountListOrdersProps = {
|
|
|
39
39
|
dateFinal: string
|
|
40
40
|
text: string
|
|
41
41
|
clientEmail: string
|
|
42
|
+
purchaseAgentId?: string
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -73,6 +74,11 @@ function getSelectedFacets({
|
|
|
73
74
|
key: 'dateFinal',
|
|
74
75
|
value: String(value),
|
|
75
76
|
})
|
|
77
|
+
} else if (filter === 'purchaseAgentId' && value) {
|
|
78
|
+
acc.push({
|
|
79
|
+
key: 'purchaseAgentId',
|
|
80
|
+
value: String(value),
|
|
81
|
+
})
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
return acc
|
|
@@ -96,6 +102,11 @@ function getAllFacets({
|
|
|
96
102
|
value: status.toLowerCase(),
|
|
97
103
|
})),
|
|
98
104
|
},
|
|
105
|
+
{
|
|
106
|
+
__typename: 'StoreFacetPlacedBy',
|
|
107
|
+
key: 'purchaseAgentId',
|
|
108
|
+
label: 'Placed by',
|
|
109
|
+
} as any,
|
|
99
110
|
{
|
|
100
111
|
__typename: 'StoreFacetRange',
|
|
101
112
|
key: 'dateRange',
|
|
@@ -233,6 +244,7 @@ export default function MyAccountListOrders({
|
|
|
233
244
|
status: filters.status,
|
|
234
245
|
dateInitial: filters.dateInitial,
|
|
235
246
|
dateFinal: filters.dateFinal,
|
|
247
|
+
purchaseAgentId: filters.purchaseAgentId,
|
|
236
248
|
}}
|
|
237
249
|
onClearAll={() => {
|
|
238
250
|
window.location.href = '/account/orders'
|
|
@@ -247,6 +259,8 @@ export default function MyAccountListOrders({
|
|
|
247
259
|
} else if (key === 'dateInitial' || key === 'dateFinal') {
|
|
248
260
|
delete updatedFilters.dateInitial
|
|
249
261
|
delete updatedFilters.dateFinal
|
|
262
|
+
} else if (key === 'purchaseAgentId') {
|
|
263
|
+
delete updatedFilters.purchaseAgentId
|
|
250
264
|
} else {
|
|
251
265
|
delete updatedFilters[key]
|
|
252
266
|
}
|
|
@@ -258,6 +272,8 @@ export default function MyAccountListOrders({
|
|
|
258
272
|
} else if (key === 'dateInitial' || key === 'dateFinal') {
|
|
259
273
|
delete updatedFilters.dateInitial
|
|
260
274
|
delete updatedFilters.dateFinal
|
|
275
|
+
} else if (key === 'purchaseAgentId') {
|
|
276
|
+
delete updatedFilters.purchaseAgentId
|
|
261
277
|
} else {
|
|
262
278
|
delete updatedFilters[key]
|
|
263
279
|
}
|
|
@@ -7,10 +7,11 @@ type MyAccountSelectedTagsProps = {
|
|
|
7
7
|
status?: string[]
|
|
8
8
|
dateInitial?: string
|
|
9
9
|
dateFinal?: string
|
|
10
|
+
purchaseAgentId?: string
|
|
10
11
|
}
|
|
11
12
|
onClearAll: () => void
|
|
12
13
|
onRemoveFilter: (
|
|
13
|
-
key: 'status' | 'dateInitial' | 'dateFinal',
|
|
14
|
+
key: 'status' | 'dateInitial' | 'dateFinal' | 'purchaseAgentId',
|
|
14
15
|
value: string
|
|
15
16
|
) => void
|
|
16
17
|
}
|
|
@@ -40,7 +41,7 @@ function Tags({
|
|
|
40
41
|
onRemoveFilter,
|
|
41
42
|
}: Pick<MyAccountSelectedTagsProps, 'filters' | 'onRemoveFilter'>) {
|
|
42
43
|
const { locale } = useSession()
|
|
43
|
-
const { dateInitial, dateFinal, status } = filters
|
|
44
|
+
const { dateInitial, dateFinal, status, purchaseAgentId } = filters
|
|
44
45
|
const formattedDateInitial = dateInitial
|
|
45
46
|
? formatFilterDate(dateInitial, locale)
|
|
46
47
|
: ''
|
|
@@ -85,8 +86,21 @@ function Tags({
|
|
|
85
86
|
</div>
|
|
86
87
|
))
|
|
87
88
|
|
|
89
|
+
const placedByTag = purchaseAgentId && (
|
|
90
|
+
<div key={`placed-by-${purchaseAgentId}`} data-fs-list-orders-selected-tag>
|
|
91
|
+
<span>Placed by: {purchaseAgentId}</span>
|
|
92
|
+
<button
|
|
93
|
+
data-fs-list-orders-selected-tag-clear
|
|
94
|
+
onClick={() => onRemoveFilter('purchaseAgentId', purchaseAgentId)}
|
|
95
|
+
>
|
|
96
|
+
×
|
|
97
|
+
</button>
|
|
98
|
+
</div>
|
|
99
|
+
)
|
|
100
|
+
|
|
88
101
|
return (
|
|
89
102
|
<>
|
|
103
|
+
{placedByTag}
|
|
90
104
|
{dateTag}
|
|
91
105
|
{statusTags}
|
|
92
106
|
</>
|
|
@@ -100,7 +114,10 @@ function MyAccountSelectedTags({
|
|
|
100
114
|
}: MyAccountSelectedTagsProps) {
|
|
101
115
|
const hasFilters = Object.entries(filters).some(
|
|
102
116
|
([key, values]) =>
|
|
103
|
-
(key === 'status' ||
|
|
117
|
+
(key === 'status' ||
|
|
118
|
+
key === 'dateInitial' ||
|
|
119
|
+
key === 'dateFinal' ||
|
|
120
|
+
key === 'purchaseAgentId') &&
|
|
104
121
|
values &&
|
|
105
122
|
(Array.isArray(values) ? values.length > 0 : true)
|
|
106
123
|
)
|
|
@@ -44,7 +44,7 @@ export const SecurityDrawer = ({
|
|
|
44
44
|
|
|
45
45
|
const [formError, setFormError] = useState<string | null>(null)
|
|
46
46
|
|
|
47
|
-
const { setPassword, loading
|
|
47
|
+
const { setPassword, loading } = useSetPassword(accountName)
|
|
48
48
|
|
|
49
49
|
const newPasswordValidations = validations.map((rule) => ({
|
|
50
50
|
label: rule.label,
|
|
@@ -85,15 +85,11 @@ export const SecurityDrawer = ({
|
|
|
85
85
|
newPassword,
|
|
86
86
|
})
|
|
87
87
|
|
|
88
|
-
if (error) {
|
|
89
|
-
throw error
|
|
90
|
-
}
|
|
91
|
-
|
|
92
88
|
if (!data.success) {
|
|
93
89
|
pushToast({
|
|
94
90
|
title: 'Error setting password',
|
|
95
91
|
status: 'ERROR',
|
|
96
|
-
message:
|
|
92
|
+
message: data.message,
|
|
97
93
|
icon: <Icon width={30} height={30} name="CircleWavyWarning" />,
|
|
98
94
|
})
|
|
99
95
|
|
|
@@ -46,6 +46,7 @@ type ListOrdersPageProps = {
|
|
|
46
46
|
dateFinal: string
|
|
47
47
|
text: string
|
|
48
48
|
clientEmail: string
|
|
49
|
+
purchaseAgentId?: string
|
|
49
50
|
}
|
|
50
51
|
} & MyAccountProps
|
|
51
52
|
|
|
@@ -171,6 +172,10 @@ export const getServerSideProps: GetServerSideProps<
|
|
|
171
172
|
const dateFinal = (context.query.dateFinal as string | undefined) || ''
|
|
172
173
|
const text = (context.query.text as string | undefined) || ''
|
|
173
174
|
const clientEmail = (context.query.clientEmail as string | undefined) || ''
|
|
175
|
+
// TODO: Integration: ensure `purchaseAgentId` is mapped to `purchase_agent_id`
|
|
176
|
+
// when calling the OMS API. Keep camelCase across the frontend.
|
|
177
|
+
const purchaseAgentId =
|
|
178
|
+
(context.query.purchaseAgentId as string | undefined) || ''
|
|
174
179
|
|
|
175
180
|
// Map labels from FastStore status to API status
|
|
176
181
|
const groupedStatus = groupOrderStatusByLabel()
|
|
@@ -246,6 +251,7 @@ export const getServerSideProps: GetServerSideProps<
|
|
|
246
251
|
dateFinal,
|
|
247
252
|
text,
|
|
248
253
|
clientEmail,
|
|
254
|
+
purchaseAgentId,
|
|
249
255
|
},
|
|
250
256
|
isRepresentative,
|
|
251
257
|
},
|