Skip to content

Commit 3ff95ce

Browse files
Show if a PR has conflicting files on the PR lists (#10130)
Co-authored-by: Lauris BH <[email protected]>
1 parent 20c513b commit 3ff95ce

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@ pulls.blocked_by_rejection = "This Pull Request has changes requested by an offi
10661066
pulls.can_auto_merge_desc = This pull request can be merged automatically.
10671067
pulls.cannot_auto_merge_desc = This pull request cannot be merged automatically due to conflicts.
10681068
pulls.cannot_auto_merge_helper = Merge manually to resolve the conflicts.
1069+
pulls.num_conflicting_files = "%d conflicting files"
10691070
pulls.no_merge_desc = This pull request cannot be merged because all repository merge options are disabled.
10701071
pulls.no_merge_helper = Enable merge options in the repository settings or merge the pull request manually.
10711072
pulls.no_merge_wip = This pull request can not be merged because it is marked as being a work in progress.

templates/repo/issue/list.tmpl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@
212212
<div class="ui {{if .IsClosed}}{{if .IsPull}}{{if .PullRequest.HasMerged}}purple{{else}}red{{end}}{{else}}red{{end}}{{else}}{{if .IsRead}}white{{else}}green{{end}}{{end}} label">#{{.Index}}</div>
213213
<a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Title}}</a>
214214

215-
{{if .IsPull }}
216-
{{if (index $.CommitStatus .PullRequest.ID)}}
217-
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
215+
{{if .IsPull }}
216+
{{if (index $.CommitStatus .PullRequest.ID)}}
217+
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
218218
{{end}}
219219
{{end}}
220220

@@ -267,6 +267,11 @@
267267
<img class="ui avatar image" src="{{.RelAvatarLink}}">
268268
</a>
269269
{{end}}
270+
{{if .IsPull}}
271+
{{if (len .PullRequest.ConflictedFiles) gt 0}}
272+
<span class="conflicting"><i class="octicon octicon-mirror"></i> {{$.i18n.Tr "repo.pulls.num_conflicting_files" (len .PullRequest.ConflictedFiles)}}</span>
273+
{{end}}
274+
{{end}}
270275
</p>
271276
</li>
272277
{{end}}

templates/user/dashboard/issues.tmpl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@
9191
<div class="ui label">{{.Repo.FullName}}#{{.Index}}</div>
9292
<a class="title has-emoji" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Title}}</a>
9393

94-
{{if .IsPull }}
95-
{{if (index $.CommitStatus .PullRequest.ID)}}
96-
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
97-
{{end}}
98-
{{end}}
94+
{{if .IsPull}}
95+
{{if (index $.CommitStatus .PullRequest.ID)}}
96+
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
97+
{{end}}
98+
{{end}}
9999

100100
{{with .Labels}}
101101
{{/* If we have any labels, we should show them
@@ -151,6 +151,11 @@
151151
<span class="octicon octicon-calendar"></span><span{{if .IsOverdue}} class="overdue"{{end}}>{{.DeadlineUnix.FormatShort}}</span>
152152
</span>
153153
{{end}}
154+
{{if .IsPull}}
155+
{{if (len .PullRequest.ConflictedFiles) gt 0}}
156+
<span class="conflicting"><i class="octicon octicon-mirror"></i> {{$.i18n.Tr "repo.pulls.num_conflicting_files" (len .PullRequest.ConflictedFiles)}}</span>
157+
{{end}}
158+
{{end}}
154159
</p>
155160
</li>
156161
{{end}}

web_src/less/_repository.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,6 +2129,10 @@
21292129
}
21302130
}
21312131

2132+
.conflicting {
2133+
padding-left: 5px;
2134+
}
2135+
21322136
.due-date {
21332137
padding-left: 5px;
21342138
}

0 commit comments

Comments
 (0)