chore: remove default fillout error issue
Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
parent
00a07647f8
commit
aeb5965db7
|
|
@ -91,11 +91,7 @@ export function ErrorElement() {
|
|||
)
|
||||
}
|
||||
|
||||
export const FeedbackIssue = ({
|
||||
message,
|
||||
stack,
|
||||
error,
|
||||
}: {
|
||||
export const FeedbackIssue = (_props: {
|
||||
message: string
|
||||
stack: string | null | undefined
|
||||
error?: unknown
|
||||
|
|
@ -105,10 +101,11 @@ export const FeedbackIssue = ({
|
|||
<a
|
||||
className="ml-2 cursor-pointer text-theme-accent-500 duration-200 hover:text-accent"
|
||||
href={getNewIssueUrl({
|
||||
error: error instanceof Error ? error : undefined,
|
||||
title: `Error: ${message}`,
|
||||
body: ["### Error", "", message, "", "### Stack", "", "```", stack, "```"].join("\n"),
|
||||
label: "bug",
|
||||
// error: error instanceof Error ? error : undefined,
|
||||
// title: `Error: ${message}`,
|
||||
// body: ["### Error", "", message, "", "### Stack", "", "```", stack, "```"].join("\n"),
|
||||
// label: "bug",
|
||||
template: "bug_report.yml",
|
||||
})}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ interface IssueOptions {
|
|||
error?: Error
|
||||
target: "issue" | "discussion"
|
||||
category: string
|
||||
template?: "bug_report.yml" | "feature_request.yml"
|
||||
}
|
||||
|
||||
export const getNewIssueUrl = ({
|
||||
|
|
@ -17,7 +18,9 @@ export const getNewIssueUrl = ({
|
|||
error,
|
||||
target = "issue",
|
||||
category,
|
||||
template,
|
||||
}: Partial<IssueOptions> = {}) => {
|
||||
// @see https://docs.github.com/en/enterprise-cloud@latest/issues/tracking-your-work-with-issues/using-issues/creating-an-issue
|
||||
const baseUrl =
|
||||
target === "discussion" ? `${repository.url}/discussions/new` : `${repository.url}/issues/new`
|
||||
|
||||
|
|
@ -25,7 +28,7 @@ export const getNewIssueUrl = ({
|
|||
if (category) searchParams.set("category", category)
|
||||
|
||||
let nextBody = [body || "", "", ...getCurrentEnvironment()].join("\n")
|
||||
if (label) searchParams.set("label", label)
|
||||
if (label) searchParams.set("labels", label)
|
||||
if (title) searchParams.set("title", title)
|
||||
|
||||
if (error && "traceId" in error && error.traceId) {
|
||||
|
|
@ -33,5 +36,6 @@ export const getNewIssueUrl = ({
|
|||
}
|
||||
|
||||
searchParams.set("body", nextBody)
|
||||
if (template) searchParams.set("template", template)
|
||||
return `${baseUrl}?${searchParams.toString()}`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ export const ListForm: Component<{
|
|||
onClick={() => {
|
||||
window.open(
|
||||
getNewIssueUrl({
|
||||
target: "discussion",
|
||||
category: "list-expired",
|
||||
body: [
|
||||
"### Info:",
|
||||
"",
|
||||
|
|
|
|||
|
|
@ -202,19 +202,20 @@ export const RenderError: FallbackRender = ({ error }) => {
|
|||
onClick={() => {
|
||||
window.open(
|
||||
getNewIssueUrl({
|
||||
body: [
|
||||
"### Error",
|
||||
"",
|
||||
nextError.message,
|
||||
"",
|
||||
"### Stack",
|
||||
"",
|
||||
"```",
|
||||
nextError.stack,
|
||||
"```",
|
||||
].join("\n"),
|
||||
label: "bug",
|
||||
title: "Render error",
|
||||
// body: [
|
||||
// "### Error",
|
||||
// "",
|
||||
// nextError.message,
|
||||
// "",
|
||||
// "### Stack",
|
||||
// "",
|
||||
// "```",
|
||||
// nextError.stack,
|
||||
// "```",
|
||||
// ].join("\n"),
|
||||
// label: "bug",
|
||||
// title: "Render error",
|
||||
template: "bug_report.yml",
|
||||
}),
|
||||
)
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ export const SettingAbout = () => {
|
|||
OpenIssueLink: (
|
||||
<a
|
||||
className="inline-flex cursor-pointer items-center gap-1 hover:underline"
|
||||
href={getNewIssueUrl()}
|
||||
href={getNewIssueUrl({ template: "feature_request.yml" })}
|
||||
target="_blank"
|
||||
>
|
||||
open an issue
|
||||
|
|
|
|||
Loading…
Reference in New Issue