fix: change template message setting default value

This commit is contained in:
yystopf 2021-10-19 14:39:15 +08:00
parent bd9759a3ed
commit dbe47dbddf
3 changed files with 19 additions and 18 deletions

View File

@ -25,7 +25,6 @@ class TemplateMessageSetting::CreateOrAssign < TemplateMessageSetting
end
def self.build_init_data
self.find_or_create_by(name: "易修被指派", key: "IssueAssigned")
self.find_or_create_by(name: "合并请求被指派", key: "PullRequestAssigned")
end
end

View File

@ -16,7 +16,7 @@
class TemplateMessageSetting::Normal < TemplateMessageSetting
def self.type_name
""
"我的状态"
end
def self.order_index
@ -24,8 +24,10 @@ class TemplateMessageSetting::Normal < TemplateMessageSetting
end
def self.build_init_data
self.find_or_create_by(name: "账号有权限变更", key: "Permission")
self.find_or_create_by(name: "被拉入或移出组织", key: "Organization")
self.find_or_create_by(name: "被拉入或移出项目", key: "Project")
self.find_or_create_by(name: "有权限变更", key: "Permission")
self.find_or_create_by(name: "易修被指派", key: "IssueAssigned")
self.find_or_create_by(name: "合并请求被指派", key: "PullRequestAssigned")
end
end

View File

@ -28,29 +28,29 @@ class UserTemplateMessageSetting < ApplicationRecord
def self.init_notification_body
{
"CreateOrAssign::IssueAssigned": true,
"CreateOrAssign::PullRequestAssigned": true,
"Normal::Permission": true,
"Normal::Project": true,
"Normal::Organization": true,
"Normal::IssueAssigned": true,
"Normal::PullRequestAssigned": true,
"ManageProject::Issue": true,
"ManageProject::PullRequest": true,
"ManageProject::Member": true,
"ManageProject::SettingChanged": true,
"Normal::Organization": true,
"Normal::Project": true,
"Normal::Permission": true,
}.stringify_keys!
end
def self.init_email_body
{
"CreateOrAssign::IssueAssigned": false,
"CreateOrAssign::PullRequestAssigned": false,
"ManageProject::Issue": false,
"ManageProject::PullRequest": false,
"ManageProject::Member": false,
"ManageProject::SettingChanged": false,
"Normal::Organization": false,
"Normal::Project": false,
"Normal::Permission": false,
"Normal::Permission": true,
"Normal::Project": true,
"Normal::Organization": true,
"Normal::IssueAssigned": true,
"Normal::PullRequestAssigned": true,
"ManageProject::Issue": true,
"ManageProject::PullRequest": true,
"ManageProject::Member": true,
"ManageProject::SettingChanged": true,
}.stringify_keys!
end