Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Bump heartwood version
Merged rudolfs opened 2 years ago

This fixes the landing page not showing local projects anymore.

check check-visual check-unit-test check-httpd-api-unit-test check-e2e check-build

👉 Preview
👉 Workflow runs
👉 Branch on GitHub

8 files changed +45 -20 9ee2a457 65e906fd
modified httpd-client/lib/project.ts
@@ -172,7 +172,7 @@ export class Client {
  }

  public async getAll(
-
    query?: { page?: number; perPage?: number },
+
    query?: { page?: number; perPage?: number; show?: "pinned" | "all" },
    options?: RequestOptions,
  ): Promise<Project[]> {
    return this.#fetcher.fetchOk(
modified httpd-client/tests/project.test.ts
@@ -210,7 +210,7 @@ describe("project", () => {
  test("#getPatchById(id, patchId)", async () => {
    await api.project.getPatchById(
      cobRid,
-
      "7db70f2ed80235db7f0ab9e5537e76572a304991",
+
      "59aa91a1d63a3a1d05292abe6292356a34ea1480",
    );
  });

modified src/views/home/router.ts
@@ -27,10 +27,12 @@ export async function loadHomeRoute(): Promise<
> {
  let projects: ProjectBaseUrl[] = [];
  if (get(httpdStore).state !== "stopped") {
-
    projects = (await api.project.getAll({ perPage: 30 })).map(project => ({
-
      project,
-
      baseUrl: api.baseUrl,
-
    }));
+
    projects = (await api.project.getAll({ perPage: 30, show: "all" })).map(
+
      project => ({
+
        project,
+
        baseUrl: api.baseUrl,
+
      }),
+
    );
  } else {
    projects = await getProjectsFromNodes(config.projects.pinned);
  }
modified src/views/nodes/router.ts
@@ -50,7 +50,7 @@ export async function loadProjects(

  const [nodeStats, projects] = await Promise.all([
    api.getStats(),
-
    api.project.getAll({ page, perPage: PROJECTS_PER_PAGE }),
+
    api.project.getAll({ page, perPage: PROJECTS_PER_PAGE, show: "all" }),
  ]);

  const results = await Promise.all(
modified tests/e2e/project.spec.ts
@@ -49,7 +49,7 @@ test("navigate to project", async ({ page }) => {
  await expect(page.getByText("Git test repository")).toBeVisible();

  // Number of nodes seeding this project.
-
  await expect(page.getByText("Seed 3")).toBeVisible();
+
  await expect(page.getByText("Seed 4")).toBeVisible();
});

test("show source tree at specific revision", async ({ page }) => {
@@ -475,11 +475,20 @@ test("internal file markdown link", async ({ page }) => {
});

test("diff selection de-select", async ({ page }) => {
-
  await page.goto(
-
    `${cobUrl}/patches/7db70f2ed80235db7f0ab9e5537e76572a304991?tab=changes#README.md:H0L0H0L3`,
-
  );
-
  await page.getByText("Add subtitle to README").click();
-
  await expect(page).toHaveURL(
-
    `${cobUrl}/patches/7db70f2ed80235db7f0ab9e5537e76572a304991?tab=changes`,
-
  );
+
  await page.goto(`${cobUrl}/patches`);
+
  await page
+
    .getByRole("link", { name: "Taking another stab at the README" })
+
    .click();
+
  await page.getByRole("link", { name: "Changes" }).click();
+
  await page
+
    .getByRole("row", { name: "+ # Cobs Repo" })
+
    .locator("div")
+
    .first()
+
    .click();
+
  await expect(page).toHaveURL(new RegExp("tab=changes#README.md:H0L1$"));
+
  // Click outside.
+
  await page
+
    .getByText("1 file changed with 5 insertions and 1 deletion")
+
    .click();
+
  await expect(page).toHaveURL(new RegExp("tab=changes$"));
});
modified tests/e2e/project/patch.spec.ts
@@ -59,7 +59,7 @@ test("navigate through revision diffs", async ({ page }) => {
    .click();

  const firstRevision = page.locator(".revision").first();
-
  const firstRevisionId = "a27a6b7";
+
  const firstRevisionId = "59aa91a";
  const secondRevision = page.locator(".revision").nth(1);

  // Second revision
modified tests/support/heartwood-version
@@ -1 +1 @@
-
5dbd9bb2a32dca6aafbd2b4a50dd73d237ca025d

\ No newline at end of file
+
49584f4e732fb0039d2089f3c39fd56fc34a2ee3
modified tests/visual/desktop/project.spec.ts
@@ -64,9 +64,23 @@ test("diff selection", async ({ page }) => {
    };
  });

-
  await page.goto(
-
    `${cobUrl}/patches/a27a6b77246e6ada5e81bc8764b5f5c593be80a5?tab=changes#README.md:H0L0H0L3`,
-
  );
+
  await page.goto(`${cobUrl}/patches`);
+
  await page
+
    .getByRole("link", { name: "Taking another stab at the README" })
+
    .click();
+
  await page.getByRole("link", { name: "Changes" }).click();
+
  await page
+
    .getByRole("row", { name: "- # Cobs Repo" })
+
    .locator("div")
+
    .first()
+
    .click();
+
  await page.keyboard.down("Shift");
+
  await page
+
    .getByRole("row", { name: "+ ## Better?" })
+
    .locator("div")
+
    .first()
+
    .click();
+
  await page.keyboard.up("Shift");
  await expect(page).toHaveScreenshot({ fullPage: true });
});