DEV: Delete plugin specific webhook events
This commit is contained in:
parent
87359cf7aa
commit
a5cbef5d1a
|
@ -40,8 +40,6 @@ class WebHook < ActiveRecord::Base
|
||||||
WebHookEventType::TYPES[:post_edited],
|
WebHookEventType::TYPES[:post_edited],
|
||||||
WebHookEventType::TYPES[:post_destroyed],
|
WebHookEventType::TYPES[:post_destroyed],
|
||||||
WebHookEventType::TYPES[:post_recovered],
|
WebHookEventType::TYPES[:post_recovered],
|
||||||
WebHookEventType::TYPES[:category_experts_approved],
|
|
||||||
WebHookEventType::TYPES[:category_experts_unapproved],
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -85,8 +85,6 @@ class WebHookEventType < ActiveRecord::Base
|
||||||
chat_message_edited: 1802,
|
chat_message_edited: 1802,
|
||||||
chat_message_trashed: 1803,
|
chat_message_trashed: 1803,
|
||||||
chat_message_restored: 1804,
|
chat_message_restored: 1804,
|
||||||
category_experts_approved: 1901,
|
|
||||||
category_experts_unapproved: 1902,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
has_and_belongs_to_many :web_hooks
|
has_and_belongs_to_many :web_hooks
|
||||||
|
@ -118,11 +116,6 @@ class WebHookEventType < ActiveRecord::Base
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
unless defined?(SiteSetting.enable_category_experts) && SiteSetting.enable_category_experts
|
|
||||||
ids_to_exclude.concat(
|
|
||||||
[TYPES[:category_experts_approved], TYPES[:category_experts_unapproved]],
|
|
||||||
)
|
|
||||||
end
|
|
||||||
self.where.not(id: ids_to_exclude)
|
self.where.not(id: ids_to_exclude)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5441,8 +5441,6 @@ en:
|
||||||
post_edited: "Post is updated"
|
post_edited: "Post is updated"
|
||||||
post_destroyed: "Post is deleted"
|
post_destroyed: "Post is deleted"
|
||||||
post_recovered: "Post is recovered"
|
post_recovered: "Post is recovered"
|
||||||
category_experts_approved: "Post marked as category experts post"
|
|
||||||
category_experts_unapproved: "Post unmarked as category experts post"
|
|
||||||
group_event:
|
group_event:
|
||||||
group_name: "Group Events"
|
group_name: "Group Events"
|
||||||
group_created: "Group is created"
|
group_created: "Group is created"
|
||||||
|
|
|
@ -230,13 +230,3 @@ WebHookEventType.seed do |b|
|
||||||
b.name = "chat_message_restored"
|
b.name = "chat_message_restored"
|
||||||
b.group = WebHookEventType.groups[:chat]
|
b.group = WebHookEventType.groups[:chat]
|
||||||
end
|
end
|
||||||
WebHookEventType.seed do |b|
|
|
||||||
b.id = WebHookEventType::TYPES[:category_experts_approved]
|
|
||||||
b.name = "category_experts_approved"
|
|
||||||
b.group = WebHookEventType.groups[:post]
|
|
||||||
end
|
|
||||||
WebHookEventType.seed do |b|
|
|
||||||
b.id = WebHookEventType::TYPES[:category_experts_unapproved]
|
|
||||||
b.name = "category_experts_unapproved"
|
|
||||||
b.group = WebHookEventType.groups[:post]
|
|
||||||
end
|
|
||||||
|
|
|
@ -49,7 +49,6 @@ RSpec.describe WebHookEventType do
|
||||||
SiteSetting.stubs(:assign_enabled).returns(true)
|
SiteSetting.stubs(:assign_enabled).returns(true)
|
||||||
SiteSetting.stubs(:topic_voting_enabled).returns(true)
|
SiteSetting.stubs(:topic_voting_enabled).returns(true)
|
||||||
SiteSetting.stubs(:chat_enabled).returns(true)
|
SiteSetting.stubs(:chat_enabled).returns(true)
|
||||||
SiteSetting.stubs(:enable_category_experts).returns(true)
|
|
||||||
plugins_event_types = WebHookEventType.active.map(&:name) - core_event_types
|
plugins_event_types = WebHookEventType.active.map(&:name) - core_event_types
|
||||||
expect(plugins_event_types).to match_array(
|
expect(plugins_event_types).to match_array(
|
||||||
%w[
|
%w[
|
||||||
|
@ -63,8 +62,6 @@ RSpec.describe WebHookEventType do
|
||||||
chat_message_edited
|
chat_message_edited
|
||||||
chat_message_trashed
|
chat_message_trashed
|
||||||
chat_message_restored
|
chat_message_restored
|
||||||
category_experts_approved
|
|
||||||
category_experts_unapproved
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue