@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
@@ -0,0 +1,139 @@
1
+ [data-fs-bp-budget-criteria-selector] {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ margin: 0;
8
+ background-color: #f5f5f5;
9
+ border: var(--fs-border-width) solid #d6d6d6;
10
+ border-radius: calc(var(--fs-border-radius) * 2);
11
+ display: flex;
12
+ flex-direction: column;
13
+ align-items: flex-start;
14
+
15
+ [data-fs-bp-budget-criteria-string] {
16
+ font-family: "Roboto", monospace;
17
+ font-size: var(--fs-text-size-1);
18
+ color: #5c5c5c;
19
+ display: flex;
20
+ align-items: center;
21
+ padding: var(--fs-spacing-3) var(--fs-spacing-3);
22
+ gap: 0;
23
+ flex-wrap: wrap;
24
+ width: 100%;
25
+
26
+ > span {
27
+ white-space: nowrap;
28
+ }
29
+
30
+ [data-fs-bp-editable-part] {
31
+ cursor: pointer;
32
+ transition: background-color 0.2s ease;
33
+ padding: 0.125rem 0 0.25rem;
34
+ border-radius: calc(var(--fs-border-radius) * 0.5);
35
+
36
+ &:hover {
37
+ background-color: #f5f5f5;
38
+ color: #1f1f1f;
39
+ }
40
+ }
41
+
42
+ [data-fs-bp-custom-dropdown] {
43
+ display: inline-flex;
44
+
45
+ [data-fs-bp-custom-dropdown-trigger] {
46
+ color: #b521b6;
47
+ border: none;
48
+ min-width: 0;
49
+ border-radius: calc(var(--fs-border-radius) * 1.5);
50
+ font-family: "Roboto", monospace;
51
+ font-size: calc(var(--fs-text-size-1) * 0.9);
52
+ padding: 0;
53
+ cursor: pointer;
54
+ transition: background-color 0.2s ease;
55
+ background-color: transparent;
56
+
57
+ &:hover {
58
+ background-color: #f5f5f5;
59
+ }
60
+ }
61
+
62
+ [data-fs-bp-custom-dropdown-menu] {
63
+ position: absolute;
64
+ top: 100%;
65
+ left: 0;
66
+ margin-top: var(--fs-spacing-1);
67
+ padding: var(--fs-spacing-1) 0;
68
+ background-color: #fff;
69
+ box-shadow: 0rem 0.5rem 0.625rem 0rem rgba(0, 0, 0, 0.0784313725);
70
+ max-height: 15rem;
71
+ min-width: 20rem;
72
+ overflow-y: auto;
73
+ z-index: 1;
74
+ border-radius: calc(var(--fs-border-radius) * 2);
75
+
76
+ &::-webkit-scrollbar {
77
+ width: 0.75rem;
78
+ height: 0.75rem;
79
+ background-color: #fff;
80
+ }
81
+
82
+ &::-webkit-scrollbar-thumb {
83
+ background-color: #adadad;
84
+ border: 0.25rem solid transparent;
85
+ border-radius: 0.375rem;
86
+ background-clip: content-box;
87
+ }
88
+
89
+ [data-fs-bp-custom-dropdown-item] {
90
+ padding: var(--fs-spacing-2) var(--fs-spacing-3);
91
+ cursor: pointer;
92
+ border-bottom: var(--fs-border-width) solid #f0f0f0;
93
+
94
+ &:last-child {
95
+ border-bottom: none;
96
+ }
97
+
98
+ &:hover,
99
+ &[data-focused="true"] {
100
+ background-color: #ebebeb;
101
+ }
102
+
103
+ [data-fs-bp-dropdown-option] {
104
+ font-family: Inter;
105
+
106
+ [data-fs-bp-dropdown-option-label] {
107
+ font-weight: var(--fs-text-weight-semibold);
108
+ color: #1f1f1f;
109
+ font-size: var(--fs-text-size-1);
110
+ margin-bottom: var(--fs-spacing-0);
111
+ }
112
+
113
+ [data-fs-bp-dropdown-option-uuid] {
114
+ font-size: var(--fs-text-size-0);
115
+ color: #5c5c5c;
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ [data-fs-bp-custom-value-indicator] {
124
+ font-size: calc(var(--fs-text-size-0) * 0.85);
125
+ color: #666666;
126
+ font-style: italic;
127
+ padding: 0 var(--fs-spacing-3) calc(var(--fs-spacing-1) * 0.5);
128
+ border-top: 0.0625rem solid #e0e0e0;
129
+ margin-top: auto;
130
+ width: 100%;
131
+ background-color: #fafafa;
132
+ border-radius: 0 0 calc(var(--fs-border-radius) * 2)
133
+ calc(var(--fs-border-radius) * 2);
134
+ }
135
+
136
+ [data-fs-bp-budget-value] {
137
+ color: #b521b6;
138
+ }
139
+ }
@@ -0,0 +1,4 @@
1
+ export {
2
+ BudgetCriteriaSelector,
3
+ type BudgetCriteriaSelectorProps,
4
+ } from "./BudgetCriteriaSelector";
@@ -7,11 +7,14 @@ import { BasicDropdownMenu, Icon } from "../../../shared/components";
7
7
  import { useBuyerPortal, useDrawerProps } from "../../../shared/hooks";
8
8
  import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
9
9
 
10
+ import type { BudgetListResponse } from "../../../budgets/types";
11
+
10
12
  export type BuyingPolicyDropdownMenuProps = {
11
13
  id: string;
12
14
  name: string;
13
15
  onDelete?: () => void;
14
16
  onUpdate?: () => void;
17
+ budgetData?: BudgetListResponse;
15
18
  };
16
19
 
17
20
  export const BuyingPolicyDropdownMenu = ({
@@ -19,6 +22,7 @@ export const BuyingPolicyDropdownMenu = ({
19
22
  name,
20
23
  onDelete,
21
24
  onUpdate,
25
+ budgetData = { data: [], total: 0 },
22
26
  }: BuyingPolicyDropdownMenuProps) => {
23
27
  const { currentContract, currentOrgUnit } = useBuyerPortal();
24
28
 
@@ -80,6 +84,7 @@ export const BuyingPolicyDropdownMenu = ({
80
84
  contractId={currentContract?.id ?? ""}
81
85
  buyingPolicyId={id}
82
86
  onUpdate={onUpdate}
87
+ budgetData={budgetData}
83
88
  {...updateBuyingPolicyDrawerProps}
84
89
  isOpen={isUpdateBuyingPolicyDrawerOpen}
85
90
  />
@@ -7,6 +7,8 @@ import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
7
7
  import { useGetBuyingPolicy, useUpdateBuyingPolicy } from "../../hooks";
8
8
  import { buyingPolicyDefault } from "../../utils";
9
9
 
10
+ import type { BudgetListResponse } from "../../../budgets/types";
11
+
10
12
  export type UpdateBuyingPolicyDrawerProps = Omit<
11
13
  BasicBuyingPolicyDrawerProps,
12
14
  "children" | "initialValues"
@@ -15,6 +17,7 @@ export type UpdateBuyingPolicyDrawerProps = Omit<
15
17
  orgUnitId: string;
16
18
  contractId: string;
17
19
  buyingPolicyId: string;
20
+ budgetData?: BudgetListResponse;
18
21
  };
19
22
 
20
23
  export const UpdateBuyingPolicyDrawer = ({
@@ -23,6 +26,7 @@ export const UpdateBuyingPolicyDrawer = ({
23
26
  orgUnitId,
24
27
  contractId,
25
28
  buyingPolicyId,
29
+ budgetData = { data: [], total: 0 },
26
30
  ...props
27
31
  }: UpdateBuyingPolicyDrawerProps) => {
28
32
  const { buyingPolicy, isBuyingPolicyLoading } = useGetBuyingPolicy(
@@ -93,6 +97,7 @@ export const UpdateBuyingPolicyDrawer = ({
93
97
  initialValues={{ ...buyingPolicyDefault, ...(buyingPolicy ?? {}) }}
94
98
  orgUnitId={orgUnitId}
95
99
  contractId={contractId}
100
+ budgetData={budgetData}
96
101
  {...props}
97
102
  />
98
103
  );
@@ -21,6 +21,7 @@ import { BuyingPolicyDropdownMenu } from "../../components";
21
21
  import { AddBuyingPolicyDrawer } from "../../components/AddBuyingPolicyDrawer/AddBuyingPolicyDrawer";
22
22
  import { useGetBuyingPolicies } from "../../hooks/useGetBuyingPolicies";
23
23
 
24
+ import type { BudgetListResponse } from "../../../budgets/types";
24
25
  import type { BuyingPolicy } from "../../types";
25
26
 
26
27
  export type BuyingPoliciesLayoutProps = {
@@ -28,12 +29,14 @@ export type BuyingPoliciesLayoutProps = {
28
29
  total: number;
29
30
  search: string;
30
31
  page: number;
32
+ budgetData?: BudgetListResponse;
31
33
  };
32
34
 
33
35
  export const BuyingPoliciesLayout = ({
34
36
  buyingPolicies: initialBuyingPolicies,
35
37
  search,
36
38
  page,
39
+ budgetData = { data: [], total: 0 },
37
40
  }: BuyingPoliciesLayoutProps) => {
38
41
  const { currentContract, currentOrgUnit } = useBuyerPortal();
39
42
 
@@ -82,6 +85,67 @@ export const BuyingPoliciesLayout = ({
82
85
  ...addBuyingPolicyDrawerProps
83
86
  } = useDrawerProps();
84
87
 
88
+ const columns = getTableColumns({
89
+ actionsLength: 1,
90
+ });
91
+
92
+ const renderLoading = () => (
93
+ <Table layoutFixed>
94
+ <Table.Head columns={columns} />
95
+ <Table.Body>
96
+ <Table.Loading columns={columns.length} />
97
+ </Table.Body>
98
+ </Table>
99
+ );
100
+
101
+ const renderEmptyState = () => (
102
+ <EmptyState
103
+ title="No buying policies yet"
104
+ iconName="Rebase"
105
+ iconSize={40}
106
+ />
107
+ );
108
+
109
+ function renderContent() {
110
+ if (isLoading) {
111
+ return renderLoading();
112
+ }
113
+
114
+ if (buyingPolicies.length === 0) {
115
+ return renderEmptyState();
116
+ }
117
+
118
+ return (
119
+ <Table layoutFixed>
120
+ <Table.Head columns={columns} />
121
+ <Table.Body>
122
+ {buyingPolicies.map((buyingPolicy) => (
123
+ <Table.Row
124
+ key={buyingPolicy.id}
125
+ title={buyingPolicy.name}
126
+ iconName="Rebase"
127
+ iconSize={24}
128
+ href={buyerPortalRoutes.buyingPolicyDetails({
129
+ contractId: currentContract?.id ?? "",
130
+ orgUnitId: currentOrgUnit?.id ?? "",
131
+ buyingPolicyId: buyingPolicy.id,
132
+ })}
133
+ dropdownMenu={
134
+ <BuyingPolicyDropdownMenu
135
+ id={buyingPolicy.id}
136
+ name={buyingPolicy.name}
137
+ onUpdate={handleRefetchBuyingPolicies}
138
+ onDelete={handleRefetchBuyingPolicies}
139
+ budgetData={budgetData}
140
+ />
141
+ }
142
+ />
143
+ ))}
144
+ </Table.Body>
145
+ </Table>
146
+ );
147
+ }
148
+
85
149
  return (
86
150
  <GlobalLayout>
87
151
  <FinanceTabsLayout pageName="Finance and Compliance">
@@ -101,52 +165,7 @@ export const BuyingPoliciesLayout = ({
101
165
  />
102
166
  </div>
103
167
 
104
- {isLoading ? (
105
- <Table>
106
- <Table.Head
107
- columns={getTableColumns({
108
- withType: false,
109
- withActions: false,
110
- })}
111
- />{" "}
112
- <Table.Body>
113
- <Table.Loading />
114
- </Table.Body>
115
- </Table>
116
- ) : buyingPolicies.length === 0 ? (
117
- <EmptyState
118
- title="No buying policies yet"
119
- iconName="Rebase"
120
- iconSize={40}
121
- />
122
- ) : (
123
- <Table>
124
- <Table.Head columns={getTableColumns({ withType: false })} />
125
- <Table.Body>
126
- {buyingPolicies.map((buyingPolicy) => (
127
- <Table.Row
128
- key={buyingPolicy.id}
129
- title={buyingPolicy.name}
130
- iconName="Rebase"
131
- iconSize={24}
132
- href={buyerPortalRoutes.buyingPolicyDetails({
133
- contractId: currentContract?.id ?? "",
134
- orgUnitId: currentOrgUnit?.id ?? "",
135
- buyingPolicyId: buyingPolicy.id,
136
- })}
137
- dropdownMenu={
138
- <BuyingPolicyDropdownMenu
139
- id={buyingPolicy.id}
140
- name={buyingPolicy.name}
141
- onUpdate={handleRefetchBuyingPolicies}
142
- onDelete={handleRefetchBuyingPolicies}
143
- />
144
- }
145
- />
146
- ))}
147
- </Table.Body>
148
- </Table>
149
- )}
168
+ {renderContent()}
150
169
 
151
170
  <div data-fs-bp-buying-policies-paginator>
152
171
  {totalBuyingPolicies > buyingPolicies.length ? (
@@ -172,6 +191,7 @@ export const BuyingPoliciesLayout = ({
172
191
  contractId={currentContract?.id ?? ""}
173
192
  isOpen={isAddBuyingPolicyDrawerOpen}
174
193
  onCreate={handleRefetchBuyingPolicies}
194
+ budgetData={budgetData}
175
195
  {...addBuyingPolicyDrawerProps}
176
196
  />
177
197
  )}
@@ -4,83 +4,77 @@
4
4
  @import "../../components/AddBuyingPolicyDrawer/add-buying-policy-drawer.scss";
5
5
 
6
6
  [data-fs-buying-policies-section] {
7
- @import "../../../shared/components/HeaderInside/header-inside.scss";
8
- @import "../../../shared/components/InternalSearch/internal-search.scss";
9
- @import "../../../shared/components/Table/table.scss";
10
- @import "../../../shared/components/LevelDivider/level-divider.scss";
11
- @import "../../../shared/components/Paginator/paginator.scss";
12
- @import "../../../shared/components/EmptyState/empty-state.scss";
7
+ @import "../../../shared/components/HeaderInside/header-inside.scss";
8
+ @import "../../../shared/components/InternalSearch/internal-search.scss";
9
+ @import "../../../shared/components/Table/table.scss";
10
+ @import "../../../shared/components/LevelDivider/level-divider.scss";
11
+ @import "../../../shared/components/Paginator/paginator.scss";
12
+ @import "../../../shared/components/EmptyState/empty-state.scss";
13
13
 
14
- min-height: 100%;
15
- display: flex;
16
- flex-direction: column;
14
+ min-height: 100%;
15
+ display: flex;
16
+ flex-direction: column;
17
17
 
18
- @include media("<=tablet") {
19
- padding-bottom: 3rem;
18
+ @include media("<=tablet") {
19
+ padding-bottom: var(--fs-spacing-7);
20
20
 
21
- [data-fs-bp-header-inside] {
22
- [data-fs-header-inside-button] {
23
- position: fixed;
24
- bottom: 20px;
25
- right: 20px;
26
- padding: 12px;
27
- cursor: pointer;
28
- z-index: 10;
29
- }
30
- }
31
- }
21
+ [data-fs-bp-header-inside] {
22
+ [data-fs-header-inside-button] {
23
+ position: fixed;
24
+ bottom: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
25
+ right: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
26
+ padding: var(--fs-spacing-2);
27
+ cursor: pointer;
28
+ z-index: 10;
29
+ }
30
+ }
31
+ }
32
32
 
33
- [data-fs-empty-state-section] {
34
- flex: 1;
35
- color: #858585;
36
- }
33
+ [data-fs-empty-state-section] {
34
+ flex: 1;
35
+ color: #858585;
36
+ }
37
37
 
38
- [data-fs-buying-policies-filter] {
39
- display: flex;
40
- justify-content: space-between;
41
- padding: 0 0 var(--fs-spacing-4);
42
- [data-fs-bp-paginator-counter] {
43
- font-size: var(--fs-text-size-1);
44
- color: #5c5c5c;
45
- display: block;
46
- }
38
+ [data-fs-buying-policies-filter] {
39
+ display: flex;
40
+ justify-content: space-between;
41
+ padding: 0 0 var(--fs-spacing-4);
42
+ [data-fs-bp-paginator-counter] {
43
+ font-size: var(--fs-text-size-1);
44
+ color: #5c5c5c;
45
+ display: block;
46
+ }
47
47
 
48
- @include media("<=tablet") {
49
- [data-fs-buyer-portal-internal-search] {
50
- width: 100%;
51
- }
48
+ @include media("<=tablet") {
49
+ [data-fs-buyer-portal-internal-search] {
50
+ width: 100%;
51
+ }
52
52
 
53
- [data-fs-bp-paginator-counter] {
54
- display: none;
55
- }
56
- }
57
- }
53
+ [data-fs-bp-paginator-counter] {
54
+ display: none;
55
+ }
56
+ }
57
+ }
58
58
 
59
- [data-fs-buying-policies-heading] {
60
- display: flex;
61
- font-weight: var(--fs-text-weight-regular);
62
- font-size: var(--fs-text-size-1);
63
- line-height: calc(var(--fs-spacing-4) - var(--fs-spacing-0));
64
- color: #5c5c5c;
65
- margin-bottom: var(--fs-spacing-1);
66
- }
59
+ [data-fs-buying-policies-heading] {
60
+ display: flex;
61
+ font-weight: var(--fs-text-weight-regular);
62
+ font-size: var(--fs-text-size-1);
63
+ line-height: calc(var(--fs-spacing-4) - var(--fs-spacing-0));
64
+ color: #5c5c5c;
65
+ margin-bottom: var(--fs-spacing-1);
66
+ }
67
67
 
68
- [data-fs-bp-buying-policies-paginator] {
69
- display: none;
70
- @include media("<=tablet") {
71
- display: flex;
72
- align-items: center;
73
- justify-content: space-between;
74
- margin-top: var(--fs-spacing-0);
75
- padding: var(--fs-spacing-2) 0;
76
- font-size: var(--fs-text-size-1);
77
- color: #5c5c5c;
78
- }
79
- }
80
-
81
- [data-fs-bp-table] {
82
- td {
83
- padding: var(--fs-spacing-1) 0;
84
- }
85
- }
68
+ [data-fs-bp-buying-policies-paginator] {
69
+ display: none;
70
+ @include media("<=tablet") {
71
+ display: flex;
72
+ align-items: center;
73
+ justify-content: space-between;
74
+ margin-top: var(--fs-spacing-0);
75
+ padding: var(--fs-spacing-2) 0;
76
+ font-size: var(--fs-text-size-1);
77
+ color: #5c5c5c;
78
+ }
79
+ }
86
80
  }
@@ -1,5 +1,8 @@
1
1
  export { buyingPolicyDefault } from "./buyingPolicyDefault";
2
- export { orderFieldsCriteriaOptions } from "./orderFieldsCriteriaOptions";
2
+ export {
3
+ BUDGET_CRITERIA,
4
+ orderFieldsCriteriaOptions,
5
+ } from "./orderFieldsCriteriaOptions";
3
6
  export { spendingLimitsCriteriaOptions } from "./spendingLimitsCriteriaOptions";
4
7
  export {
5
8
  BUYING_POLICIES_WORKFLOW_TYPES,
@@ -1,39 +1,42 @@
1
+ export const BUDGET_CRITERIA =
2
+ '$exists(budgetData.unitAllocations.*[budgetId="${budget-id}"])';
3
+
1
4
  export const orderFieldsCriteriaOptions = [
2
5
  {
3
6
  label: "If the order contains a budget",
4
- criteria: "$count(budgetData.unitAllocations) > 0",
7
+ criteria: "$exists(budgetData.unitAllocations.*[])",
5
8
  },
6
9
  {
7
10
  label: "If the order contains the budgets X, Y, Z",
8
- criteria:
9
- 'budgetData.unitAllocations.budgetId = "Tech" or budgetData.unitAllocations.budgetId = "Growth"',
11
+ criteria: BUDGET_CRITERIA,
10
12
  },
11
13
  {
12
14
  label: "If the order contains an exceeded budget",
13
- criteria: "budgetData.unitAllocations.budgetBalance.remaining < 0",
15
+ criteria:
16
+ "$exists(budgetData.unitAllocations.**.budgetBalance[remaining < 0])",
14
17
  },
15
18
  {
16
19
  label: "If the order contains an expired budget Pending confirmation",
17
- criteria: "budgetData.unitAllocations.cycleConfiguration.endDate < now()",
20
+ criteria: "$exists(budgetData.unitAllocations.*[budgetEndDate < $now()])",
18
21
  },
19
22
  {
20
23
  label: "If the order contains a PO number",
21
- criteria: '$exists(customData.customFields.fields[name="poNumber"].value)',
24
+ criteria: '$exists(customData.customFields.fields[name="PO Number"].value)',
22
25
  },
23
26
  {
24
27
  label: "If the order contains the PO numbers X, Y, Z",
25
28
  criteria:
26
- 'customData.customFields.fields[name="poNumber"].value = "1112223334444" or customData.customFields.fields[name="poNumber"].value = "1234567890"',
29
+ 'customData.customFields.fields[name="PO Number"].value = "1112223334444" or customData.customFields.fields[name="PO Number"].value = "1234567890"',
27
30
  },
28
31
  {
29
32
  label: "If the order contains a cost center",
30
33
  criteria:
31
- '$exists(customData.customFields.fields[name="costCenter"].value)',
34
+ '$exists(customData.customFields.fields[name="Cost Center"].value)',
32
35
  },
33
36
  {
34
37
  label: "If the order contains the cost centers X, Y, Z",
35
38
  criteria:
36
- 'customData.customFields.fields[name="costCenter"].value = "CC1" or customData.customFields.fields[name="costCenter"].value = "CC2"',
39
+ 'customData.customFields.fields[name="Cost Center"].value = "CC1" or customData.customFields.fields[name="Cost Center"].value = "CC2"',
37
40
  },
38
41
  {
39
42
  label: "If all order items are negotiated items",
@@ -2,7 +2,7 @@ import { useState } from "react";
2
2
 
3
3
  import { useSearchParams } from "next/navigation";
4
4
 
5
- import { Tooltip } from "@faststore/ui";
5
+ import { IconButton, Tooltip } from "@faststore/ui";
6
6
 
7
7
  import { Icon, Table } from "../../../shared/components";
8
8
  import { getTableColumns } from "../../../shared/components/Table/utils/tableColumns";
@@ -45,10 +45,12 @@ export function CollectionsTable({
45
45
  openRemoveCollectionDrawer();
46
46
  }
47
47
 
48
+ const columns = getTableColumns({ actionsLength: 1 });
49
+
48
50
  return (
49
51
  <div data-fs-bp-collection-table>
50
- <Table>
51
- <Table.Head columns={getTableColumns()} />
52
+ <Table layoutFixed>
53
+ <Table.Head columns={columns} />
52
54
  <Table.Body>
53
55
  {collections.map((item) => (
54
56
  <Table.Row
@@ -57,34 +59,26 @@ export function CollectionsTable({
57
59
  key={item.id}
58
60
  iconSize={24}
59
61
  searchTerm={searchTerm ?? undefined}
60
- >
61
- <Table.Cell data-fs-bp-table-row-options align="right">
62
+ actionIcons={
62
63
  <Tooltip
63
64
  content={removeTooltipContent}
64
65
  placement={"left-center"}
65
66
  >
66
- <button
67
+ <IconButton
67
68
  data-fs-collections-row-action-button
68
- disabled={removeDisabled}
69
+ icon={<Icon name={"MinusCircle"} width={20} height={20} />}
69
70
  aria-label="Remove collections"
70
- type="button"
71
+ disabled={removeDisabled}
71
72
  onClick={() =>
72
73
  handleRemoveSelectedCollection({
73
74
  id: item.id,
74
75
  name: item.name,
75
76
  })
76
77
  }
77
- >
78
- <Icon
79
- data-fs-icon
80
- name={"MinusCircle"}
81
- width={20}
82
- height={20}
83
- />
84
- </button>
78
+ />
85
79
  </Tooltip>
86
- </Table.Cell>
87
- </Table.Row>
80
+ }
81
+ />
88
82
  ))}
89
83
  </Table.Body>
90
84
  </Table>