DEV: Remove dreprecated review queue code (#47)

DEV: Remove dreprecated review queue code (#47)

diff --git a/assets/javascripts/discourse-assign/connectors/flagged-post-below-controls/show-not-assigned.hbs b/assets/javascripts/discourse-assign/connectors/flagged-post-below-controls/show-not-assigned.hbs
deleted file mode 100644
index 2936879..0000000
--- a/assets/javascripts/discourse-assign/connectors/flagged-post-below-controls/show-not-assigned.hbs
+++ /dev/null
@@ -1,20 +0,0 @@
-{{#unless canAct}}
-  {{#if actableFilter}}
-    {{#if flaggedPost.topic.assigned_to_user}}
-      <div class='cant-act-flagged-post'>
-        <div class='cant-act-message'>
-          {{i18n "discourse_assign.cant_act"}}
-        </div>
-        <div class='assigned-to'>
-          {{assigned-to user=flaggedPost.topic.assigned_to_user}}
-        </div>
-      </div>
-    {{else}}
-      <div class='cant-act-flagged-post'>
-        <div class='cant-act-message'>
-          {{i18n "discourse_assign.cant_act_unclaimed"}}
-        </div>
-      </div>
-    {{/if}}
-  {{/if}}
-{{/unless}}
diff --git a/assets/javascripts/discourse-assign/connectors/flagged-post-controls/claim-flagged-post.hbs b/assets/javascripts/discourse-assign/connectors/flagged-post-controls/claim-flagged-post.hbs
deleted file mode 100644
index a1100d6..0000000
--- a/assets/javascripts/discourse-assign/connectors/flagged-post-controls/claim-flagged-post.hbs
+++ /dev/null
@@ -1 +0,0 @@
-{{claim-topic topic=flaggedPost.topic}}
diff --git a/assets/javascripts/discourse-assign/connectors/flagged-post-controls/claim-flagged-post.js.es6 b/assets/javascripts/discourse-assign/connectors/flagged-post-controls/claim-flagged-post.js.es6
deleted file mode 100644
index c6d22f8..0000000
--- a/assets/javascripts/discourse-assign/connectors/flagged-post-controls/claim-flagged-post.js.es6
+++ /dev/null
@@ -1,5 +0,0 @@
-export default {
-  shouldRender(args) {
-    return args.actableFilter && !args.topic;
-  }
-};
diff --git a/assets/javascripts/discourse-assign/connectors/flagged-topic-details-header/assigned-to.hbs b/assets/javascripts/discourse-assign/connectors/flagged-topic-details-header/assigned-to.hbs
deleted file mode 100644
index c9c4eb6..0000000
--- a/assets/javascripts/discourse-assign/connectors/flagged-topic-details-header/assigned-to.hbs
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class='assign-controls'>
-  {{flagged-topic-listener topic=topic}}
-  {{claim-topic topic=topic}}
-</div>
diff --git a/assets/javascripts/discourse-assign/connectors/flagged-topic-header-row/add-assigned-header.hbs b/assets/javascripts/discourse-assign/connectors/flagged-topic-header-row/add-assigned-header.hbs
deleted file mode 100644
index 6473abd..0000000
--- a/assets/javascripts/discourse-assign/connectors/flagged-topic-header-row/add-assigned-header.hbs
+++ /dev/null
@@ -1 +0,0 @@
-<th class='topic-assigned-to'>{{i18n "discourse_assign.assigned"}}</th>
diff --git a/assets/javascripts/discourse-assign/connectors/flagged-topic-row/add-claim-controls.hbs b/assets/javascripts/discourse-assign/connectors/flagged-topic-row/add-claim-controls.hbs
deleted file mode 100644
index 849ffd0..0000000
--- a/assets/javascripts/discourse-assign/connectors/flagged-topic-row/add-claim-controls.hbs
+++ /dev/null
@@ -1,3 +0,0 @@
-<td>
-  {{claim-topic topic=topic}}
-</td>
diff --git a/assets/javascripts/discourse-assign/connectors/flagged-topics-before/add-listener.hbs b/assets/javascripts/discourse-assign/connectors/flagged-topics-before/add-listener.hbs
deleted file mode 100644
index 6eee759..0000000
--- a/assets/javascripts/discourse-assign/connectors/flagged-topics-before/add-listener.hbs
+++ /dev/null
@@ -1 +0,0 @@
-{{flagged-topic-listener flaggedTopics=flaggedTopics}}
diff --git a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6 b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6
index eecbd6d..b8be2b9 100644
--- a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6
+++ b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6
@@ -4,9 +4,6 @@ import { iconNode } from "discourse-common/lib/icon-library";
 import { h } from "virtual-dom";
 import { iconHTML } from "discourse-common/lib/icon-library";
 import { queryRegistry } from "discourse/widgets/widget";
-
-// TODO: This has to be removed when 2.3 becomes the new stable version.
-import { ListItemDefaults } from "discourse/components/topic-list-item";
 import { getOwner } from "discourse-common/lib/get-owner";
 
 function registerTopicFooterButtons(api) {
@@ -140,10 +137,7 @@ function initialize(api) {
         "user-plus"
       )}${assignedTo}</a>`;
 
-      if (
-        ListItemDefaults === undefined &&
-        topic.archetype === "private_message"
-      ) {
+      if (topic.archetype === "private_message") {
         assignLabels += `<div>${iconHTML("envelope")} Message</div>`;
       }
 
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index d89ac26..03b2246 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -9,9 +9,7 @@ en:
     assign_other_regex: "Regex that needs to pass for assigning topics to others via mention. Example 'your list'."
     unassign_on_group_archive: "When a message is archived by a group, unassign message (reassign if moved back to inbox)"
     unassign_on_close: "When a topic is closed unassign topic"
-    assign_locks_flags: "When a topic is assigned to a staff member, its flags can only be handled by that person"
     assign_mailer_enabled: "When enabled, the assigned user will receive a notification email on each assignment"
-    flags_require_assign: "When enabled, flags cannot be handled unless assigned to a user."
     remind_assigns: "Remind users about pending assigns."
     remind_assigns_frequency: "Frequency for reminding users about assigned topics."
     max_assigned_topics: "Maximum number of topics that can be assigned to a user."
diff --git a/config/settings.yml b/config/settings.yml
index 17bdc10..1c69920 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -12,12 +12,6 @@ plugins:
   assigns_user_url_path:
     client: true
     default: "/latest?assigned={username}"
-  assign_locks_flags:
-    default: true
-    client: true
-  flags_require_assign:
-    default: false
-    client: true
   assign_mailer_enabled: false
   remind_assigns_frequency:
     client: true
diff --git a/plugin.rb b/plugin.rb
index 735888b..6b3af49 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -46,14 +46,6 @@ after_initialize do
     self.value = self.value.to_i if self.name == frequency_field
   end
 
-=begin
-  TODO: Remove this once 2.3 becomes the new stable.
-  Also remove:
-    - flagged-* connectors
-    - flagged queue code inside the JS initializer
-=end
-  reviewable_api_enabled = defined?(Reviewable)
-
   # TODO: Remove this once 2.4 becomes the new stable.
   attribute = above_min_version ? 'id' : 'name'
 
@@ -96,32 +88,6 @@ after_initialize do
     SiteSetting.assign_allowed_on_groups = new_setting
   end
 
-  # Raise an invalid access error if a user tries to act on something
-  # not assigned to them
-  DiscourseEvent.on(:before_staff_flag_action) do |args|
-    if !reviewable_api_enabled && SiteSetting.assign_locks_flags?
-
-      if custom_fields = args[:post].topic&.custom_fields
-        if assigned_to_id = custom_fields[TopicAssigner::ASSIGNED_TO_ID]
-          unless assigned_to_id.to_i == args[:user].id
-            raise Discourse::InvalidAccess.new(
-              "That flag has been assigned to another user",
-              nil,
-              custom_message: 'discourse_assign.flag_assigned'
-            )
-          end
-        elsif SiteSetting.flags_require_assign?
-          raise Discourse::InvalidAccess.new(
-            "Flags must be assigned before they can be acted on",
-            nil,
-            custom_message: 'discourse_assign.flag_unclaimed'
-          )
-        end
-      end
-
-    end
-  end
-
   DiscourseEvent.on(:assign_topic) do |topic, user, assigning_user, force|

[... diff too long, it was truncated ...]

GitHub sha: dc6041ab