diff --git a/src/routes/projects_new/[projectId]/Board.svelte b/src/routes/projects_new/[projectId]/Board.svelte index 58098b065..5b89f7965 100644 --- a/src/routes/projects_new/[projectId]/Board.svelte +++ b/src/routes/projects_new/[projectId]/Board.svelte @@ -52,7 +52,7 @@ id: `${Date.now()}-${file.id}-commit`, description: '', kind: 'commit', - files: [file], + files: [{ ...file, isDndShadowItem: false }], isDndShadowItem: !isFinal } ] diff --git a/src/routes/projects_new/[projectId]/BranchLane.svelte b/src/routes/projects_new/[projectId]/BranchLane.svelte index c502d9096..80cd6a353 100644 --- a/src/routes/projects_new/[projectId]/BranchLane.svelte +++ b/src/routes/projects_new/[projectId]/BranchLane.svelte @@ -36,9 +36,9 @@ for (const file of fileItems) { commitItems.push({ id: `${Date.now()}-${file.id}`, - description: '', + description: 'New commit', kind: 'commit', - files: [file], + files: [{ ...file, isDndShadowItem: false }], isDndShadowItem: !isFinal }); } diff --git a/src/routes/projects_new/[projectId]/CommitGroup.svelte b/src/routes/projects_new/[projectId]/CommitGroup.svelte index e545271ff..3d28c625e 100644 --- a/src/routes/projects_new/[projectId]/CommitGroup.svelte +++ b/src/routes/projects_new/[projectId]/CommitGroup.svelte @@ -50,24 +50,26 @@ } -
handleDndEvent(e, false)} - on:finalize={(e) => handleDndEvent(e, true)} -> - {#each files.filter((x) => x.hunks) as file, idx (file.id)} -
- -
- {/each} +
+
handleDndEvent(e, false)} + on:finalize={(e) => handleDndEvent(e, true)} + > + {#each files.filter((x) => x.hunks) as file, idx (file.id)} +
+ +
+ {/each} +
{description}
diff --git a/src/routes/projects_new/[projectId]/helpers.ts b/src/routes/projects_new/[projectId]/helpers.ts new file mode 100644 index 000000000..d929510c2 --- /dev/null +++ b/src/routes/projects_new/[projectId]/helpers.ts @@ -0,0 +1,11 @@ +import type { Commit, File } from './types'; + +export function createCommit(files: File[], isShadow: boolean): Commit { + return { + id: `commit-${Date.now()}`, + description: '', + kind: 'commit', + files: files, + isDndShadowItem: isShadow + }; +}