mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
mp_index for issue_priorities issue_tags issue_statues
This commit is contained in:
@@ -32,18 +32,7 @@ class IssueTag < ApplicationRecord
|
||||
validates :name, uniqueness: {scope: :project_id, message: "已存在" }
|
||||
|
||||
def self.init_data(project_id)
|
||||
data = [
|
||||
["缺陷", "表示存在意外问题或错误", "#d92d4c"],
|
||||
["功能", "表示新功能申请", "#ee955a"],
|
||||
["疑问", "表示存在疑惑", "#2d6ddc"],
|
||||
["支持", "表示特定功能或特定需求", "#019549"],
|
||||
["任务", "表示需要分配的任务", "#c1a30d"],
|
||||
["协助", "表示需要社区用户协助", "#2a0dc1"],
|
||||
["搁置", "表示此问题暂时不会继续处理", "#892794"],
|
||||
["文档", "表示文档材料补充", "#9ed600"],
|
||||
["测试", "表示需要测试的需求", "#2897b9"],
|
||||
["重复", "表示已存在类似的疑修", "#bb5332"]
|
||||
]
|
||||
data = init_issue_tag_data
|
||||
data.each do |item|
|
||||
next if IssueTag.exists?(project_id: project_id, name: item[0])
|
||||
IssueTag.create!(project_id: project_id, name: item[0], description: item[1], color: item[2])
|
||||
@@ -57,6 +46,34 @@ class IssueTag < ApplicationRecord
|
||||
end
|
||||
|
||||
|
||||
def self.init_issue_tag_data
|
||||
[
|
||||
["缺陷", "表示存在意外问题或错误", "#d92d4c"],
|
||||
["功能", "表示新功能申请", "#ee955a"],
|
||||
["疑问", "表示存在疑惑", "#2d6ddc"],
|
||||
["支持", "表示特定功能或特定需求", "#019549"],
|
||||
["任务", "表示需要分配的任务", "#c1a30d"],
|
||||
["协助", "表示需要社区用户协助", "#2a0dc1"],
|
||||
["搁置", "表示此问题暂时不会继续处理", "#892794"],
|
||||
["文档", "表示文档材料补充", "#9ed600"],
|
||||
["测试", "表示需要测试的需求", "#2897b9"],
|
||||
["重复", "表示已存在类似的疑修", "#bb5332"]
|
||||
]
|
||||
end
|
||||
|
||||
def self.init_mp_issues_tags
|
||||
data = {"total_count": 10,}
|
||||
data["issue_tags"] = init_issue_tag_data.map{|item|
|
||||
{
|
||||
"name": item[0],
|
||||
"description": item[1],
|
||||
"color": item[2],
|
||||
}
|
||||
}
|
||||
data
|
||||
end
|
||||
|
||||
|
||||
def to_builder
|
||||
Jbuilder.new do |tag|
|
||||
tag.(self, :id, :name, :description)
|
||||
|
||||
Reference in New Issue
Block a user