fix(web): render draft PRs in gray (#9537)
This commit is contained in:
1 parent
5cc369b7eb
commit
caab2fdbac
30 files changed
+152
-36
No files matched your search
@@ -14,6 +14,7 @@ export interface NormalizedGitLabMergeRequestRecord {
|
||||
readonly baseRefName: string;
|
||||
readonly headRefName: string;
|
||||
readonly state: "open" | "closed" | "merged";
|
||||
readonly isDraft?: boolean;
|
||||
readonly updatedAt: Option.Option<DateTime.Utc>;
|
||||
readonly isCrossRepository?: boolean;
|
||||
readonly headRepositoryNameWithOwner?: string | null;
|
||||
@@ -41,6 +42,8 @@ const GitLabMergeRequestSchema = Schema.Struct({
|
||||
source_branch: TrimmedNonEmptyString,
|
||||
target_branch: TrimmedNonEmptyString,
|
||||
state: Schema.optional(Schema.NullOr(Schema.String)),
|
||||
draft: Schema.optional(Schema.Boolean),
|
||||
work_in_progress: Schema.optional(Schema.Boolean),
|
||||
updated_at: Schema.optional(Schema.OptionFromNullOr(Schema.DateTimeUtcFromString)),
|
||||
source_project_id: Schema.optional(Schema.NullOr(Schema.Number)),
|
||||
target_project_id: Schema.optional(Schema.NullOr(Schema.Number)),
|
||||
@@ -108,6 +111,7 @@ function normalizeGitLabMergeRequestRecord(
|
||||
baseRefName: raw.target_branch,
|
||||
headRefName: raw.source_branch,
|
||||
state: normalizeGitLabMergeRequestState(raw.state),
|
||||
...(raw.draft === true || raw.work_in_progress === true ? { isDraft: true } : {}),
|
||||
updatedAt: raw.updated_at ?? Option.none(),
|
||||
...(typeof isCrossRepository === "boolean" ? { isCrossRepository } : {}),
|
||||
...(sourceProjectPath ? { headRepositoryNameWithOwner: sourceProjectPath } : {}),
|
||||
|
||||
Reference in new issue
Block a user