Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show if a PR has conflicting files on the PR lists #10130

Merged
merged 2 commits into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Show if a PR has conflicting files on the PR lists
  • Loading branch information
James Lakin committed Feb 3, 2020
commit 88232d75a5219f8936bbd385a86153b7b1de0f64
1 change: 1 addition & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ pulls.blocked_by_rejection = "This Pull Request has changes requested by an offi
pulls.can_auto_merge_desc = This pull request can be merged automatically.
pulls.cannot_auto_merge_desc = This pull request cannot be merged automatically due to conflicts.
pulls.cannot_auto_merge_helper = Merge manually to resolve the conflicts.
pulls.num_conflicting_files = "%d conflicting files"
pulls.no_merge_desc = This pull request cannot be merged because all repository merge options are disabled.
pulls.no_merge_helper = Enable merge options in the repository settings or merge the pull request manually.
pulls.no_merge_wip = This pull request can not be merged because it is marked as being a work in progress.
Expand Down
11 changes: 8 additions & 3 deletions templates/repo/issue/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@
<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>
<a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Title}}</a>

{{if .IsPull }}
{{if (index $.CommitStatus .PullRequest.ID)}}
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
{{if .IsPull }}
{{if (index $.CommitStatus .PullRequest.ID)}}
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
{{end}}
{{end}}

Expand Down Expand Up @@ -267,6 +267,11 @@
<img class="ui avatar image" src="{{.RelAvatarLink}}">
</a>
{{end}}
{{if .IsPull}}
{{if (len .PullRequest.ConflictedFiles) gt 0}}
<span class="conflicting"><i class="octicon octicon-mirror"></i> {{$.i18n.Tr "repo.pulls.num_conflicting_files" (len .PullRequest.ConflictedFiles)}}</span>
{{end}}
{{end}}
</p>
</li>
{{end}}
Expand Down
15 changes: 10 additions & 5 deletions templates/user/dashboard/issues.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@
<div class="ui label">{{.Repo.FullName}}#{{.Index}}</div>
<a class="title has-emoji" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Title}}</a>

{{if .IsPull }}
{{if (index $.CommitStatus .PullRequest.ID)}}
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
{{end}}
{{end}}
{{if .IsPull}}
{{if (index $.CommitStatus .PullRequest.ID)}}
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
{{end}}
{{end}}

{{with .Labels}}
{{/* If we have any labels, we should show them
Expand Down Expand Up @@ -151,6 +151,11 @@
<span class="octicon octicon-calendar"></span><span{{if .IsOverdue}} class="overdue"{{end}}>{{.DeadlineUnix.FormatShort}}</span>
</span>
{{end}}
{{if .IsPull}}
{{if (len .PullRequest.ConflictedFiles) gt 0}}
<span class="conflicting"><i class="octicon octicon-mirror"></i> {{$.i18n.Tr "repo.pulls.num_conflicting_files" (len .PullRequest.ConflictedFiles)}}</span>
{{end}}
{{end}}
</p>
</li>
{{end}}
Expand Down
4 changes: 4 additions & 0 deletions web_src/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,10 @@
}
}

.conflicting {
padding-left: 5px;
}

.due-date {
padding-left: 5px;
}
Expand Down