FIX: Change to new discourse plugin-api for advanced search options (#91)

FIX: Change to new discourse plugin-api for advanced search options (#91)

Changed to new discourse plugin-api and added status:unsolved option

diff --git a/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6 b/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6
index 670fb57..59c7ca6 100644
--- a/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6
+++ b/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6
@@ -10,7 +10,6 @@ import PostCooked from "discourse/widgets/post-cooked";
 import { formatUsername } from "discourse/lib/utilities";
 import { iconHTML } from "discourse-common/lib/icon-library";
 import { iconNode } from "discourse-common/lib/icon-library";
-import SearchAdvancedOptions from "discourse/components/search-advanced-options";
 
 function clearAccepted(topic) {
   const posts = topic.get("postStream.posts");
@@ -264,16 +263,6 @@ export default {
       }),
     });
 
-    SearchAdvancedOptions.reopen({
-      didInsertElement() {
-        this._super();
-        this.statusOptions.push({
-          name: I18n.t("search.advanced.statuses.solved"),
-          value: "solved",
-        });
-      },
-    });
-
     withPluginApi("0.1", initializeWithApi);
 
     withPluginApi("0.8.10", (api) => {
@@ -282,5 +271,20 @@ export default {
         "check-square"
       );
     });
+
+    withPluginApi("0.11.0", (api) => {
+      api.addAdvancedSearchOptions({
+        statusOptions: [
+          {
+            name: I18n.t("search.advanced.statuses.solved"),
+            value: "solved",
+          },
+          {
+            name: I18n.t("search.advanced.statuses.unsolved"),
+            value: "unsolved",
+          },
+        ],
+      });
+    });
   },
 };
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 48b1da7..f66942c 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -32,6 +32,7 @@ en:
       advanced:
         statuses:
           solved: "are solved"
+          unsolved: "are unsolved"
 
     admin:
       web_hooks:

GitHub sha: 945974a5

This commit appears in #91 which was merged by davidtaylorhq.