( blockIdMapping: ReadonlyMap<string, string>, sourceIsParent: boolean, sourceWorkflowId: string, targetWorkflowId: string )
| 52 | * fixed for the whole mapping (one source workflow copied into one target workflow). |
| 53 | */ |
| 54 | export function toForkBlockPairs( |
| 55 | blockIdMapping: ReadonlyMap<string, string>, |
| 56 | sourceIsParent: boolean, |
| 57 | sourceWorkflowId: string, |
| 58 | targetWorkflowId: string |
| 59 | ): ForkBlockPair[] { |
| 60 | const parentWorkflowId = sourceIsParent ? sourceWorkflowId : targetWorkflowId |
| 61 | const childWorkflowId = sourceIsParent ? targetWorkflowId : sourceWorkflowId |
| 62 | const pairs: ForkBlockPair[] = [] |
| 63 | for (const [sourceBlockId, targetBlockId] of blockIdMapping) { |
| 64 | pairs.push({ |
| 65 | parentWorkflowId, |
| 66 | childWorkflowId, |
| 67 | parentBlockId: sourceIsParent ? sourceBlockId : targetBlockId, |
| 68 | childBlockId: sourceIsParent ? targetBlockId : sourceBlockId, |
| 69 | }) |
| 70 | } |
| 71 | return pairs |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Replace the persisted pairs for the promoted SOURCE workflows with the live ones. Deleting |
no test coverage detected