change pr

This commit is contained in:
sylor_huang@126.com
2020-06-30 09:44:28 +08:00
parent d4962b5c75
commit 999006fba7
5 changed files with 30 additions and 11 deletions

View File

@@ -1,9 +1,11 @@
json.partial! "commons/success"
# json.partial! "pull_requests/merge_item"
json.fork_project_user_name @fork_project_user_name
json.fork_project_user @fork_project_user
json.fork_project_identifier @fork_project_identifier
json.project_author @project.owner.try(:show_real_name)
json.project_name @project.repository.try(:identifier)
json.project_login @project.owner.try(:login)
json.extract! @pull_request, :id, :title, :body, :milestone,:head,:base,:is_original
json.extract! @issue, :assigned_to_id, :fixed_version_id, :priority_id
json.issue_tag_ids @issue.issue_tags_value.split(",")

View File

@@ -7,6 +7,7 @@ json.search_count @issues_size
json.limit @limit
json.user_admin_or_member @user_admin_or_member
json.project_name @project.name
json.project_author_name @project.owner.try(:login)
json.issues do
json.array! @issues.to_a do |issue|
@@ -17,9 +18,10 @@ json.issues do
json.pull_request_base pr.base
json.pull_request_staus pr.status == 1 ? "merged" : (pr.status == 2 ? "closed" : "open")
json.is_original pr.is_original
json.fork_project_id pr.fork_project_id
json.pull_request_user pr.user.try(:show_real_name)
json.fork_project_id pr&.fork_project_id
json.fork_project_user pr&.fork_project&.owner.try(:login)
json.id issue.id
json.name issue.subject
json.pr_time time_from_now(pr.status == 1 ? pr.updated_at : issue.updated_on)

View File

@@ -5,11 +5,12 @@ json.pr_time time_from_now(@pull_request.updated_at)
json.pull_request do
json.extract! @pull_request, :id,:base, :head, :status,:fork_project_id, :is_original
json.pull_request_staus @pull_request.status == 1 ? "merged" : (@pull_request.status == 2 ? "closed" : "open")
json.pull_request_user @pull_request.user.try(:show_real_name)
json.fork_project_user @pull_request&.fork_project&.owner.try(:login)
end
json.issue do
json.extract! @issue, :id,:subject,:description,:is_private, :branch_name
json.project_author_name @project.owner.try(:login)
json.user_permission @user_permission
json.closed_on @issue.closed_on.present? ? format_time(@issue.closed_on) : ""
json.created_at format_time(@issue.created_on)