@vtex/faststore-plugin-buyer-portal 1.3.38 → 1.3.40
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/.github/CODEOWNERS +1 -0
- package/.github/workflows/ci.yml +9 -4
- package/CHANGELOG.md +13 -1
- package/cypress/support/commands.ts +3 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* @b2b-enabler-front
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -34,18 +34,23 @@ jobs:
|
|
|
34
34
|
run: yarn link
|
|
35
35
|
working-directory: ./plugin
|
|
36
36
|
|
|
37
|
+
- name: Install dependencies in b2bfaststoredev.store
|
|
38
|
+
run: yarn install
|
|
39
|
+
working-directory: ./b2bfaststoredev.store
|
|
40
|
+
|
|
37
41
|
- name: Yarn link plugin in b2bfaststoredev.store
|
|
38
42
|
run: yarn link "@vtex/faststore-plugin-buyer-portal"
|
|
39
|
-
working-directory: ./b2bfaststoredev.store
|
|
43
|
+
working-directory: ./b2bfaststoredev.store/packages/discovery
|
|
40
44
|
|
|
41
45
|
- name: Cypress run
|
|
42
46
|
uses: cypress-io/github-action@v6
|
|
43
47
|
with:
|
|
44
|
-
working-directory: ./b2bfaststoredev.store
|
|
48
|
+
working-directory: ./b2bfaststoredev.store/packages/discovery/
|
|
45
49
|
build: yarn build
|
|
46
50
|
start: yarn start
|
|
47
|
-
config-file:
|
|
51
|
+
config-file: node_modules/@vtex/faststore-plugin-buyer-portal/cypress.config.ts
|
|
48
52
|
browser: chrome
|
|
53
|
+
install: false
|
|
49
54
|
env: VTEX_AUTH_TOKEN=${{secrets.VTEX_AUTH_TOKEN}},VTEX_ACCOUNT_LOGIN=${{secrets.VTEX_ACCOUNT_LOGIN}},VTEX_ACCOUNT_PASSWORD=${{secrets.VTEX_ACCOUNT_PASSWORD}}
|
|
50
55
|
|
|
51
56
|
- name: Upload Cypress artifacts
|
|
@@ -53,4 +58,4 @@ jobs:
|
|
|
53
58
|
uses: actions/upload-artifact@v4
|
|
54
59
|
with:
|
|
55
60
|
name: cypress-artifacts
|
|
56
|
-
path: b2bfaststoredev.store/cypress
|
|
61
|
+
path: b2bfaststoredev.store/packages/discovery/cypress
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.40] - 2025-12-09
|
|
11
|
+
|
|
12
|
+
- Fix e2e auth flow
|
|
13
|
+
|
|
14
|
+
## [1.3.39] - 2025-12-09
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Add empty state to Payment Methods
|
|
19
|
+
|
|
10
20
|
## [1.3.38] - 2025-12-08
|
|
11
21
|
|
|
12
22
|
### Added
|
|
@@ -346,7 +356,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
346
356
|
- Add CHANGELOG file
|
|
347
357
|
- Add README file
|
|
348
358
|
|
|
349
|
-
[unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.
|
|
359
|
+
[unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.40...HEAD
|
|
350
360
|
[1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.2.2...1.2.3
|
|
351
361
|
[1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.3
|
|
352
362
|
[1.2.4]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.4
|
|
@@ -388,6 +398,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
388
398
|
> > > > > > > main
|
|
389
399
|
> > > > > > > [1.3.11]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.11
|
|
390
400
|
|
|
401
|
+
[1.3.40]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.39...v1.3.40
|
|
402
|
+
[1.3.39]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.38...v1.3.39
|
|
391
403
|
[1.3.38]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.37...v1.3.38
|
|
392
404
|
[1.3.37]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.36...v1.3.37
|
|
393
405
|
[1.3.36]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.35...v1.3.36
|
|
@@ -19,7 +19,9 @@ Cypress.Commands.add("login", () => {
|
|
|
19
19
|
return new Cypress.Promise((resolve, reject) => {
|
|
20
20
|
cy.visit(auth.LOGIN_URL);
|
|
21
21
|
|
|
22
|
-
cy.get('input[
|
|
22
|
+
cy.get('input[placeholder="Username"]').type(login);
|
|
23
|
+
cy.contains("Continue").click();
|
|
24
|
+
cy.wait(2000);
|
|
23
25
|
cy.get('input[type="password"]').type(password);
|
|
24
26
|
cy.get('button[type="submit"]').click();
|
|
25
27
|
|
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>
|