@vtex/faststore-plugin-buyer-portal 1.3.14 → 1.3.16

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 CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.3.16] - 2025-11-03
11
+
12
+ ### Added
13
+
14
+ - Add rename and delete options to dropdown
15
+
16
+ ## [1.3.15] - 2025-11-03
17
+
18
+ ### Added
19
+
20
+ - Disable default button for inactive credit card
21
+
10
22
  ## [1.3.14] - 2025-11-03
11
23
 
12
24
  ### Fixed
@@ -15,6 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
27
 
16
28
  ## [1.3.13] - 2025-11-03
17
29
 
30
+ ### Fixed
31
+
18
32
  - Setup OTLP to send log events on error boundary
19
33
 
20
34
  ## [1.3.12] - 2025-10-30
@@ -181,7 +195,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
181
195
  - Add CHANGELOG file
182
196
  - Add README file
183
197
 
184
- [unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.14...HEAD
198
+ [unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.16...HEAD
185
199
  [1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.2.2...1.2.3
186
200
  [1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.3
187
201
  [1.2.4]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.4
@@ -196,6 +210,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
196
210
 
197
211
  # <<<<<<< HEAD
198
212
 
213
+ [1.3.16]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.15...v1.3.16
214
+ [1.3.15]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.14...v1.3.15
199
215
  [1.3.14]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.13...v1.3.14
200
216
  [1.3.13]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.12...v1.3.13
201
217
  [1.3.12]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.11...v1.3.12
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",
4
4
  "description": "A plugin for faststore with buyer portal",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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";