@vtex/faststore-plugin-buyer-portal 1.3.11 → 1.3.12
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 +8 -2
- package/package.json +1 -1
- package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/BasicBuyingPolicyDrawer.tsx +1 -1
- package/src/features/buying-policies/components/BudgetCriteriaSelector/BudgetCriteriaSelector.tsx +3 -3
- package/src/features/buying-policies/utils/orderFieldsCriteriaOptions.ts +2 -3
- package/src/features/shared/utils/constants.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.12] - 2025-10-30
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Updates JSONata expressions to match Budget data.
|
|
15
|
+
|
|
10
16
|
## [1.3.11] - 2025-10-23
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -165,7 +171,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
165
171
|
- Add CHANGELOG file
|
|
166
172
|
- Add README file
|
|
167
173
|
|
|
168
|
-
[unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/
|
|
174
|
+
[unreleased]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.12...HEAD
|
|
169
175
|
[1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.2.2...1.2.3
|
|
170
176
|
[1.2.3]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.3
|
|
171
177
|
[1.2.4]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.2.4
|
|
@@ -177,5 +183,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
177
183
|
[1.3.9]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.8...v1.3.9
|
|
178
184
|
[1.3.8]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.7...v1.3.8
|
|
179
185
|
[1.3.7]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.7
|
|
180
|
-
|
|
186
|
+
[1.3.12]: https://github.com/vtex/faststore-plugin-buyer-portal/compare/v1.3.11...v1.3.12
|
|
181
187
|
[1.3.11]: https://github.com/vtex/faststore-plugin-buyer-portal/releases/tag/1.3.11
|
package/package.json
CHANGED
package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/BasicBuyingPolicyDrawer.tsx
CHANGED
|
@@ -175,7 +175,7 @@ export const BasicBuyingPolicyDrawer = ({
|
|
|
175
175
|
|
|
176
176
|
const isBudgetCriteria =
|
|
177
177
|
criteria === BUDGET_CRITERIA ||
|
|
178
|
-
criteria.includes('$exists(budgetData.
|
|
178
|
+
criteria.includes('$exists(budgetData.budgets[id="');
|
|
179
179
|
|
|
180
180
|
const renderCriteria = (criteria: string) => {
|
|
181
181
|
if (isBudgetCriteria) {
|
package/src/features/buying-policies/components/BudgetCriteriaSelector/BudgetCriteriaSelector.tsx
CHANGED
|
@@ -18,7 +18,7 @@ export const BudgetCriteriaSelector = ({
|
|
|
18
18
|
budgetData = { data: [], total: 0 },
|
|
19
19
|
}: BudgetCriteriaSelectorProps) => {
|
|
20
20
|
const extractBudgetValueFromCriteria = (criteria: string): string => {
|
|
21
|
-
const match = criteria.match(/
|
|
21
|
+
const match = criteria.match(/id="([^"]+)"/);
|
|
22
22
|
return match ? match[1] : "budget-001";
|
|
23
23
|
};
|
|
24
24
|
|
|
@@ -39,7 +39,7 @@ export const BudgetCriteriaSelector = ({
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
const generateCriteriaString = (value: string) => {
|
|
42
|
-
return `$exists(budgetData.
|
|
42
|
+
return `$exists(budgetData.budgets[id="${value}"])`;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
const handleBudgetSelect = (budgetId: string) => {
|
|
@@ -74,7 +74,7 @@ export const BudgetCriteriaSelector = ({
|
|
|
74
74
|
>
|
|
75
75
|
<div data-fs-bp-budget-criteria-string>
|
|
76
76
|
<span onClick={handleEditablePartClick} data-fs-bp-editable-part>
|
|
77
|
-
$exists(budgetData.
|
|
77
|
+
$exists(budgetData.budgets[id="
|
|
78
78
|
</span>
|
|
79
79
|
{hasBudgetData ? (
|
|
80
80
|
<div onClick={handleBudgetSelectorClick}>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export const BUDGET_CRITERIA =
|
|
2
|
-
'$exists(budgetData.unitAllocations.*[budgetId="${budget-id}"])';
|
|
1
|
+
export const BUDGET_CRITERIA = '$exists(budgetData.budgets[id="${budget-id}"])';
|
|
3
2
|
|
|
4
3
|
export const orderFieldsCriteriaOptions = [
|
|
5
4
|
{
|
|
6
5
|
label: "If the order contains a budget",
|
|
7
|
-
criteria: "$exists(budgetData.
|
|
6
|
+
criteria: "$exists(budgetData.budgets.*[])",
|
|
8
7
|
},
|
|
9
8
|
{
|
|
10
9
|
label: "If the order contains the budgets X, Y, Z",
|