From 95ed1a0353e7c257cecfb1ccd02f17920ef7c6fd Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Mon, 27 Nov 2023 16:56:06 +0100 Subject: [PATCH] Adding embed editing in issues and patches --- httpd-client/index.ts | 3 +- httpd-client/lib/project.ts | 2 +- httpd-client/lib/project/issue.ts | 3 +- httpd-client/lib/project/patch.ts | 3 +- src/components/Comment.svelte | 6 +- src/components/CommentToggleInput.svelte | 4 +- src/components/ExtendedTextarea.svelte | 30 +++----- src/components/Markdown.svelte | 11 ++- src/components/Thread.svelte | 9 ++- src/lib/file.ts | 17 +++-- src/views/projects/Cob/Embeds.svelte | 2 +- src/views/projects/Cob/Revision.svelte | 2 +- src/views/projects/Issue.svelte | 23 +++--- src/views/projects/Issue/New.svelte | 10 +-- src/views/projects/Patch.svelte | 14 +++- tests/e2e/project/issue.spec.ts | 81 +++++++++++++++++++- tests/e2e/project/issues.spec.ts | 54 +------------- tests/e2e/project/threads.spec.ts | 95 +++++++++++++++++++++++- 18 files changed, 246 insertions(+), 123 deletions(-) diff --git a/httpd-client/index.ts b/httpd-client/index.ts index b7bb41e1e..fdf5b2be8 100644 --- a/httpd-client/index.ts +++ b/httpd-client/index.ts @@ -6,7 +6,7 @@ import type { Tree, DiffResponse, } from "./lib/project.js"; -import type { Comment } from "./lib/project/comment.js"; +import type { Comment, Embed } from "./lib/project/comment.js"; import type { Commit, CommitBlob, @@ -52,6 +52,7 @@ export type { DiffContent, DiffFile, DiffResponse, + Embed, HunkLine, Issue, IssueState, diff --git a/httpd-client/lib/project.ts b/httpd-client/lib/project.ts index a955ad5bc..7184212db 100644 --- a/httpd-client/lib/project.ts +++ b/httpd-client/lib/project.ts @@ -1,5 +1,5 @@ -import type { Embed } from "@app/lib/file.js"; import type { Commit, Commits } from "./project/commit.js"; +import type { Embed } from "./project/comment.js"; import type { Fetcher, RequestOptions } from "./fetcher.js"; import type { Issue, diff --git a/httpd-client/lib/project/issue.ts b/httpd-client/lib/project/issue.ts index a010c2227..a6d70143c 100644 --- a/httpd-client/lib/project/issue.ts +++ b/httpd-client/lib/project/issue.ts @@ -1,5 +1,4 @@ -import type { Embed } from "@app/lib/file.js"; -import type { Comment } from "./comment.js"; +import type { Comment, Embed } from "./comment.js"; import type { ZodSchema } from "zod"; import { array, boolean, literal, object, string, union } from "zod"; diff --git a/httpd-client/lib/project/patch.ts b/httpd-client/lib/project/patch.ts index 43e40eb39..24e39553c 100644 --- a/httpd-client/lib/project/patch.ts +++ b/httpd-client/lib/project/patch.ts @@ -1,5 +1,4 @@ -import type { Embed } from "@app/lib/file.js"; -import type { Comment } from "./comment.js"; +import type { Comment, Embed } from "./comment.js"; import type { ZodSchema, z } from "zod"; import { commentSchema } from "./comment.js"; diff --git a/src/components/Comment.svelte b/src/components/Comment.svelte index 9c4ed5684..97e6d2eb2 100644 --- a/src/components/Comment.svelte +++ b/src/components/Comment.svelte @@ -1,5 +1,5 @@