-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
Some v1.2 frontend fixes #3228
Some v1.2 frontend fixes #3228
Conversation
askvortsov1
commented
Dec 27, 2021
•
edited
Loading
edited
- Fix error when not allowed to search
- Fix login form inputs unclickable on mobile
- Use translations for page titles in frontend for consistency with backend
- Fix consecutive shows of same modal with different attrs (Fixes https://discuss.flarum.org/d/25182-friendsofflarum-oauth/259)
If there are no search sources, HTML for the Search component won't be rendered, so trying to attach listeners to it will likely error. In this PR, we don't attach such listeners/logic if there are no sources. We also stop asserting that sources is defined to help avoid other similar issues in the future.
Adding `clickOutsideDeactivates` seems to fix the issue, contrary to what the focus-trap documentation implies about it being unnecessary.
Re-running tests because they were taking 30+ mins to install deps 🤣 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Search & input fixes tested working.
Updated title logic needs fixing & question about BC.
# Translations in this namespace are used to format page meta titles. | ||
meta_titles: | ||
with_page_title: "{pageNumber, plural, =1 {{pageTitle} - {forumName}} other {{pageTitle}: Page # - {forumName}}}" | ||
without_page_title: "{pageNumber, plural, =1 {{forumName}} other {Page # - {forumName}}}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not a breaking change for language packs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm that's a tough one. As per the definition in https://discuss.flarum.org/d/26242-draft-public-api-policy, our public API is defined in terms of the interfaces of the code, not necessarily of behavior. This will require language packs to update, but in the meantime it won't break forums using those language packs, so I don't see it as illegal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine, we introduced these in this cycle anyway, so it doesn't matter, it never made it to a release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The argument is that even requiring translations means that extensions will need to add translations to avoid showing the 'core.lib' text. However, since that's easily addressable and doesn't break functionality, I think it's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I figured it wasn't that big of a deal as it's not breaking.
This gives more flexibility for customization, and allows overriding title structure via translations / linguist.
be9edaf
to
6868e58
Compare
We need to specify a unique key for each modal so that the modals are fully destroyed and recreated. For instance, this fixes the signup modal being empty with OAuth register flows.
6868e58
to
b7f2fe2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed fix for app title & modal opening (specifically oauth with sign up modal) working