@vtex/faststore-plugin-buyer-portal 1.1.95 → 1.1.97

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.
Files changed (58) hide show
  1. package/package.json +1 -1
  2. package/src/features/addresses/components/AddressLocationsList/AddressLocationsList.tsx +28 -39
  3. package/src/features/addresses/components/AddressRecipientsList/AddressRecipientsList.tsx +42 -42
  4. package/src/features/addresses/layouts/AddressDetailsLayout/address-details-layout.scss +285 -286
  5. package/src/features/addresses/layouts/AddressesLayout/AddressesLayout.tsx +26 -29
  6. package/src/features/addresses/layouts/AddressesLayout/addresses-layout.scss +144 -151
  7. package/src/features/budgets/components/BudgetAllocationsSelection/BudgetAllocationsSelection.tsx +61 -57
  8. package/src/features/budgets/components/BudgetAllocationsSelection/budget-allocations-selection.scss +131 -232
  9. package/src/features/budgets/components/BudgetAllocationsTable/BudgetAllocationsTable.tsx +104 -91
  10. package/src/features/budgets/components/BudgetAllocationsTable/budget-allocations-table.scss +80 -182
  11. package/src/features/budgets/components/BudgetsTable/BudgetsTable.tsx +90 -107
  12. package/src/features/budgets/components/BudgetsTable/budgets-table.scss +128 -126
  13. package/src/features/budgets/layouts/BudgetsLayout/BudgetsLayout.tsx +0 -15
  14. package/src/features/buying-policies/components/AddBuyingPolicyDrawer/AddBuyingPolicyDrawer.tsx +4 -0
  15. package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/BasicBuyingPolicyDrawer.tsx +35 -4
  16. package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/basic-buying-policy-drawer.scss +2 -1
  17. package/src/features/buying-policies/components/BudgetCriteriaSelector/BudgetCriteriaSelector.tsx +113 -0
  18. package/src/features/buying-policies/components/BudgetCriteriaSelector/budget-criteria-selector.scss +139 -0
  19. package/src/features/buying-policies/components/BudgetCriteriaSelector/index.ts +4 -0
  20. package/src/features/buying-policies/components/BuyingPolicyDropdownMenu/BuyingPolicyDropdownMenu.tsx +5 -0
  21. package/src/features/buying-policies/components/UpdateBuyingPolicyDrawer/UpdateBuyingPolicyDrawer.tsx +5 -0
  22. package/src/features/buying-policies/layouts/BuyingPoliciesLayout/BuyingPoliciesLayout.tsx +66 -46
  23. package/src/features/buying-policies/layouts/BuyingPoliciesLayout/buying-policies-layout.scss +64 -70
  24. package/src/features/buying-policies/utils/index.ts +4 -1
  25. package/src/features/buying-policies/utils/orderFieldsCriteriaOptions.ts +12 -9
  26. package/src/features/collections/components/CollectionsTable/CollectionsTable.tsx +12 -18
  27. package/src/features/collections/components/CollectionsTable/collections-table.scss +138 -118
  28. package/src/features/collections/components/table/AddCollectionsDrawerTable.tsx +48 -54
  29. package/src/features/collections/components/table/add-collections-drawer-table.scss +57 -56
  30. package/src/features/credit-cards/layouts/CreditCardsLayout/CreditCardLayout.tsx +55 -61
  31. package/src/features/credit-cards/layouts/CreditCardsLayout/credit-card-layout.scss +63 -153
  32. package/src/features/payment-methods/components/AddPaymentMethodsDrawer/AddPaymentMethodsDrawer.tsx +58 -49
  33. package/src/features/payment-methods/components/AddPaymentMethodsDrawer/add-payment-methods-drawer.scss +58 -63
  34. package/src/features/payment-methods/layouts/PaymentMethodsLayout/PaymentMethodsLayout.tsx +15 -12
  35. package/src/features/roles/layout/RoleDetailsLayout/RoleDetailsLayout.tsx +57 -26
  36. package/src/features/roles/layout/RoleDetailsLayout/role-details-layout.scss +77 -0
  37. package/src/features/roles/layout/RolesLayout/RolesLayout.tsx +4 -12
  38. package/src/features/roles/layout/RolesLayout/roles-layout.scss +8 -22
  39. package/src/features/shared/components/CustomField/table/CustomFieldTable.tsx +67 -110
  40. package/src/features/shared/components/CustomField/table/custom-field-table.scss +39 -144
  41. package/src/features/shared/components/IconBookmarked/IconBookmarked.tsx +9 -0
  42. package/src/features/shared/components/IconBookmarked/icon-bookmarked.scss +9 -0
  43. package/src/features/shared/components/Table/Table.tsx +7 -2
  44. package/src/features/shared/components/Table/TableCell/TableCell.tsx +15 -3
  45. package/src/features/shared/components/Table/TableCell/table-cell.scss +34 -0
  46. package/src/features/shared/components/Table/TableHead/TableHead.tsx +34 -6
  47. package/src/features/shared/components/Table/TableHead/table-head.scss +53 -49
  48. package/src/features/shared/components/Table/TableLoading/TableLoading.tsx +16 -6
  49. package/src/features/shared/components/Table/TableLoading/table-loading.scss +13 -8
  50. package/src/features/shared/components/Table/TableRow/TableRow.tsx +65 -42
  51. package/src/features/shared/components/Table/TableRow/table-row.scss +104 -68
  52. package/src/features/shared/components/Table/table.scss +11 -6
  53. package/src/features/shared/components/Table/utils/tableColumns.ts +30 -33
  54. package/src/features/shared/components/index.ts +1 -0
  55. package/src/features/users/layouts/UsersLayout/UsersLayout.tsx +20 -27
  56. package/src/pages/budgets.tsx +1 -1
  57. package/src/pages/buying-policies.tsx +14 -1
  58. package/src/themes/layouts.scss +1 -0
@@ -10,6 +10,7 @@ import {
10
10
  Paginator,
11
11
  } from "../../../shared/components";
12
12
  import { Table } from "../../../shared/components/Table/Table";
13
+ import { getTableColumns } from "../../../shared/components/Table/utils/tableColumns";
13
14
  import {
14
15
  useBuyerPortal,
15
16
  useDrawerProps,
@@ -21,7 +22,6 @@ import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
21
22
  import { CreateUserDrawer } from "../../components";
22
23
  import { UserDropdownMenu } from "../../components/UserDropdownMenu/UserDropdownMenu";
23
24
 
24
- import type { TableColumn } from "../../../shared/components/Table/TableHead/TableHead";
25
25
  import type { UserData } from "../../types";
26
26
 
27
27
  export type UsersLayoutProps = {
@@ -53,20 +53,19 @@ export const UsersLayout = ({
53
53
  ...createUserDrawerProps
54
54
  } = useDrawerProps();
55
55
 
56
- const configTable: Array<TableColumn> = [
57
- {
58
- key: "name",
59
- label: "Name",
60
- align: "left",
61
- colspan: 2,
62
- },
63
- {
64
- key: "role",
65
- label: "Role",
66
- align: "left",
67
- colspan: 3,
68
- },
69
- ];
56
+ const columns = getTableColumns({
57
+ actionsLength: 1,
58
+ nameColumnSize: "13.5rem",
59
+ extraColumns: [
60
+ {
61
+ key: "role",
62
+ label: "Role",
63
+ size: "100%",
64
+ align: "left",
65
+ hideOnScreenSize: "phonemid",
66
+ },
67
+ ],
68
+ });
70
69
 
71
70
  const rolesCellLayout = (roles?: string[]) => {
72
71
  if (!roles || roles?.length === 0) {
@@ -112,18 +111,11 @@ export const UsersLayout = ({
112
111
  itemsLength={users.length}
113
112
  />
114
113
  </div>
115
- <Table>
116
- <colgroup>
117
- <col style={{ width: "40px" }} />
118
- <col style={{ width: "175px" }} />
119
- <col style={{ width: "100%" }} />
120
- <col style={{ width: "40px" }} />
121
- <col style={{ width: "0" }} />
122
- </colgroup>
123
- <Table.Head columns={configTable} />
114
+ <Table layoutFixed>
115
+ <Table.Head columns={columns} />
124
116
  <Table.Body>
125
117
  {isLoading ? (
126
- <Table.Loading />
118
+ <Table.Loading columns={columns.length} />
127
119
  ) : (
128
120
  items.map((user) => (
129
121
  <Table.Row
@@ -141,9 +133,10 @@ export const UsersLayout = ({
141
133
  rolesOptions={rolesOptions}
142
134
  />
143
135
  }
144
- data-fs-bp-users-item
145
136
  >
146
- <Table.Cell>{rolesCellLayout(user.roles)}</Table.Cell>
137
+ <Table.Cell hideOnScreenSize="phonemid">
138
+ {rolesCellLayout(user.roles)}
139
+ </Table.Cell>
147
140
  </Table.Row>
148
141
  ))
149
142
  )}
@@ -1,6 +1,5 @@
1
1
  import { BudgetsLayout } from "../features/budgets/layouts";
2
2
  import { listBudgetsService } from "../features/budgets/services";
3
- import { BudgetListResponse } from "../features/budgets/types";
4
3
  import { getContractDetailsService } from "../features/contracts/services";
5
4
  import { getOrgUnitBasicDataService } from "../features/org-units/services";
6
5
  import {
@@ -16,6 +15,7 @@ import {
16
15
  } from "../features/shared/utils";
17
16
  import { getUserByIdService } from "../features/users/services";
18
17
 
18
+ import type { BudgetListResponse } from "../features/budgets/types";
19
19
  import type { ContractData } from "../features/contracts/types";
20
20
  import type { OrgUnitBasicData } from "../features/org-units/types";
21
21
  import type { LoaderData } from "../features/shared/types";
@@ -1,3 +1,4 @@
1
+ import { listBudgetsService } from "../features/budgets/services";
1
2
  import { BuyingPoliciesLayout } from "../features/buying-policies/layouts";
2
3
  import { getBuyingPoliciesService } from "../features/buying-policies/services";
3
4
  import { getContractDetailsService } from "../features/contracts/services";
@@ -17,6 +18,7 @@ import {
17
18
  import { getUserByIdService } from "../features/users/services";
18
19
 
19
20
  import type { GetAddressesServiceProps } from "../features/addresses/services";
21
+ import type { BudgetListResponse } from "../features/budgets/types";
20
22
  import type { BuyingPolicy } from "../features/buying-policies/types";
21
23
  import type { ContractData } from "../features/contracts/types";
22
24
  import type { OrgUnitBasicData } from "../features/org-units/types";
@@ -34,6 +36,7 @@ export type BuyingPoliciesPageData = {
34
36
  currentOrgUnit: OrgUnitBasicData | null;
35
37
  currentUser: UserData | null;
36
38
  };
39
+ budgetData?: BudgetListResponse;
37
40
  hasError?: boolean;
38
41
  error?: ErrorBoundaryProps;
39
42
  };
@@ -54,7 +57,7 @@ const loaderFunction = async (
54
57
 
55
58
  const { cookie, userId, ...clientContext } = await getClientContext(data);
56
59
 
57
- const [currentOrgUnit, user, contract, buyingPoliciesResponse] =
60
+ const [currentOrgUnit, user, contract, budgetData, buyingPoliciesResponse] =
58
61
  await Promise.all([
59
62
  getOrgUnitBasicDataService({
60
63
  id: orgUnitId,
@@ -66,6 +69,13 @@ const loaderFunction = async (
66
69
  cookie,
67
70
  unitId: orgUnitId,
68
71
  }),
72
+
73
+ listBudgetsService({
74
+ customerId: clientContext.customerId,
75
+ cookie,
76
+ unitId: orgUnitId,
77
+ }),
78
+
69
79
  getBuyingPoliciesService({
70
80
  orgUnitId,
71
81
  contractId,
@@ -94,6 +104,7 @@ const loaderFunction = async (
94
104
  currentUser: user,
95
105
  currentContract: contract,
96
106
  },
107
+ budgetData: budgetData ?? { data: [], total: 0 },
97
108
  };
98
109
  };
99
110
 
@@ -110,6 +121,7 @@ const BuyingPoliciesPage = ({
110
121
  total,
111
122
  hasError,
112
123
  error,
124
+ budgetData = { data: [], total: 0 },
113
125
  }: BuyingPoliciesPageData) => (
114
126
  <BuyerPortalProvider {...context}>
115
127
  {hasError ? (
@@ -120,6 +132,7 @@ const BuyingPoliciesPage = ({
120
132
  search={search}
121
133
  page={page}
122
134
  total={total}
135
+ budgetData={budgetData}
123
136
  />
124
137
  )}
125
138
  </BuyerPortalProvider>
@@ -40,3 +40,4 @@
40
40
  @import "../features/payment-methods/layouts/PaymentMethodsLayout/payment-methods-layout.scss";
41
41
  // Roles
42
42
  @import "../features/roles/layout/RolesLayout/roles-layout.scss";
43
+ @import "../features/roles/layout/RoleDetailsLayout/role-details-layout.scss";