@vtex/faststore-plugin-buyer-portal 1.3.14 → 1.3.16-experimental.20251103194517

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,69 @@
1
+ # This Action runs on experimental branch and publishes an experimental version to npm
2
+ name: CD Beta
3
+
4
+ on:
5
+ push:
6
+ branches:
7
+ - beta
8
+
9
+ jobs:
10
+ build:
11
+ name: BuyerPortal Beta
12
+ timeout-minutes: 15
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - name: Check out code
17
+ uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 2
20
+
21
+ - name: Setup Node.js environment
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: 20
25
+ cache: "yarn"
26
+ registry-url: "https://registry.npmjs.org"
27
+
28
+ - name: Configure CI Git User
29
+ run: |
30
+ git config user.name vtexgithubbot
31
+ git config user.email vtexgithubbot@github.com
32
+
33
+ - name: Install dependencies
34
+ run: yarn
35
+
36
+ - name: Get current version
37
+ id: get_version
38
+ run: |
39
+ CURRENT_VERSION=$(node -p "require('./package.json').version")
40
+ echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
41
+
42
+ - name: Generate experimental version
43
+ id: generate_version
44
+ run: |
45
+ # Extract base version (remove any existing prerelease suffix)
46
+ BASE_VERSION=$(echo "${{ steps.get_version.outputs.current_version }}" | sed -E 's/(-.*)?$//')
47
+ # Generate timestamp-based identifier
48
+ TIMESTAMP=$(date +%Y%m%d%H%M%S)
49
+ # Create experimental version
50
+ EXPERIMENTAL_VERSION="${BASE_VERSION}-experimental.${TIMESTAMP}"
51
+ echo "experimental_version=$EXPERIMENTAL_VERSION" >> $GITHUB_OUTPUT
52
+ echo "Publishing experimental version: $EXPERIMENTAL_VERSION"
53
+
54
+ - name: Update package.json version
55
+ run: |
56
+ npm version ${{ steps.generate_version.outputs.experimental_version }} --no-git-tag-version
57
+
58
+ - name: Publish experimental version
59
+ run: yarn publish --non-interactive --tag experimental
60
+ env:
61
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62
+
63
+ - name: Push changes and tags
64
+ run: |
65
+ git config user.email "vtexgithubbot@github.com"
66
+ git config user.name "vtexgithubbot"
67
+ git add package.json
68
+ git commit -m "chore: publish experimental version ${{ steps.generate_version.outputs.experimental_version }}" || echo "No changes to commit"
69
+ git push origin experimental || echo "No changes to push"
package/CHANGELOG.md CHANGED
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ - Create BETA publish flow
13
+
14
+ ## [1.3.16] - 2025-11-03
15
+
16
+ ### Added
17
+
18
+ - Add rename and delete options to dropdown
19
+
20
+ ## [1.3.15] - 2025-11-03
21
+
22
+ ### Added
23
+
24
+ - Disable default button for inactive credit card
25
+
10
26
  ## [1.3.14] - 2025-11-03
11
27
 
12
28
  ### Fixed
@@ -15,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
31
 
16
32
  ## [1.3.13] - 2025-11-03
17
33
 
34
+ ### Fixed
35
+
18
36
  - Setup OTLP to send log events on error boundary
19
37
 
20
38
  ## [1.3.12] - 2025-10-30
@@ -181,7 +199,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
181
199
  - Add CHANGELOG file
182
200
  - Add README file
183
201
 
184
- [unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.14...HEAD
202
+ [unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.16...HEAD
185
203
  [1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.2.2...1.2.3
186
204
  [1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.3
187
205
  [1.2.4]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.4
@@ -196,6 +214,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
196
214
 
197
215
  # <<<<<<< HEAD
198
216
 
217
+ [1.3.16]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.15...v1.3.16
218
+ [1.3.15]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.14...v1.3.15
199
219
  [1.3.14]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.13...v1.3.14
200
220
  [1.3.13]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.12...v1.3.13
201
221
  [1.3.12]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.11...v1.3.12
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+
3
+ BRANCH_NAME="beta"
4
+
5
+ echo "Attempting to checkout branch: $BRANCH_NAME"
6
+
7
+ git fetch --all
8
+
9
+ echo "Delete current $BRANCH_NAME"
10
+ git branch -D "$BRANCH_NAME"
11
+
12
+ echo "Create branch $BRANCH_NAME"
13
+ git checkout -b "$BRANCH_NAME"
14
+
15
+ git add .
16
+
17
+ echo "Update $BRANCH_NAME"
18
+ git commit -m "Update BETA environment"
19
+
20
+ git push --set-upstream origin +$BRANCH_NAME
21
+
22
+ echo "Go back to previous branch on local workspace"
23
+ git checkout -
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/faststore-plugin-buyer-portal",
3
- "version": "1.3.14",
3
+ "version": "1.3.16-experimental.20251103194517",
4
4
  "description": "A plugin for faststore with buyer portal",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,7 +8,8 @@
8
8
  "lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
9
9
  "prepare": "husky",
10
10
  "release": "yarn release:stable",
11
- "release:stable": "yarn check --integrity && yarn release-it -c .release-it.json --ci --no-npm"
11
+ "release:stable": "yarn check --integrity && yarn release-it -c .release-it.json --ci --no-npm",
12
+ "release:beta": "./beta-release.sh"
12
13
  },
13
14
  "lint-staged": {
14
15
  "*.{js,jsx,ts,tsx}": [
@@ -114,17 +114,18 @@ export const CreditCardDropdownMenu = ({
114
114
  Rename
115
115
  </DropdownItem> */}
116
116
 
117
- {currentCreditCard.isDefault ? (
118
- <DropdownItem onClick={handleUnsetAsDefault}>
119
- <Icon name="BookmarkRemove" {...sizeProps} />
120
- Unset as default
121
- </DropdownItem>
122
- ) : (
123
- <DropdownItem onClick={handleSetAsDefault}>
124
- <Icon name="BookmarkAdd" {...sizeProps} />
125
- Set as default
126
- </DropdownItem>
127
- )}
117
+ {currentCreditCard.isActive &&
118
+ (currentCreditCard.isDefault ? (
119
+ <DropdownItem onClick={handleUnsetAsDefault}>
120
+ <Icon name="BookmarkRemove" {...sizeProps} />
121
+ Unset as default
122
+ </DropdownItem>
123
+ ) : (
124
+ <DropdownItem onClick={handleSetAsDefault}>
125
+ <Icon name="BookmarkAdd" {...sizeProps} />
126
+ Set as default
127
+ </DropdownItem>
128
+ ))}
128
129
 
129
130
  {/* Precisamos controlar scope com um toggle pra credit card devido a suas particularidades */}
130
131
  {/* <DropdownItem onClick={openRemoveDrawer}>
@@ -134,7 +135,7 @@ export const CreditCardDropdownMenu = ({
134
135
  {
135
136
  // isRootLevelOrgUnit && ( TODO: Put again when we validate the delete rule
136
137
  <>
137
- <BasicDropdownMenu.Separator />
138
+ {currentCreditCard.isActive && <BasicDropdownMenu.Separator />}
138
139
 
139
140
  <DropdownItem
140
141
  onClick={openDeleteDrawer}
@@ -97,7 +97,14 @@ export const CreditCardLayout = ({ data }: CreditCardsLayoutProps) => {
97
97
  aria-label="is contract active"
98
98
  defaultChecked={creditCard.isActive}
99
99
  onChange={(event) => {
100
+ updateItemsFromRefetch(
101
+ creditCards.map((c) =>
102
+ c === creditCard ? { ...c, isActive: !c.isActive } : c
103
+ )
104
+ );
105
+
100
106
  creditCard.isActive = !creditCard.isActive;
107
+
101
108
  handleCardChangeStatus(
102
109
  event,
103
110
  creditCard.accountId,
@@ -2,6 +2,11 @@ import { useState } from "react";
2
2
 
3
3
  import { DropdownItem } from "@faststore/ui";
4
4
 
5
+ import {
6
+ CreateOrgUnitDrawer,
7
+ DeleteOrgUnitDrawer,
8
+ UpdateOrgUnitDrawer,
9
+ } from "..";
5
10
  import { CreateAddressDrawer } from "../../../addresses/components";
6
11
  import { CreateBudgetDrawer } from "../../../budgets/components/CreateBudgetDrawer/CreateBudgetDrawer";
7
12
  import { AddBuyingPolicyDrawer } from "../../../buying-policies/components";
@@ -14,7 +19,6 @@ import { useGetRolesOptions } from "../../../roles/hooks";
14
19
  import { BasicDropdownMenu, Icon } from "../../../shared/components";
15
20
  import { useDrawerProps } from "../../../shared/hooks";
16
21
  import { CreateUserDrawer } from "../../../users/components";
17
- import { CreateOrgUnitDrawer } from "../CreateOrgUnitDrawer/CreateOrgUnitDrawer";
18
22
 
19
23
  export type AddAllToOrgUnitDropdownProps = {
20
24
  isSingleContract: boolean;
@@ -60,6 +64,12 @@ export const AddAllToOrgUnitDropdown = ({
60
64
  setCustomField(customField);
61
65
  }
62
66
 
67
+ const {
68
+ open: openUpdateDrawer,
69
+ isOpen: isOpenUpdateDrawer,
70
+ ...updateDrawerProps
71
+ } = useDrawerProps();
72
+
63
73
  const {
64
74
  open: openAddressDrawer,
65
75
  isOpen: isOpenAddressDrawer,
@@ -84,6 +94,12 @@ export const AddAllToOrgUnitDropdown = ({
84
94
  ...buyingPolicyDrawerProps
85
95
  } = useDrawerProps();
86
96
 
97
+ const {
98
+ open: openDeleteDrawer,
99
+ isOpen: isOpenDeleteDrawer,
100
+ ...deleteDrawerProps
101
+ } = useDrawerProps();
102
+
87
103
  return (
88
104
  <>
89
105
  <BasicDropdownMenu align={align}>
@@ -95,6 +111,12 @@ export const AddAllToOrgUnitDropdown = ({
95
111
  Add contract
96
112
  </DropdownItem> */}
97
113
 
114
+ <DropdownItem onClick={openUpdateDrawer}>
115
+ <Icon name="FormatSize" {...sizeProps} />
116
+ Rename
117
+ </DropdownItem>
118
+ <BasicDropdownMenu.Separator />
119
+
98
120
  {isSingleContract && (
99
121
  <>
100
122
  <DropdownItem onClick={openAddressDrawer}>
@@ -149,6 +171,16 @@ export const AddAllToOrgUnitDropdown = ({
149
171
  <Icon name="Rebase" {...sizeProps} />
150
172
  Add buying policy
151
173
  </DropdownItem>
174
+
175
+ <BasicDropdownMenu.Separator />
176
+
177
+ <DropdownItem
178
+ onClick={openDeleteDrawer}
179
+ data-fs-bp-dropdown-menu-item-mode="danger"
180
+ >
181
+ <Icon name="Delete" {...sizeProps} />
182
+ Delete
183
+ </DropdownItem>
152
184
  </BasicDropdownMenu>
153
185
 
154
186
  {isOpenCreditCardDrawer && (
@@ -215,6 +247,23 @@ export const AddAllToOrgUnitDropdown = ({
215
247
  contractId={contractId}
216
248
  />
217
249
  )}
250
+ {isOpenUpdateDrawer && (
251
+ <UpdateOrgUnitDrawer
252
+ readonly
253
+ id={unitId}
254
+ name={unitName}
255
+ {...updateDrawerProps}
256
+ isOpen={isOpenUpdateDrawer}
257
+ />
258
+ )}
259
+ {isOpenDeleteDrawer && (
260
+ <DeleteOrgUnitDrawer
261
+ id={unitId}
262
+ name={unitName}
263
+ {...deleteDrawerProps}
264
+ isOpen={isOpenDeleteDrawer}
265
+ />
266
+ )}
218
267
  </>
219
268
  );
220
269
  };
@@ -25,7 +25,6 @@ import {
25
25
  AddAllToOrgUnitDropdown,
26
26
  OrgUnitBreadcrumb,
27
27
  OrgUnitDetailsNavbar,
28
- OrgUnitsDropdownMenu,
29
28
  } from "../../components";
30
29
  import { useOrgUnitByUser } from "../../hooks";
31
30
 
@@ -104,14 +103,6 @@ export const OrgUnitsDetailsLayout = ({
104
103
  />
105
104
  )}
106
105
 
107
- <Dropdown>
108
- <BasicDropdownMenu.Trigger />
109
- <OrgUnitsDropdownMenu
110
- isComplete={false}
111
- id={orgUnit.id}
112
- name={orgUnit.name}
113
- />
114
- </Dropdown>
115
106
  <Dropdown>
116
107
  <DropdownButton asChild>
117
108
  <HeaderInside.Button />
@@ -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.14";
16
+ export const CURRENT_VERSION = "1.3.16";