Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing automation store #15227

Merged
merged 14 commits into from
Dec 24, 2024
1 change: 1 addition & 0 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"@sveltejs/vite-plugin-svelte": "1.4.0",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/svelte": "^4.1.0",
"@types/shortid": "^2.2.0",
adrinr marked this conversation as resolved.
Show resolved Hide resolved
"babel-jest": "^29.6.2",
"identity-obj-proxy": "^3.0.0",
"jest": "29.7.0",
Expand Down
8 changes: 7 additions & 1 deletion packages/builder/src/dataBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,12 @@ export const updateReferencesInObject = ({

// Migrate references
// Switch all bindings to reference their ids
export const migrateReferencesInObject = ({ obj, label = "steps", steps }) => {
export const migrateReferencesInObject = ({
obj,
label = "steps",
steps,
originalIndex,
}) => {
const stepIndexRegex = new RegExp(`{{\\s*${label}\\.(\\d+)\\.`, "g")
const updateActionStep = (str, index, replaceWith) =>
str.replace(`{{ ${label}.${index}.`, `{{ ${label}.${replaceWith}.`)
Expand All @@ -1528,6 +1533,7 @@ export const migrateReferencesInObject = ({ obj, label = "steps", steps }) => {
migrateReferencesInObject({
obj: obj[key],
steps,
originalIndex,
adrinr marked this conversation as resolved.
Show resolved Hide resolved
})
}
}
Expand Down
Loading
Loading