Skip to content

Commit

Permalink
Merge pull request #1363 from DalgoT4D/fix-noora-flow-edit-issue
Browse files Browse the repository at this point in the history
Fix noora's flow edit issue
  • Loading branch information
fatchat authored Dec 23, 2024
2 parents 5fc358c + d934c11 commit 19fa936
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/Flows/FlowCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,13 @@ const FlowCreate = ({
}

//if "data.transformTasks" and "tasksToApply" are same then the alignment is simple else advanced.
const ifTasksAligned = data.transformTasks.every(
(task: { uuid: string; seq: number }, index: number) =>
task.uuid === tasksToApply[index].uuid
);
// In the case of dbt cloud job, the taskToApply is an empty array as there are no system tasks being fetched, hence the check.
const ifTasksAligned =
tasksToApply.length &&
data.transformTasks.every(
(task: { uuid: string; seq: number }, index: number) =>
task.uuid === tasksToApply[index].uuid
);
if (data.transformTasks.length > 0 && !ifTasksAligned) {
const uuidOrder = data.transformTasks.reduce((acc: any, obj: any) => {
acc[obj.uuid] = obj.seq;
Expand Down

0 comments on commit 19fa936

Please sign in to comment.