mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Change actions to who what when
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 }) => {
|
||||
|
||||
@@ -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",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user