Added plugin api in search-advanced-options to be easily used by plugins (PR #10606)

GitHub

I think this file has been incorrectly included in the PR?

@Ahmedgagan Thank you for contributing to Discourse. Can you expand on your use case here? I’ll would like to see how these new plugin api functions added to the client side will work in the bigger scheme of adding additional advanced options to search.

Yaa, i’ve deleted the file from this PR in the latest commit :sweat_smile::smile:

@Ahmedgagan Thank you for contributing to Discourse. Can you expand on your use case here? I’ll would like to see how these new plugin api functions added to the client side will work in the bigger scheme of adding additional advanced options to search.

@tgxworld I was working on the discourse-assign plugin where we were adding 2 extra options in advance-search-options dropdown for in: search so in order to do that, we had to override _init() method of the search-advance-options component, for which @ZogStriP suggested me to add a plugin API for that, so i added plugin API for all 4 dropdown’s which can be extended in future from any plugins.

Please can you bump this number to 0.11.0, so that plugins can use that to detect whether the core version supports these new methods. (Then make sure to use that new number in discourse-assign, so the plugin keeps working on Discourse stable)

I think we need some more descriptive names here, because it’s not clear they are related to advanced search.

addAdvancedSearchInOptionsForUsers would be better, but it is quite long. Do you think there is some way we could combine them into a single method like

addAdvancedSearchOptions({
  inOptionsForUsers: [
    ...my new options
  ],
  statusOptions: [
    ... other new options
  ]
})

We should also add some comments above the method with some usage examples.