Commit Graph

3912 Commits

Author SHA1 Message Date
daniellesniak
912a0381c3 Convert highlight helper to Typescript (#2532) 2021-01-23 16:43:40 -05:00
Alexander Skvortsov
2ee8358dbb Remove deprecated formatting events 2021-01-20 16:25:32 -05:00
Alexander Skvortsov
555c7767df Remove deprecated UserPreferences event 2021-01-20 15:23:56 -05:00
Alexander Skvortsov
30a26b02f4 Remove deprecated floodgate 2021-01-20 15:23:30 -05:00
Alexander Skvortsov
ca99e9911c Remove deprecated notification events 2021-01-20 15:23:30 -05:00
Alexander Skvortsov
1303b3b939 Remove deprecated validation events 2021-01-20 15:23:30 -05:00
Alexander Skvortsov
c2e03d2b02 Remove deprecated post types event 2021-01-20 15:22:28 -05:00
Alexander Skvortsov
54fd02e839 Remove deprecated policy and visibility scoping events 2021-01-20 15:21:30 -05:00
Alexander Skvortsov
c887093e67 Remove deprecated CSRF wildcard path match 2021-01-20 12:01:52 -05:00
flarum-bot
fbdc36dfbd Bundled output for commit 0c30f309b8 [skip ci] 2021-01-19 22:40:14 +00:00
Alexander Skvortsov
0c30f309b8 Bring m.attrs.bidi in as a util
We previously used the tobscure/m.attrs.bidi github repo, but that repo was recently taken offline. We decided to integrate it as a util instead of publishing it as a separate package since we seem to be the only project using it, and adopting it into a new project requires barneycarroll/mattr, which does not seem to be used anywhere.

The code added here was taken from https://github.com/askvortsov1/m.attrs.bidi, a fork (without changes) of the tobscure repo. Support for alternative module systems and ways of registering bidi were removed, and the file was formatted in compliance with our prettier config.
2021-01-19 17:30:03 -05:00
Alexander Skvortsov
60eb89e152 NotificationTest: Rely on adminUser from installation 2021-01-19 17:05:53 -05:00
Sami Mazouz
88ef99b13c Add Notification extender beforeSending method (#2533) 2021-01-19 14:40:19 -05:00
Alexander Skvortsov
c12bf937f5 Policies: treat true as allow, and false as deny (#2534) 2021-01-18 18:28:48 -05:00
Alexander Skvortsov
877296d194 Add subscribe method to event extender (#2535)
Historically, extensions using subscribers has caused problems because subscribers were constructed/applied at extension boot. This caused some classes (e.g. UrlGenerator) to be resolved early, breaking parts of Flarum. For this reason, subscriber support wasn't included in the initial version of the Event extender.

However, updating extensions has shown that there is a legitimate use case for subscribers in organizing clean code; for instance, core's own `DiscussionMetadataUpdater`.

This commit introduces support for subscribers, but only applies them after the app has booted, which avoids the early resolution issues. Since event listeners/subscribers are only intended to be used with domain events, which would never be dispatched during app boot, the late activation of subscribers should not cause issue.
2021-01-15 20:33:29 -05:00
flarum-bot
d8b1ce60a8 Bundled output for commit 9a7fa7e4c9 [skip ci] 2021-01-13 22:50:31 +00:00
Wadim Kalmykov
9a7fa7e4c9 Fix DiscussionListPane jumping around (#2402)
Ensure that scroll position is retained between page changes, so if navigating via the sidebar, you don't need to re-scroll down every time.
2021-01-13 17:49:26 -05:00
Alexander Skvortsov
c1778d5dd6 Merge pull request #2304 from flarum/fl/tests-in-transaction
Run Backend Tests in Transactions
2021-01-12 21:26:59 -05:00
Alexander Skvortsov
a5a8b075dd Apply fixes from StyleCI
[ci skip] [skip ci]
2021-01-09 00:36:07 -05:00
Alexander Skvortsov
54e0d1b7da Fix fulltext search tests
Under InnoDB, database entries created in transactions are not processed by fulltext indexes until the transaction is committed. To work around this, cases that test fulltext search have been split off into a separate class that adds and removes seed discussions/posts outside of transactions during setUp/tearDown.
2021-01-09 00:35:55 -05:00
Alexander Skvortsov
7c0d98c63d Tests: purge settings cache
Some tests need to change settings, but since MemoryCacheSettingsRepository caches settings in-memory, those changes aren't reflected. The new `purgeSettingsCache` removes it from the container, eliminating that cache.

For UserTest, we also need to regenerate the display name driver, since that's set statically on boot, before we'll get a change to clear the settings cache.
2021-01-09 00:35:55 -05:00
Alexander Skvortsov
eeac5ffce9 Tests: Add missing instantiation of data 2021-01-09 00:35:55 -05:00
Alexander Skvortsov
17e2dc21ec Tests: Comply with default permissions
Before transactions, each test class would need to explicitly state starting state for permissions, which made the initial permission configuration somewhat arbitrary. Now, we might as well use the initial state of the default installation.

One of the User show_test tests has been commented out until
2021-01-09 00:35:55 -05:00
Alexander Skvortsov
b92695a9c2 Tests: remove prepDb workaround
Previously, the `prepareDatabase` method would directly modify the database, booting the app in the process. This would prevent any extenders from being applied, since `->extend()` has no effect once the app is booted.

Since the new implementation of `prepareDatabase` simply registers seed data to be applied during app boot, the workaround of sticking this seed data into `prepDb` is no longer necessary, and seed data common to all test cases in a class can be provided in `setUp`.

When needed, app boot is explicitly triggered in individual test cases by calling `$this->app()`.
2021-01-09 00:35:55 -05:00
Alexander Skvortsov
823e6cbd2e Add @inheritDoc to all setUp and tearDown methods 2021-01-09 00:35:55 -05:00
Franz Liedke
450ca99325 Boot app explicitly to run seeds in time 2021-01-09 00:35:47 -05:00
Alexander Skvortsov
d5bf544668 Add vscode config to gitignore 2021-01-07 23:27:32 -05:00
Alexander Skvortsov
a1a2598c03 Fix deleting posts/discussions by deleted user (#2521)
Making the $user argument nullable prevents this unnecessary exception, and doesn't introduce any issues since we check that $user exists as part of the method.
2021-01-07 17:46:14 -05:00
Franz Liedke
956050c643 Tests: Always start transaction before seeding 2021-01-07 17:34:13 -05:00
Franz Liedke
9b2383fe20 Tests: Stop using Eloquent models for seeding data 2021-01-07 17:34:13 -05:00
Franz Liedke
1b98526e89 Tests: Rely on admin user, groups, permissions from test setup script 2021-01-07 17:34:06 -05:00
flarum-bot
403ee77c6c Bundled output for commit f6478096ee [skip ci] 2021-01-07 15:26:14 +00:00
Sami Mazouz
f6478096ee Fix composer header hidden by mobile browser (#2279) 2021-01-07 10:25:12 -05:00
Franz Liedke
a42ce7045d Tests: DB tables no longer need to be truncated 2021-01-05 22:48:09 -05:00
Franz Liedke
b14da91a98 Run integration tests in a transaction 2021-01-05 22:47:19 -05:00
Alexander Skvortsov
fb7ffc2351 Fix IOS scroll menu bug (#2527)
Fixes https://github.com/flarum/core/issues/1959

These transform lines are known to cause issues on iOS, and were added to hack around chrome issues that have since been fixed upstream.
2021-01-05 19:40:11 -05:00
Sami Mazouz
111f615c60 Add default value to Settings extender (#2495) 2021-01-05 01:28:25 -05:00
Daniël Klabbers
7a6284c760 npm audit fix 2020-12-20 20:55:51 +01:00
flarum-bot
f9ee8e02fd Bundled output for commit 445923fb11 [skip ci] 2020-12-20 17:15:07 +00:00
Sami Mazouz
445923fb11 Add ExtensionPermissionGrid to compat (#2501) 2020-12-20 12:14:00 -05:00
Daniël Klabbers
4fc2f1ae56 beta 15 changelog and version constant 2020-12-18 20:02:22 +01:00
Daniël Klabbers
dcea305864 Fixes validation failures of avatars that are jpg/jpeg (#2497)
Due to a commit by @fabpot in october, the mimetypes symfony class
now re-orders the shortened mimetypes that are returned when looking
up based on header mimetype. Our validator uses the first key, pops
the prefix off and then matches against our hardcoded array.

I've added a constraint to symfony/mime ^5.2.0 which ships with this change.
This constraint is fully compatible with our current lineup. In addition
I changed the hardcoded array to use the first entry from symfony mime types
now `jpg` instead of `jpeg`.
2020-12-16 13:53:17 -05:00
flarum-bot
2d22a8a1cd Bundled output for commit 68b0554c2f [skip ci] 2020-12-15 22:50:49 +00:00
Alexander Skvortsov
68b0554c2f Support multiple callback-based settings per-extension 2020-12-15 17:49:24 -05:00
Alexander Skvortsov
6ed4442ea6 Clarify that request argument of render callbacks for Formatter must be either nullable or omitted 2020-12-14 17:20:35 -05:00
Alexander Skvortsov
8f2e76d966 Deprecate CheckingForFlooding
This should have been done earlier as part of the ThrottleApi PR
2020-12-14 17:12:05 -05:00
flarum-bot
c2b3bfe1d9 Bundled output for commit a7306addf1 [skip ci] 2020-12-14 19:07:44 +00:00
Alexander Skvortsov
a7306addf1 Fix scroll on long discussions
- Anchor scroll when inserting post placeholders
- Indicate that pages are loading at start of `loadPage`, which allows `onscroll` to not request that multiple pages be loaded at the same time

These changes are particularly applicable to firefox, where previously, dozens of posts could be skipped at a time if scroll up was held while at the top of the viewport.
2020-12-14 14:06:32 -05:00
Ian Morland
a6547f02b0 Fix wrong namespace in docblock (#2494) 2020-12-12 15:36:25 -05:00
Alexander Skvortsov
91a7205dd8 Fix composer json attribute path to links override section 2020-12-08 19:29:59 -05:00