forked from farhoodlabs/paperclip
Render join requests inline in inbox like approvals and other work items
Join requests were displayed in a separate card-style section below the main inbox list. This moves them into the unified work items feed so they sort chronologically alongside issues, approvals, and failed runs—matching the inline treatment hiring requests already receive. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -28,6 +28,11 @@ export type InboxWorkItem =
|
||||
kind: "failed_run";
|
||||
timestamp: number;
|
||||
run: HeartbeatRun;
|
||||
}
|
||||
| {
|
||||
kind: "join_request";
|
||||
timestamp: number;
|
||||
joinRequest: JoinRequest;
|
||||
};
|
||||
|
||||
export interface InboxBadgeData {
|
||||
@@ -152,10 +157,12 @@ export function getInboxWorkItems({
|
||||
issues,
|
||||
approvals,
|
||||
failedRuns = [],
|
||||
joinRequests = [],
|
||||
}: {
|
||||
issues: Issue[];
|
||||
approvals: Approval[];
|
||||
failedRuns?: HeartbeatRun[];
|
||||
joinRequests?: JoinRequest[];
|
||||
}): InboxWorkItem[] {
|
||||
return [
|
||||
...issues.map((issue) => ({
|
||||
@@ -173,6 +180,11 @@ export function getInboxWorkItems({
|
||||
timestamp: normalizeTimestamp(run.createdAt),
|
||||
run,
|
||||
})),
|
||||
...joinRequests.map((joinRequest) => ({
|
||||
kind: "join_request" as const,
|
||||
timestamp: normalizeTimestamp(joinRequest.createdAt),
|
||||
joinRequest,
|
||||
})),
|
||||
].sort((a, b) => {
|
||||
const timestampDiff = b.timestamp - a.timestamp;
|
||||
if (timestampDiff !== 0) return timestampDiff;
|
||||
|
||||
Reference in New Issue
Block a user