New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: Prevents assign notification & change status on solved #285
Changes from 1 commit
c6f8794
0487888
e63af67
c1d37ac
e102d82
3e0a596
6603d84
9d0e602
f398843
ab17e39
1a3a77d
8584bf6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
module DiscourseSolved | ||
class PluginInitializer | ||
attr_reader :plugin | ||
|
||
def initialize(plugin) | ||
@plugin = plugin | ||
end | ||
|
||
def apply_plugin_api | ||
# this method should be overridden by subclasses | ||
raise NotImplementedError | ||
end | ||
end | ||
|
||
class AssignsRemainderForTopicsQuery < PluginInitializer | ||
def apply_plugin_api | ||
plugin.register_modifier(:assigns_reminder_assigned_topics_query) do |query| | ||
next query if !SiteSetting.prevent_assign_notification | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will need this site setting to be more specific, something like |
||
query.where( | ||
"topics.id NOT IN ( | ||
SELECT topic_id | ||
FROM topic_custom_fields | ||
WHERE name = 'accepted_answer_post_id' | ||
)", | ||
) | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,9 @@ en: | |
solved_topics_auto_close_hours: "Auto close topic (n) hours after the last reply once the topic has been marked as solved. Set to 0 to disable auto closing." | ||
show_filter_by_solved_status: "Show a dropdown to filter a topic list by solved status." | ||
notify_on_staff_accept_solved: "Send notification to the topic creator when a post is marked as solution by a staff." | ||
prevent_assign_notification: "Prevent notification from discourse-assign for solved topics." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here maybe "Prevent assigned reminder from including solved topics. only relevant when discourse-assign" |
||
assign_to_status_on_solved: "Enable assigning a status when a topic is solved. Requires discourse-assign plugin." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe - "When a topic is solved update all assignments to this status" |
||
status_to_assign_on_solved: "The status to assign when a topic is solved." | ||
disable_solved_education_message: "Disable education message for solved topics." | ||
accept_solutions_topic_author: "Allow the topic author to accept a solution." | ||
solved_add_schema_markup: "Add QAPage schema markup to HTML." | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,13 @@ discourse_solved: | |
client: true | ||
notify_on_staff_accept_solved: | ||
default: false | ||
prevent_assign_notification: | ||
default: false | ||
assign_to_status_on_solved: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually think we don't need this site setting. You can default |
||
default: false | ||
status_to_assign_on_solved: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
type: string | ||
default: "Done" | ||
disable_solved_education_message: | ||
default: false | ||
accept_solutions_topic_author: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this remainder or reminder ?