@vtex/faststore-plugin-buyer-portal 1.3.38 → 1.3.39
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/CHANGELOG.md +8 -1
- package/package.json +1 -1
- package/src/features/payment-methods/layouts/PaymentMethodsLayout/PaymentMethodsLayout.tsx +32 -30
- package/src/features/product-assortment/clients/ProductAssortmentClient.ts +0 -1
- package/src/features/product-assortment/layouts/ProductAssortmentLayout/ProductAssortmentLayout.tsx +54 -34
- package/src/features/shared/utils/constants.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.39] - 2025-12-09
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add empty state to Payment Methods
|
|
15
|
+
|
|
10
16
|
## [1.3.38] - 2025-12-08
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -346,7 +352,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
346
352
|
- Add CHANGELOG file
|
|
347
353
|
- Add README file
|
|
348
354
|
|
|
349
|
-
[unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.
|
|
355
|
+
[unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.39...HEAD
|
|
350
356
|
[1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.2.2...1.2.3
|
|
351
357
|
[1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.3
|
|
352
358
|
[1.2.4]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.4
|
|
@@ -388,6 +394,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
388
394
|
> > > > > > > main
|
|
389
395
|
> > > > > > > [1.3.11]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.11
|
|
390
396
|
|
|
397
|
+
[1.3.39]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.38...v1.3.39
|
|
391
398
|
[1.3.38]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.37...v1.3.38
|
|
392
399
|
[1.3.37]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.36...v1.3.37
|
|
393
400
|
[1.3.36]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.35...v1.3.36
|
package/package.json
CHANGED
|
@@ -45,7 +45,7 @@ export const PaymentMethodsLayout = ({
|
|
|
45
45
|
setSelectedMethod(undefined);
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
const isLastPage = data.paging.pages === page;
|
|
48
|
+
const isLastPage = data.paging.pages === page || data.paging.pages === 0;
|
|
49
49
|
|
|
50
50
|
const {
|
|
51
51
|
isLoading,
|
|
@@ -180,35 +180,37 @@ export const PaymentMethodsLayout = ({
|
|
|
180
180
|
|
|
181
181
|
{renderContent()}
|
|
182
182
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
183
|
+
{!isLoading && paymentMethods.length > 0 && (
|
|
184
|
+
<div data-fs-bp-payment-methods-paginator>
|
|
185
|
+
{data.paging.page > 1 ? (
|
|
186
|
+
<Paginator.NextPageButton
|
|
187
|
+
onClick={decreasePage}
|
|
188
|
+
disabled={isLoading}
|
|
189
|
+
>
|
|
190
|
+
{isLoading ? "Loading" : "Previous Page"}
|
|
191
|
+
</Paginator.NextPageButton>
|
|
192
|
+
) : (
|
|
193
|
+
<></>
|
|
194
|
+
)}
|
|
195
|
+
{!isLastPage ? (
|
|
196
|
+
<Paginator.NextPageButton
|
|
197
|
+
onClick={increasePage}
|
|
198
|
+
disabled={isLoading}
|
|
199
|
+
>
|
|
200
|
+
{isLoading ? "Loading" : "Next Page"}
|
|
201
|
+
</Paginator.NextPageButton>
|
|
202
|
+
) : (
|
|
203
|
+
<></>
|
|
204
|
+
)}
|
|
205
|
+
|
|
206
|
+
<Paginator.Counter
|
|
207
|
+
total={data.paging.total}
|
|
208
|
+
itemsLength={
|
|
209
|
+
isLastPage ? data.paging.total : page * data.paging.perPage
|
|
210
|
+
}
|
|
211
|
+
/>
|
|
212
|
+
</div>
|
|
213
|
+
)}
|
|
212
214
|
|
|
213
215
|
{!isLoading && (
|
|
214
216
|
<p data-fs-bp-payment-methods-search-container-counter-bottom>
|
package/src/features/product-assortment/layouts/ProductAssortmentLayout/ProductAssortmentLayout.tsx
CHANGED
|
@@ -43,7 +43,9 @@ export const ProductAssortmentLayout = ({
|
|
|
43
43
|
page,
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
const isLastPage =
|
|
46
|
+
const isLastPage =
|
|
47
|
+
initialProductAssortment.paging.pages === page ||
|
|
48
|
+
initialProductAssortment.paging.pages === 0;
|
|
47
49
|
|
|
48
50
|
const {
|
|
49
51
|
open: openAddProductAssortmentDrawer,
|
|
@@ -53,6 +55,18 @@ export const ProductAssortmentLayout = ({
|
|
|
53
55
|
|
|
54
56
|
//const enabledAssortment = productAssortment.filter((p) => p.isEnabled);
|
|
55
57
|
const hasAllAssortment = drawerProductAssortment.items.length === 0;
|
|
58
|
+
const isEmpty = productAssortment.length === 0;
|
|
59
|
+
|
|
60
|
+
const renderEmpty = () => (
|
|
61
|
+
<EmptyState
|
|
62
|
+
title="No results found"
|
|
63
|
+
description={
|
|
64
|
+
searchTerm.length > 0
|
|
65
|
+
? "Try using different terms"
|
|
66
|
+
: "No Product Assorments found"
|
|
67
|
+
}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
56
70
|
|
|
57
71
|
return (
|
|
58
72
|
<GlobalLayout>
|
|
@@ -114,41 +128,47 @@ export const ProductAssortmentLayout = ({
|
|
|
114
128
|
/>
|
|
115
129
|
</div>
|
|
116
130
|
|
|
117
|
-
|
|
118
|
-
|
|
131
|
+
{!isLoading && productAssortment.length === 0 ? (
|
|
132
|
+
renderEmpty()
|
|
133
|
+
) : (
|
|
134
|
+
<section>
|
|
135
|
+
<ProductAssortmentTable
|
|
136
|
+
productAssortment={productAssortment}
|
|
137
|
+
/>
|
|
119
138
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
<div data-fs-bp-product-assortment-paginator>
|
|
140
|
+
{initialProductAssortment.paging.page > 1 ? (
|
|
141
|
+
<Paginator.NextPageButton
|
|
142
|
+
onClick={decreasePage}
|
|
143
|
+
disabled={isLoading}
|
|
144
|
+
>
|
|
145
|
+
{isLoading ? "Loading" : "Previous Page"}
|
|
146
|
+
</Paginator.NextPageButton>
|
|
147
|
+
) : (
|
|
148
|
+
<></>
|
|
149
|
+
)}
|
|
150
|
+
{!isLastPage && !isEmpty ? (
|
|
151
|
+
<Paginator.NextPageButton
|
|
152
|
+
onClick={increasePage}
|
|
153
|
+
disabled={isLoading}
|
|
154
|
+
>
|
|
155
|
+
{isLoading ? "Loading" : "Next Page"}
|
|
156
|
+
</Paginator.NextPageButton>
|
|
157
|
+
) : (
|
|
158
|
+
<></>
|
|
159
|
+
)}
|
|
141
160
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
161
|
+
<Paginator.Counter
|
|
162
|
+
total={initialProductAssortment.paging.total}
|
|
163
|
+
itemsLength={
|
|
164
|
+
isLastPage
|
|
165
|
+
? initialProductAssortment.paging.total
|
|
166
|
+
: page * initialProductAssortment.paging.perPage
|
|
167
|
+
}
|
|
168
|
+
/>
|
|
169
|
+
</div>
|
|
170
|
+
</section>
|
|
171
|
+
)}
|
|
152
172
|
</div>
|
|
153
173
|
)}
|
|
154
174
|
</section>
|