Commit Graph

4216 Commits

Author SHA1 Message Date
Alexander Skvortsov
f8421b47b2 Centralize permission caching (#2832) 2021-05-04 13:56:14 -04:00
David Wheatley
a7f98f54fa Mark JS dist folder as generated code (#2828)
This excludes it from the repo's language stats and are suppressed in Linguist diffs.

See: https://github.com/github/linguist/blob/master/docs/overrides.md#generated-code
2021-05-04 18:13:42 +01:00
Robert Korulczyk
02d9033349 Update validation.yml. (#2829)
source: https://github.com/laravel/laravel/blob/v8.5.16/resources/lang/en/validation.php
2021-05-03 19:47:18 -04:00
Matt Kilgore
b6a811bbcc Harden Headers (#2721)
* Basic security headers

* Remove XSS Header (not relevent)

* Fix config name

* Use Arr::get()

* Add tests

* Re-fix the StoreConfig step for fresh installs

Co-authored-by: luceos <luceos@users.noreply.github.com>
Co-authored-by: Alexander Skvortsov <askvortsov1@users.noreply.github.com>
2021-05-03 12:42:06 -04:00
Alexander Skvortsov
87024fc8b7 Apply fixes from StyleCI
[ci skip] [skip ci]
2021-05-03 05:36:06 +00:00
Alexander Skvortsov
a22fed10a7 Use latest version of settings package
This allows us to get rid of hacks for configuring settings and config
2021-05-03 01:35:46 -04:00
flarum-bot
5e0d59eedb Bundled output for commit 3893d92d4a [skip ci] 2021-05-02 16:14:09 +00:00
David Wheatley
3893d92d4a Revamp notifications stylesheet (grid and flex) (#2822) 2021-05-02 17:13:04 +01:00
flarum-bot
6f07235be0 Bundled output for commit f3eb142a57 [skip ci] 2021-05-02 10:38:26 +00:00
David Wheatley
f3eb142a57 Allow multiple methods to be provided to extend and override 2021-05-02 11:37:19 +01:00
flarum-bot
1f1c17628a Bundled output for commit b32fc37df4 [skip ci] 2021-04-30 17:00:49 +00:00
Alexander Skvortsov
b32fc37df4 Fix package-lock
b5ee8a034b accidentially commited a package-lock with symlinks, breaking the JS build process
2021-04-30 12:59:33 -04:00
Alexander Skvortsov
b5ee8a034b Switch to ICU MessageFormat (#2759) 2021-04-30 12:44:39 -04:00
Alexander Skvortsov
9461df8803 Remove unnecessary laravel config (#2796) 2021-04-30 00:31:19 +02:00
Matt Kilgore
9aa50ca6e3 Move Powered By Header to headers config (#2777)
* Move Powered By Header to headers config
* Use Arr::get()
2021-04-30 00:30:01 +02:00
David Wheatley
56a02944f1 [A11Y] Add focus ring mixin to restore ring to elements which no longer have it (#2814)
* Add focus ring mixin

These mixins allow us to restore default browser focus rings on elements which no longer have them.

* Add info about custom outline styles; use `#private` namespace and fix mixin name

I just learned that Less has namespaces! https://lesscss.org/features/#mixins-feature-namespaces
2021-04-29 22:10:17 +01:00
David Wheatley
f7d3150ce5 LESS should be capitalised as Less
See http://lesscss.org/
2021-04-29 22:07:46 +01:00
Daniël Klabbers
27e0002738 Revision compiler revised (#2805)
- revisions now use <asset>.<type>?v=<revision> instead of <asset>-<revision>.<type>- remove deprecated filename for revision method
- reconsider use of cache differentiator and implement something that
prevents recompiling css every single time
- allow force recompilation
2021-04-29 16:49:36 -04:00
Daniël Klabbers
b64698d79f error handling when extending flarum from extensions fails (#2740) 2021-04-29 16:17:41 -04:00
Daniël Klabbers
d77cc5440b fixed container bindings use of container (#2807) 2021-04-29 15:33:51 -04:00
Sami Mazouz
53467fa5a1 Remove ExtensionPage CSS over-specification (#2792) 2021-04-29 16:31:37 +01:00
Daniël Klabbers
15fab7cd9b clarify callable arguments for password checker (#2812) 2021-04-29 10:19:06 -04:00
flarum-bot
231744b3b7 Bundled output for commit b75aa9c496 [skip ci] 2021-04-26 16:15:37 +00:00
Sami Mazouz
b75aa9c496 Fix class naming (#2811) 2021-04-26 17:14:22 +01:00
flarum-bot
75222f7eae Bundled output for commit 3db457c0f9 [skip ci] 2021-04-22 22:37:03 +00:00
David Wheatley
3db457c0f9 Add users list to admin dashboard (#2626)
* Commit initial WIP code

* Fix squashed grid on mobile

* Add pagination support; rename to userList

* Improve grid sizing

* Improve grid row shading

* Move EditUserModal to common

* Add link to profile page in grid

* Use Less styling vars

* Move EditUserModal translations to lib

* Add edit user button to grid

* Fix incorrect profile link priority

* Update profile link translation key

* Add priorities to other columns

* Add group badges to grid

* Add username to profile link tooltip

* Organise imports

* Use variable for header border bottom color

* Fix broken export

* Add total user count to API payload's metadata

* Add new metadata to ApiPayload type

* Implement correct page number

* Remove debug code

* Use function to get the total pages

This allows us to use the raw count elsewhere in the component (pssst... check the next commit!)

* Center profile link in column

* Add profile link header

* Show total users above table

* Use ItemList's itemName property for column data attributes

* Add user email column, hidden by default

This column is hidden by default using a placeholder email and blur filter. These are then removed when the visibility toggle is pressed.

This prevents any over-the-shoulder accidental data leakage, as emails are classed as PII under GDPR.

* Fix incorrect tooltip translation keys

* Add extra padding between email and visibility toggle button

* Prevent selection of blurred email

* Fix incorrect icon state for email toggle

* Update API response type to include metadata (for now)

* Increase number of users per page to 50

* Update compat files with new locations

* Format

* Add @deprecated notices for forum compat export

* Use AdminPayload for user count instead of supplying as REST API metadata

* Make nav look less squashed using bottom margin

* Suppress TS warning

* StyleCI fixes

* Fix TS error

* Update based on review comments

* Rename user list -> users

* Rename internal instances of user_list to users

* Fix formatting

* Use CSS custom properties for the table column count

* Use .Button--icon instead of custom style

* Make fake email more realistic length

* Add a11y attributes

* Use padding bottom instead of margin bottom for page spacing

* Make compatible with new CSS LoadingIndicator

I won't let it break here! :P

* Integrate profile link into username column

* Don't force columns to be 300px

This made the grid look very bloated and intimidating -- lets instead increase the padding between items and make it only the width it needs to be.

* Center edit user button in column

* Increase spacing between email and visibility toggle button

* Rename `statistics` to `modelStatistics` in Admin payload

This prevents any possible conflicts with core and `flarum/statistics`. We might want to consider migrating the stats extension to extend this object in the future.

* Update comments, fix TS error

* Various translation key changes

* Change gmail.com -> example.com

* Stretch 'edit user' button to entire cell size

* Update translations

* Is the YAML formatted right this time? 🙈

* Remove email placeholder

Fixes an issue where the table would jump if an email was unhidden that was longer than the placeholder.

* Re-order lib translations

* Clicking blurred email now unblurs

* Correct header class

* Improve edit user button centring

* Improve vertical row item centering

* Fix incorrect column length in aria attribute

* Use .Button--text!
2021-04-22 23:35:42 +01:00
flarum-bot
88fcc352a5 Bundled output for commit 90ffa63056 [skip ci] 2021-04-21 11:27:23 +00:00
David Wheatley
90ffa63056 Fix uses of loading spinner (#2797)
* Update Loading Indicator

- Fix mistake in LoadingIndicator Less
- Middle align the loading indicator when inline
- Fix Loading Indicator not correctly accepting container class names
- Add inline and block attributes

* Fix loading indicator in composer

* Fix loading indicator on notification list

* Fix loading indicator on discussion page

* Fix loading indicator on button

* Update more uses of loading indicator

* Fix loading indicator in Search box

* Fix AvatarEditor loading spinner

* Set default spinner props

* Replace "tiny" with "small" in Less

* Improve spinner vertical centring in buttons

* Reduce size specificity

* Use single attribute for block/inline

* Use new display attribute

* Use classes for different sizes

* Use `display=block` by default
2021-04-21 12:26:09 +01:00
Alexander Skvortsov
401672aac4 Combine search tests
#b4738febaa2e9a34cea181b621016b50a145115d and #0fb3548f46719090579a5ef4e8cda26234d24943
 both added/improved searching tests, but did so in separate files. As a result, the tests did not consider each other, and when both were merged, started failing. This commit combines the tests into one file that tests both order and search in titles.
2021-04-20 19:16:59 -04:00
Sami Mazouz
b4738febaa Add user id slug driver (#2787) 2021-04-20 23:52:53 +01:00
Alexander Skvortsov
04115e28c1 Fix searching titles in discussions (#2698)
* Fix searching titles in discussions

* Apply fixes from StyleCI

* Fix tests

* Distinct by discussion ID

* Replace distinct with groupBy

Co-authored-by: Alexander Skvortsov <askvortsov1@users.noreply.github.com>
2021-04-20 18:52:14 -04:00
flarum-bot
9929034e8c Bundled output for commit c042394d4a [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 bb4e7ac900 [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
Sami Mazouz
72e29a24b7 Add unparse to Formatter extender (#2780) 2021-04-14 11:34:49 +01: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
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 65984b0cc9 [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