mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-09 13:40:28 +08:00
Fix commit listing, adding new commits to list instead of replacing
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
"__format": "json"
|
||||
}
|
||||
},
|
||||
"source": {
|
||||
"commitsPerPage": "COMMITS_PER_PAGE"
|
||||
},
|
||||
"supportWebsite": "SUPPORT_WEBSITE",
|
||||
"fallbackPreferredSeed": {
|
||||
"__name": "FALLBACK_PREFERRED_SEED",
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"source": {
|
||||
"commitsPerPage": 30
|
||||
},
|
||||
"supportWebsite": "https://radicle.zulipchat.com",
|
||||
"fallbackPreferredSeed": {
|
||||
"hostname": "seed.radicle.garden",
|
||||
|
||||
Vendored
+3
@@ -10,6 +10,9 @@ declare module "virtual:*" {
|
||||
defaultHttpdScheme: string;
|
||||
pinned: { baseUrl: BaseUrl }[];
|
||||
};
|
||||
source: {
|
||||
commitsPerPage: number;
|
||||
};
|
||||
reactions: string[];
|
||||
supportWebsite: string;
|
||||
fallbackPreferredSeed: BaseUrl;
|
||||
|
||||
+13
-4
@@ -82,10 +82,19 @@ const config: PlaywrightTestConfig = {
|
||||
},
|
||||
],
|
||||
|
||||
webServer: {
|
||||
command: "npm run start -- --strictPort --port 3001",
|
||||
port: 3001,
|
||||
},
|
||||
webServer: [
|
||||
{
|
||||
command: "npm run start -- --strictPort --port 3001",
|
||||
port: 3001,
|
||||
},
|
||||
// Required by test tests/e2e/project/commits.spec.ts "loading more commits, adds them to the commits list"
|
||||
{
|
||||
command: "npm run start -- --strictPort --port 3002",
|
||||
port: 3002,
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
env: { COMMITS_PER_PAGE: "4" },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
} from "@http-client";
|
||||
import type { ProjectRoute } from "./router";
|
||||
|
||||
import { COMMITS_PER_PAGE } from "./router";
|
||||
import config from "virtual:config";
|
||||
import { HttpdClient } from "@http-client";
|
||||
import { baseUrlToString } from "@app/lib/utils";
|
||||
import { groupCommits } from "@app/lib/commit";
|
||||
@@ -58,9 +58,9 @@
|
||||
const response = await api.project.getAllCommits(project.id, {
|
||||
parent: allCommitHeaders[0].id,
|
||||
page,
|
||||
perPage: COMMITS_PER_PAGE,
|
||||
perPage: config.source.commitsPerPage,
|
||||
});
|
||||
allCommitHeaders = response;
|
||||
allCommitHeaders = [...allCommitHeaders, ...response];
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import { handleError, unreachableError } from "@app/views/projects/error";
|
||||
import { HttpdClient } from "@http-client";
|
||||
import { ResponseError, ResponseParseError } from "@http-client/lib/fetcher";
|
||||
|
||||
export const COMMITS_PER_PAGE = 30;
|
||||
export const PATCHES_PER_PAGE = 10;
|
||||
export const ISSUES_PER_PAGE = 10;
|
||||
|
||||
@@ -524,7 +523,7 @@ async function loadHistoryView(
|
||||
await api.project.getAllCommits(project.id, {
|
||||
parent: commitId,
|
||||
page: 0,
|
||||
perPage: COMMITS_PER_PAGE,
|
||||
perPage: config.source.commitsPerPage,
|
||||
}),
|
||||
]);
|
||||
|
||||
|
||||
@@ -87,6 +87,17 @@ test("peer and branch switching", async ({ page }) => {
|
||||
}
|
||||
});
|
||||
|
||||
test("loading more commits, adds them to the commits list", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto(`http://localhost:3002${sourceBrowsingUrl}`);
|
||||
await page.getByRole("button", { name: "Commits" }).click();
|
||||
await expect(page.locator("div > div > .teaser")).toHaveCount(4);
|
||||
|
||||
await page.getByRole("button", { name: "More" }).click();
|
||||
await expect(page.locator("div > div > .teaser")).toHaveCount(8);
|
||||
});
|
||||
|
||||
test("commit messages with double colon not converted into single colon", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user