mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 02:00:31 +08:00
Show number of nodes tracking a repo
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
This commit is contained in:
@@ -54,6 +54,7 @@ export interface Project {
|
||||
open: number;
|
||||
closed: number;
|
||||
};
|
||||
trackings: number;
|
||||
}
|
||||
|
||||
const projectSchema = strictObject({
|
||||
@@ -73,6 +74,7 @@ const projectSchema = strictObject({
|
||||
open: number(),
|
||||
closed: number(),
|
||||
}),
|
||||
trackings: number(),
|
||||
}) satisfies ZodSchema<Project>;
|
||||
|
||||
const projectsSchema = array(projectSchema) satisfies ZodSchema<Project[]>;
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
import type { ProjectRoute } from "@app/views/projects/router";
|
||||
|
||||
import { config } from "@app/lib/config";
|
||||
import { isLocal } from "@app/lib/utils";
|
||||
import { pluralize } from "@app/lib/pluralize";
|
||||
|
||||
import CloneButton from "@app/views/projects/CloneButton.svelte";
|
||||
import Icon from "@app/components/Icon.svelte";
|
||||
import Link from "@app/components/Link.svelte";
|
||||
import ProjectLink from "@app/components/ProjectLink.svelte";
|
||||
import SquareButton from "@app/components/SquareButton.svelte";
|
||||
import { isLocal } from "@app/lib/utils";
|
||||
|
||||
export let activeRoute: ProjectRoute;
|
||||
export let baseUrl: BaseUrl;
|
||||
@@ -19,6 +20,7 @@
|
||||
|
||||
export let openPatchCount: number;
|
||||
export let openIssueCount: number;
|
||||
export let trackings: number = 0;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -45,6 +47,11 @@
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
}
|
||||
.trackings {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.2rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="header">
|
||||
@@ -117,4 +124,9 @@
|
||||
{isLocal(baseUrl.hostname) ? "radicle.local" : baseUrl.hostname}
|
||||
</SquareButton>
|
||||
</Link>
|
||||
<SquareButton hoverable={false}>
|
||||
<span class="trackings" title="Tracked by {trackings} nodes">
|
||||
<Icon name="network" />{trackings} nodes
|
||||
</span>
|
||||
</SquareButton>
|
||||
</div>
|
||||
|
||||
@@ -187,6 +187,7 @@
|
||||
projectName={project.name}
|
||||
openPatchCount={project.patches.open}
|
||||
openIssueCount={project.issues.open}
|
||||
trackings={project.trackings}
|
||||
{activeRoute}
|
||||
{baseUrl} />
|
||||
|
||||
|
||||
@@ -64,6 +64,9 @@ test("navigate to project", async ({ page }) => {
|
||||
|
||||
// Show rendered README.md contents.
|
||||
await expect(page.locator("text=Git test repository")).toBeVisible();
|
||||
|
||||
// Number of nodes tracking this project.
|
||||
await expect(page.locator("text=3 nodes")).toBeVisible();
|
||||
});
|
||||
|
||||
test("show source tree at specific revision", async ({ page }) => {
|
||||
|
||||
@@ -1 +1 @@
|
||||
97f122c4512fbc5ea0b04a11db01d0d2d0977527
|
||||
fd91cf4d28bd370a6c5beb9ca158e4d91432df25
|
||||
|
||||
Reference in New Issue
Block a user