Skip to content

Commit

Permalink
add "Report issue" link
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Jun 13, 2024
1 parent fb2a58f commit b275cb1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions web/src/routes/(assets)/[...path]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ $: item = data.currentItem || (data.currentDir?.items.length == 1 ? data.current
$: title = item ? (item.path.split("/").pop() + item.ext) : "USD Assets";
$: thumbnailPath = item ? "https://github.com/usd-wg/assets/blob/main" + "/" + item.src + "?raw=true" : "";
function getNewIssueUrl() {
const repo = "https://github.com/needle-tools/usd-wg-assets/issues/new";
if (!item) return repo;
if (typeof navigator === "undefined") return repo;
const params = new URLSearchParams();
params.append("body", `### Description\n<!-- Please describe the issue you're seeing so that it can be reproduced.-->\n\n### Asset Link\n${item.filename}\n${window.location.href}\n\n### System Info\n\`\`\`${navigator.userAgent}\`\`\``);
params.append("title", `Issue with ${item.filename} at \`${item.path}\``);
return repo + "?" + params.toString();
}
</script>

<svelte:head>
Expand Down Expand Up @@ -59,6 +71,8 @@ $: thumbnailPath = item ? "https://github.com/usd-wg/assets/blob/main" + "/" + i
</a>

{/if}

<a href={getNewIssueUrl()} target="_blank">Report an issue</a><br/>
<a href={absoluteGithubUrl} target="_blank">View {item.filename}{item.ext} on GitHub</a><br/>
{#if data.usdText}
<a href="#code">View USD code</a>
Expand Down

0 comments on commit b275cb1

Please sign in to comment.