Show number of nodes tracking a repo

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
This commit is contained in:
xphoniex
2023-06-02 13:11:27 +00:00
parent 5de111e963
commit c3346575ee
5 changed files with 20 additions and 2 deletions
+2
View File
@@ -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[]>;
+13 -1
View File
@@ -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>
+1
View File
@@ -187,6 +187,7 @@
projectName={project.name}
openPatchCount={project.patches.open}
openIssueCount={project.issues.open}
trackings={project.trackings}
{activeRoute}
{baseUrl} />
+3
View File
@@ -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
View File
@@ -1 +1 @@
97f122c4512fbc5ea0b04a11db01d0d2d0977527
fd91cf4d28bd370a6c5beb9ca158e4d91432df25