diff --git a/src/lib/commit.ts b/src/lib/commit.ts index 6e2ee45e9..7522f0996 100644 --- a/src/lib/commit.ts +++ b/src/lib/commit.ts @@ -1,4 +1,4 @@ -import type { Stats, Person } from "@app/lib/project"; +import type { Stats } from "@app/lib/project"; import type { Diff, DiffStats } from "@app/lib/diff"; import { ApiError } from "@app/lib/api"; import { getDaysPassed } from "@app/lib/utils"; @@ -10,7 +10,6 @@ export interface CommitsHistory { export interface CommitMetadata { commit: CommitHeader; - context: CommitContext; } export interface Author { @@ -30,16 +29,6 @@ export interface GroupedCommitsHistory { stats: Stats; } -export interface CommitContext { - committer?: { - peer: { - id: string; - person: Person | null; - delegate: boolean; - }; - }; -} - export interface CommitHeader { author: Author; committer: Author; @@ -68,7 +57,6 @@ export interface Commit { stats: DiffStats; diff: Diff; branches: string[]; - context: CommitContext; } export function formatGroupTime(timestamp: number): string { @@ -81,7 +69,7 @@ export function formatGroupTime(timestamp: number): string { } export function groupCommits( - commits: { commit: CommitHeader; context: CommitContext }[], + commits: { commit: CommitHeader }[], ): CommitGroup[] { const groupedCommits: CommitGroup[] = []; let groupDate: Date | undefined = undefined; @@ -97,8 +85,8 @@ export function groupCommits( return 0; }); - for (const commit of commits) { - const time = commit.commit.committer.time * 1000; + for (const { commit } of commits) { + const time = commit.committer.time * 1000; const date = new Date(time); const isNewDay = !groupedCommits.length || @@ -116,7 +104,7 @@ export function groupCommits( }); groupDate = date; } - groupedCommits[groupedCommits.length - 1].commits.push(commit); + groupedCommits[groupedCommits.length - 1].commits.push({ commit }); } return groupedCommits; } catch (err) { diff --git a/src/views/projects/Commit.svelte b/src/views/projects/Commit.svelte index da5d5de7e..366add899 100644 --- a/src/views/projects/Commit.svelte +++ b/src/views/projects/Commit.svelte @@ -5,11 +5,11 @@ import Changeset from "@app/views/projects/SourceBrowser/Changeset.svelte"; import CommitAuthorship from "@app/views/projects/Commit/CommitAuthorship.svelte"; - import CommitVerifiedBadge from "@app/views/projects/Commit/CommitVerifiedBadge.svelte"; import * as router from "@app/lib/router"; export let commit: Commit; + const { commit: header } = commit; const onBrowse = (event: { detail: string }) => { router.updateProjectRoute({ view: { resource: "tree" }, @@ -41,11 +41,6 @@ color: var(--color-foreground-5); font-size: var(--font-size-small); } - .authorship { - display: flex; - align-items: center; - justify-content: space-between; - } @media (max-width: 960px) { .commit { @@ -57,21 +52,16 @@
{commit.commit.description}
-
+ {header.description}
+