fix(import-flow): update all variables in step parameters

This commit is contained in:
Ali BARIN
2025-02-12 11:11:52 +00:00
parent c92463f599
commit d9e2c19352
2 changed files with 3 additions and 3 deletions

View File

@@ -117,7 +117,7 @@ describe('POST /api/v1/flows/import', () => {
key: 'text', key: 'text',
name: 'Text', name: 'Text',
parameters: { parameters: {
input: `hello {{step.${triggerStep.id}.query.sample}} world`, input: `hello {{step.${triggerStep.id}.query.sample}} {{step.${triggerStep.id}.query.anotherSample}} world`,
transform: 'capitalize', transform: 'capitalize',
}, },
position: 2, position: 2,
@@ -171,7 +171,7 @@ describe('POST /api/v1/flows/import', () => {
}); });
expect(newActionParameters).toMatchObject({ expect(newActionParameters).toMatchObject({
input: `hello {{step.${newTriggerStepId}.query.sample}} world`, input: `hello {{step.${newTriggerStepId}.query.sample}} {{step.${newTriggerStepId}.query.anotherSample}} world`,
transform: 'capitalize', transform: 'capitalize',
}); });
}); });

View File

@@ -63,7 +63,7 @@ const updateParameters = (parameters, stepIdMap) => {
let updatedParameters = stringifiedParameters; let updatedParameters = stringifiedParameters;
Object.entries(stepIdMap).forEach(([oldStepId, newStepId]) => { Object.entries(stepIdMap).forEach(([oldStepId, newStepId]) => {
updatedParameters = updatedParameters.replace( updatedParameters = updatedParameters.replaceAll(
`{{step.${oldStepId}.`, `{{step.${oldStepId}.`,
`{{step.${newStepId}.` `{{step.${newStepId}.`
); );