mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 22:30:41 +08:00
Add merged patch state
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
+9
-2
@@ -59,19 +59,26 @@ export interface Merge {
|
||||
export type PatchState =
|
||||
| { status: "draft" }
|
||||
| { status: "open" }
|
||||
| { status: "archived" };
|
||||
| { status: "archived" }
|
||||
| { status: "merged" };
|
||||
|
||||
export function groupPatches(patches: Patch[]): {
|
||||
open: Patch[];
|
||||
draft: Patch[];
|
||||
archived: Patch[];
|
||||
merged: Patch[];
|
||||
} {
|
||||
return patches.reduce(
|
||||
(acc, patch) => {
|
||||
acc[patch.state.status].push(patch);
|
||||
return acc;
|
||||
},
|
||||
{ open: [] as Patch[], draft: [] as Patch[], archived: [] as Patch[] },
|
||||
{
|
||||
open: [] as Patch[],
|
||||
draft: [] as Patch[],
|
||||
archived: [] as Patch[],
|
||||
merged: [] as Patch[],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ export interface ProjectInfo {
|
||||
open: number;
|
||||
draft: number;
|
||||
archived: number;
|
||||
merged: number;
|
||||
};
|
||||
issues: {
|
||||
open: number;
|
||||
@@ -137,6 +138,7 @@ export class Project implements ProjectInfo {
|
||||
open: number;
|
||||
draft: number;
|
||||
archived: number;
|
||||
merged: number;
|
||||
};
|
||||
issues: {
|
||||
open: number;
|
||||
|
||||
Reference in New Issue
Block a user