mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
Update types to latest heartwood release
This commit is contained in:
@@ -142,23 +142,23 @@ const diffChangesetSchema = object({
|
||||
});
|
||||
|
||||
const diffAddedChangesetSchema = diffChangesetSchema.merge(
|
||||
object({ state: literal("added"), new: diffFileSchema }),
|
||||
object({ status: literal("added"), new: diffFileSchema }),
|
||||
);
|
||||
|
||||
const diffDeletedChangesetSchema = diffChangesetSchema.merge(
|
||||
object({ state: literal("deleted"), old: diffFileSchema }),
|
||||
object({ status: literal("deleted"), old: diffFileSchema }),
|
||||
);
|
||||
|
||||
const diffModifiedChangesetSchema = diffChangesetSchema.merge(
|
||||
object({
|
||||
state: literal("modified"),
|
||||
status: literal("modified"),
|
||||
new: diffFileSchema,
|
||||
old: diffFileSchema,
|
||||
}),
|
||||
);
|
||||
|
||||
const diffCopiedChangesetSchema = object({
|
||||
state: literal("copied"),
|
||||
status: literal("copied"),
|
||||
newPath: string(),
|
||||
oldPath: string(),
|
||||
});
|
||||
@@ -173,7 +173,7 @@ const diffCopiedWithModificationsChangesetSchema =
|
||||
);
|
||||
|
||||
const diffMovedChangesetSchema = object({
|
||||
state: literal("moved"),
|
||||
status: literal("moved"),
|
||||
newPath: string(),
|
||||
oldPath: string(),
|
||||
current: diffFileSchema,
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
const diffDescription = (diffFiles: Diff["files"]): string =>
|
||||
Object.entries(
|
||||
diffFiles.reduce(
|
||||
(acc, { state }) => {
|
||||
acc[state]++;
|
||||
(acc, { status }) => {
|
||||
acc[status]++;
|
||||
return acc;
|
||||
},
|
||||
{ added: 0, modified: 0, deleted: 0, copied: 0, moved: 0 },
|
||||
@@ -109,7 +109,7 @@
|
||||
filePath={path}
|
||||
oldFilePath={"oldPath" in file ? file.oldPath : undefined}
|
||||
fileDiff={file.diff}
|
||||
headerBadgeCaption={file.state}
|
||||
headerBadgeCaption={file.status}
|
||||
content={"new" in file ? files[file.new.oid]?.content : undefined}
|
||||
oldContent={"old" in file
|
||||
? files[file.old.oid]?.content
|
||||
@@ -117,7 +117,7 @@
|
||||
visible={filesVisibility.has(path)} />
|
||||
{:else}
|
||||
<FileLocationChange
|
||||
headerBadgeCaption={file.state}
|
||||
headerBadgeCaption={file.status}
|
||||
oldPath={file.oldPath}
|
||||
newPath={file.newPath}
|
||||
{repoId}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
export let content: string | undefined = undefined;
|
||||
export let oldFilePath: string | undefined = undefined;
|
||||
export let fileDiff: DiffContent;
|
||||
export let headerBadgeCaption: ChangesetWithDiff["state"];
|
||||
export let headerBadgeCaption: ChangesetWithDiff["status"];
|
||||
export let revision: string | undefined = undefined;
|
||||
export let baseUrl: BaseUrl;
|
||||
export let repoId: string;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import Link from "@app/components/Link.svelte";
|
||||
import FilePath from "@app/components/FilePath.svelte";
|
||||
|
||||
export let headerBadgeCaption: ChangesetWithoutDiff["state"];
|
||||
export let headerBadgeCaption: ChangesetWithoutDiff["status"];
|
||||
export let newPath: string;
|
||||
export let oldPath: string;
|
||||
export let revision: string | undefined = undefined;
|
||||
|
||||
Reference in New Issue
Block a user