FIX: Change to new discourse plugin-api for advanced search options (#91)
Changed to new discourse plugin-api and added status:unsolved option
This commit is contained in:
parent
613267c3a2
commit
945974a5e4
|
@ -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",
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
|
@ -32,6 +32,7 @@ en:
|
|||
advanced:
|
||||
statuses:
|
||||
solved: "are solved"
|
||||
unsolved: "are unsolved"
|
||||
|
||||
admin:
|
||||
web_hooks:
|
||||
|
|
Loading…
Reference in New Issue