From 0487888fb5287dbd34bf41a0bfeee22d4762df84 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Wed, 24 Apr 2024 11:06:32 -0300 Subject: [PATCH] DEV: Address review comments Update SiteSettings names. --- app/lib/plugin_initializer.rb | 2 +- config/locales/server.en.yml | 5 ++--- config/settings.yml | 8 +++----- plugin.rb | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/lib/plugin_initializer.rb b/app/lib/plugin_initializer.rb index e118016..1d49f4a 100644 --- a/app/lib/plugin_initializer.rb +++ b/app/lib/plugin_initializer.rb @@ -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 diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 54e4630..ff72237 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -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." diff --git a/config/settings.yml b/config/settings.yml index 6187de6..5e67f0b 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -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: diff --git a/plugin.rb b/plugin.rb index e16e2ad..d6b190d 100644 --- a/plugin.rb +++ b/plugin.rb @@ -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