@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.
@@ -0,0 +1 @@
1
+ /* @b2b-enabler-front
@@ -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: ../plugin/cypress.config.ts
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.38...HEAD
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[type="text"]').type(login);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/faststore-plugin-buyer-portal",
3
- "version": "1.3.38",
3
+ "version": "1.3.40",
4
4
  "description": "A plugin for faststore with buyer portal",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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
- <div data-fs-bp-payment-methods-paginator>
184
- {data.paging.page > 1 ? (
185
- <Paginator.NextPageButton
186
- onClick={decreasePage}
187
- disabled={isLoading}
188
- >
189
- {isLoading ? "Loading" : "Previous Page"}
190
- </Paginator.NextPageButton>
191
- ) : (
192
- <></>
193
- )}
194
- {!isLastPage ? (
195
- <Paginator.NextPageButton
196
- onClick={increasePage}
197
- disabled={isLoading}
198
- >
199
- {isLoading ? "Loading" : "Next Page"}
200
- </Paginator.NextPageButton>
201
- ) : (
202
- <></>
203
- )}
204
-
205
- <Paginator.Counter
206
- total={data.paging.total}
207
- itemsLength={
208
- isLastPage ? data.paging.total : page * data.paging.perPage
209
- }
210
- />
211
- </div>
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>
@@ -29,7 +29,6 @@ export class ProductAssortmentClient extends Client {
29
29
  headers: { Cookie: cookie },
30
30
  params: {
31
31
  ...(name ? { name } : undefined),
32
- filterByScope: true,
33
32
  ...(page ? { page } : undefined),
34
33
  },
35
34
  }
@@ -43,7 +43,9 @@ export const ProductAssortmentLayout = ({
43
43
  page,
44
44
  });
45
45
 
46
- const isLastPage = initialProductAssortment.paging.pages === page;
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
- <section>
118
- <ProductAssortmentTable productAssortment={productAssortment} />
131
+ {!isLoading && productAssortment.length === 0 ? (
132
+ renderEmpty()
133
+ ) : (
134
+ <section>
135
+ <ProductAssortmentTable
136
+ productAssortment={productAssortment}
137
+ />
119
138
 
120
- <div data-fs-bp-product-assortment-paginator>
121
- {initialProductAssortment.paging.page > 1 ? (
122
- <Paginator.NextPageButton
123
- onClick={decreasePage}
124
- disabled={isLoading}
125
- >
126
- {isLoading ? "Loading" : "Previous Page"}
127
- </Paginator.NextPageButton>
128
- ) : (
129
- <></>
130
- )}
131
- {!isLastPage ? (
132
- <Paginator.NextPageButton
133
- onClick={increasePage}
134
- disabled={isLoading}
135
- >
136
- {isLoading ? "Loading" : "Next Page"}
137
- </Paginator.NextPageButton>
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
- <Paginator.Counter
143
- total={initialProductAssortment.paging.total}
144
- itemsLength={
145
- isLastPage
146
- ? initialProductAssortment.paging.total
147
- : page * initialProductAssortment.paging.perPage
148
- }
149
- />
150
- </div>
151
- </section>
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>
@@ -13,4 +13,4 @@ export const LOCAL_STORAGE_LOCATION_EDIT_KEY = "bp_hide_edit_location_confirm";
13
13
  export const LOCAL_STORAGE_RECIPIENT_EDIT_KEY =
14
14
  "bp_hide_edit_recipient_confirm";
15
15
 
16
- export const CURRENT_VERSION = "1.3.38";
16
+ export const CURRENT_VERSION = "1.3.40";