Skip to content

Commit

Permalink
DEV: Address review comments
Browse files Browse the repository at this point in the history
Update SiteSettings names.
  • Loading branch information
Grubba27 committed Apr 24, 2024
1 parent c6f8794 commit 0487888
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/lib/plugin_initializer.rb
Expand Up @@ -17,7 +17,7 @@ def apply_plugin_api
class AssignsRemainderForTopicsQuery < PluginInitializer
def apply_plugin_api
plugin.register_modifier(:assigns_reminder_assigned_topics_query) do |query|
next query if !SiteSetting.prevent_assign_notification
next query if !SiteSetting.ignore_solved_topics_in_assigned_reminder
query.where(
"topics.id NOT IN (
SELECT topic_id
Expand Down
5 changes: 2 additions & 3 deletions config/locales/server.en.yml
Expand Up @@ -11,9 +11,8 @@ 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."
assign_to_status_on_solved: "Enable assigning a status when a topic is solved. Requires discourse-assign plugin."
status_to_assign_on_solved: "The status to assign when a topic is solved."
ignore_solved_topics_in_assigned_reminder: "Prevent assigned reminder from including solved topics. only relevant when discourse-assign."
assignment_status_on_solve: "When a topic is solved update all assignments to this status"
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."
Expand Down
8 changes: 3 additions & 5 deletions config/settings.yml
Expand Up @@ -32,13 +32,11 @@ discourse_solved:
client: true
notify_on_staff_accept_solved:
default: false
prevent_assign_notification:
ignore_solved_topics_in_assigned_reminder:
default: false
assign_to_status_on_solved:
default: false
status_to_assign_on_solved:
assignment_status_on_solve:
type: string
default: "Done"
default: ""
disable_solved_education_message:
default: false
accept_solutions_topic_author:
Expand Down
4 changes: 2 additions & 2 deletions plugin.rb
Expand Up @@ -623,11 +623,11 @@ def self.skip_db?
end
end

if defined?(DiscourseAssign) && SiteSetting.assign_to_status_on_solved
if defined?(DiscourseAssign) && SiteSetting.assignment_status_on_solve.present?
on(:accepted_solution) do |post|
Assigner.new(post.topic, post.acting_user).assign(
post.acting_user,
status: SiteSetting.status_to_assign_on_solved,
status: SiteSetting.assignment_status_on_solve,
)
end
end
Expand Down

0 comments on commit 0487888

Please sign in to comment.