History

fix(web): render draft PRs in gray (#9537)

Exotic committed 2 months agov0.0.39-nightly.20260904.1276

Commit caab2fd1 parent 5cc369b30 files · +152 −36Browse files

Showing the changes to apps/server/src/sourceControl/gitLabMergeRequests.ts (1 of 30 files). Show all

Unified · Split

apps/server/src/sourceControl/gitLabMergeRequests.ts+4−0
@@ -14,6 +14,7 @@ export interface NormalizedGitLabMergeRequestRecord { · 13 unmodified lines
1414 readonly baseRefName: string;
1515 readonly headRefName: string;
1616 readonly state: "open" | "closed" | "merged";
17+ readonly isDraft?: boolean;
1718 readonly updatedAt: Option.Option<DateTime.Utc>;
1819 readonly isCrossRepository?: boolean;
1920 readonly headRepositoryNameWithOwner?: string | null;
@@ -41,6 +42,8 @@ const GitLabMergeRequestSchema = Schema.Struct({ · 21 unmodified lines
4142 source_branch: TrimmedNonEmptyString,
4243 target_branch: TrimmedNonEmptyString,
4344 state: Schema.optional(Schema.NullOr(Schema.String)),
45+ draft: Schema.optional(Schema.Boolean),
46+ work_in_progress: Schema.optional(Schema.Boolean),
4447 updated_at: Schema.optional(Schema.OptionFromNullOr(Schema.DateTimeUtcFromString)),
4548 source_project_id: Schema.optional(Schema.NullOr(Schema.Number)),
4649 target_project_id: Schema.optional(Schema.NullOr(Schema.Number)),
@@ -108,6 +111,7 @@ function normalizeGitLabMergeRequestRecord( · 61 unmodified lines
108111 baseRefName: raw.target_branch,
109112 headRefName: raw.source_branch,
110113 state: normalizeGitLabMergeRequestState(raw.state),
114+ ...(raw.draft === true || raw.work_in_progress === true ? { isDraft: true } : {}),
111115 updatedAt: raw.updated_at ?? Option.none(),
112116 ...(typeof isCrossRepository === "boolean" ? { isCrossRepository } : {}),
113117 ...(sourceProjectPath ? { headRepositoryNameWithOwner: sourceProjectPath } : {}),