Skip to content

Commit

Permalink
Update types to latest heartwood release
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastinez committed Aug 29, 2024
1 parent 1cd2840 commit 1fb1d84
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions http-client/lib/repo/commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
});
Expand All @@ -173,7 +173,7 @@ const diffCopiedWithModificationsChangesetSchema =
);

const diffMovedChangesetSchema = object({
state: literal("moved"),
status: literal("moved"),
newPath: string(),
oldPath: string(),
current: diffFileSchema,
Expand Down
8 changes: 4 additions & 4 deletions src/views/repos/Changeset.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -109,15 +109,15 @@
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
: undefined}
visible={filesVisibility.has(path)} />
{:else}
<FileLocationChange
headerBadgeCaption={file.state}
headerBadgeCaption={file.status}
oldPath={file.oldPath}
newPath={file.newPath}
{repoId}
Expand Down
2 changes: 1 addition & 1 deletion src/views/repos/Changeset/FileDiff.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/views/repos/Changeset/FileLocationChange.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1fb1d84

Please sign in to comment.