8498 Commits

Author SHA1 Message Date
Alexander Skvortsov
0569da23e1 Drop all DB tables before installation during setup. (#9)
This ensures a clean state for the extension currently being tested. The alternative requires the user to create and keep track of multiple test databases, or manually delete/re-recreate the database every time they switch between extensions being tested. Now, a simple `composer test:setup` will always reset the test environment to the original state.
2021-04-20 14:47:07 -04:00
flarum-bot
9929034e8c Bundled output for commit c042394d4a6c27a4c7694f4d72db0683708923f8 [skip ci] 2021-04-20 16:26:39 +00:00
David Wheatley
c042394d4a Add accessibility attributes to loading spinner (#2799) 2021-04-20 17:25:23 +01:00
Alexander Skvortsov
42a9de5a11 Fix registering custom searchers, allow searchers without fulltext (#2755) 2021-04-19 16:59:53 -04:00
Alexander Skvortsov
4fea0ebdee Filesystem Extender and Tests (#2732) 2021-04-19 16:25:08 -04:00
Alexander Skvortsov
804564a09a Asset Publish Command (#2731) 2021-04-19 15:51:28 -04:00
Alexander Skvortsov
3e173afa24 Use Laravel filesystem interface for assets and avatars (#2729)
* WIP: Use Laravel filesystem interface where possible
* Drop vendorFilesystem
* Support getting URL of cloud-based logo and favicon
* FilesystemAdapter should always be cloud
* Get base avatar URL from filesystem adapter
* Restore deleted getAsset method

Co-authored-by: Alexander Skvortsov <askvortsov1@users.noreply.github.com>
2021-04-19 21:11:03 +02:00
Alexander Skvortsov
9a3f579cbb Rename relevant migration so it runs again (#2793) 2021-04-19 14:14:07 -04:00
flarum-bot
c227447841 Bundled output for commit bb4e7ac90060168b62038914451931dd441333c8 [skip ci] 2021-04-19 14:37:25 +00:00
Alexander Skvortsov
bb4e7ac900 Adjust search height on resize (#2775)
Identified as a potential issue in https://github.com/flarum/core/pull/2650

When typing, the keyboard generally obstructs half the screen. However, when the keyboard is closed, search results don't expand to take up full space.
2021-04-19 10:36:04 -04:00
Alexander Skvortsov
1699ac3355 Add id to migrations table (#2794) 2021-04-19 10:35:21 -04:00
Alexander Skvortsov
a56f4896a6 Remove unused container argument 2021-04-18 17:20:14 -04:00
Alexander Skvortsov
6ae880b214 Drop session from user class (#2790)
This was originally introduced in d87583d0ef, but has not seen usage, since usually when the session needs to be modified, the request is available.

It causes issues with certain queue drivers, as it can't be serialized.

It's also not entirely accurate, as a user can have multiple sessions at once. Therefore, a given session is a property of the request, not of the user.

The reason this causes issues in the Queue is that when a Job has payload that consists User(s), the Queue will try to serialize that. Serializing the User object will require serializing the session too; this causes a Serialization of Closure is not allowed error, see image.

One can circumvent that in many ways, the most obvious one is adding a __sleep and __wakeup implementation in the User class (or the session handler). But as we aren't really using the session on the User model anywhere in core, bundled or most community extensions it is best to simply detach this from the user.
2021-04-16 15:53:05 -04:00
Sami Mazouz
72c7d3f49b Update laravel docs references to 8.x (#2788) 2021-04-16 13:26:15 +01:00
Alexander Skvortsov
8fd1cc4f0d TestCase Config method (#13)
Similarly to `settings`, this allows setting/overriding config prior to application boot.
2021-04-14 16:27:59 -04:00
Sami Mazouz
72e29a24b7 Add unparse to Formatter extender (#2780) 2021-04-14 11:34:49 +01:00
Sami Mazouz
b2ecb8f020 Remove UsesSettingsTrait (#12) 2021-04-13 23:46:04 -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
Sami Mazouz
67e452dda5 Access request actor in error handler (#2410)
* Add an ActorReference class to store the actor `$request->getAttribute('actorReference')->getActor()`
* Add a middleware to inject the actor reference
* Deprecate `$request->getAttribute('actor')`
2021-04-12 18:42:22 +01:00
Alexander Skvortsov
76a869a198 Start transactions before the app is fully booted. (#11)
This make a cleaner state more likely, and ensures that settings set via `$this->setting` are cleaned up after the test case runs.
2021-04-12 10:26:05 -04:00
Alexander Skvortsov
675627ac15 Add a few more automated tests 2021-04-11 23:00:36 -04:00
Alexander Skvortsov
f13d45f77b Test against dev version of core
Since we're making changes for the dev version of core, we should test against that too.

For now, this fixes issues with the `extensions` method of `Installation` being undefined.
2021-04-11 22:47:09 -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
0fb3548f46 Fix relevance sort (#2773)
- Adds a field to QueryCriteria that determines whether the sort provided is the controller's default sort
- Set this field to true iff sort not in query params. Default it to false
- Override $sort if a new default sort has been set on search state, and the param is true.
- Add tests!
2021-04-11 22:21:56 -04:00
Sami Mazouz
598bb94657 Require unique route names (#2771) 2021-04-10 20:38:25 +01:00
flarum-bot
68f0dc4d4c Bundled output for commit 65984b0cc99bee3880060f068f5f12af66d3a8b9 [skip ci] 2021-04-10 14:45:12 +00:00
David Wheatley
65984b0cc9 Push lockfile from Linux to fix missing chokidar 2021-04-10 14:39:05 +00:00
David Wheatley
284d9a1461 Add option to build with Webpack Bundle Analyzer (#2708)
* Add option to build with webpack bundle analyzer

* Bump npm to v7 as recommended in actions/setup-node#213

* Workaround for npm/cli#558

* Add missing dep
2021-04-10 15:00:48 +01:00
Adam Hosker
bc0ed8803d Remove MyISAM Requirement (#2442)
- Remove Database Engine Default of InnoDB
- Remove Hard Coded MyISAM requirement
2021-04-09 08:13:47 -04:00
flarum-bot
0c15257b24 Bundled output for commit 734ea42ff6bc2f767a3ad3e809ff4ce57617c54c [skip ci] 2021-04-08 23:43:36 +00:00
David Wheatley
734ea42ff6 Replace spin.js with a CSS-only loading spinner (#2764)
* Create CSS only loading indicator

* Core mods to fix Loading Indicator usage

* Remove extra whitespace

* Attrs interface extends ComponentAttrs and is exported

* Add doc block about custom styling
2021-04-09 00:42:32 +01:00
Alexander Skvortsov
f2101e502e Don't enable extensions during installation (#7) 2021-04-08 18:39:21 -04:00
David Wheatley
84e12a4864 Cache npm cache between JS build runs (#2710) 2021-04-08 20:29:37 +01:00
flarum-bot
06c3a4f429 Bundled output for commit db876fef81988f84c799f11441e6419fdf887e8d [skip ci] 2021-04-08 11:36:26 +00:00
David Wheatley
db876fef81 Bump dependencies, add missing typing libraries (#2753)
* Bump dependencies and add missing typing libraries

* Fix expose-loader breaking changes

* Expose jQuery using its own typings instead of ours

* Extend jQuery typings with our own custom $.fn helpers

* Use jQuery typings for Component's `this.$` attribute

* Format webpack config file

* Use Spin.js 3.1.0
2021-04-08 12:35:10 +01:00
David Wheatley
3ade56e704 Add code scanning workflow to identify common issues (#2744)
* Add code scanning workflow to identify common issues

* Don't run CodeQL if the only changes in a push/PR are .less or .md files

* Change cron

* Change workflow name to include language

* Make indents consistent with other workflows
2021-04-08 12:15:27 +01: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
Alexander Skvortsov
a554c85d8a Introduce RequestUtil to encapsulate getting/setting actor on requests(#2449) 2021-04-07 23:33:05 -04:00
Alexander Skvortsov
809e0d2ae0 Allow configuring default enabled extensions as part of installation (#2757)
This is needed for the testing library
2021-04-07 22:47:54 -04:00
Alexander Skvortsov
9a9a644c56 Don't fail silently on cache clear (#2756) 2021-04-07 22:13:08 -04:00
Sami Mazouz
e4d5a328f3 Fix a missed getRouteData() (#2774) 2021-04-07 20:08:21 -04:00
flarum-bot
fa249d9bc0 Bundled output for commit afa89aa05d7c21df2f68cc33f38f49d6dbe293a1 [skip ci] 2021-04-07 22:26:04 +00:00
Alexander Skvortsov
afa89aa05d Preloaded API document Improvements (#2754)
* Invalidate preloadedApiDocument if URL has changed
* Revert to using `getRouteData()[0]`
2021-04-07 23:25:01 +01:00
Sami Mazouz
a58ce93486 Merge pull request #10 from flarum/as/allow-specifying-settings-before-boot
Allow configuring settings before app boot
2021-04-07 22:59:20 +01:00
Alexander Skvortsov
9ed29cd35e Add automated tests for flarum/testing 2021-04-07 22:38:58 +01:00