Currently, tags will be dragged immediately on touch, which makes it very hard to click the edit button, as any non-perfect touch drags the tag. This commit adds a delay on mobile devices only, so that the tag can be both dragged and edited easily.
Closes https://github.com/flarum/core/issues/3098
* fix: `$relationsArray` can end up containing closures
Not sure I didn't simply unset the first time around..
* Use a new array instead of modifying one
* test: Start by adding tests for this case scenario
* fix: All discussions hidden from everyone when minSecondary > 0 and no secondary tags
* test: Test the scenario for primary tags as well
* fix: Properly fix the general case of more tags required than available
* Adjust to only check with the `viewForum` ability
* Test Cases for private discussions
* Use css variables for tag labels
* Use css variables for hero
* Fix color when links force override (event posts)
* Use css variables for start discussion button
* Use css variables for tag tiles
* Use css variables for sidenav links
* Use `classList` instead
This ensures that the proper tag values are returned to the API by clearing any cached tags before returning a response. It also makes sure that the listeners to the `DiscussionWasTagged` event won't have old data under `$event->discussion->tags`.
Fixes https://github.com/flarum/core/issues/2514
This doesn't fix anything, but we should explicitly only check the
permission for the ability it is meant for, just to be safe in the
future.
Also add more tests.
This allows tag scoping permissions that don't start with `discussion`, or on the contrary, removing tag scoping from permissions that DO start with `discussion`.
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
- Rename to queryIdsWhereHasPermission, since that's more accurate
- Make the base query an optional 3rd argument. This feels more intuitive
- Add a `can` function in AbstractPolicy, so extensions that add tag scopable permissions don't need to define their own policies (e.g. with approval)
- Combine ScopeDiscussionVisibilityWithAbility and ScopeDiscussionVisibility
- Fix ScopeDiscussionVisibility only requiring in one tag, not all.
- Add lots and lots of tests
Co-authored-by: SychO9 <sychocouldy@gmail.com>