修改工单和里程碑暂不需要的字段

This commit is contained in:
sylor_huang@126.com 2020-06-08 11:38:03 +08:00
parent 1780f825ef
commit 26bc53ad26
9 changed files with 28 additions and 28 deletions

View File

@ -241,13 +241,13 @@ class IssuesController < ApplicationController
@issue_assign_to = @issue.get_assign_user
@join_users = join_users(@issue)
#总耗时
cost_time(@issue)
# cost_time(@issue)
#被依赖
@be_depended_issues_array = be_depended_issues(@issue)
# #被依赖
# @be_depended_issues_array = be_depended_issues(@issue)
#依赖于
depended_issues(@issue)
# #依赖于
# depended_issues(@issue)
end
def destroy

View File

@ -246,13 +246,13 @@ class PullRequestsController < ApplicationController
@issue_assign_to = @issue.get_assign_user
@join_users = join_users(@issue)
#总耗时
cost_time(@issue)
# cost_time(@issue)
#被依赖
@be_depended_issues_array = be_depended_issues(@issue)
# #被依赖
# @be_depended_issues_array = be_depended_issues(@issue)
#依赖于
depended_issues(@issue)
# #依赖于
# depended_issues(@issue)
end
def pr_merge

View File

@ -75,7 +75,7 @@ module TagChosenHelper
end
end
issue_versions = project.versions.order("created_at desc")&.pluck(:id,:name, :status)
issue_versions = project.versions&.pluck(:id,:name, :status)
new_version_info = [] #issue里程碑
if issue_versions.size > 0
issue_versions.each do |t|
@ -95,7 +95,7 @@ module TagChosenHelper
end
end
issue_tags = project.issue_tags.order("created_at desc")&.pluck(:id,:name, :color)
issue_tags = project.issue_tags&.pluck(:id,:name, :color)
new_tags_info = [] #issue标签
if issue_tags.size > 0
issue_tags.each do |t|

View File

@ -24,12 +24,12 @@ class Project < ApplicationRecord
has_one :project_score, dependent: :destroy
has_one :repository, dependent: :destroy
has_many :pull_requests, dependent: :destroy
has_many :issue_tags, dependent: :destroy
has_many :issue_tags, -> { order("issue_tags.created_at DESC") }, dependent: :destroy
has_many :issues, dependent: :destroy
# has_many :user_grades, dependent: :destroy
has_many :attachments, as: :container, dependent: :destroy
has_one :project_score, dependent: :destroy
has_many :versions, -> { order("versions.effective_date DESC, versions.name DESC") }, dependent: :destroy
has_many :versions, -> { order("versions.created_on DESC, versions.name DESC") }, dependent: :destroy
has_many :praise_treads, as: :praise_tread_object, dependent: :destroy
has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"

View File

@ -10,7 +10,7 @@ json.user_admin_or_member @user_admin_or_member
json.issues do
json.array! @issues.to_a do |issue|
cost_time(issue)
# cost_time(issue)
json.id issue.id
json.name issue.subject
json.format_time format_time(issue.created_on)
@ -31,6 +31,6 @@ json.issues do
json.token issue.issue_type == "2" ? issue.token : ""
json.issue_classify issue.issue_classify
json.branch_name issue.branch_name
json.cost_time @all_cost_time
# json.cost_time @all_cost_time
end
end

View File

@ -18,10 +18,10 @@ json.done_ratio @issue.done_ratio.to_s + "%"
json.issue_type @issue.issue_type
json.token @issue.issue_type == "2" ? @issue.token : ""
json.join_users @join_users
json.cost_time @cost_time_array
json.total_cost_time Time.at(@all_cost_time).utc.strftime('%H h %M min %S s')
json.be_depended_issues @be_depended_issues_array
json.depended_issues @depended_issues_array
# json.cost_time @cost_time_array
# json.total_cost_time Time.at(@all_cost_time).utc.strftime('%H h %M min %S s')
# json.be_depended_issues @be_depended_issues_array
# json.depended_issues @depended_issues_array
json.issue_classify @issue.issue_classify
json.branch_name @issue.branch_name
json.journals_count @issue.get_journals_size

View File

@ -10,7 +10,7 @@ json.user_admin_or_member @user_admin_or_member
json.issues do
json.array! @issues.to_a do |issue|
cost_time(issue)
# cost_time(issue)
json.pull_request_id issue.pull_request.id
json.pull_request_status issue.pull_request.status
json.id issue.id
@ -33,7 +33,7 @@ json.issues do
json.token issue.issue_type == "2" ? issue.token : ""
json.issue_classify issue.issue_classify
json.branch_name issue.branch_name
json.cost_time @all_cost_time
# json.cost_time @all_cost_time
end
end

View File

@ -23,10 +23,10 @@ json.issue do
json.issue_type @issue.issue_type == "1" ? "普通" : "悬赏"
json.token @issue.issue_type == "2" ? @issue.token : ""
json.join_users @join_users
json.cost_time @cost_time_array
json.total_cost_time Time.at(@all_cost_time).utc.strftime('%H h %M min %S s')
json.be_depended_issues @be_depended_issues_array
json.depended_issues @depended_issues_array
# json.cost_time @cost_time_array
# json.total_cost_time Time.at(@all_cost_time).utc.strftime('%H h %M min %S s')
# json.be_depended_issues @be_depended_issues_array
# json.depended_issues @depended_issues_array
end
json.attachments do

View File

@ -13,7 +13,7 @@ json.extract! @version, :id,:name,:project_id,:description, :effective_date, :st
json.issues do
json.array! @version_issues.each.to_a do |issue|
cost_time(issue)
# cost_time(issue)
json.id issue.id
json.name issue.subject
json.format_time format_time(issue.created_on)
@ -34,7 +34,7 @@ json.issues do
json.token issue.issue_type == "2" ? issue.token : ""
json.issue_classify issue.issue_classify
json.branch_name issue.branch_name
json.cost_time @all_cost_time
# json.cost_time @all_cost_time
end
end