Change actions to who what when

This commit is contained in:
Sebastian Martinez
2024-01-17 17:00:10 +00:00
committed by Rūdolfs Ošiņš
parent 64d7fbcf56
commit c76c8e7ab8
11 changed files with 67 additions and 51 deletions
+4 -4
View File
@@ -123,7 +123,10 @@
<slot name="icon" />
</div>
<NodeId nodeId={authorId} alias={authorAlias} />
{caption}
<slot name="caption">{caption}</slot>
<span class="card-metadata">
{utils.formatTimestamp(timestamp)}
</span>
{#if lastEdit}
<div class="card-metadata">•</div>
<div class="card-metadata" title={utils.formatEditedCaption(lastEdit)}>
@@ -138,9 +141,6 @@
</IconButton>
</div>
{/if}
<div class="card-metadata" title={utils.absoluteTimestamp(timestamp)}>
{utils.formatTimestamp(timestamp)}
</div>
</div>
</div>
</div>
@@ -39,7 +39,6 @@
align-items: flex-start;
gap: 1rem;
margin-left: auto;
color: var(--color-foreground-dim);
}
.summary:hover {
text-decoration: underline;
@@ -53,7 +52,6 @@
<div class="teaser" aria-label="commit-teaser">
<div class="left">
<div class="message">
<span class="global-hash">{formatCommit(commit.id)}</span>
<Link
route={{
resource: "project.commit",
@@ -82,7 +80,13 @@
<div class="right">
<div style:display="flex" style:gap="1rem" style:height="1.5rem">
<div style:margin-bottom="1rem">
<CommitAuthorship header={commit} />
<CommitAuthorship header={commit}>
<span
class="global-hash"
style:color="var(--color-foreground-yellow)">
{formatCommit(commit.id)}
</span>
</CommitAuthorship>
</div>
<IconButton title="Browse the repository at this point in the history">
<Link
-11
View File
@@ -1,9 +1,3 @@
<script lang="ts">
import * as utils from "@app/lib/utils";
export let id: string | undefined = undefined;
</script>
<style>
.header {
display: flex;
@@ -39,11 +33,6 @@
</div>
<div class="subtitle">
<slot name="state" />
{#if id}
<div class="global-hash">
{utils.formatObjectId(id)}
</div>
{/if}
<slot name="author" />
</div>
<div class="description">
+14 -12
View File
@@ -74,7 +74,7 @@
case "reject":
return "rejected revision";
default:
return "left a review";
return "reviewed revision";
}
}
@@ -384,10 +384,14 @@
{#if patchId === revisionId}
opened this patch
{:else}
updated to <span class="global-hash">
updated to
<span class="global-hash">
{utils.formatObjectId(revisionId)}
</span>
{/if}
<span style:color="var(--color-foreground-dim)">
{utils.formatTimestamp(revisionTimestamp)}
</span>
<div style="display: flex; gap: 0.5rem; margin-left: auto;">
{#if canEdit(revisionAuthor.id) && editRevision && revisionState === "read"}
<IconButton
@@ -396,11 +400,6 @@
<IconSmall name="edit" />
</IconButton>
{/if}
<div
class="timestamp"
title={utils.absoluteTimestamp(revisionTimestamp)}>
{utils.formatTimestamp(revisionTimestamp)}
</div>
</div>
</div>
{#if editRevision && latestEdit && revisionState !== "read"}
@@ -491,13 +490,11 @@
<span class="global-hash">
{utils.formatCommit(element.inner.commit)}
</span>
<div
style="margin-left: auto"
<span
class="timestamp"
title={utils.absoluteTimestamp(revisionTimestamp)}>
{utils.formatTimestamp(revisionTimestamp)}
</div>
</span>
</div>
</div>
{:else if element.type === "review"}
@@ -510,11 +507,16 @@
class:negative-review={review.verdict === "reject"}>
<CommentComponent
rawPath={rawPath(projectHead)}
caption={formatVerdict(review.verdict)}
authorId={author}
authorAlias={review.author.alias}
timestamp={review.timestamp}
body={review.summary ?? ""}>
<div slot="caption">
{formatVerdict(review.verdict)}
<span class="global-hash">
{utils.formatObjectId(revisionId)}
</span>
</div>
<div slot="icon" style:color={verdictIconColor(review.verdict)}>
{#if review.verdict === "accept"}
<IconSmall name="checkmark" />
@@ -19,6 +19,8 @@
flex-wrap: nowrap;
white-space: nowrap;
gap: 0.5rem;
font-family: var(--font-family-monospace);
font-weight: var(--font-weight-semibold);
}
.avatar {
width: 1rem;
@@ -28,7 +30,6 @@
</style>
<span class="authorship">
<slot />
{#if header.author.email === header.committer.email}
<div class="person">
<img
@@ -38,7 +39,10 @@
{header.committer.name}
</div>
committed
{formatTimestamp(header.committer.time)}
<slot />
<span style:color="var(--color-foreground-dim)">
{formatTimestamp(header.committer.time)}
</span>
{:else}
<div class="person">
<img class="avatar" alt="avatar" src={gravatarURL(header.author.email)} />
@@ -53,6 +57,9 @@
{header.committer.name}
</div>
committed
{formatTimestamp(header.committer.time)}
<slot />
<span style:color="var(--color-foreground-dim)">
{formatTimestamp(header.committer.time)}
</span>
{/if}
</span>
+7 -5
View File
@@ -468,7 +468,7 @@
<Layout {baseUrl} {project} activeTab="issues">
<div class="issue">
<div class="content">
<CobHeader id={issue.id}>
<CobHeader>
<svelte:fragment slot="title">
{#if issueState !== "read"}
<TextInput
@@ -562,10 +562,12 @@
</div>
</div>
<div class="author" slot="author">
opened by <NodeId
nodeId={issue.author.id}
alias={issue.author.alias} />
{utils.formatTimestamp(issue.discussion[0].timestamp)}
<NodeId nodeId={issue.author.id} alias={issue.author.alias} />
opened
<span class="global-hash">{utils.formatObjectId(issue.id)}</span>
<span style:color="var(--color-foreground-dim)">
{utils.formatTimestamp(issue.discussion[0].timestamp)}
</span>
{#if lastDescriptionEdit}
<div class="author-metadata">•</div>
<div
+5 -2
View File
@@ -125,9 +125,12 @@
</span>
</div>
<div class="summary subtitle">
<span class="global-hash">{formatObjectId(issue.id)}</span>
opened {formatTimestamp(issue.discussion[0].timestamp)} by
<NodeId nodeId={issue.author.id} alias={issue.author.alias} />
opened
<span class="global-hash">{formatObjectId(issue.id)}</span>
<span style:color="var(--color-foreground-dim)">
{formatTimestamp(issue.discussion[0].timestamp)}
</span>
</div>
</div>
<div class="right">
+7 -5
View File
@@ -646,7 +646,7 @@
<Layout {baseUrl} {project} activeTab="patches">
<div class="patch">
<div class="content">
<CobHeader id={patch.id}>
<CobHeader>
<svelte:fragment slot="title">
{#if patchState !== "read"}
<TextInput
@@ -718,10 +718,12 @@
</div>
</svelte:fragment>
<div class="author" slot="author">
opened by <NodeId
nodeId={patch.author.id}
alias={patch.author.alias} />
{utils.formatTimestamp(patch.revisions[0].timestamp)}
<NodeId nodeId={patch.author.id} alias={patch.author.alias} />
opened
<span class="global-hash">{utils.formatObjectId(patch.id)}</span>
<span style:color="var(--color-foreground-dim)">
{utils.formatTimestamp(patch.revisions[0].timestamp)}
</span>
</div>
</CobHeader>
+10 -3
View File
@@ -153,10 +153,17 @@
</div>
<div class="summary">
<span class="subtitle">
<span class="global-hash">{formatObjectId(patch.id)}</span>
{patch.revisions.length > 1 ? "updated" : "opened"}
{formatTimestamp(latestRevision.timestamp)} by
<NodeId nodeId={patch.author.id} alias={patch.author.alias} />
{patch.revisions.length > 1 ? "updated" : "opened"}
<span class="global-hash">{formatObjectId(patch.id)}</span>
{#if patch.revisions.length > 1}
to <span class="global-hash">
{formatObjectId(patch.revisions[patch.revisions.length - 1].id)}
</span>
{/if}
<span style:color="var(--color-foreground-dim)">
{formatTimestamp(latestRevision.timestamp)}
</span>
</span>
</div>
</div>
+1 -1
View File
@@ -30,7 +30,7 @@ test("relative timestamps", async ({ page }) => {
};
});
await page.goto(commitUrl);
await expect(page.getByText("Bob Belcher committed now")).toBeVisible();
await expect(page.getByText("Bob Belcher committed 28f3710")).toBeVisible();
});
test("modified file", async ({ page }) => {
+2 -2
View File
@@ -117,11 +117,11 @@ test("relative timestamps", async ({ page }) => {
await page.getByRole("link", { name: "bob" }).click();
await expect(page.getByTitle("Change peer")).toHaveText("bob");
const latestCommit = page.locator(".teaser").first();
await expect(latestCommit).toContainText("Bob Belcher committed now");
await expect(latestCommit).toContainText("Bob Belcher committed 28f3710 now");
await expect(latestCommit).toContainText("28f3710");
const earliestCommit = page.locator(".teaser").last();
await expect(earliestCommit).toContainText(
"Alice Liddell committed last month",
"Alice Liddell committed 36d5bbe last month",
);
});