Commit Graph

307 Commits

Author SHA1 Message Date
2cb00d6773 Fix missing space after mentions inserted via post reply
Closes https://github.com/flarum/core/issues/3096
2021-10-06 16:30:45 -04:00
7c954129f0 Bundled output for commit 84dcde4e857d5d42527f600dadca0a60c49377c9
Includes transpiled JS/TS.

[skip ci]
2021-10-06 20:24:50 +00:00
84dcde4e85 Fix delayed mention search results
Fixes https://github.com/flarum/core/issues/3095
2021-10-06 16:22:04 -04:00
03c6db4c8d Import function correctly
There was a typo in the function's name which broke mentions.
2021-10-06 16:15:01 -04:00
798fadbddc Bundled output for commit 6173c3d6124d04cad7d2b788b90af47f8bb39276
Includes transpiled JS/TS.

[skip ci]
2021-09-20 17:43:50 +00:00
6173c3d612 Minor refactors in frontend JS (#69)
* Add Prettier

* Update dependencies; add typescript setup

* Add tsconfig

* Rewrite some mentions frontend into TS

* Fix use of username instead of display name

* Change back to JS

* Remove commented code

* Update function name to match filename

* Update getMentionText.js

* Simplify condition

* Bump packages to stable versions; use prettier package

* Make functions use camel case

* Update js/package.json

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Don't access data directly

* Update js/src/forum/addComposerAutocomplete.js

Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>

* Update tsconfig.json

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
2021-09-20 18:42:38 +01:00
6a5d7e9864 Fix unrecognised user/post mentions (#71)
* fix: Use proper mentionsUsers serializer
The only reason we haven't seen any issues with this up until now is because we have not has to include the relationship in any responses.

* fix: User/Post mentions showing as deleted after saving
The reason this happens is because the modified relationship is not refreshed, so the formatter doesn't recognize the new mentions as valid.
2021-08-30 18:23:59 +01:00
af9e5a9cc9 Eager load more necessary related mentions (#72)
* perf: Eager load related mentions from the extender

These missing relations caused more queries to be called, the more mentions posts have the more queries produced.

* perf: Eager load models in show endpoints

Can't use the extender for that
2021-08-23 20:33:42 +01:00
5217b8b6be fix branch alias 2021-05-25 22:51:07 +02:00
d37a43c795 changes for stable 2021-05-25 16:26:34 +02:00
37c1933d37 Bundled output for commit 07e93747be3625e7d12f8dadad4577aa11ebffac
Includes transpiled JS/TS.

[skip ci]
2021-05-25 07:03:39 +00:00
b0a301229a Tweak test name and add posts mention equivalent test 2021-05-25 00:15:10 +01:00
cc62044e6f Support smart quotes in mentions format 2021-05-24 21:49:31 +01:00
a311edf106 Update tests to use setting method (#68) 2021-05-17 22:46:02 +01:00
53bbb63a24 Bump composer reqs for 1.0.0 2021-05-16 18:28:41 -04:00
59320d401f Update copyright year 2021-05-15 00:56:10 +01:00
b7e9d729c1 Bundled output for commit 8ef8dee5322353b7ed20505775ae85d2a3a9fd08
Includes transpiled JS/TS.

[skip ci]
2021-05-14 22:15:06 +00:00
8ef8dee532 Use slug for user mentions page 2021-05-14 23:13:45 +01:00
4d8f105d07 Bundled output for commit ae69dd25c76969ef0fc3bfb0c0f58e0efa2f27d5
Includes transpiled JS/TS.

[skip ci]
2021-05-13 00:02:51 +00:00
ae69dd25c7 Update for ICU MessageFormat 2021-05-12 19:27:13 -04:00
bc187d9b83 Bundled output for commit 3e596aaadf99bb0ee793665eb8417f740782de49 [skip ci] 2021-05-12 19:43:31 +00:00
3e596aaadf Move replies preview dropdown out of Post-footer (#55) 2021-05-12 20:42:33 +01:00
8ed08b63cd Fix mentioned filtering (#67) 2021-05-04 14:57:29 -04:00
e2b309ad95 Bundled output for commit 02d3355989e3fc179b5807584478a4b7b2bee588 [skip ci] 2021-05-02 20:38:50 +00:00
02d3355989 Add space when inserting a post mention 2021-05-02 21:37:31 +01:00
83ed624223 Bundled output for commit e407c6678471368273eb6fadc4a018849149816e [skip ci] 2021-04-21 09:59:51 +00:00
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
057517688c Add integration tests (#66) 2021-04-13 22:27:42 +01:00
cd3934e358 Use RequestUtil to access actor 2021-04-08 00:03:18 -04:00
46aabd2ae5 Eager load mentionedBy and only missing relations (#64) 2021-03-25 15:37:47 +01:00
613664525d Release v0.1.0-beta.16 2021-03-15 12:11:51 +01:00
b922257468 Use non-deprecated translator interface 2021-03-13 17:10:23 -05:00
23c03e058a change category (#62) 2021-03-08 14:21:21 -05:00
37f0a100bd Bundled output for commit 0ad97bb4edbdd53f1d445badda4b1f5921a56b9e [skip ci] 2021-03-02 04:33:37 +00:00
0ad97bb4ed Fix dropdown going off top of screen
The previous solution didn't properly account for document scroll, so when replying to posts, the parent offset would be extremely large, and it'd fall back to the top coordinate, which is out of bounds on small screens.
2021-03-01 23:32:30 -05:00
302687b11a Use one instance of formatter extender 2021-03-01 23:26:35 -05:00
8c78af4b1c Bundled output for commit d4db946c31dbeaf636a2a296596f76e1005af000 [skip ci] 2021-02-26 21:20:57 +00:00
d4db946c31 Update for Editor Drivers Abstraction (#61) 2021-02-26 16:20:07 -05:00
b06f6470e7 Move locale files from language pack to extension. (#56) 2021-02-17 16:23:40 -05:00
d368aa4e55 Fix incorrect display_name showing in email notifications (#59) 2020-12-21 12:43:27 -05:00
5f8a4009fe changelog and constraint for beta 15 2020-12-15 09:15:26 +01:00
80101d52a9 npm audit fix 2020-12-15 09:15:26 +01:00
198f8ae870 Ensure nullable arguments are indeed nullable 2020-12-13 16:38:24 -05:00
4f153a099d Bundled output for commit eea694e021df0bdd839f48464e9ddaa17bc0c856 [skip ci] 2020-12-11 04:50:41 +00:00
eea694e021 Fix mention button in composer toolbar
It seems like we missed one `this.props` during the beta 14 rewrite
2020-12-10 23:49:26 -05:00
9ca860ee7b Update composer metadata for admin dashboard 2020-12-08 19:57:10 -05:00
3198de4b9b Use Formatter extender for rendering callbacks 2020-12-08 11:41:05 -05:00
256e821289 Use new extenders (#58) 2020-12-08 11:15:52 -05:00
ab27fd452d Add composer metadata for admin ux redesign 2020-11-25 01:23:14 -05:00
2e9d9ab816 Use the new Notification type extender (#57) 2020-10-31 18:43:02 -04:00