Skip to content

Commit

Permalink
Merge pull request #15227 from Budibase/feat/automation-store-ts-conv…
Browse files Browse the repository at this point in the history
…ersion

Typing automation store
  • Loading branch information
PClmnt authored Dec 24, 2024
2 parents 939416c + 8b76982 commit 98e31c4
Show file tree
Hide file tree
Showing 10 changed files with 597 additions and 453 deletions.
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",
"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,
})
}
}
Expand Down
Loading

0 comments on commit 98e31c4

Please sign in to comment.