@vtex/faststore-plugin-buyer-portal 1.3.11 → 1.3.12-experimental.20251103125015
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/.github/workflows/betarelease.yaml +69 -0
- package/CHANGELOG.md +8 -2
- package/beta-release.sh +20 -0
- package/package.json +3 -2
- 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
|
@@ -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,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/beta-release.sh
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtex/faststore-plugin-buyer-portal",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.12-experimental.20251103125015",
|
|
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}": [
|
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",
|