Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] [extensibility] feat: allow DiscussionsSearchSource to be extended #4025

Merged
merged 1 commit into from
Sep 28, 2024

Conversation

imorland
Copy link
Member

@imorland imorland commented Sep 26, 2024

Changes proposed in this pull request:
This splits DiscussionsSearchSource out so that it is possible to extend/customize the following:

On DiscussionsSearchSource

  • includes - allow adding additional includes from the frontend.
  • limit - allow setting a different results limit
  • queryMutators - allow adding additional gambits to the default query. ie, from fof/best-answer, we can now choose to exclude best answer results from the normal discussions results, as this extension adds it's own search source with best answer results.

New DiscussionsSearchItem
This handles how the elements are presented within the search dropdown. We can customize:

  • discussionTitle - ie, for within a translation extension so that titles can be presented already translated
  • mostRelevantPostContent - as above
  • viewItems - add/remove/modify elements of the view by dealing with an ItemList

Reviewers should focus on:

Screenshot

QA

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

@imorland imorland requested a review from a team as a code owner September 26, 2024 16:08
@imorland imorland changed the base branch from 2.x to 1.x September 26, 2024 16:09
@imorland imorland added this to the 1.8.6 milestone Sep 26, 2024
@imorland imorland added type/extensibility javascript Pull requests that update Javascript code labels Sep 26, 2024
@imorland imorland changed the title [1.x] [extensibility] feat: allow DiscussionSearchSource to be extended [1.x] [extensibility] feat: allow DiscussionsSearchSource to be extended Sep 26, 2024
@imorland imorland merged commit c79d289 into 1.x Sep 28, 2024
275 checks passed
@imorland imorland deleted the im/search branch September 28, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code type/extensibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant