Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1b25baa
Add issue reminders cron job with channel mapping and due in x days g…
azizu06 Mar 23, 2026
9be1ed1
create helper for formatting channel reminder messages
azizu06 Mar 23, 2026
e4587ec
add webhook envs for new issue reminder channels
azizu06 Mar 23, 2026
43a2116
add new webhook url channels
azizu06 Mar 23, 2026
cf30b4a
add blade to cron env
azizu06 Mar 23, 2026
35d3b1f
run the issue reminder schedule
azizu06 Mar 23, 2026
98c8730
include dry runs for channel msgs
azizu06 Mar 23, 2026
1851491
extend getIssue api to inlcude related team and assignees
azizu06 Mar 23, 2026
9c82f41
add the owning team of each issue
azizu06 Mar 23, 2026
b6e7a0d
make minimal page for issue reminder hyperlink
azizu06 Mar 23, 2026
16d03a6
remove debugs
azizu06 Mar 23, 2026
68afef8
remove test logs
azizu06 Mar 24, 2026
50b6b2a
Merge branch 'main' into sprint-01/cron-issue-reminders
azizu06 Mar 24, 2026
bd34e54
add notfound redirect if issue url param doesnt exist
azizu06 Mar 24, 2026
66f6a72
update env configuration to make issue webhooks optional and add remi…
azizu06 Mar 24, 2026
e5e34ab
Merge branch 'sprint-01/cron-issue-reminders' of https://github.com/K…
azizu06 Mar 24, 2026
d8ea5a5
add Discord webhook integration for issue reminders and improve loggi…
azizu06 Mar 24, 2026
0f310ca
fix formatting
azizu06 Mar 24, 2026
12fd904
add logging message for cron when the reminder channels are disabled.
azizu06 Mar 24, 2026
8a2af3b
add page level perm check for reading issues
azizu06 Mar 24, 2026
14bf6c2
split long messages into chunks so it doesn't exceed Discord's web ho…
azizu06 Mar 24, 2026
01da610
add additional message truncation for discord webhook
azizu06 Mar 24, 2026
654b355
fix format
azizu06 Mar 24, 2026
afc409d
Remove webhook retry and change issue day grouping to EST time.
azizu06 Mar 24, 2026
d594678
add overdue day prefix to discord msg
azizu06 Mar 25, 2026
772ebbc
change overdue format
azizu06 Mar 25, 2026
539cd3e
again format
azizu06 Mar 25, 2026
641ad9f
fix spacing
azizu06 Mar 25, 2026
ad710c2
make a list non bulleted
azizu06 Mar 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions apps/blade/src/app/issues/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import { notFound, redirect } from "next/navigation";
import { z } from "zod";

import { auth } from "@forge/auth";

import { SIGN_IN_PATH } from "~/consts";
import { api } from "~/trpc/server";

interface IssuePageProps {
params: Promise<{
id: string;
}>;
}

export default async function IssuePage({ params }: IssuePageProps) {
const session = await auth();
if (!session) redirect(SIGN_IN_PATH);

const hasAccess = await api.roles.hasPermission({ or: ["READ_ISSUES"] });
if (!hasAccess) notFound();

const { id } = await params;
if (!z.string().uuid().safeParse(id).success) notFound();
let issue;
try {
issue = await api.issues.getIssue({ id });
} catch {
notFound();
}

return (
<div className="container mx-auto max-w-4xl space-y-6 p-6 pb-16 lg:pt-40">
<div className="space-y-2">
<p className="text-sm text-muted-foreground">Issue</p>
<h1 className="text-3xl font-bold tracking-tight">{issue.name}</h1>
</div>

<div className="grid gap-4 md:grid-cols-2">
<div className="rounded-lg border p-4">
<h2 className="font-semibold">Status</h2>
<p className="mt-2 text-muted-foreground">{issue.status}</p>
</div>

<div className="rounded-lg border p-4">
<h2 className="font-semibold">Due Date</h2>
<p className="mt-2 text-muted-foreground">
{issue.date
? new Date(issue.date).toLocaleDateString()
: "No due date"}
</p>
</div>
</div>

<div className="rounded-lg border p-4">
<h2 className="font-semibold">Team</h2>
<p className="mt-2 text-muted-foreground">{issue.team.name}</p>
</div>

<div className="rounded-lg border p-4">
<h2 className="font-semibold">Description</h2>
<p className="mt-2 whitespace-pre-wrap text-muted-foreground">
{issue.description}
</p>
</div>

<div className="grid gap-4 md:grid-cols-2">
<div className="rounded-lg border p-4">
<h2 className="font-semibold">Assignees</h2>
<div className="mt-2 text-muted-foreground">
{issue.userAssignments.length > 0 ? (
<ul className="space-y-1">
{issue.userAssignments.map((assignment) => (
<li key={assignment.userId}>
{assignment.user.name ?? assignment.user.discordUserId}
</li>
))}
</ul>
) : (
<p>Unassigned</p>
)}
</div>
</div>

<div className="rounded-lg border p-4">
<h2 className="font-semibold">Visible Teams</h2>
<div className="mt-2 text-muted-foreground">
{issue.teamVisibility.length > 0 ? (
<ul className="space-y-1">
{issue.teamVisibility.map((visibility) => (
<li key={visibility.teamId}>{visibility.team.name}</li>
))}
</ul>
) : (
<p>No team visibility rules</p>
)}
</div>
</div>
</div>

<div className="rounded-lg border p-4">
<h2 className="font-semibold">Links</h2>
<div className="mt-2 text-muted-foreground">
{issue.links && issue.links.length > 0 ? (
<ul className="space-y-1">
{issue.links.map((link) => (
<li key={link}>
<a
href={link}
target="_blank"
rel="noreferrer"
className="text-primary underline underline-offset-4"
>
{link}
</a>
</li>
))}
</ul>
) : (
<p>No links</p>
)}
</div>
</div>
</div>
);
}
Loading
Loading