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

[2.0] feat!: use ItemList for the DiscussionListState sorting map #3133

Closed
wants to merge 3 commits into from

Conversation

davwheat
Copy link
Member

@davwheat davwheat commented Oct 27, 2021

Changes proposed in this pull request:

It is currently very difficult to change the ordering of the discussion list sorting options. This change replaces the existing object map with an ItemList, allowing us to use priorities instead.

Reviewers should focus on:

Screenshot

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.

Required changes:

  • Related documentation PR: (Remove if irrelevant)
  • Related core extension PRs: (Remove if irrelevant)

@davwheat davwheat added this to the 2.0 milestone Oct 27, 2021
@davwheat davwheat self-assigned this Oct 27, 2021
@davwheat davwheat marked this pull request as ready for review October 27, 2021 18:09
@askvortsov1
Copy link
Member

Before looking into the code, wanted to share a quick thought. There's been a lot of questions about customizing sort options (including defaults), and doing so right now is a bit clunky. In the future, if our API and serializers are generic and done through extenders, we could also use the forum payload to deliver "resource config", such as available/default sorts.

With that in mind, I wonder if it makes sense to introduce an API for this now, if we might want to replace it relatively soon?

@davwheat
Copy link
Member Author

Ian and I came across this issue today, hence the PR.

I believe we're going to create a joint PR later to standardise default sorting and sorting options between front-end and back-end.

I think I'll convert this back to a draft in the meantime.

@davwheat davwheat marked this pull request as draft October 27, 2021 21:00
@askvortsov1 askvortsov1 removed this from the 2.0 milestone Mar 10, 2022
@askvortsov1
Copy link
Member

Hello, thank you for your pull request! In order to speed up future development, keep all work in one place, and take advantage of CI tools that can help us avoid breaking changes, we have moved all Flarum code to a single monorepo at flarum/framework. You can read more about this process in our dev diary. Unfortunately, pull requests can't be carried over to the monorepo, so we have to close all open pull requests. If this pull request is still relevant, please feel free to reopen it over on the monorepo. We apologize for the inconvenience, and hope you will consider contributing to Flarum again in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants