mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 03:10:38 +09:00
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:
parent
59e29afab5
commit
c4838cca6e
3 changed files with 144 additions and 61 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue