Commit Graph

8565 Commits

Author SHA1 Message Date
flarum-bot
0e1b33c3e7 Bundled output for commit f4da9319ea [skip ci] 2021-01-24 17:13:48 +00:00
Alexander Skvortsov
6eafce0660 If current package is an extension, add it to the extension manager (#1)
Core's ExtensionManager only looks for extensions in the vendor directory, which makes sense for a Flarum instance, but is problematic if used in the context of a test suite for an extension. This PR:

- Adds a class extending ExtensionManager to include the current package
- Adds an extender that replaces ExtensionManager with this new class in container bindings

Effectively, this package can now be used to test extensions.
2021-01-24 12:13:27 -05:00
Alexander Skvortsov
f4da9319ea Fix notification panel infinite scroll (#2524)
Improves calculations for determining whether we are at the bottom of the notifications panel (which would trigger infinite scroll). This should be particularly effective in fixing issues on smaller screens.
2021-01-24 12:12:42 -05:00
flarum-bot
ca95c3164d Bundled output for commit 1c6b8c67a7 [skip ci] 2021-01-24 06:43:38 +00:00
David Sevilla Martín
1c6b8c67a7 Fix suspended notification not showing correct suspension length (#32) 2021-01-24 01:42:52 -05:00
Alexander Skvortsov
4432bce771 Merge pull request #2557 from flarum/as/remove-deprecated
Remove deprecated PHP events, bootstrap.php fallback
2021-01-23 16:52:38 -05:00
Alexander Skvortsov
375a33145f Remove deprecated bootstrap.php support
See https://github.com/flarum/core/issues/1557
2021-01-23 16:48:29 -05:00
Alexander Skvortsov
1ae7dbe464 Remove deprecated API events 2021-01-23 16:48:22 -05:00
flarum-bot
8f798deb87 Bundled output for commit 912a0381c3 [skip ci] 2021-01-23 21:44:56 +00:00
daniellesniak
912a0381c3 Convert highlight helper to Typescript (#2532) 2021-01-23 16:43:40 -05:00
flarum-bot
0abbe627d0 Bundled output for commit 768fc0d653 [skip ci] 2021-01-22 18:54:03 +00:00
Sami Mazouz
768fc0d653 Fix evaluation of post content by m.trust() (#24) 2021-01-22 13:53:11 -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
9b65d4cbc8 Bundled output for commit 4dbc7369a2 [skip ci] 2021-01-20 03:23:08 +00:00
Ian Morland
4dbc7369a2 Restrict post excerps to IndexPage and DiscussionPage only #2066 (#25) 2021-01-19 22:22:20 -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
167ffced5d Fix vendor path 2021-01-13 16:49:39 -05:00
Alexander Skvortsov
0dba5af52d Move setup script to importable class 2021-01-13 16:22:47 -05:00
Ian Morland
82c57cd36a Add is_sticky, last_posted_at index to improve performance (#23)
This PR introduces an additional index [is_sticky, last_posted_at] to the discussions table. We discovered that when viewing discussions in a tag with a large number of discussions (approx 1.4M in our case), performance was poor when using the default sort criteria (sort by latest).
2021-01-13 14:18:38 -05:00
Alexander Skvortsov
b392b85f17 Add composer.json 2021-01-13 01:27:27 -05:00
Alexander Skvortsov
ba0fbd71e6 Move test infrastructure to Testing namespace in src directory 2021-01-13 01:27:05 -05:00
Alexander Skvortsov
1afbb07037 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-13 01:21:38 -05:00
Alexander Skvortsov
ab43c31ff5 Add @inheritDoc to all setUp and tearDown methods 2021-01-13 01:21:38 -05:00
Franz Liedke
6ca9191f42 Tests: Always start transaction before seeding 2021-01-13 01:21:38 -05:00
Franz Liedke
663f7a5d32 Tests: Stop using Eloquent models for seeding data 2021-01-13 01:21:38 -05:00
Franz Liedke
b1a18971ca Tests: Rely on admin user, groups, permissions from test setup script 2021-01-13 01:21:38 -05:00
Franz Liedke
31028e0bf9 Run integration tests in a transaction 2021-01-13 01:21:38 -05:00
Alexander Skvortsov
8675e76c92 Add vscode config to gitignore 2021-01-13 01:21:38 -05:00
Wadim Kalmykov
eaf5358def Improve developer experience by forcing LF line endings (#2321) 2021-01-13 01:21:38 -05:00
Franz Liedke
d1462571ed Use Config class for data from config.php 2021-01-13 01:21:38 -05:00
Franz Liedke
99eeaf0be5 Clean up usages / deprecate path helpers (#2155)
* Write source map without creating temp file

Less I/O, and one less place where we access the global path helpers.

* Drop useless app_path() helper

This was probably taken straight from Laravel. There is no equivalent
concept in Flarum, so this should be safe to remove.

* Deprecate global path helpers

Developers using these helpers can inject the `Paths` class instead.

* Stop storing paths as strings in container

* Avoid using path helpers from Application class

* Deprecate path helpers from Application class

* Avoid using public_path() in prerequisite check

a) The comparison was already outdated, as a different path was passed.
b) We're trying to get rid of these global helpers.
2021-01-13 01:21:38 -05:00
Franz Liedke
3224aeabac Tests: Actually accept multiple extenders
We did pass multiple extenders to this method in the tests for the
`Model` extender - now this actually has the desired effect.
2021-01-13 01:21:38 -05:00
Franz Liedke
fe0159ecd1 Test setup: Do not use env() helper
Not needed, and not working without a full Laravel installation.
2021-01-13 01:21:38 -05:00
Franz Liedke
f45a1608df Split up Application and Container
- Stop trying to implement Laravel's Application contract, which
  has no value for us.
- Stop inheriting from the Container, injecting one works equally
  well and does not clutter up the interfaces.
- Inject the Paths collection instead of unwrapping it again, for
  better encapsulation.

This brings us one step closer toward upgrading our Laravel
components (#2055), because we no longer need to adopt the changes
to the Application contract.
2021-01-13 01:21:38 -05:00
Alexander Skvortsov
915a428973 Add console extender (#2057)
* Made the console command system extender-friendly

* Added console extender

* Added ConsoleTestCase to integration tests

* Added integration tests for console extender

* Marked event-based console extension system as deprecated

* Moved trimming command output of whitespace into superclass

* Renamed 'add' to 'command'

* Added special processing for laravel commands

* Code style fixes

* More style fixes

* Fixed $this->container
2021-01-13 01:21:38 -05:00
Franz Liedke
21f4c3f6dd Apply fixes from StyleCI
[ci skip] [skip ci]
2021-01-13 01:21:38 -05:00