修复:部分issue
This commit is contained in:
parent
2c3b7c6fa2
commit
16dbb87526
|
@ -219,7 +219,7 @@ class Issue < ApplicationRecord
|
||||||
|
|
||||||
def to_builder
|
def to_builder
|
||||||
Jbuilder.new do |issue|
|
Jbuilder.new do |issue|
|
||||||
issue.(self, :id, :project_issues_index, :subject, :description)
|
issue.(self, :id, :project_issues_index, :subject, :description, :branch_name, :start_date, :due_date)
|
||||||
issue.created_at self.created_on.strftime("%Y-%m-%d %H:%M")
|
issue.created_at self.created_on.strftime("%Y-%m-%d %H:%M")
|
||||||
issue.updated_at self.updated_on.strftime("%Y-%m-%d %H:%M")
|
issue.updated_at self.updated_on.strftime("%Y-%m-%d %H:%M")
|
||||||
issue.tags self.show_issue_tags.map{|t| JSON.parse(t.to_builder.target!)}
|
issue.tags self.show_issue_tags.map{|t| JSON.parse(t.to_builder.target!)}
|
||||||
|
|
|
@ -128,7 +128,7 @@ class Api::V1::Issues::UpdateService < ApplicationService
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_previous_issue_changes
|
def build_previous_issue_changes
|
||||||
@previous_issue_changes.merge!(@updated_issue.previous_changes.slice("status_id", "priority_id", "fixed_version_id", "issue_tags_value", "branch_name").symbolize_keys)
|
@previous_issue_changes.merge!(@updated_issue.previous_changes.slice("status_id", "priority_id", "fixed_version_id", "issue_tags_value", "branch_name", "subject", "description").symbolize_keys)
|
||||||
if @updated_issue.previous_changes[:start_date].present?
|
if @updated_issue.previous_changes[:start_date].present?
|
||||||
@previous_issue_changes.merge!(start_date: [@updated_issue.previous_changes[:start_date][0].to_s, @updated_issue.previous_changes[:start_date][1].to_s])
|
@previous_issue_changes.merge!(start_date: [@updated_issue.previous_changes[:start_date][0].to_s, @updated_issue.previous_changes[:start_date][1].to_s])
|
||||||
end
|
end
|
||||||
|
|
|
@ -55,7 +55,7 @@ module Webhook::Client
|
||||||
|
|
||||||
@response_content["status"] = response.code
|
@response_content["status"] = response.code
|
||||||
@response_content["headers"] = response.headers
|
@response_content["headers"] = response.headers
|
||||||
@response_content["body"] = response.body.to_json
|
@response_content["body"] = response.body
|
||||||
|
|
||||||
rescue => e
|
rescue => e
|
||||||
@response_content["status"] = 500
|
@response_content["status"] = 500
|
||||||
|
|
|
@ -89,6 +89,7 @@ class Webhook::IssueClient
|
||||||
{
|
{
|
||||||
"action": @changes["assigners"].blank? ? "unassigned" : "assigned",
|
"action": @changes["assigners"].blank? ? "unassigned" : "assigned",
|
||||||
"number": @issue.project_issues_index,
|
"number": @issue.project_issues_index,
|
||||||
|
"changes": @changes,
|
||||||
"issue": JSON.parse(@issue.to_builder.target!),
|
"issue": JSON.parse(@issue.to_builder.target!),
|
||||||
"project": JSON.parse(@issue.project.to_builder.target!),
|
"project": JSON.parse(@issue.project.to_builder.target!),
|
||||||
"sender": JSON.parse(@sender.to_builder.target!)
|
"sender": JSON.parse(@sender.to_builder.target!)
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Webhook::IssueCommentClient
|
||||||
def initialize(webhook, issue, journal, sender, event, action_type, comment_json={})
|
def initialize(webhook, issue, journal, sender, event, action_type, comment_json={})
|
||||||
@webhook = webhook
|
@webhook = webhook
|
||||||
@issue = issue.reload
|
@issue = issue.reload
|
||||||
@journal = journal.reload
|
@journal = journal.present? ? journal.reload : nil
|
||||||
@sender = sender.reload
|
@sender = sender.reload
|
||||||
@event = event
|
@event = event
|
||||||
@action_type = action_type
|
@action_type = action_type
|
||||||
|
|
|
@ -6,7 +6,7 @@ class Webhook::PullCommentClient
|
||||||
def initialize(webhook, pull, journal, sender, event, action_type='created', comment_json={})
|
def initialize(webhook, pull, journal, sender, event, action_type='created', comment_json={})
|
||||||
@webhook = webhook
|
@webhook = webhook
|
||||||
@pull = pull.reload
|
@pull = pull.reload
|
||||||
@journal = journal.reload
|
@journal = journal.present? ? journal.reload : nil
|
||||||
@sender = sender.reload
|
@sender = sender.reload
|
||||||
@event = event
|
@event = event
|
||||||
@action_type = action_type
|
@action_type = action_type
|
||||||
|
|
Loading…
Reference in New Issue