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

User Preferences Extender and Tests #2463

Merged
merged 4 commits into from
Dec 4, 2020

Conversation

askvortsov1
Copy link
Member

Part of #1891
Replaces #2082

Changes proposed in this pull request:
Adds a simple extender and unit tests without any refactorings to the underlying preferences system. Since the public API of the extender remains unchanged, there isn't a necessity to implement refactorings in the same PR as the extender.

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).

Copy link
Member

@clarkwinkelmann clarkwinkelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, but I'm a bit confused with the naming.

"add"
"configure"
"register"

Wouldn't it make more sense to also call the extender method addPreference ?

@askvortsov1
Copy link
Member Author

I like register more than add, because that makes it clear that no values are going into the preference, and this is just configuration. Perhaps we could add a registerPreference static method to User and deprecate addPreference?

@askvortsov1 askvortsov1 merged commit eed4078 into master Dec 4, 2020
@askvortsov1 askvortsov1 deleted the as/simple_user_preferences_extender branch December 4, 2020 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants