3611 Commits

Author SHA1 Message Date
Alexander Skvortsov
be59e77a01 Move in visibility scoping from tags, add automated testing. 2021-05-11 20:04:52 -04:00
Sami Mazouz
fffedb4e1d Only check for bypassTagCounts permission for startDiscussion ability (#130)
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.
2021-05-11 16:35:10 -04:00
flarum-bot
a0f9416f90 Bundled output for commit 99009e5d3b965a2c1d67b4bbfd4861b7ad0f3627 [skip ci] 2021-05-11 20:06:14 +00:00
Alexander Skvortsov
99009e5d3b Permission Tag Scoping Field (#127)
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>
2021-05-11 16:05:11 -04:00
Glowing Blue
93d373f066 Added created_at to post_likes table (#28) 2021-05-11 15:23:35 -04:00
Alexander Skvortsov
dfbb468744 Refactor queryIdsWhereCan (#128)
- 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>
2021-05-11 02:34:30 -04:00
flarum-bot
be62a33d23 Bundled output for commit 7ea9db7426b37cf78aa94c68d5fa9e128dc0e67d [skip ci] 2021-05-10 21:36:25 +00:00
Alexander Skvortsov
7ea9db7426 Editor Consolidation (#28)
- Move insertText to core
- Move styles and apply to core
- Simplify shortcut and button system
- Drop mdarea for now. In the future, we could implement the features we use (list continue, indent) in core.
- Remove admin dist (only admin setting was mdarea)
- Move inline style to css
2021-05-10 17:35:22 -04:00
flarum-bot
382729dd46 Bundled output for commit cc7e805a4bfa11637a50932cbc594285d4f0d056 [skip ci] 2021-05-10 18:22:48 +00:00
Alexander Skvortsov
cc7e805a4b Restore searching in tags when on tag page (#129) 2021-05-10 14:21:43 -04:00
Alexander Skvortsov
8ed08b63cd Fix mentioned filtering (#67) 2021-05-04 14:57:29 -04:00
flarum-bot
42a1c97371 Bundled output for commit a1edbdc9b0e13f2f1ac6fc540dadadd295a8de7d [skip ci] 2021-05-04 17:58:54 +00:00
Daniël Klabbers
a1edbdc9b0 Initial tag load performance improvement (#87)
- Only load lastPostedDiscussion on TagsPage
- For forum payload, only load top-level primary tags and top 3 secondary tags.
- In other cases, load tags in dynamically when needed.


Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2021-05-04 13:57:55 -04:00
Alexander Skvortsov
712286151f Optimize tag permissions (#126)
The new implementation generates a subquery of IDs instead of sending big arrays of data to/from the database. This massively speeds up performance.
2021-05-04 12:53:20 -04:00
flarum-bot
e2b309ad95 Bundled output for commit 02d3355989e3fc179b5807584478a4b7b2bee588 [skip ci] 2021-05-02 20:38:50 +00:00
SychO9
02d3355989 Add space when inserting a post mention 2021-05-02 21:37:31 +01:00
flarum-bot
83ed624223 Bundled output for commit e407c6678471368273eb6fadc4a018849149816e [skip ci] 2021-04-21 09:59:51 +00:00
Sami Mazouz
e407c66784 New mentions format, decouple usernames from mentions (#65)
* Convert user mentions to new `@"Display Name"#ID` format

* Handle deleted user's mentions

* Convert post mentions to `@"Display Name"#pID` format

* Handle deleted user's post mentions and deleted posts mentions

* Clean display name of `"#{letters}{numbers}` (replace with underscore _)

* Adapt integration tests to new mention formats

* Use a deleted attribute for user mentions

* Introduce cleanDisplayName util

* Detect new format with autocomplete

* Slug needed on rendering only

* Invalidate user mention tag when ID is invalid
This used to be implicitly done, when there was a username attribute configured, formatter would check that all attributes are available and if not invalidate.

since we now only have `displayname` and `id` attributes which are both available from the regex matching, formatter doesn't implicitly invalidate anymore and therefore validates ANY matches. So we explicitly invalidate the tag when the ID does not match a user.

* Allow username mention format with a setting

* Add tests for turning setting on/off

* Move setting check to tag filter
Because the configurator caches, changing the setting only takes effect after the cache is cleared.

* fix: showing autocomplete at the right moment

* Add dockblocks to explain unparsing process
2021-04-21 10:58:54 +01:00
Alexander Skvortsov
3b3cbdc82f Fix conflicts with other extension visibility scoping (#26)
Wrapping all `wheres` in an `orWhere` ensures that there's no conflict.

See https://github.com/flarum/core/issues/2798, https://github.com/flarum/docs/pull/200
2021-04-20 14:51:01 -04:00
Sami Mazouz
057517688c Add integration tests (#66) 2021-04-13 22:27:42 +01:00
Alexander Skvortsov
62be9088a1 Use RequestUtil to access actor 2021-04-12 17:50:59 -04:00
Alexander Skvortsov
258fe6d158 Apply fixes from StyleCI 2021-04-12 02:29:32 +00:00
Alexander Skvortsov
078441204d Use criteria's sortIsDefault field
This was introduced in https://github.com/flarum/core/pull/2773, and allows us to more cleanly determine whether the sort requested is the default one, while taking extension modifications into account.
2021-04-11 22:29:20 -04:00
Alexander Skvortsov
5235dda1e4 Use RequestUtil to access actor 2021-04-08 00:07:14 -04:00
Alexander Skvortsov
cd3934e358 Use RequestUtil to access actor 2021-04-08 00:03:18 -04:00
Alexander Skvortsov
f80a88d45b Use RequestUtil for accessing actor 2021-04-08 00:02:11 -04:00
Alexander Skvortsov
9936681634 Use Symfony translator contract instead of deprecated component 2021-04-08 00:00:49 -04:00
Sami Mazouz
d5149b7406 Eager load post.user.groups relation and allow extensions to eager load relations (#38)
* Allow extensions to eager load relations
* Eager load post.user.groups
2021-04-07 16:24:52 +01:00
Alexander Skvortsov
0b65a4c375 Update changelog for 0.1.0-beta.16.1 2021-04-06 18:20:14 -04:00
Alexander Skvortsov
c9d9e85780 Fix FullTextGambit interface compatibility 2021-04-04 15:44:07 -04:00
Alexander Skvortsov
ac4edef78c Use extender for setting NicknameFullTextGambit 2021-04-04 13:41:15 -04:00
Alexander Skvortsov
4ec8b87cdc Update changelog for v0.1.0-beta.16.1 2021-03-25 13:54:43 -04:00
flarum-bot
2c8f88a72b Bundled output for commit 61e61f5e8c18d017079d8a20f4185a74cda153b2 [skip ci] 2021-03-25 17:52:17 +00:00
Alexander Skvortsov
61e61f5e8c Allow disabling mdarea via admin setting (#27) 2021-03-25 13:51:21 -04:00
Sami Mazouz
46aabd2ae5 Eager load mentionedBy and only missing relations (#64) 2021-03-25 15:37:47 +01:00
Sami Mazouz
a1ba21ec69 Eager load tags relation in discussion, posts and flags listing endpoints (#125)
* Eager load tags relation when listing posts & discussions
* Eager load ListFlags post.discussion.tags relation
2021-03-25 15:37:14 +01:00
flarum-bot
e12320a25d Bundled output for commit e783a7603d4830a2c7a468d9c19fcbe5d166e42f [skip ci] 2021-03-18 16:39:31 +00:00
sl-kr
e783a7603d change value of subscribed from false to null in the JSON API (#37) 2021-03-18 12:38:21 -04:00
flarum-bot
14c10d400e Bundled output for commit 4f63399d4aa66c22d8da9d85adab62073f7351b8 [skip ci] 2021-03-18 15:59:27 +00:00
Daniël Klabbers
4f63399d4a Adds the ability to push new posts onto discussions that aren't public. (#17)
It's very frustrating having pusher installed, but not seeing new posts pop up on non public
discussions. This PR simply re-uses the existing channels per user by reading
all similar private user channels (which require authentication) and then pushing
the websocket message over the line. This only happens in case the discussion is
not public and it only sends to connected users.
2021-03-18 11:58:29 -04:00
Alexander Skvortsov
c1c47e81aa SubscriptionFilterGambit: properly implement conditions method 2021-03-17 14:22:10 -04:00
Ian Morland
1b339267f8 Canonical URL: Use UrlGenerator in place of extracting the url from request (#122) 2021-03-15 21:44:22 -04:00
Matt Kilgore
34ee9c32de Fix Changelog beta.16 header link 2021-03-15 11:39:02 -04:00
Daniel Klabbers
e8f64bc2ac fix heading of removed 2021-03-15 13:29:23 +01:00
Daniel Klabbers
4988649816 Release v0.1.0-beta.16 2021-03-15 13:24:21 +01:00
Daniel Klabbers
4ff74d3289 Release v0.1.0-beta.16 2021-03-15 13:03:08 +01:00
Daniel Klabbers
258ff753de Release v0.1.0-beta.16 2021-03-15 12:45:15 +01:00
Daniel Klabbers
786bf91f93 Release v0.1.0-beta.16 2021-03-15 12:36:13 +01:00
Daniel Klabbers
4805b7d2ee Release v0.1.0-beta.16 2021-03-15 12:33:03 +01:00
Daniel Klabbers
78ad65c6c1 Release v0.1.0-beta.16 2021-03-15 12:20:50 +01:00