Browse Source

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

Co-authored-by: Lauris BH <lauris@nix.lv>
for-closed-social
James Lakin 4 years ago
committed by GitHub
parent
commit
3ff95cef60
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 8 deletions
  1. +1
    -0
      options/locale/locale_en-US.ini
  2. +8
    -3
      templates/repo/issue/list.tmpl
  3. +10
    -5
      templates/user/dashboard/issues.tmpl
  4. +4
    -0
      web_src/less/_repository.less

+ 1
- 0
options/locale/locale_en-US.ini View File

@ -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.

+ 8
- 3
templates/repo/issue/list.tmpl View File

@ -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}}
@ -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}}

+ 10
- 5
templates/user/dashboard/issues.tmpl View File

@ -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
@ -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}}

+ 4
- 0
web_src/less/_repository.less View File

@ -2129,6 +2129,10 @@
}
}
.conflicting {
padding-left: 5px;
}
.due-date {
padding-left: 5px;
}

Loading…
Cancel
Save