Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Show number of nodes tracking a repo
xphoniex committed 2 years ago
commit c3346575eece8c059370a629cea73470ae16ce78
parent 5de111e963aa47c68100750c038bce77502dd320
5 files changed +20 -2
modified httpd-client/lib/project.ts
@@ -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[]>;
modified src/views/projects/Header.svelte
@@ -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>
modified src/views/projects/View.svelte
@@ -187,6 +187,7 @@
        projectName={project.name}
        openPatchCount={project.patches.open}
        openIssueCount={project.issues.open}
+
        trackings={project.trackings}
        {activeRoute}
        {baseUrl} />

modified tests/e2e/project.spec.ts
@@ -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 }) => {
modified tests/support/heartwood-version
@@ -1 +1 @@
-
97f122c4512fbc5ea0b04a11db01d0d2d0977527
+
fd91cf4d28bd370a6c5beb9ca158e4d91432df25