1
0
mirror of https://github.com/flarum/core.git synced 2025-08-13 11:54:32 +02:00

Compare commits

...

437 Commits

Author SHA1 Message Date
Sami Mazouz
bed386f8e4 fix(approval): post approved event triggered when not approving 2023-11-10 10:50:53 +01:00
Ian Morland
82e08e3fa5 chore: prep 1.8.2 release 2023-09-22 20:01:59 +01:00
flarum-bot
2c4a2b8d9e Bundled output for commit 00866fbba9
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-09-22 18:51:39 +00:00
Ian Morland
00866fbba9 chore: bump version 2023-09-22 19:46:39 +01:00
IanM
0d1d4d46d1 fix: missing compat exports (#3888) 2023-09-22 19:38:59 +01:00
Sami Mazouz
b1383a955f fix(1.x,suspend): suspended users can abuse avatar upload (#3890)
* fix(1.x,suspend): suspended users can abuse avatar upload

* test: works as expected

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-09-22 19:38:33 +01:00
Sami Mazouz
daeab48ae8 chore: turn on frontend build on 1.x branch 2023-09-20 21:12:54 +01:00
Ian Morland
e03ca4406d chore: build js 2023-07-06 12:03:30 +01:00
StyleCI Bot
7894c6a69b Apply fixes from StyleCI 2023-07-05 09:31:05 +00:00
Sami Mazouz
102e31754a chore: not 1.8.2 2023-07-04 11:19:15 +01:00
Sami Mazouz
8538f9c8f6 chore: prepare v1.8.2 release 2023-07-04 11:12:55 +01:00
Sami Mazouz
5a4bb7ccf2 fix: missing slug from post mention links 2023-07-04 11:00:45 +01:00
Sami Mazouz
d2a6329689 fix(mentions): cannot use mentionables extender (#3849) 2023-07-04 10:56:52 +01:00
Rafael Horvat
2bc2899a1d fix(mentions): missed post mentions UI changes (#3832)
Co-authored-by: Ian Morland <ian@morland.me>
2023-07-01 17:44:59 +01:00
Sami Mazouz
5437bf5c23 chore: prepare v1.8.1 release
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-23 19:24:51 +01:00
flarum-bot
717af13bb1 Bundled output for commit e72541e35d
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-22 21:58:15 +00:00
Sami Mazouz
e72541e35d fix: recover temporary solution for html entities in browser title
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-22 22:49:20 +01:00
Sami Mazouz
577890d89c fix: custom contrast color affected by parents
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-22 22:23:11 +01:00
Sami Mazouz
253a3d281d fix: reply placeholder wrong positioning
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-22 21:58:38 +01:00
flarum-bot
d27f952584 Bundled output for commit e5abffc75b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-20 16:46:42 +00:00
Sami Mazouz
e5abffc75b chore: v1.8 preparations
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-20 16:08:42 +01:00
Sami Mazouz
d1059c1cc7 fix: improve avatar upload functionality
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-20 15:15:53 +01:00
flarum-bot
777c304ab7 Bundled output for commit 789246b621
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-17 10:47:32 +00:00
Sami Mazouz
789246b621 fix(regression): slidable mark read showing for read discussions
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-17 11:37:33 +01:00
Sami Mazouz
980cfd6c28 Update prepare-release.yml 2023-05-17 09:51:06 +01:00
Sami Mazouz
65390a4fc0 test: patch phpstan error
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-16 19:57:57 +01:00
Sami Mazouz
c7c86a77e9 fix(regression): newCollection does not accept base collection
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-16 19:25:23 +01:00
Sami Mazouz
f1f6051deb fix(regression): lost spacing between tag label icon and text
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-16 19:21:04 +01:00
Sami Mazouz
bded3da42d fix(regression): queryVisibleTo accepts nullable actor
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-16 19:17:07 +01:00
Sami Mazouz
231cee1f78 fix(regression): newCollection accepts collections
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-15 17:31:23 +01:00
flarum-bot
f6c9bbb427 Bundled output for commit feb968780a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-14 20:41:53 +00:00
Sami Mazouz
feb968780a fix(regression): missing TagsLabel class
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-14 21:34:34 +01:00
Sami Mazouz
5b89d3e91a chore(regression): use correct imports from core js
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-14 21:34:17 +01:00
Daniël Klabbers
ba7599e6fe chore: bbcode not psr autoloaded 2023-05-09 09:10:37 +02:00
Sami Mazouz
80b34d1164 fix: discussion page showing horizontal scroll on iOS (#3821)
Co-authored-by: David Wheatley <david@davwheat.dev>
2023-05-08 09:28:32 +01:00
Sami Mazouz
3accdc322c fix(regression): fetch promise rejections not handled
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-07 22:44:25 +01:00
flarum-bot
4247e54c64 Bundled output for commit ef35faaded
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-07 21:37:58 +00:00
Sami Mazouz
ef35faaded fix(regression): wrong app import in forum JS
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-07 22:31:07 +01:00
flarum-bot
715b8c39ae Bundled output for commit 232618aba6
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-07 21:24:30 +00:00
Sami Mazouz
232618aba6 fix: UserSecurityPage not exported
Fixes #3820

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-07 22:18:21 +01:00
flarum-bot
96e1411b7d Bundled output for commit 21b483625e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-07 17:49:29 +00:00
David Wheatley
21b483625e feat: add user creation to users list page (#3744) 2023-05-07 18:38:37 +01:00
Sami Mazouz
9363682e1c fix: filter values are not validated (#3795) 2023-05-07 18:37:53 +01:00
flarum-bot
c766881e1f Bundled output for commit e63e161be6
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-07 16:49:15 +00:00
David Wheatley
e63e161be6 chore: major frontend JS cleanup (#3609) 2023-05-07 17:40:18 +01:00
Nicolas Peugnet
3264455068 fix(testing): always clear cache in integration test's tearDown (#3818)
This prevent tests from interacting between each other through the cache.
2023-05-02 19:24:14 +01:00
Sami Mazouz
d7fcd8a9e5 fix(bbcode): highlight.js does not work after changing post content (#3817)
* fix(bbcode): highlight.js does not work after changing post content

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore(bbcode): organize bbcode code

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-05-02 09:39:43 +01:00
IanM
b4f3f0558e feat: cli command for enabling or disabling an extension (#3816) 2023-05-01 08:06:52 +01:00
Sami Mazouz
919c3bb770 perf: speed up post creation time (#3808)
* chore: drop unused visibility checking in notif syncer

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* perf: eager load parsed mentions

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* perf: eager load some relations needed for visibility checking

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* perf: trigger mentions notifications in a queueable job

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* fix: broken tag mentions

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-04-30 10:10:31 +01:00
Sami Mazouz
7298ccb301 feat(testing): add a trait to flush the formatter cache in tests (#3811) 2023-04-30 09:48:46 +01:00
flarum-bot
cfdd6910eb Bundled output for commit 7ebeb9c0a5
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-29 17:42:13 +00:00
Sami Mazouz
7ebeb9c0a5 fix: unreadable badge icon on certain colors (#3810) 2023-04-29 18:35:18 +01:00
Sami Mazouz
af3f91ca5b fix(tags): DiscussionTaggedPost shows tags as deleted (#3812)
* fix(tags): `DiscussionTaggedPost` shows tags as `deleted`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-04-29 09:48:01 +02:00
Sami Mazouz
4784307e26 fix(bbcode): localize quote wrote string (#3809)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-27 20:26:28 +01:00
flarum-bot
105b22976e Bundled output for commit fea31a8290
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-24 17:10:43 +00:00
Robert Korulczyk
fea31a8290 Fix encoding of page title. (#3768) 2023-04-24 18:00:22 +01:00
Sami Mazouz
accdfde6e1 fix(mentions): mentions XHR fired even after mentioning is done (#3806)
* fix(mentions): mentions XHR fired even after mentioning is done

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: simplify diff

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-24 17:57:41 +01:00
flarum-bot
7684a1086a Bundled output for commit f8577c8078
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-22 08:52:48 +00:00
luk
f8577c8078 fix: isDark() utility can receive null value (#3774)
* Make isDark() not fail as easily with invalid input

Add early return if input looks fishy, minor refactoring and improvements of the entire method.

* Fix double quotes

* Run prettier 🙄

* chore: review

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-22 09:45:51 +01:00
flarum-bot
e55844f3db Bundled output for commit 1d20f4d4aa
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-21 06:52:38 +00:00
Rafael Horvat
1d20f4d4aa Change some methods from private to protected, to be able to extend the affected classes (#3802) 2023-04-21 07:42:42 +01:00
Sami Mazouz
803f0cd0f4 fix(tags): not all tags are loaded in the permission grid (#3804)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-21 07:38:09 +01:00
IanM
8576df1a43 fix: null as 2nd param is deprecated (#3801) 2023-04-19 19:07:10 +02:00
flarum-bot
1792e22639 Bundled output for commit 5e281136f6
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-19 12:05:15 +00:00
Sami Mazouz
5e281136f6 feat(mentions,tags): tag mentions (#3769)
* feat: add tag search

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* feat(mentions): tag mentions backend

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* feat: tag mention design

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* refactor: revamp mentions autocomplete

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: unauthorized mention of hidden groups

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* feat(mentions,tags): use hash format for tag mentions

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* refactor: frontend mention format API with mentionable models

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* feat: implement tag search on the frontend

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: tag color contrast

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: tag suggestions styling

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* test: works with disabled tags extension

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: move `MentionFormats` to `formats`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: mentions preview bad styling

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* docs: further migration location clarification

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* fix: bad test namespace

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: phpstan

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: conditionally add tag related extenders

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* feat(phpstan): evaluate conditional extenders

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* feat: use mithril routing for tag mentions

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-04-19 12:58:11 +01:00
flarum-bot
b868c3d763 Bundled output for commit 297a2d8c5c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-19 11:48:24 +00:00
Sami Mazouz
297a2d8c5c fix: deleting a discussion from the profile does not visually remove it (#3799)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-19 12:37:30 +01:00
flarum-bot
c0af41c305 Bundled output for commit d0669b08aa
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-19 08:32:02 +00:00
Sami Mazouz
d0669b08aa perf(likes): limit likes relationship results (#3781)
* perf(core,mentions): limit `mentionedBy` post relation results

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* chore: use a static property to allow customization

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: use a static property to allow customization

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: include count in show post endpoint

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: consistent locale key format

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: forgot to delete `FilterVisiblePosts`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* test: `mentionedByCount` must not include invisible posts to actor

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: visibility scoping on `mentionedByCount`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: `loadAggregates` conflicts with visibility scopers

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* chore: phpstan

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* perf(likes): limit `likes` relationship results

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* chore: simplify

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* test: `likesCount` is as expected

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: IanM <16573496+imorland@users.noreply.github.com>
2023-04-19 09:22:41 +01:00
flarum-bot
6b8e9ce1db Bundled output for commit fbbece4bda
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-19 07:30:05 +00:00
Sami Mazouz
fbbece4bda perf(core,mentions): limit mentionedBy post relation results (#3780)
* perf(core,mentions): limit `mentionedBy` post relation results

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* chore: use a static property to allow customization

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: use a static property to allow customization

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: include count in show post endpoint

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: consistent locale key format

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: forgot to delete `FilterVisiblePosts`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* test: `mentionedByCount` must not include invisible posts to actor

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: visibility scoping on `mentionedByCount`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: `loadAggregates` conflicts with visibility scopers

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* chore: phpstan

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-04-19 08:23:08 +01:00
dependabot[bot]
13e655aca5 chore(deps): bump webpack from 5.75.0 to 5.76.0 (#3761)
Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-19 07:45:00 +01:00
flarum-bot
c00e8706e1 Bundled output for commit 1b5da13e8a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-17 08:14:57 +00:00
Robert Korulczyk
1b5da13e8a fix: infinite scroll not initialized for notifications on big screens (#3733) 2023-04-17 09:07:00 +01:00
flarum-bot
ecfbcd1c30 Bundled output for commit 818a100625
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-17 08:01:58 +00:00
Tristian Kelly
818a100625 feat: add delete own posts permission (#3784) 2023-04-17 08:53:51 +01:00
flarum-bot
176b5540d8 Bundled output for commit 2e76a8ecb5
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-16 20:54:45 +00:00
Sami Mazouz
2e76a8ecb5 fix: color input overflowing the input box (#3796)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-16 21:33:57 +01:00
Sami Mazouz
11aa7bbb35 fix: unread count in post stream not visible (#3791)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-16 21:14:54 +01:00
Sami Mazouz
3a26c29935 feat: provide old content to Revised event (#3789)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-16 21:14:17 +01:00
Sami Mazouz
94e92cf24e fix: approving a post does not bump user comment_count (#3790)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-16 21:13:57 +01:00
Sami Mazouz
aa33cfd1f8 fix(a11y): reply placeholder not accessible (#3793)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-16 21:13:32 +01:00
Sami Mazouz
4901c586ce chore: drop usage of jquery in install and update interfaces (#3797) 2023-04-16 21:12:47 +01:00
Sami Mazouz
7a6d477550 fix: notification subject discussion eager loading fails (#3788) 2023-04-16 21:12:01 +01:00
Sami Mazouz
b89a01c010 chore: extensibility improvements (#3729)
* chore: improve tags page extensibility
* chore: improve discussion list item extensibility
* chore: improve change password modal extensibility
* chore: item-listify tags page
* chore: item-listify change email modal
* chore: simplify data flow

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-16 21:05:23 +01:00
flarum-bot
8b11fef3ee Bundled output for commit 8a114cd826
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-16 11:48:33 +00:00
Sami Mazouz
8a114cd826 fix(regression): styling and semantics of header tag are incorrect
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-16 12:41:51 +01:00
flarum-bot
62c93b4a05 Bundled output for commit fab71f2d01
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-15 15:29:22 +00:00
Sami Mazouz
fab71f2d01 fix(package-manager): available core updates cause an error in the dashboard
Fixes #3776

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-04-15 16:21:45 +01:00
Sami Mazouz
e8c867dcac fix: circular dependencies disable all involved extensions (#3785) 2023-04-12 21:59:06 +01:00
flarum-bot
1247a7f1dd Bundled output for commit b0aad1a2d6
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-04-10 20:09:56 +00:00
Rafał Całka
b0aad1a2d6 fix(tags): tag discussion modal filters with exact matches only after first index (#3786)
* feat: Update tag filtering to include partial matches

* fix: Case insensitive filtering
2023-04-10 21:01:18 +01:00
flarum-bot
bddc9d96f2 Bundled output for commit d684248492
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-23 08:10:20 +00:00
IanM
d684248492 fix: empty string displayed as SelectDropdown title (#3773)
* fix: empty string displayed as SelectDropdown title

* chore: remove import

* chore: ts-ignore

* Update framework/core/js/src/common/components/SelectDropdown.tsx

Co-authored-by: David Wheatley <david@davwheat.dev>

---------

Co-authored-by: David Wheatley <david@davwheat.dev>
2023-03-23 08:02:59 +00:00
Rafael Horvat
85b63681ae Fix: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous (#3772) 2023-03-21 10:32:23 +00:00
Sami Mazouz
8372363cc2 feat: conditional extenders (#3759) 2023-03-14 21:53:16 +01:00
Ngô Quốc Đạt
a6a067ad48 chore: update to PHP 8.2 in frontend workflow (#3755) 2023-03-12 13:58:06 +01:00
Sami Mazouz
241eba4d0c chore: mark start of 1.8.0 development
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-12 13:56:39 +01:00
Sami Mazouz
a6b12826c3 chore: 1.7.1 preparations
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-12 13:28:04 +01:00
Sami Mazouz
dd868ab44e fix: improve sessions user UI on mobile
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-12 13:21:21 +01:00
flarum-bot
5f3e0d6a09 Bundled output for commit 661b9d7d9a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-12 11:45:23 +00:00
Robert Korulczyk
661b9d7d9a chore: hide developer tokens section in if there is nothing to display or create (#3753) 2023-03-12 12:37:49 +01:00
flarum-bot
b7498d6cb1 Bundled output for commit e7c55532a0
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-12 09:46:12 +00:00
Robert Korulczyk
e7c55532a0 fix: hardcoded language strings in StatusWidget (#3754) 2023-03-12 10:37:57 +01:00
Robert Korulczyk
cce6b74fce fix: missing parameter names in token title translation. (#3752) 2023-03-12 10:33:19 +01:00
flarum-bot
da651c722b Bundled output for commit abc9670659
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-11 08:14:06 +00:00
Sami Mazouz
abc9670659 fix(tags): incorrect max and min primary tags used
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-11 09:05:12 +01:00
Sami Mazouz
b66fe5dd5f chore(release): preparations
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-09 19:00:32 +01:00
flarum-bot
7d79895ae0 Bundled output for commit 3ab4529232
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-09 15:35:22 +00:00
Sami Mazouz
3ab4529232 fix(qa): apply color contrast fix when colored only
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-09 16:28:32 +01:00
flarum-bot
360a2ba1d8 Bundled output for commit eaa4063fef
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-08 19:21:16 +00:00
Sami Mazouz
eaa4063fef fix(qa): attempt to fix akismet error
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-08 20:14:09 +01:00
flarum-bot
72d277bd45 Bundled output for commit 28e3ccfde6
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-08 17:34:35 +00:00
Sami Mazouz
28e3ccfde6 fix(qa): increase YIQ and fix menu item title
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-08 18:25:04 +01:00
Sami Mazouz
3f864bafc8 fix(regression): custom less validation check
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-06 15:24:03 +01:00
Sami Mazouz
3af0481f30 test: remove use of deprecated phpunit assertion
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-06 15:03:33 +01:00
Sami Mazouz
1761660c98 fix: disallow certain dangerous LESS features
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-04 20:38:19 +01:00
Sami Mazouz
8ddb0feb09 chore: yarn audit-fix
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-01 12:35:59 +01:00
Sami Mazouz
fa30f4f250 fix(regression): cannot delete users (#3746)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-24 18:22:12 +01:00
Robert Korulczyk
79a9b23096 fix: normal logout affects all sessions (#3571)
Previously all user tokens were deleted, which logouts from all sessions.
2023-02-21 17:23:20 +01:00
Tristian Kelly
33e2bd1a77 fix(mentions): post reply mention missing notification on approval (#3738)
* Add PostWasApproved event

* Apply fixes from StyleCI

* fix: phpstan error

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-02-21 15:04:03 +00:00
flarum-bot
a3a39caa44 Bundled output for commit bbf873442a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-02-21 14:37:00 +00:00
Sami Mazouz
bbf873442a feat: global logout to clear all sessions, access tokens, email tokens and password tokens (#3605)
* chore: re-organize security locale keys alphabetically
* test: can globally logout
* feat: add global logout controller
* feat: add global logout UI to user security page
* test: re-adapt tests to changes
* feat: add boolean to indicate if logout even is global
* chore(review): split loading property
* chore: follow-up branch update

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-21 15:28:55 +01:00
David Wheatley
d35bb873a8 chore: make go-to-page input number-like (#3743) 2023-02-21 15:23:59 +01:00
flarum-bot
598ff21d7d Bundled output for commit 9342903d68
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-02-21 13:29:36 +00:00
Sami Mazouz
9342903d68 feat: access tokens user management UI (#3587)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Co-authored-by: David <hi@davwheat.dev>
2023-02-21 14:14:53 +01:00
Robert Korulczyk
ea7b270f47 fix(tags): clickable tag labels have underline (#3737) 2023-02-21 14:09:37 +01:00
David Wheatley
906b0fb633 feat: add display name column to admin users list (#3740) 2023-02-21 13:04:53 +00:00
David Wheatley
408a92b4ea feat: improved page navigation for users list (#3741)
* feat: add first and last page buttons

* feat: add textbox-based page navigation

* feat: add query parameter page navigation
2023-02-21 13:04:30 +00:00
Robert Korulczyk
0da069ba9f Fix translation key for scheduler dashboard. (#3736) 2023-02-16 17:33:37 +01:00
flarum-bot
d8fa791d9c Bundled output for commit fee6ffe396
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-02-15 17:50:20 +00:00
Robert Korulczyk
fee6ffe396 feat(seo): Do not use h3 header for poster author in posts stream (#3732)
* Do not use h3 header for poster author in posts stream.

* Change back `.PostUser-name` tag to h3.
2023-02-15 18:44:58 +01:00
flarum-bot
7a60a529da Bundled output for commit 37fd218723
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-02-15 16:33:15 +00:00
Robert Korulczyk
37fd218723 feat(seo): Use h2 header for discussions on discussions list (#3731)
* Use H2 header for discussions on discussions list.

* Put `DiscussionListPane` in `aside` tag to indicate that its content should not be treated as part of discussion content.

* Update markup for views generated by PHP.
2023-02-15 17:26:43 +01:00
IanM
1ee5cf6ba9 feat(core): PHP 8.2 Support (#3709)
* chore: test with php 8.2
* chore: bump httphandlerunnder
* chore: bump httphandlerunner
* chore: address php8.2 deprecation
* chore: php 8.2
* chore: bump less.php version
* avoid dynamic properties
* avoid another dynamic property
* Apply fixes from StyleCI
* tags php82
* php82
* fix: check for property existence
* Rerun checks after s9e/text-formatter update
* chore: disable deprecation warnings for php 8.2
* chore: PHP8.2 does not accept dynamic properties
* chore: temporarily disable package manager tests workflow

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-14 19:09:56 +01:00
flarum-bot
ced1c2d94f Bundled output for commit f8d856028d
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-02-13 20:20:57 +00:00
Sami Mazouz
f8d856028d fix(regression): admin header styling messed up
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-13 21:14:52 +01:00
Sami Mazouz
748cca6d12 chore: prepare @flarum/jest-config for release
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-12 17:45:00 +01:00
flarum-bot
f4f8369dc0 Bundled output for commit aa0b3288d5
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-02-11 12:36:30 +00:00
Daniël Klabbers
aa0b3288d5 feat(seo): shift h1 tag from logo to discussion title (#3724)
* feat(seo): shift h1 tag from logo to discussion title

Many times have we seen opponents of using h2 as the discussion title. Although
my own SEO knowledge is limited, I have seen the importance of structuring pages
according to the content you wish to prioritize. If we only take that into consideration
there is zero reason for the app-wide identical logo to take precedence over any
other heading.

This change makes the logo a standard (visually identical) element, and
makes the discussion hero title a h1.

* feat(seo): rewrite remainder of hero titles and subtitles
2023-02-11 13:27:46 +01:00
Sami Mazouz
153bb1a53c feat(actions): allow running JS tests in GH actions (#3730)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-11 13:19:57 +01:00
Sami Mazouz
ee1e04cdc2 chore: yarn
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-10 23:20:14 +01:00
flarum-bot
77a0b11bc8 Bundled output for commit 7e6458a125
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-02-10 22:08:35 +00:00
Sami Mazouz
7e6458a125 feat(jest): mithril component testing (#3679)
* feat(jest): create jest config package for unit testing
* chore: housekeeping
* fix: now we need to explicitly allow importing without extension
* fix: recover EditorDriverInterface import
* feat(jest): mithril component testing
* fix: use separate `tsconfig.test.json`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-10 23:02:50 +01:00
flarum-bot
675cdab658 Bundled output for commit e7fc29a59f
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-02-08 21:09:22 +00:00
Sami Mazouz
e7fc29a59f feat(jest): create jest config package for unit testing (#3678)
* feat(jest): create jest config package for unit testing
* chore: housekeeping
* fix: now we need to explicitly allow importing without extension
* fix: recover EditorDriverInterface import
* Apply suggestions from code review
* chore: yarn

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-08 22:02:40 +01:00
flarum-bot
08dead81ce Bundled output for commit 47b670aa29
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-02-08 20:19:47 +00:00
Sami Mazouz
47b670aa29 feat: frontend Model extender (#3646)
* feat: reintroduce frontend extenders
* chore: used `Routes` extender in bundled extensions
* chore: used `PostTypes` extender in bundled extensions
* chore: `yarn format`
* feat: `Model` frontend extender
* chore: naming
* chore(review): attributes can be nullable or undefined
* chore(review): delay extender implementation
* chore(review): unnecessary check
* chore(review): stay consistent
* chore: merge conflicts
* chore: unused import
* chore: multiline extenders
* feat: add Store extender

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-08 21:13:53 +01:00
Nicolas Peugnet
f9a5d485c3 fix(phpstab): adapt phpstan package for extension use (#3727)
- fix "Stub file does not exist" error message as reported in
  <https://github.com/flarum/docs/pull/441#issuecomment-1419668760>
- fix "Ignored error pattern was not matched in reported errors" error
  messages as reported in
  <https://github.com/flarum/docs/pull/441#issuecomment-1420903036>
2023-02-08 10:43:41 +01:00
Darkle
5717a74fcc fix(css): choose tags button misaligned (#3726) 2023-02-05 19:15:15 +01:00
flarum-bot
2e0f026dde Bundled output for commit bf52743510
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-01-22 13:16:48 +00:00
Sami Mazouz
bf52743510 chore: improve group mentions parsing (#3723)
* chore: improve group mentions color handling
* Avoid storing the `GroupMention--dark` and light classes on the database.
* Avoid recreating YIQ logic on the backend.
* Improve text color flexibility through CSS variables.
* Apply fixes from StyleCI
* chore: tweak tests
* chre: unused import

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-22 14:11:13 +01:00
Sami Mazouz
da1bf8da21 chore(phpstan): enable phpstan in bundled extensions (#3667)
* feat(phpstan): pick up extended model relations typings
* feat(phpstan): pick up extended model date attributes
* feat(core): introduce `castAttribute` extender
Stops using `dates` as it's deprecated in laravel 8
* feat(phpstan): pick up extended model attributes through casts
* fix: extenders not resolved when declared namespace
* fix(phpstan): new model attributes are always nullable
* chore(phpstan): add helpful cache clearing command
* Apply fixes from StyleCI
* chore: improve extend files provider logic
* chore: rename `castAttribute` to just `cast`
* chore: update phpstan package to detect `cast` method
* chore: enable phpstan in bundled extensions
* chore: rebasing conflicts
* chore: rebasing conflicts
* chore: typings for latest 1.7 changes

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-19 21:49:38 +01:00
flarum-bot
ccf9442d79 Bundled output for commit 4bb3b2235d
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-01-17 20:01:25 +00:00
Owen Melbourne
4bb3b2235d The negate field doesn't get used, which means you cant exclude tags (#3713)
e.g. This allows you to

`/api/posts?sort=-createdAt&filter[tag]=14` to include tag 14 and `/api/posts?sort=-createdAt&filter[tag]=-14` to exclude tag 14
2023-01-17 20:47:28 +01:00
IanM
03d2d7eabb feat: expose {time} to eventPost data, fix renamed tooltip (#3698) 2023-01-17 20:47:02 +01:00
ornanovitch
4d292263b5 fix(tags): tag text color contrast (#3653)
* add yiq calculator util
* use the new contast util to differentiate light/dark tags
* fix: invert logic
* feat: add tag-dark and tag-light less config
* fix: convert 3 chars hex to 6 chars hex
* fix: rename import
* fix: clarify util name
* fix: rename function
* fix: invert less variables when dark mode is enabled
* fix: TagTiles contrast
* refactor: simplify logic with a unique variable
* refactor: simplify logic with a unique variable
* feat: add text color variables not depending on the dark/light mode
* refactor: use isDark rather than getContrast
* refactor: change getContrast to isDark with for a more direct approach
* fix: adjust snippet description
* refactor: change getContrast to isDark with for a more direct approach
* fix: adjust snippet description
* fix: TagHero contrast
* fix: DiscussionHero contrast
* fix: newDiscussion contrast
* fix(newDiscussion): restore less rule when tag is not colored
* fix: TagTiles description
* fix: TagTiles last posted
* chore: change `var` to `let`
* refactor: keep it for backwards compatibility
* refactor: keep it for backwards compatibility
* Apply suggestions from code review
* fix: missed this when I was resolving
* fix: remove dist files from pull request
* Revert "Resolved merge conflict"
This reverts commit c7f0d14aa8, reversing
changes made to 6753dfc2af.
* fix: missed this when I was resolving
* fix
* Update isDark.ts
* chore: flexible contrast color fixing
* refactor(isDark): clarify the doc block
* fix(isDark): increase the yiq threshold
* typo
* fix: preserve design coloring through light and dark modes

Co-authored-by: David Wheatley <david@davwheat.dev>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-17 20:45:03 +01:00
flarum-bot
6adae00f72 Bundled output for commit d7f4975330
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-01-17 18:15:45 +00:00
Sami Mazouz
d7f4975330 feat: introduce frontend extenders (#3645)
* feat: reintroduce frontend extenders
* chore: used `Routes` extender in bundled extensions
* chore: used `PostTypes` extender in bundled extensions
* chore: `yarn format`
* chore: naming
* chore(review): unnecessary check
* chore(review): stay consistent
* chore: unused import

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-17 19:10:24 +01:00
Sami Mazouz
5fe3cfd837 feat(phpstan): foundation for usage in extensions (#3666)
* feat(phpstan): pick up extended model relations typings
* feat(phpstan): pick up extended model date attributes
* feat(core): introduce `castAttribute` extender
Stops using `dates` as it's deprecated in laravel 8
* feat(phpstan): pick up extended model attributes through casts
* fix: extenders not resolved when declared namespace
* fix(phpstan): new model attributes are always nullable
* chore(phpstan): add helpful cache clearing command
* Apply fixes from StyleCI
* chore: improve extend files provider logic
* chore: rename `castAttribute` to just `cast`
* chore: update phpstan package to detect `cast` method
* Update framework/core/src/Extend/Model.php

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-15 15:25:13 +01:00
Sami Mazouz
2d2bf5c504 fix: permissions table on mobile is unusable (#3722) 2023-01-14 19:34:12 +01:00
Sami Mazouz
a4f4ee8e71 chore: Merge 1.6.3 into main 2023-01-13 19:57:31 +01:00
Sami Mazouz
4a38047bfb Merge branch 'main' into merge-1.6.3-into-main 2023-01-13 19:12:11 +01:00
flarum-bot
d5e6f6db5f Bundled output for commit 20e7d245da
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-01-13 08:37:32 +00:00
Tristian Kelly
20e7d245da feat: Admin User Search (#3712)
* Initial search
* oninput attempt
* Working search!
* forgot to format
* fix debounce, locale
* use core.ref
2023-01-13 09:31:22 +01:00
Sami Mazouz
243bc139b0 chore: changelog
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-10 15:22:17 +01:00
Sami Mazouz
adf78bbd95 chore(subscriptions): prepare
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-10 15:06:03 +01:00
StyleCI Bot
c8d9f1111e Apply fixes from StyleCI 2023-01-10 14:04:18 +00:00
Sami Mazouz
e5f05166a0 fix(subscriptions): post notifications not getting access checked
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-10 15:04:02 +01:00
Sami Mazouz
02556c6ca6 chore: prepare v1.6.3 release
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-10 15:00:38 +01:00
Sami Mazouz
666223fa8c test: make data providers public
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-10 15:00:38 +01:00
Sami Mazouz
12dfcc5c79 Merge pull request from GHSA-hph3-hv3c-7725
* test: add reply creation tests

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: access checking being bypassed for post creation when first post is deleted

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: recover tests

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: make provider public

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-10 15:00:38 +01:00
StyleCI Bot
248a71d9b5 Apply fixes from StyleCI 2023-01-10 15:00:37 +01:00
Sami Mazouz
a131e87911 Merge pull request from GHSA-8gcg-vwmw-rxj4
* fix: notifications grant access to private data of posts

* chore: fix tests

* test: start with tests about notification subject visibility

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: check subject access before sending notification to user

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Daniël Klabbers <daniel@klabbers.email>
2023-01-10 15:00:37 +01:00
StyleCI Bot
be63b28437 Apply fixes from StyleCI 2023-01-10 15:00:37 +01:00
Sami Mazouz
132fdea659 Merge pull request from GHSA-22m9-m3ww-53h3
* fix: check post visibility when mentioning

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: `mentionsPosts` include is not used and leaks private posts

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chre: use `PostRepository`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-10 15:00:37 +01:00
dependabot[bot]
fe8480c8f7 chore(deps): bump json5 from 2.2.1 to 2.2.3 (#3717)
Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 16:54:29 +01:00
IanM
1e8a0f930d fix: load actor.groups (#3716) 2023-01-09 12:00:46 +01:00
Daniël Klabbers
d7b9a03f31 chore: fix php 8.1 on preg_match 2nd argument being null, which also optimizes slightly 2022-12-17 01:05:38 +01:00
flarum-bot
78189f29d2 Bundled output for commit 07f8b6161a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-12-12 10:18:58 +00:00
IanM
07f8b6161a fix: support 3digit hex color input (#3706) 2022-12-12 10:14:59 +00:00
flarum-bot
0eff1f6b2d Bundled output for commit a53a0db2b7
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-12-12 09:48:42 +00:00
Sami Mazouz
a53a0db2b7 feat(tags): admin tag selection component (reusable tag selection modal) (#3686)
* chore: move `KeyboardNavigation` to `common` first
* feat: exract reusable `TagSelectionModal` from `TagDiscussionModal`
* fix: improve for generic use
* feat: add select tags admin setting component
2022-12-12 10:44:33 +01:00
flarum-bot
a129999132 Bundled output for commit 8f80cde5b7
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-12-03 21:19:51 +00:00
Sami Mazouz
8f80cde5b7 feat: allow using utf8 characters in tag slugs (#3588)
* feat: allow using utf8 characters in slugs
url-encoded slugs are not read by the backend.
* chore: use as a slug driver
* chore: refactor tests to use data provider
* Apply fixes from StyleCI
* fix: wrong resource used
* fix: forgotten slug from slug manager in serializer
* chore(review): adapt tag slug suggestions on the UI
* chore: introduce modes for slugging
* chore: `yarn format`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-12-03 22:15:34 +01:00
flarum-bot
4de3cd4d9c Bundled output for commit 3dd2cadb9b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-30 16:46:54 +00:00
IanM
3dd2cadb9b fix: undefined showing in dropdown active title (#3700) 2022-11-30 16:39:32 +00:00
Rafael Horvat
605225c851 fix: column id can be ambiguous in group filter with extensions (#3696) 2022-11-27 10:44:06 +01:00
flarum-bot
f33fbdd0b5 Bundled output for commit 5bc47c0278
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-27 09:40:52 +00:00
Sami Mazouz
5bc47c0278 chore: convert Dropdown components to TS (#3608)
* chore: convert `Dropdown` components to TS
* chore(review): `buttonClassName` technically not required
* chore(review): `accessibleToggleLabel` technically not required
* chore(review): use `classList` where possible
* chore: `yarn format`
* Update framework/core/js/src/common/components/Dropdown.tsx
* chore(review): use `includes`
* chore(review): define constant of excluded groups
* chore(review): use `null coalesce` and `logical or` assignments
* chore(review): `null coalesce`
* chore(review): `any` to `typeof Component`
* chore(review): `classList`
* chore(review): `yarn format`
* chore: fix typing issues after typescript update

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: David Wheatley <hi@davwheat.dev>
2022-11-27 10:34:29 +01:00
flarum-bot
0e238a9c82 Bundled output for commit 64fa35f2f3
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-25 17:25:24 +00:00
Sami Mazouz
64fa35f2f3 chore: update JS dependencies (#3695)
* chore: lock mithril to `2.0` because `2.2` has breaking changes with no upgrade guide
* chore: update JS dependencies `yarn upgrade`
* chore: fix typings after js deps updates
* chore(review): better semver

Co-authored-by: David Wheatley <hi@davwheat.dev>
2022-11-25 18:20:30 +01:00
flarum-bot
c99d04fce2 Bundled output for commit 67c0d75ebc
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-25 11:11:04 +00:00
IanM
67c0d75ebc feat: include current user as forum relation (#3668)
* feat: include current user as forum relation

* Update framework/core/src/Api/Controller/ShowForumController.php

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

* Update framework/core/src/Api/Controller/ShowForumController.php

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

* Update framework/core/src/Api/Serializer/ForumSerializer.php

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

* Update framework/core/tests/integration/api/forum/ShowTest.php

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

* Update framework/core/tests/integration/api/forum/ShowTest.php

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

* No need to call the user endpoint as we already have the data loaded

* chore: return types

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-25 11:00:19 +00:00
IanM
6f4f964ce8 feat: allow push additional items to the end of the poststream (#3691)
* feat: allow push additional items to the end of the poststream

* Update framework/core/js/src/forum/components/PostStream.js

Co-authored-by: David Wheatley <hi@davwheat.dev>

* chore: prettier

* Update framework/core/js/src/forum/components/PostStream.js

Co-authored-by: David Wheatley <hi@davwheat.dev>

Co-authored-by: David Wheatley <hi@davwheat.dev>
2022-11-25 10:59:23 +00:00
Ian Morland
67dd2c21b6 fix: provide web friendly session driver name (#3690) 2022-11-22 17:02:44 +00:00
flarum-bot
e5d2b8cad9 Bundled output for commit f5c346f1c7
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-20 12:08:32 +00:00
Clark Winkelmann
f5c346f1c7 chore: Indicate cross-origin request in generic error message (#3669)
* Indicate cross-origin request in generic error message
* Run javascript format
* Move text to beginning of error message
* Update framework/core/locale/core.yml

Co-authored-by: David Wheatley <hi@davwheat.dev>
2022-11-20 13:02:41 +01:00
flarum-bot
5bb0593bad Bundled output for commit 47d2053766
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-19 22:30:32 +00:00
Ian Morland
47d2053766 feat: expose queue driver, schedule status (#3593)
* feat: expose queue driver, schedule status

* Apply fixes from StyleCI

* docblock

* fix inheritdoc

* Add info link for scheduler setup

* Remove unsed import

* fix: phpstan error

* Only show scheduler status when jobs are registered

* Apply fixes from StyleCI

* add ItemList priorities

* Add translations

* Include schedule status in info console cmd

* Apply fixes from StyleCI

* Move identifyX logic into shared 'ApplicationInfoProvider'

* Apply fixes from StyleCI

* uniform data layout

* inject queue

Co-authored-by: StyleCI Bot <bot@styleci.io>
2022-11-19 22:23:04 +00:00
Sami Mazouz
e0b9dcfbcd Merge branch 'release/v1.6.2'
# Conflicts:
#	framework/core/js/dist/admin.js
#	framework/core/js/dist/admin.js.map
#	framework/core/js/dist/forum.js
#	framework/core/js/dist/forum.js.map
#	framework/core/src/Foundation/Application.php
2022-11-18 23:24:43 +01:00
Sami Mazouz
8a65ad980d chore: v1.6.2 changelog
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-18 22:38:41 +01:00
Sami Mazouz
9a0668effd chore: update version constant to v1.6.2
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-18 22:35:12 +01:00
Sami Mazouz
224b122303 chore: yarn build
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-18 22:34:29 +01:00
Sami Mazouz
ed0cee97f5 fix: evaluated page title content (#3684)
* fix: evaluated page title content
* chore: add comment
* chore: use DOMParser instead
* fix: use `innerHTML` for the actual value

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: David Wheatley <hi@davwheat.dev>
2022-11-18 22:32:24 +01:00
flarum-bot
543c5f2a2e Bundled output for commit 690de9ce0f
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-18 21:16:57 +00:00
Sami Mazouz
690de9ce0f fix: evaluated page title content (#3684)
* fix: evaluated page title content
* chore: add comment
* chore: use DOMParser instead
* fix: use `innerHTML` for the actual value

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: David Wheatley <hi@davwheat.dev>
2022-11-18 22:09:22 +01:00
Clark Winkelmann
50253a2eb8 fix: typo in Formatter extender docblock (#3676) 2022-11-17 15:47:09 +01:00
flarum-bot
92473c0967 Bundled output for commit 361234205c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-17 09:23:09 +00:00
Rafael Horvat
361234205c fix: add missing states exports to compat.ts (#3683) 2022-11-17 09:17:16 +00:00
flarum-bot
54798aaa47 Bundled output for commit fe5d543864
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-16 23:26:37 +00:00
David Wheatley
fe5d543864 fix: post dropdown opens all dropdowns in .Post-actions (#3675) 2022-11-16 23:21:57 +00:00
Ian Morland
2517bc0f70 chore: set flarum version to 1.7.0 for dev 2022-11-16 20:59:51 +00:00
Sami Mazouz
b5f324a7b3 chore: v1.6.1 changelog
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-16 12:29:36 +01:00
Sami Mazouz
8ef0df94b2 chore: update app version constant
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-16 12:27:40 +01:00
flarum-bot
c50c924242 Bundled output for commit 18bdd48835
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-16 10:30:13 +00:00
Sami Mazouz
18bdd48835 Merge remote-tracking branch 'origin/main' 2022-11-16 11:22:47 +01:00
Sami Mazouz
f49cf887dc revert: fix typing errors after dependencies update
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-16 11:17:20 +01:00
Sami Mazouz
19793d5617 chore: run yarn-audit-fix
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-16 10:54:04 +01:00
Sami Mazouz
4a2f48ad04 revert: before audit fix and JS dependency updates
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-16 10:50:35 +01:00
Daniël Klabbers
2b413b06c5 Revert "chore: try to fallback on npm as yarn seems to use wrong deps"
This reverts commit bb9f01372f.
2022-11-16 09:58:54 +01:00
Daniël Klabbers
2b89dedc08 Revert "chore: wrong package manager value changed to fix mentions bug"
This reverts commit bc59b8d9ab.
2022-11-16 09:58:41 +01:00
Daniël Klabbers
00a880c467 Revert "chore: lock needed for npm builds"
This reverts commit 92d2adc5fd.
2022-11-16 09:58:30 +01:00
Daniël Klabbers
92d2adc5fd chore: lock needed for npm builds 2022-11-16 09:51:50 +01:00
Daniël Klabbers
bc59b8d9ab chore: wrong package manager value changed to fix mentions bug 2022-11-16 09:41:52 +01:00
Daniël Klabbers
bb9f01372f chore: try to fallback on npm as yarn seems to use wrong deps 2022-11-16 09:26:08 +01:00
flarum-bot
069a29d22a Bundled output for commit 105170b5bc
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-16 07:26:43 +00:00
Daniël Klabbers
105170b5bc chore: recompile assets to fix mentions bug 2022-11-16 08:20:04 +01:00
flarum-bot
b8261ef055 Bundled output for commit d14770188b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-15 23:43:41 +00:00
Ian Morland
d14770188b chore: add fullstop to comment 2022-11-15 23:38:02 +00:00
Ian Morland
e9bb646dbf chore: newline 2022-11-15 23:25:35 +00:00
flarum-bot
46adf40675 Bundled output for commit 6938a13223
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-13 14:37:46 +00:00
Sami Mazouz
6938a13223 fix: typing errors after dependencies update
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-13 15:31:10 +01:00
flarum-bot
ab56aefeaa Bundled output for commit 259db92b9a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-10 23:30:18 +00:00
David Wheatley
259db92b9a fix: update JS dependencies 2022-11-10 23:23:44 +00:00
Daniël Klabbers
094ec77980 chore: js vulnerabilities through audit fix 2022-11-10 13:48:31 +01:00
Daniël Klabbers
bb712693d4 chore: update application constant for version 2022-11-10 13:48:17 +01:00
Daniël Klabbers
1e00e3fdbb chore: dependency on core updated for extensions 2022-11-10 13:48:00 +01:00
Daniël Klabbers
47d7a6e155 chore: changelog for v1.6.0 2022-11-10 13:47:23 +01:00
Daniël Klabbers
45d91212f6 fix: akismet fails when the extension is not on a version 2022-11-09 20:42:49 +01:00
flarum-bot
1a81c98d43 Bundled output for commit c98e6ba5a7
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-07 15:55:28 +00:00
Ian Morland
c98e6ba5a7 fix: groupmentions have poor contrast on some backgrounds (#3672)
* fix: poor text contrast on some backgrounds
* use hexdec()
* fix render test
* appears to be working now
2022-11-07 16:49:47 +01:00
flarum-bot
eeb00cc56b Bundled output for commit 87cdb5b4d8
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-07 15:14:44 +00:00
Ian Morland
87cdb5b4d8 feat: Allow additional reset password params, introduce ForgotPasswordValidator (#3671)
* feat: Allow additional reset password params, introduce 'ForgotPasswordValidator'

* Apply fixes from StyleCI

Co-authored-by: StyleCI Bot <bot@styleci.io>
2022-11-07 15:06:00 +00:00
flarum-bot
bc4b0b864c Bundled output for commit 53ab1503e4
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-07 13:53:51 +00:00
Ian Morland
53ab1503e4 feat: Allow additional login params, Introduce LogInValidator (#3670)
* Allow additional login params, dispatch 'LoggingIn' event

* Update framework/core/js/src/forum/components/LogInModal.tsx

Co-authored-by: David Wheatley <hi@davwheat.dev>

* Introduce 'LogInValidator'

* Apply fixes from StyleCI

Co-authored-by: David Wheatley <hi@davwheat.dev>
Co-authored-by: StyleCI Bot <bot@styleci.io>
2022-11-07 13:47:04 +00:00
Sami Mazouz
62a396e434 feat: send notifications of a new reply when post is approved (#3656)
* test(subscriptions): approved reply sends out notifications to users

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* feat: send notifications when a post is approved

The code in approval was extracted into a listener because no matter what listeners are always executed before subscribers even if the extension is set to load before.

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-07 11:52:28 +00:00
flarum-bot
2096fa2807 Bundled output for commit 06963df407
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-07 11:36:10 +00:00
Ian Morland
06963df407 chore: format js 2022-11-07 11:30:01 +00:00
flarum-bot
8fe09815f5 Bundled output for commit fccc3e2188
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-07 11:28:16 +00:00
ornanovitch
fccc3e2188 feat: contrast util with yiq calculator (#3652)
* add yiq calculator util

* fix: convert 3 chars hex to 6 chars hex

* fix: clarify util name

* feat: add text color variables not depending on the dark/light mode

* refactor: change getContrast to isDark with for a more direct approach

* fix: adjust snippet description

* chore: change `var` to `let`

Co-authored-by: David Wheatley <david@davwheat.dev>
2022-11-07 11:20:02 +00:00
Sami Mazouz
f0a867b20f chore: throw an exception when no serializer is provided to the controller (#3614)
* chore: throw an exception when no serializer is provided to the controller

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>

* test: no serializer set throws exception

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-06 18:56:07 +00:00
Sami Mazouz
69311ae689 feat: allow specifying extensions when installing an instance (#3655)
* feat: allow specifying extensions when installing an instance

Useful when doing migrations where more than the default extensions are required to migrate the data to flarum. This allows quickly spinning up a flarum database with the necessary schema.

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: consider dependency graph before running migrations

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-06 18:43:13 +00:00
Clark Winkelmann
f005b9e031 Fix tag discussion count decreased by 2 when hiding before deleting (#3660) 2022-11-06 18:27:32 +00:00
flarum-bot
31ced98e0d Bundled output for commit 9964ddd731
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-06 18:26:49 +00:00
David Wheatley
9964ddd731 [statistics] fix: add missing last period to custom date ranges (#3661)
* fix: last node in previous data matches first node of current data

* fix: add previous period support for custom periods

* test: update to show previous period for custom range
2022-11-06 18:21:28 +00:00
flarum-bot
32ac0a8d8f Bundled output for commit 827e905f8e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-05 19:34:25 +00:00
Ian Morland
827e905f8e [mentions] feat: group mentions (#3658)
* wip: group mentions

* Apply fixes from StyleCI

* chore: format

* group mention autocomplete

* chore: format

* remove console.log

* implement notifications

* prevent guest and member groups from being mentioned

* Update extensions/mentions/less/forum.less

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

* rename displayname to groupname

* Update extensions/mentions/src/Formatter/FormatGroupMentions.php

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

* remove redundant unparse

* simplify migrations

* add group deleted translation

* Apply fixes from StyleCI

* handle everything falsy

* Include icon in group mention preview

* remove box-shadow from autocomplete group results

* Add color to preview

* chore: format

* Remove box shadow from group autocomplete results

* Update extensions/mentions/migrations/2022_10_21_000000_create_post_mentions_groups_table.php

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

* remove unneeded migration

* prevent former group icon from beingdisplayed

* add group searcher with permissions

* Apply fixes from StyleCI

* Search groups based on canSearchGroups permission

* Don't include virtual groups in results

* Add search groups translation

* Revert "remove unneeded migration"

This reverts commit 9347665baa.

* Revert "Update extensions/mentions/migrations/2022_10_21_000000_create_post_mentions_groups_table.php"

This reverts commit 8406d51df2.

* add searchGroups permission to tests

* Apply fixes from StyleCI

* Add default searchGroups permission

* Apply fixes from StyleCI

* Update extensions/mentions/js/src/forum/addComposerAutocomplete.js

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

* Update extensions/mentions/migrations/2022_10_21_000000_create_post_mentions_groups_table.php

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

* remove unneeded migration, correct table table

* correct table name in down migration

* Remove group searcher

* Apply fixes from StyleCI

* Remove group searching from composer autocomplete

* Add mentionGroups permission

* Apply fixes from StyleCI

* prevent post preview from rendering a group mention when user does not have permission

* remove test changes

* wip: expose ServerRequestInterface to textformatter parse()

* Apply fixes from StyleCI

* Set post content properly

* php 7.x compatibility

* begin adding groupmention tests

* Apply fixes from StyleCI

* test virtual groups don't mention

* Apply fixes from StyleCI

* Update framework/core/tests/integration/api/groups/ListTest.php

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

* Update framework/core/tests/integration/api/groups/ListTest.php

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

* Update framework/core/tests/integration/api/groups/ListTest.php

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

* Update framework/core/tests/integration/api/groups/ListTest.php

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

* Update framework/core/tests/integration/api/groups/ListTest.php

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

* Update extensions/mentions/extend.php

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

* Update extensions/mentions/extend.php

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

* requested changes

* Update framework/core/tests/integration/api/groups/ListTest.php

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

* Update framework/core/tests/integration/api/groups/ListTest.php

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

* Update framework/core/src/Search/SearchServiceProvider.php

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

* Update framework/core/src/Extend/Formatter.php

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

* remove default permission migration

* try using datetime column instead of timestamp

* Apply fixes from StyleCI

* chore: remove commented code

* add tests

* Apply fixes from StyleCI

* Pass actor to parser instead of ServerRequest

* Allow for  to be null

* Update framework/core/src/Extend/Formatter.php

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

* pass actor instead of request

* Apply fixes from StyleCI

* actor instead of request

* remove serverrequest

* Apply fixes from StyleCI

* remove dupe actor

* Update extensions/mentions/src/Formatter/CheckPermissions.php

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

* fix type in comment

* group does not have the relation, post does

* test: invalid, deleted, fresh data mentions

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* fix: group mentions don't work when editing posts

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-05 19:29:01 +00:00
Sami Mazouz
cdc76567d4 fix: larastan v1 incompatible with phpstan v1.9.0 (#3665)
We can't update to larastan v2 until we update to laravel v9 which has to wait for Flarum v2, so we need to stay on phpstan v1.8

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-03 11:55:52 +01:00
Clark Winkelmann
5898a50463 Log migration path when up/down keys are missing (#3664)
* Log migration path when up/down keys are missing
2022-11-02 15:22:21 +01:00
flarum-bot
72d9ee2010 Bundled output for commit 4e5e4e5c6e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-01 17:53:52 +00:00
David Wheatley
4e5e4e5c6e feat: add statistics chart export button (#3662) 2022-11-01 18:47:22 +01:00
flarum-bot
201d7430fe Bundled output for commit 52f6148876
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-10-18 14:44:18 +00:00
Sami Mazouz
52f6148876 chore: add priorities to profile settings page (#3657)
To give extensions more flexibility
2022-10-18 16:38:25 +02:00
Sami Mazouz
dc215aba59 chore(statistics): prepare v1.5.1
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-10-11 18:22:47 +01:00
flarum-bot
90a68506b8 Bundled output for commit bd0577f435
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-10-02 18:49:08 +00:00
Sami Mazouz
bd0577f435 fix: statistics previous period chart is unclear (#3654)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-10-02 19:43:47 +01:00
Ngô Quốc Đạt
d33f1abffc fix: apply flex for AppearancePage colors input (#3651) 2022-10-01 20:18:03 +02:00
Sami Mazouz
b0b47a0888 test: allow specifying php extensions in workflow
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-30 20:53:50 +01:00
flarum-bot
8c0a14aff2 Bundled output for commit 76788efaba
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-09-29 11:17:55 +00:00
David Wheatley
76788efaba feat(statistics): support for custom date ranges (#3622)
* feat: backend support for statistics custom date ranges
* feat: use seconds-based timestamps on backend instead
* feat: add frontend date selection option
* feat: add tests for lifetime and timed stats
* fix: add error alert when end date is after start date
* fix: wrong label
* fix: no data when start and end date are same day
* fix: use utc dayjs for formatting custom date range on widget
* chore: add dayjs as project dep
* fix: make end date inclusive
* feat: add integration test for custom date period
* fix: incorrect ts expect error comment
* fix: add missing type
* fix: typing errors
* fix(tests): remove type from class attribute definition
* fix: extract default values to function body
* fix: typo
* chore: use small modal
* fix: add missing `FormControl` class
* fix: cast url params to int to enforce type
* chore: `yarn format`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-29 13:12:54 +02:00
flarum-bot
973ec32e13 Bundled output for commit cf818aae9e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-09-23 18:59:15 +00:00
Ngô Quốc Đạt
cf818aae9e replace ColorPreviewInput for GroupModal color input (#3650) 2022-09-23 19:52:48 +01:00
flarum-bot
6da0bc63b7 Bundled output for commit 6e1bc2daed
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-09-23 13:18:01 +00:00
Ngô Quốc Đạt
6e1bc2daed fix: package manager failures not showing alerts (#3647)
* fix: close `LoadingModal` when install falied
* move error handler to catch
2022-09-23 14:11:36 +01:00
Rafael Horvat
7ce9d63ed6 feat(test): Make it possible to extend SetupScript (#3643)
* Make it possible to extend Flarum\Testing\integration\Setup\SetupScript and added public methods to add settings or extensions to in initial installation pipeline

* Fix syntax error, unexpected 'static'

* Remove `addExtensions` method and document `addSettings`
2022-09-23 13:44:17 +02:00
StyleCI Bot
267f6759f8 Apply fixes from StyleCI 2022-09-22 08:21:34 +00:00
Daniël Klabbers
b5874a08e4 fix(approval): posts approved for deleted users error
In certain edge cases posts get approved through moderative action and
throws an error when the user has already been deleted.

Ref: DISCUSS-11K on sentry
2022-09-22 10:20:06 +02:00
flarum-bot
368e08bb9b Bundled output for commit 5f2d7fb7b6
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-09-17 11:36:06 +00:00
Sami Mazouz
5f2d7fb7b6 fix(regression): bad import
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-17 12:29:16 +01:00
flarum-bot
68d6e30143 Bundled output for commit c5c312db0d
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-09-17 11:07:16 +00:00
Sami Mazouz
c5c312db0d chore: yarn format
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-17 11:54:09 +01:00
flarum-bot
05f80b7b83 Bundled output for commit 31c3cfc4ea
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-09-16 10:02:55 +00:00
Sami Mazouz
31c3cfc4ea chore(package-manager): set min core version and add warning
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-16 10:54:39 +01:00
Sami Mazouz
fd196454a5 chore(package-manager): config composer to use web php version
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-15 11:07:08 +01:00
Sami Mazouz
f6761843b2 feat: customizable session driver (#3610) 2022-09-14 18:10:30 +01:00
Sami Mazouz
84c31165e5 fix: password reset leaks user existence (#3616) 2022-09-14 15:57:52 +01:00
Sami Mazouz
fc4d5e3d43 chore: Setup PHPStan Level 5 (#3553) 2022-09-14 15:23:56 +01:00
Daniël Klabbers
b2fa28e4b5 chore: remove styleci from changelog 2022-09-13 12:22:45 +02:00
Daniël Klabbers
fc743ba888 chore: set flarum version to dev for 1.6.0 2022-09-13 12:22:29 +02:00
Daniël Klabbers
a35df8c139 chore: v1.5.0 preparations 2022-09-13 10:55:30 +02:00
Sami Mazouz
8aec252452 fix(qa): simpler grid layout fix for overflow
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-08 20:52:33 +01:00
Sami Mazouz
32961d480c fix(qa): grid layout causes overflowing of content
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-08 20:33:32 +01:00
Alexander Skvortsov
27e3d322ec feat: increase margin between notifications list control icons (#3629)
* feat: increase margin between notifications list control icons

This feels cleaner, and reduces the chances of a misclick.

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-06 12:28:09 +02:00
Sami Mazouz
9eab1085da fix(regression): exiting long modal by clicking backdrop fails
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-05 15:32:14 +01:00
flarum-bot
c305f9a105 Bundled output for commit 3b773e2677
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-09-05 13:31:03 +00:00
Sami Mazouz
3b773e2677 chore: don't pass password field between auth modals (#3626)
* chore: don't pass password field between auth modals
* chore: reset password on failed attempts
* chore: `yarn format`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-05 13:44:11 +01:00
Daniël Klabbers
6e48a0303e Create CODEOWNERS
Start requiring an approval from the core team on PR's
2022-09-05 09:03:20 +02:00
Sami Mazouz
31f1ffd6a5 fix(regression): bad post actions alignment introduced in #3540 (#3619)
* chore: merge media queries
* chore: change discussion page skeleton to grid layout
* chore: use grid areas instead of order

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2022-09-03 13:30:44 +01:00
Sami Mazouz
9897f682a0 fix: explicitly select post columns (#3621)
additional columns can be explicitly added by extensions

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-09-03 12:33:38 +01:00
flarum-bot
f3156c65c9 Bundled output for commit 2719042c71
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-31 19:22:47 +00:00
Robert Korulczyk
2719042c71 feat: add custom class for email confirmation alert (#3584) 2022-08-31 21:13:25 +02:00
flarum-bot
ffd0b90a83 Bundled output for commit 87aaaf6971
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-31 09:20:08 +00:00
David Wheatley
87aaaf6971 feat(subscriptions): add option to send notifications when not caught up (#3503) 2022-08-31 11:13:51 +02:00
Sami Mazouz
6ffa9e3736 fix(mentions): accessing id of null user relation (#3618)
* test: editing a post with deleted author and mentions
* fix(mentions): accessing `id` of null `user` relation

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-26 10:38:00 +01:00
Sami Mazouz
434c459246 fix(tags): use default index sortmap (#3615)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-24 12:17:00 +01:00
Sami Mazouz
7f2f3e34f5 chore(statistics): add release notes for 1.4.2
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-22 11:24:29 +01:00
Sami Mazouz
f7dd609b26 feat: discussion UTF-8 slug driver (#3606)
* feat: add utf-8 slug driver
* test: add tests for slugging expectations
* fix: non-word characters aren't removed

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>
2022-08-21 15:27:41 +01:00
flarum-bot
ec97ee41f9 Bundled output for commit 335c602cea
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-20 17:30:31 +00:00
Sami Mazouz
335c602cea chore(package-manager): last tweaks before beta tag
chore: fix workflow errors
chore: fix workflow errors
chore: avoid updating an extension that wasn't directly required
chore: prevent job overlap
chore: reorganize code, separate state from view
fix: update checking ui display
chore: minor improvements

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-20 18:21:02 +01:00
flarum-bot
082117d8bc Bundled output for commit 11a9b73610
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-17 13:02:21 +00:00
Hasan Özbey
11a9b73610 fix: use isCollapsed instead of rangeCount (#3581) 2022-08-17 13:56:03 +01:00
flarum-bot
974f003fe3 Bundled output for commit 352a50e3ad
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-16 17:36:57 +00:00
David Wheatley
352a50e3ad perf(statistics): split timed data into per-model XHR requests (#3601)
* chore: kill off timeset offset from statistics extension

* perf: split timed data into per-model requests
2022-08-16 18:30:24 +01:00
Ngô Quốc Đạt
5637fe8041 fix: $events property declared dynamically (#3598) 2022-08-16 17:50:29 +01:00
David Wheatley
3d167749cb fix(subscriptions): add missing table prefix for filter gambit (#3599) 2022-08-15 12:35:03 +02:00
David Wheatley
1a189f4923 fix: typo in error message 2022-08-14 17:16:52 +01:00
Sami Mazouz
6de8113720 test: prevent running both push and pull_request actions at the same time (#3597)
Not a 100% perfect solution, however as us maintainers always push branches directly to the original repository and make PRs from those, this is plenty enough. Instead of having 300+ actions in each PR which takes time, we'll just have the normal 171 `push` actions.

This makes sure to still run `pull_request` actions from contributors as they'd be forking the repo.

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-13 09:33:37 +01:00
Sami Mazouz
f74f7f58cd test: refactor prefix matrix and add MySQL 8.0 & PHP 7.3 to workflows (#3595)
* chore: simplify added prefix tests to matrix without using exclusions
* test: recover 7.3 testing
* test: add mysql 8.0 to matrix
* test: exclude some PHP versions from running with MySQL 8.0 to reduce actions

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-12 19:22:38 +01:00
flarum-bot
34b7686d8a Bundled output for commit 4eb2112282
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-11 20:46:35 +00:00
Ian Morland
4eb2112282 feat: Admin debug mode warning (#3590)
* feat: Admin debug mode warning

* prettier

* Wrap in Alert component

* feat: add `title` and `icon` attributes to the `Alert` component

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>

* Update framework/core/js/src/admin/components/DebugWarningWidget.js

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

* Update framework/core/locale/core.yml

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

* prettier

* chore: convert to TS

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>

* Update framework/core/js/src/common/components/Alert.tsx

Co-authored-by: David Wheatley <hi@davwheat.dev>

* chore: add docs link

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Co-authored-by: Sami Mazouz <ilyasmazouz@gmail.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: David Wheatley <hi@davwheat.dev>
2022-08-11 22:41:54 +02:00
Sami Mazouz
25122fd355 fix: user has wrong discussion read status (#3591)
* test: deleting last post(s) then posting new replies works as expected
* fix: user has wrong discussion read status
2022-08-09 22:43:38 +02:00
Daniël Klabbers
1d14ea6b45 fix(compilation): versioner not inject into compilers (#3589) 2022-08-09 12:12:36 +02:00
flarum-bot
eab5093012 Bundled output for commit 1948f25151
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-08 21:22:31 +00:00
Sami Mazouz
1948f25151 refactor: convert page components to TypeScript (#3538)
* fix(a11y): color preview fields have no aria label
* refactor: convert page components to TypeScript

Co-authored-by: David Wheatley <hi@davwheat.dev>
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-08 22:11:58 +01:00
flarum-bot
44825f1b94 Bundled output for commit d02bf0faa1
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-08 18:30:58 +00:00
Ian Morland
d02bf0faa1 feat: Delete all notifications (#3529)
* Add delete all notifications option
* chore: `DELETE /api/notifications` as per conventions
* test: can delete all notifications

Co-authored-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-08 19:26:16 +01:00
flarum-bot
b28606b8ef Bundled output for commit 631b4c194c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-08 13:53:39 +00:00
Sami Mazouz
631b4c194c chore: unify JS actions into one (rewritten flarum/action-build) (#3573)
* chore: unify JS actions into one (rewritten `flarum/action-build)`
* chore: maintain backwards compatibility
* fix: wrong default format check script

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-08 14:48:43 +01:00
flarum-bot
b20961cc9d Bundled output for commit 495462183b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-08 13:04:48 +00:00
David Wheatley
495462183b chore: format code 2022-08-08 14:00:22 +01:00
flarum-bot
40fa7a2c9b Bundled output for commit f69210b6d1
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-08 12:35:51 +00:00
Jasper Vriends
f69210b6d1 feat(modals): support stacking modals, remove bootstrap modals dependency (#3456)
* Feature: Stackable modals

* Processed feedback

* fix: use position in modal stack rather than key for modal number

* fix: use correct base z-index

* chore: simplify `className` to `class`

* chore: add `key` attribute to ModalManager element

* fix: backdrop flashing as modals are stacked/unstacked

* chore: simplify modal close process

* docs: add TS overload to indicate deprecated modal opening syntax

Require explicit values for `attrs` and `stackModal` from Flarum 2.0, beginning deprecation from now.

* feat: use stackable modal for forgot password modal above sign in

* chore: explicitly check if modal is open before trying to focus trap

* fix(a11y): add missing  `aria-hidden` on main content when modal open

* fix(a11y): add missing `aria-modal` on modal

* chore: remove test code

* chore: remove dead CSS

* chore: remove overload

* fix: lock page scrolling when modal is open

* fix: strange scrolling behaviour

* chore: convert to JSX

* fix: event listener memory leak

* chore: remove unneeded optional chaining

* fix: incorrect return types

* chore: rewrite backdrop system - use one backdrop for all modals

* docs: typos in comment block

* fix: show backdrop directly below top-most modal

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

* chore: format

* fix: use an invisible backdrop for each modal to exit

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>

* chore: remove debugging code

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>

* chore: remove forgotten debug code

Co-authored-by: David Wheatley <david@davwheat.dev>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-08-08 13:29:14 +01:00
flarum-bot
bb5f7b87bc Bundled output for commit e2f568252b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-08 10:37:13 +00:00
Robert Korulczyk
e2f568252b perf: add loading="lazy" attribute for avatars (#3578)
Co-authored-by: David Wheatley <david@davwheat.dev>
2022-08-08 11:29:52 +01:00
flarum-bot
bca7d48d99 Bundled output for commit 3bdb0af993
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-05 19:27:47 +00:00
David Wheatley
3bdb0af993 fix: intellisense imports defaulting to absolute path from src folder (#3549)
* docs: remove baseUrl recommendation

Fixes https://github.com/flarum/flarum-tsconfig/issues/4

* chore: implement change within framework monorepo
2022-08-05 20:23:45 +01:00
flarum-bot
d345734a8e Bundled output for commit 4b25c2d425
Includes transpiled JS/TS.

[skip ci]
2022-08-05 18:28:35 +00:00
Sami Mazouz
4b25c2d425 test: relying on a third-party for avatar URL tests is unreliable (#3586) 2022-08-05 19:24:43 +01:00
flarum-bot
54e1966ec8 Bundled output for commit f073c22212
Includes transpiled JS/TS.

[skip ci]
2022-08-04 09:55:07 +00:00
Sami Mazouz
f073c22212 chore: remove debug line that slipped in while rebasing a PR (#3580)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-08-04 10:43:26 +01:00
flarum-bot
71731819fb Bundled output for commit b01b75e367
Includes transpiled JS/TS.

[skip ci]
2022-08-04 08:11:58 +00:00
Daniël Klabbers
b01b75e367 fix: return type hint static is php 8+ 2022-08-04 10:07:48 +02:00
flarum-bot
71b444b6f6 Bundled output for commit bb641144b6
Includes transpiled JS/TS.

[skip ci]
2022-08-02 11:36:01 +00:00
StyleCI Bot
bb641144b6 Apply fixes from StyleCI 2022-08-02 11:28:25 +00:00
Daniël Klabbers
590639f5f3 fix: remove deprecation warning for decoding null values 2022-08-02 13:28:03 +02:00
flarum-bot
b06be43988 Bundled output for commit 237076e5b7
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-02 10:31:17 +00:00
Ian Morland
237076e5b7 chore(approval, likes): use subscribers (#3577)
* chore: use subscribers

* Apply fixes from StyleCI

* Un-static

Co-authored-by: StyleCI Bot <bot@styleci.io>
2022-08-02 11:27:26 +01:00
flarum-bot
737783a8a8 Bundled output for commit 7d3147d4e1
Includes transpiled JS/TS.

[skip ci]
2022-08-02 10:10:01 +00:00
Ian Morland
7d3147d4e1 feat: add createTableIfNotExists migration helper (#3576) 2022-08-02 10:43:31 +01:00
David Wheatley
61c4421bd2 fix: sticky nav content displays below post stream (#3575) 2022-08-02 10:40:51 +01:00
flarum-bot
85d4fb6ce2 Bundled output for commit da855c654e
Includes transpiled JS/TS.

[skip ci]
2022-08-01 22:53:45 +00:00
Ian Morland
da855c654e feat: Restart the queue worker after cache clearing, ext enable/disable, save settings (#3565)
* Add queue restarter
* Update framework/core/src/Queue/QueueRestarter.php
2022-08-02 00:49:58 +02:00
flarum-bot
7147d39975 Bundled output for commit f4ace73a3c
Includes transpiled JS/TS.

[skip ci]
2022-08-01 11:03:26 +00:00
David Wheatley
f4ace73a3c chore(statistics): add release notes for 1.4.1 2022-08-01 11:59:57 +01:00
flarum-bot
0b299d0003 Bundled output for commit 70e483d1b1
Includes transpiled JS/TS.

[skip ci]
2022-07-30 22:16:30 +00:00
Daniël Klabbers
70e483d1b1 fix: prepare release workflow has invalid layout 2022-07-31 00:09:14 +02:00
Daniël Klabbers
628c281c39 fix: update workflow name 2022-07-31 00:02:34 +02:00
Daniël Klabbers
0901e59a58 feat: add new workflow for generating release meta 2022-07-31 00:00:50 +02:00
Daniël Klabbers
5530400b09 chore: getting the release workflow in 2022-07-30 23:33:55 +02:00
flarum-bot
e7af009fbc Bundled output for commit 2b31b185e4
Includes transpiled JS/TS.

[skip ci]
2022-07-30 12:05:59 +00:00
Sami Mazouz
2b31b185e4 feat: clear password & email tokens when appropriate (#3567)
* test: password tokens are generated and deleted on password change
* chore: delete all password tokens when the password is changed
* test: email tokens are generated and deleted on email change
* test: email tokens are deleted after password reset
* chore: delete email tokens after password change
* test: password tokens are deleted after email change
* chore: delete password tokens after email change
* chore: syntactic sugar
* chore: unify event listening
2022-07-30 13:02:06 +01:00
flarum-bot
f96f914576 Bundled output for commit f610f8aa67
Includes transpiled JS/TS.

[skip ci]
2022-07-30 06:22:07 +00:00
Sami Mazouz
f610f8aa67 feat: throttle email change, email confirmation, and password reset endpoints. (#3555)
* chore: move post throttler to separate class
* feat: throttle email change requests
* feat: throttle email activation requests
* feat: throttle password resets for logged-in users
* docs: comment new throttlers
2022-07-30 08:18:51 +02:00
flarum-bot
021793fc52 Bundled output for commit 9ab1680b17
Includes transpiled JS/TS.

[skip ci]
2022-07-29 12:54:55 +00:00
dependabot[bot]
9ab1680b17 chore(deps): bump terser from 5.12.0 to 5.14.2 (#3551)
Bumps [terser](https://github.com/terser/terser) from 5.12.0 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-29 13:48:04 +01:00
Soobin Rho
8dde6a27bf docs: link logo at the top with the official website (#3552)
When I was reading README.md, I clicked the logo and I expected to go to the official website https://flarum.org/ but it didn't. So, the image is being linked to the official website in this commit.

Signed-off-by: Soobin Rho <soobinrho@gmail.com>
2022-07-29 13:43:54 +01:00
Ian Morland
44f30ad51e Replace event helper with event dispatcher (#3570) 2022-07-28 21:09:42 +01:00
David Wheatley
6911e3a71d feat: expose assets base url to frontend forum model (#3566) 2022-07-28 19:37:10 +01:00
David Wheatley
cad6280a45 fix: potential static caching memory exhaustion (#3548)
* perf: get notification counts through relation, not model filtering

* chore: rename `queryUnreadNotifications` to `unreadNotifications`

* fix: null coalesce to 0 for notif read time
2022-07-28 19:14:32 +01:00
David Wheatley
7d67cfd1e7 fix: incorrect centring of deleted user avatars in notification list (#3569) 2022-07-28 17:15:29 +01:00
flarum-bot
e911b52b4c Bundled output for commit 2defb17cc2
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-26 12:53:14 +00:00
David Wheatley
2defb17cc2 feat: publish assets on admin dashboard cache clear (#3564)
Co-authored-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-26 13:48:04 +01:00
flarum-bot
fe20e2c212 Bundled output for commit 795a500adb
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-24 13:06:41 +00:00
Sami Mazouz
795a500adb feat: Queue package manager commands (#3418)
* feat: Queue package manager commands
* adjust tests
* fix: force run whynot command synchronously
* chore: maximize command output box's height
* chore: more user instructions on background queue
* feat: track command peak memory usage
* feat: exit of CLI php version doesn't match web php version
* chore: install deps
* chore: format and typing workflow fix

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-24 14:02:13 +01:00
Daniël Klabbers
75aaef7d76 fix: MyISAM tables for extensions during installation 2022-07-23 23:53:14 +02:00
Daniël Klabbers
f128190f14 Revert "fix: MyISAM tables for extensions during installation"
This reverts commit f926c58e01.
2022-07-23 23:52:57 +02:00
Daniël Klabbers
f926c58e01 fix: MyISAM tables for extensions during installation 2022-07-23 23:42:34 +02:00
flarum-bot
e5a3598bf6 Bundled output for commit 7cafd9f51a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-21 10:54:05 +00:00
David Wheatley
7cafd9f51a fix: titles positioned wrongly with custom header height (#3550) 2022-07-21 11:47:37 +01:00
flarum-bot
e9fec9b22f Bundled output for commit 31a00eeb95
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-19 18:26:37 +00:00
Sami Mazouz
31a00eeb95 fix(regression): loading next discussion list pages fails (#3547)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-19 19:22:45 +01:00
flarum-bot
6b577e6f1f Bundled output for commit 64f0ae7c33
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-19 09:36:41 +00:00
Sami Mazouz
64f0ae7c33 chore: revert tsconfig changes for local development (#3545)
* chore: delete unwanted dist typings
* chore: revert 4e52f0e420

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-19 10:30:23 +01:00
flarum-bot
343fe0e317 Bundled output for commit 07b2f86dcc
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-18 23:14:26 +00:00
Daniël Klabbers
07b2f86dcc fix: minor backward compatible fix for php 8.1 in st_replace 2022-07-19 01:09:43 +02:00
flarum-bot
ffaea861e5 Bundled output for commit 46b3b7a952
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-18 18:21:14 +00:00
Sami Mazouz
46b3b7a952 chore: require guzzle 6 or 7
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-18 19:16:12 +01:00
flarum-bot
78544ce68d Bundled output for commit af3116bce9
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-18 18:12:03 +00:00
David Wheatley
af3116bce9 perf(statistics): rewrite for performance on very large communities (#3531)
Co-authored-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-18 19:07:38 +01:00
flarum-bot
6dde236d77 Bundled output for commit d0998be8fa
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-18 15:20:01 +00:00
David Wheatley
d0998be8fa fix: html entities shown raw in page title (#3542) 2022-07-18 16:10:34 +01:00
Ian Morland
8dcfa6c474 fix: move guzzle composer requirement to core (#3544) 2022-07-18 16:10:04 +01:00
flarum-bot
744927215a Bundled output for commit 54c21459d6
Includes transpiled JS/TS.

[skip ci]
2022-07-18 14:47:05 +00:00
Ian Morland
54c21459d6 feat(likes): Option to prevent users liking their own posts (#3534)
* Option to prevent users liking their own posts
* test: user can only like own post if setting ON

Co-authored-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-18 15:32:27 +01:00
flarum-bot
91f8bd34b1 Bundled output for commit 4e52f0e420
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-18 14:30:42 +00:00
Sami Mazouz
4e52f0e420 chore: monorepo local development improvements (#3523)
* chore: centralize editorconfig
* chore: tweak tsconfigs for local development
* revert src path change
* fix: akismet type checking requires flag ext `@types`
* fix: make tags route optional to avoid typescript typing error
2022-07-18 15:19:11 +01:00
Sami Mazouz
ac23d79fe7 fix: unread notifications are globally cached between users. (#3543)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-18 15:17:46 +01:00
David Wheatley
29179e27c6 feat: use position: sticky for discussion side nav (#3540) 2022-07-17 11:06:19 +01:00
flarum-bot
cd610a1cf2 Bundled output for commit 0c017c2aa0
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-15 22:33:28 +00:00
Sami Mazouz
0c017c2aa0 refactor: convert AlertManager IndexPage and UserPage components to TS (#3536)
* chore: convert `AlertManager` component to TypeScript
* chore: `compat.js` to `compat.ts`
* chore: convert `IndexPage` component to TypeScript
* chore: convert `UserPage` component and inheritors to TypeScript
* chore: `yarn format`
* chore: import types instead
2022-07-15 23:27:47 +01:00
David Wheatley
5721a2f487 fix: replace .fa() mixin usage with .fas() (#3537) 2022-07-15 23:16:49 +01:00
David Wheatley
b673d36f33 chore: split FA imports into separate Less file for easy overriding (#3535) 2022-07-15 09:42:02 +01:00
flarum-bot
bacb095382 Bundled output for commit 7471ef64d5
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-14 15:02:48 +00:00
Sami Mazouz
7471ef64d5 refactor: convert Badge, Checkbox and Navigation components to TS (#3532)
* chore: convert badge components to TypeScript

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>

* chore: convert checkbox components to TypeScript

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>

* chore: convert `Navigation` component to TypeScript

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>

* chore: import mithril type instead
2022-07-14 15:54:16 +01:00
flarum-bot
707ca2d16d Bundled output for commit 3246f5a8f6
Includes transpiled JS/TS.

[skip ci]
2022-07-14 13:48:19 +00:00
Ian Morland
3246f5a8f6 feat(likes): Add likes tab to user profile (#3528) 2022-07-14 14:38:31 +01:00
David Wheatley
bf6f63cfe1 feat: extender to add custom less variables (#3530) 2022-07-14 13:04:38 +01:00
flarum-bot
819602520a Bundled output for commit 16f59f514b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-14 11:39:02 +00:00
Ian Morland
16f59f514b fix: set translator locale to user preference for email notifications (#3525) 2022-07-14 12:02:55 +01:00
David Wheatley
759f7ef327 fix(a11y): present post streams as feeds, setting busy when loading new pages (#3522) 2022-07-14 12:02:20 +01:00
David Wheatley
9c825aaa2b fix(a11y): set aria-busy when editing a post stream item (#3521)
* fix(a11y): add `aria-busy="true"` to posts being edited

* fix(a11y): add `aria-busy="true"` to reply placeholder
2022-07-14 12:02:12 +01:00
David Wheatley
952a5891bb fix(a11y): add accessible labels to notification grid options (#3520) 2022-07-14 12:02:00 +01:00
flarum-bot
0daa24cf4b Bundled output for commit 33bf2284c7
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-14 08:52:21 +00:00
Daniël Klabbers
33bf2284c7 fix: core settings header has no priority
Due to missing sort the category title sorts underneath the core settings nav items.
2022-07-14 10:44:39 +02:00
Sami Mazouz
d3e456a1bf chore: fix github issue templates
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-13 22:39:10 +01:00
Sami Mazouz
51472625ba choe: use github issue template forms (#3526)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-13 22:22:22 +01:00
flarum-bot
ec22162cf4 Bundled output for commit 1af506d4b8
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-07-13 20:47:43 +00:00
Sami Mazouz
1af506d4b8 refactor: convert core modals to TypeScript (#3515)
* refactor: convert core modals to TypeScript
* chore: excplicitly specify return type instead
* chore: `yarn format`

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-13 21:42:45 +01:00
Daniël Klabbers
d86440506d chore: update version constant during cycle 22 2022-07-13 20:01:01 +02:00
Daniël Klabbers
556d461cfb chore: update v1.4 constraints and update issues url 2022-07-12 23:30:03 +02:00
Daniël Klabbers
6cfebe381a chore: update version constant for the v1.4 release 2022-07-12 23:29:45 +02:00
Daniël Klabbers
8ab2827f4c chore: add changelog for v1.4 2022-07-12 23:27:03 +02:00
Sami Mazouz
024155a608 test(likes): like action behavior (#3512)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-11 10:42:21 +01:00
Sami Mazouz
4da21463c1 fix: multiple createdAt columns in query causes conflicts (#3506)
* test: list posts with mentions filter and `createdAt` sort
* fix: multiple `createdAt` columns in query causes conflicts
* chore: link to pull request for context

Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-09 10:36:48 +01:00
Sami Mazouz
abc12b4ba5 chore: add .gitattributes to extensions to export-ignore files. (#3513)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-08 20:38:20 +01:00
Sami Mazouz
d8d4eae9f5 test(suspend): test that suspension works as expected (#3511)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-08 19:24:59 +01:00
Sami Mazouz
d82a73feed fix(approval): unapproved posts visible to all when no visibility scopers are added
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-08 19:16:53 +01:00
Sami Mazouz
ab6cee1a25 test(approval): unapproved content can only be seen by allowed users
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-08 19:16:53 +01:00
Sami Mazouz
2e840dc73d test(sticky): list discussions works as expected with stickies (#3507)
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-08 19:07:03 +01:00
Sami Mazouz
ae9139bd73 chore(subscriptions): enable backend tests
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-07 23:35:29 +01:00
Daniël Klabbers
2e3d6dfa2c chore: upstream changes to dependencies 2022-07-05 21:19:01 +02:00
David Wheatley
7cd28710bc fix: composer title positioning incorrect with custom header height (#3502) 2022-07-04 14:28:44 +01:00
Clark Winkelmann
bc1d6f9e91 fix: assertAdmin sending wrong ability name to gate (#3501) 2022-07-04 14:18:18 +01:00
Sami Mazouz
bf4c543692 fix: restricted sibling tags appearing for unauthorized members on the sidebar (#3419)
* test: user should only be able to see related tags when allowed

* fix: restricted sibling tags appearing for unauthorized members on the sidebar

* fix: apply logic on tags with parents
2022-07-04 12:19:03 +01:00
David Sevilla Martin
709c5566bb fix: overflow notifications group header text with ellipses (#3500)
Fixes #3408
2022-07-04 12:16:59 +01:00
David Wheatley
9a62c32c28 fix: remove return type 2022-07-04 10:52:10 +01:00
1220 changed files with 28207 additions and 19260 deletions

View File

@@ -17,3 +17,9 @@ trim_trailing_whitespace = false
[*.{php,xml,json}]
indent_size = 4
[{tsconfig.json,prettierrc.json}]
indent_size = 2
[*.neon]
indent_style = tab

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @flarum/core

View File

@@ -1,39 +0,0 @@
---
name: "🐛 Bug Report"
about: "If something isn't working as expected"
---
## Bug Report
**Current Behavior**
A clear and concise description of the behavior.
**Steps to Reproduce**
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected Behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment**
- Flarum version: x.y.z
- Website URL: http://example.com
- Webserver: [e.g. apache, nginx]
- Hosting environment: [e.g. shared, vps]
- PHP version: x.y.z
- Browser: [e.g. chrome 67, safari 11]
```
Output of "php flarum info", run this in terminal in your Flarum directory.
```
**Possible Solution**
<!--- Only if you have suggestions or a fix for the bug -->
**Additional Context**
Add any other context about the problem here.

78
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,78 @@
name: "🐛 Bug Report"
description: If something isn't working as expected
labels: ["type/bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: current_behavior
attributes:
label: Current Behavior
description: A clear and concise description of the behavior.
validations:
required: true
- type: textarea
id: steps_to_reproduce
attributes:
label: Steps to Reproduce
description: The exact steps to reproduce the bug.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error message '....'
validations:
required: true
- type: textarea
id: expected_behavior
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
validations:
required: false
- type: textarea
id: enironment
attributes:
label: Environment
value: |
- Flarum version: x.y.z
- Website URL: http://example.com
- Webserver: [e.g. apache, nginx]
- Hosting environment: [e.g. shared, vps]
- PHP version: x.y.z
- Browser: [e.g. chrome 67, safari 11]
validations:
required: true
- type: textarea
id: php_flarum_info
attributes:
label: "Output of `php flarum info`"
value: |
```
Output of "php flarum info", run this in terminal in your Flarum directory.
```
validations:
required: false
- type: textarea
id: possible_solution
attributes:
label: Possible Solution
description: Only if you have suggestions or a fix for the bug.
validations:
required: false
- type: textarea
id: additional_context
attributes:
label: Additional Context
description: Add any other context about the problem here.
validations:
required: false

17
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
blank_issues_enabled: false
contact_links:
- name: "🚀 Feature Request"
url: https://discuss.flarum.org/t/proposals
about: |
Thanks for taking the time to fill out this feature request!
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future.
For feature requests, ideas and feedback please post in the Flarum Community.
Feature requests are added to GitHub only when they have been accepted by the development team and implementation details have been laid out.
- name: "🙋‍ Support Question"
url: https://discuss.flarum.org/t/support
about: |
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future; for usage and support questions, please check out these resources below. Thanks!
* Flarum Community: https://discuss.flarum.org/
* Discord Chat: https://flarum.org/discord/
* Twitter: https://twitter.com/Flarum

View File

@@ -1,7 +0,0 @@
---
name: "🚀 Feature Request"
about: "If you have a suggestion please head over to our forum!"
---
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future. For feature requests, ideas and feedback please post in the Flarum Community: https://discuss.flarum.org/t/proposals. Feature requests are added to GitHub only when they have been accepted by the development team and implementation details have been laid out.

View File

@@ -1,11 +0,0 @@
---
name: "🙋‍ Support Question"
about: "If you have a question, please check out our forum or Discord!"
---
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future; for usage and support questions, please check out these resources below. Thanks!
* Flarum Community: https://discuss.flarum.org/
* Discord Chat: https://flarum.org/discord/
* Twitter: https://twitter.com/Flarum

View File

@@ -9,6 +9,12 @@ on:
default: true
required: false
enable_phpstan:
description: "Enable PHPStan Static Analysis?"
type: boolean
default: false
required: false
backend_directory:
description: The directory of the project where backend code is located. This should contain a `composer.json` file, and is generally the root directory of the repo.
type: string
@@ -19,12 +25,19 @@ on:
description: Versions of PHP to test with. Should be array of strings encoded as JSON array
type: string
required: false
default: '["7.4", "8.0", "8.1"]'
default: '["7.3", "7.4", "8.0", "8.1", "8.2"]'
php_extensions:
description: PHP extensions to install.
type: string
required: false
default: 'curl, dom, gd, json, mbstring, openssl, pdo_mysql, tokenizer, zip'
db_versions:
description: Versions of databases to test with. Should be array of strings encoded as JSON array
type: string
required: false
default: '["mysql:5.7", "mariadb"]'
default: '["mysql:5.7", "mysql:8.0.30", "mariadb"]'
php_ini_values:
description: PHP ini values
@@ -44,23 +57,54 @@ jobs:
matrix:
php: ${{ fromJSON(inputs.php_versions) }}
service: ${{ fromJSON(inputs.db_versions) }}
prefix: ['', flarum_]
prefix: ['']
php_ini_values: [inputs.php_ini_values]
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude
include:
# Expands the matrix by naming DBs.
- service: 'mysql:5.7'
db: MySQL
db: MySQL 5.7
- service: 'mysql:8.0.30'
db: MySQL 8.0
- service: mariadb
db: MariaDB
- prefix: flarum_
# Include Database prefix tests with only one PHP version.
- php: ${{ fromJSON(inputs.php_versions)[0] }}
service: 'mysql:5.7'
db: MySQL 5.7
prefix: flarum_
prefixStr: (prefix)
- php: ${{ fromJSON(inputs.php_versions)[0] }}
service: 'mysql:8.0.30'
db: MySQL 8.0
prefix: flarum_
prefixStr: (prefix)
- php: ${{ fromJSON(inputs.php_versions)[0] }}
service: mariadb
db: MariaDB
prefix: flarum_
prefixStr: (prefix)
# @TODO: remove in 2.0
# Include testing PHP 8.2 with deprecation warnings disabled.
- php: 8.2
php_ini_values: error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED
# To reduce number of actions, we exclude some PHP versions from running with some DB versions.
exclude:
- php: 8.0
service: 'mysql:5.7'
prefix: flarum_
- php: 8.0
service: mariadb
prefix: flarum_
- php: ${{ fromJSON(inputs.php_versions)[1] }}
service: 'mysql:8.0.30'
- php: ${{ fromJSON(inputs.php_versions)[2] }}
service: 'mysql:8.0.30'
- php: ${{ fromJSON(inputs.php_versions)[3] }}
service: 'mysql:8.0.30'
# @TODO: remove in 2.0
# Exclude testing PHP 8.2 with deprecation warnings enabled.
- php: 8.2
php_ini_values: error_reporting=E_ALL
services:
mysql:
@@ -70,7 +114,9 @@ jobs:
name: 'PHP ${{ matrix.php }} / ${{ matrix.db }} ${{ matrix.prefixStr }}'
if: inputs.enable_backend_testing
if: >-
inputs.enable_backend_testing &&
((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || github.event_name != 'pull_request')
steps:
- uses: actions/checkout@master
@@ -80,9 +126,9 @@ jobs:
with:
php-version: ${{ matrix.php }}
coverage: xdebug
extensions: curl, dom, gd, json, mbstring, openssl, pdo_mysql, tokenizer, zip
extensions: ${{ inputs.php_extensions }}
tools: phpunit, composer:v2
ini-values: ${{ inputs.php_ini_values }}
ini-values: ${{ matrix.php_ini_values }}
# The authentication alter is necessary because newer mysql versions use the `caching_sha2_password` driver,
# which isn't supported prior to PHP7.4
@@ -110,3 +156,35 @@ jobs:
working-directory: ${{ inputs.backend_directory }}
env:
COMPOSER_PROCESS_TIMEOUT: 600
phpstan:
runs-on: ubuntu-latest
strategy:
matrix:
php: ${{ fromJSON(inputs.php_versions) }}
name: 'PHPStan PHP ${{ matrix.php }}'
if: >-
inputs.enable_phpstan &&
((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || github.event_name != 'pull_request')
steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
extensions: ${{ inputs.php_extensions }}
tools: phpunit, composer:v2
ini-values: ${{ matrix.php_ini_values }}
- name: Install Composer dependencies
run: composer install
working-directory: ${{ inputs.backend_directory }}
- name: Run PHPStan
run: composer analyse:phpstan

View File

@@ -3,6 +3,37 @@ name: Flarum Frontend Jobs
on:
workflow_call:
inputs:
build_script:
description: "Script to run for production build. Empty value to disable."
type: string
required: false
default: build
build_typings_script:
description: "Script to run for typings build. Empty value to disable."
type: string
required: false
default: build-typings
format_script:
description: "Script to run for code formatting. Empty value to disable."
type: string
required: false
default: format-check
check_typings_script:
description: "Script to run for tyiping check. Empty value to disable."
type: string
required: false
default: check-typings
type_coverage_script:
description: "Script to run for type coverage. Empty value to disable."
type: string
required: false
default: check-typings-coverage
test_script:
description: "Script to run for tests. Empty value to disable."
type: string
required: false
default: test
enable_bundlewatch:
description: "Enable Bundlewatch?"
type: boolean
@@ -18,6 +49,11 @@ on:
type: boolean
default: true
required: false
enable_tests:
description: "Enable Tests?"
type: boolean
default: false
required: false
backend_directory:
description: The directory of the project where backend code is located. This should contain a `composer.json` file, and is generally the root directory of the repo.
@@ -61,73 +97,19 @@ env:
cache_dependency_path: ${{ inputs.cache_dependency_path || format(inputs.js_package_manager == 'yarn' && '{0}/yarn.lock' || '{0}/package-lock.json', inputs.frontend_directory) }}
jobs:
bundlewatch:
name: Bundlewatch
build:
name: Checks & Build
runs-on: ubuntu-latest
if: inputs.enable_bundlewatch
if: >-
((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || github.event_name != 'pull_request')
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
cache-dependency-path: ${{ env.cache_dependency_path }}
- name: Build production assets
uses: flarum/action-build@2
with:
github_token: ${{ secrets.github_token }}
build_script: build
package_manager: ${{ inputs.js_package_manager }}
js_path: ${{ inputs.frontend_directory }}
do_not_commit: true
- name: Check bundle size change
run: node_modules/.bin/bundlewatch --config .bundlewatch.config.json
working-directory: ${{ inputs.frontend_directory }}
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.bundlewatch_github_token }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
prettier:
name: Prettier
runs-on: ubuntu-latest
if: inputs.enable_prettier
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
cache-dependency-path: ${{ env.cache_dependency_path }}
- name: Install JS dependencies
run: ${{ env.ci_script }}
working-directory: ${{ inputs.frontend_directory }}
- name: Check JS formatting
run: ${{ inputs.js_package_manager }} run format-check
working-directory: ${{ inputs.frontend_directory }}
typecheck:
name: Typecheck
runs-on: ubuntu-latest
if: inputs.enable_typescript
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
@@ -136,7 +118,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.2'
extensions: curl, dom, gd, json, mbstring, openssl, pdo_mysql, tokenizer, zip
tools: composer:v2
@@ -149,72 +131,24 @@ jobs:
run: ${{ env.ci_script }}
working-directory: ${{ inputs.frontend_directory }}
- name: Typecheck
run: ${{ inputs.js_package_manager }} run check-typings
working-directory: ${{ inputs.frontend_directory }}
type-coverage:
name: Type Coverage
runs-on: ubuntu-latest
if: inputs.enable_typescript
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
cache-dependency-path: ${{ env.cache_dependency_path }}
- name: Install JS dependencies
run: ${{ env.ci_script }}
working-directory: ${{ inputs.frontend_directory }}
- name: Check type coverage
run: ${{ inputs.js_package_manager }} run check-typings-coverage
working-directory: ${{ inputs.frontend_directory }}
build:
name: Build
runs-on: ubuntu-latest
if: "always() && !contains(needs.*.result, 'failed') && !contains(needs.*.result, 'cancelled')"
needs: [bundlewatch, prettier, typecheck, type-coverage]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
cache-dependency-path: ${{ env.cache_dependency_path }}
# Our action will install npm/yarn, cd into `${{ inputs.frontend_directory }}`, build dist JS and typings,
# then commit and upload any changes iff we are on the main branch and have just pushed.
- name: Build production JS
if: inputs.enable_typescript
uses: flarum/action-build@2
- name: JS Checks & Production Build
uses: flarum/action-build@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build
package_manager: ${{ inputs.js_package_manager }}
typings_script: build-typings
js_path: ${{ inputs.frontend_directory }}
do_not_commit: ${{ github.ref != format('refs/heads/{0}', inputs.main_git_branch) || github.event_name != 'push' }}
# Our action will install npm/yarn, cd into `${{ inputs.frontend_directory }}`, build dist JS and typings,
# then commit and upload any changes iff we are on the main branch and have just pushed.
- name: Build production JS
if: "! inputs.enable_typescript"
uses: flarum/action-build@2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build
build_script: ${{ inputs.build_script }}
build_typings_script: ${{ inputs.build_typings_script }}
format_script: ${{ inputs.enable_prettier == true && inputs.format_script || '' }}
check_typings_script: ${{ inputs.enable_typescript == true && inputs.check_typings_script || '' }}
type_coverage_script: ${{ inputs.enable_typescript == true && inputs.type_coverage_script || '' }}
test_script: ${{ inputs.enable_tests == true && inputs.test_script || '' }}
package_manager: ${{ inputs.js_package_manager }}
js_path: ${{ inputs.frontend_directory }}
do_not_commit: ${{ github.ref != format('refs/heads/{0}', inputs.main_git_branch) || github.event_name != 'push' }}
- name: Check bundle size change
if: ${{ inputs.enable_bundlewatch }}
run: node_modules/.bin/bundlewatch --config .bundlewatch.config.json
working-directory: ${{ inputs.frontend_directory }}
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.bundlewatch_github_token }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}

View File

@@ -1,20 +0,0 @@
name: Akismet JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: true
frontend_directory: ./extensions/akismet/js
backend_directory: ./extensions/akismet
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -6,6 +6,6 @@ jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
enable_backend_testing: true
backend_directory: ./extensions/approval

View File

@@ -1,20 +0,0 @@
name: Approval JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/approval/js
backend_directory: ./extensions/approval
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: Core JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: true
enable_prettier: true
enable_typescript: true
frontend_directory: ./framework/core/js
backend_directory: ./framework/core
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: Embed JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/embed/js
backend_directory: ./extensions/embed
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: Emoji JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/emoji/js
backend_directory: ./extensions/emoji
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: Flags JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: true
frontend_directory: ./extensions/flags/js
backend_directory: ./extensions/flags
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -6,6 +6,6 @@ jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
enable_backend_testing: true
backend_directory: ./extensions/likes

View File

@@ -1,20 +0,0 @@
name: Likes JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/likes/js
backend_directory: ./extensions/likes
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: Lock JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/lock/js
backend_directory: ./extensions/lock
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: Markdown JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/markdown/js
backend_directory: ./extensions/markdown
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: Mentions JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/mentions/js
backend_directory: ./extensions/mentions
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: Nicknames JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/nicknames/js
backend_directory: ./extensions/nicknames
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -6,6 +6,6 @@ jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
enable_backend_testing: false
backend_directory: ./extensions/package-manager

View File

@@ -1,20 +0,0 @@
name: Package Manager JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: true
frontend_directory: ./extensions/package-manager/js
backend_directory: ./extensions/package-manager
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: Pusher JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: true
frontend_directory: ./extensions/pusher/js
backend_directory: ./extensions/pusher
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: Statistics JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: true
frontend_directory: ./extensions/statistics/js
backend_directory: ./extensions/statistics
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -6,6 +6,6 @@ jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
enable_backend_testing: true
backend_directory: ./extensions/sticky

View File

@@ -1,20 +0,0 @@
name: Sticky JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/sticky/js
backend_directory: ./extensions/sticky
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -6,6 +6,6 @@ jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
enable_backend_testing: true
backend_directory: ./extensions/subscriptions

View File

@@ -1,20 +0,0 @@
name: Subscriptions JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/subscriptions/js
backend_directory: ./extensions/subscriptions
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -6,6 +6,6 @@ jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
enable_backend_testing: true
backend_directory: ./extensions/suspend

View File

@@ -1,20 +0,0 @@
name: Suspend JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./extensions/suspend/js
backend_directory: ./extensions/suspend
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@@ -1,4 +1,4 @@
name: Tags JS
name: Framework JS
on: [workflow_dispatch, push, pull_request]
@@ -6,14 +6,14 @@ jobs:
run:
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: true
frontend_directory: ./extensions/tags/js
backend_directory: ./extensions/tags
frontend_directory: ./
backend_directory: ./
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
main_git_branch: 1.x
enable_tests: true
# @TODO: fix bundlewatch
enable_bundlewatch: false
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

12
.github/workflows/phpstan.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
name: Framework PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
enable_phpstan: true
backend_directory: .

26
.github/workflows/prepare-release.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Prepare Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
type: string
jobs:
run:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare release
uses: flarum/action-release@master
with:
next_tag: ${{ inputs.version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
open_collective_token: ${{ secrets.OPEN_COLLECTIVE_TOKEN }}

View File

@@ -1,5 +1,288 @@
# Changelog
## [v1.8.2](https://github.com/flarum/framework/compare/v1.8.1...v1.8.2)
### Fixed
* suspended users can abuse avatar upload [#3890]
* missing compat exports [#3888]
## [v1.8.1](https://github.com/flarum/framework/compare/v1.8.0...v1.8.1)
### Fixed
* recover temporary solution for html entities in browser title (e72541e35de4f71f9d870bbd9bb46ddf586bdf1d)
* custom contrast color affected by parents (577890d89c593ae5b6cb96083fab69e2f1ae600c)
* reply placeholder wrong positioning (253a3d281dbf5ce3fa712b629b80587cf67e7dbe)
* (mentions) missed post mentions UI changes with lazy loading [#3832]
* (mentions) cannot use newly introduced mentionables extender [#3849]
* (mentions) missing slug from post mention links ([5a4bb7c](5a4bb7ccf226f66dd44816cb69b3d7cfe4ad7f7c))
## [v1.8.0](https://github.com/flarum/framework/compare/v1.7.1...v1.8.0)
### Fixed
- (a11y) reply placeholder not accessible [#3793]
- (bbcode) highlight.js does not work after changing post content [#3817]
- (bbcode) localize quote `wrote` string [#3809]
- (mentions) mentions XHR fired even after mentioning is done [#3806]
- (package-manager) available core updates cause an error in the dashboard ([fab71f2](fab71f2d01fa20ce9b3002833339dc5ea3ea6301))
- (tags) not all tags are loaded in the permission grid [#3804]
- (tags) tag discussion modal filters with exact matches only after first index [#3786]
- (testing) always clear cache in integration test's tearDown [#3818]
- `UserSecurityPage` not exported ([232618a](232618aba604ab003425df38b895208c863d3260))
- `isDark()` utility can receive null value [#3774]
- approving a post does not bump user `comment_count` [#3790]
- circular dependencies disable all involved extensions [#3785]
- color input overflowing the input box [#3796]
- deleting a discussion from the profile does not visually remove it [#3799]
- discussion page showing horizontal scroll on iOS [#3821]
- empty string displayed as SelectDropdown title [#3773]
- filter values are not validated [#3795]
- infinite scroll not initialized for notifications on big screens [#3733]
- notification subject discussion eager loading fails [#3788]
- null as 2nd param in `preg_match` is deprecated [#3801]
- unread count in post stream not visible [#3791]
- unreadable badge icon on certain colors [#3810]
- integrity constraint violation [#3772]
### Changed
- (core,mentions) limit `mentionedBy` post relation results [#3780]
- (likes) limit `likes` relationship results [#3781]
- Change some methods from private to protected, to be able to extend the affected classes [#3802]
- Do not catch exceptions when testing Console commands [#3813]
- drop usage of jquery in `install` and `update` interfaces [#3797]
- extensibility improvements [#3729]
- major frontend JS cleanup [#3609]
- revert ineffective code for encoding of page title [#3768]
- speed up post creation time [#3808]
### Added
- (mentions,tags) tag mentions [#3769]
- add delete own posts permission [#3784]
- add a trait to flush the formatter cache in tests [#3811]
- add user creation to users list page [#3744]
- cli command for enabling or disabling an extension [#3816]
- conditional extenders [#3759]
- provide old content to `Revised` event [#3789]
## [v1.7.1](https://github.com/flarum/framework/compare/v1.7.0...v1.7.1)
### Fixed
- (tags) composer tag selection modal using wrong primary max & min numbers (abc9670659426b765274376945b818b70d84848c)
- missing parameter names in token title translation. (#3752)
- hardcoded language strings in StatusWidget (#3754)
- hide developer tokens section in if there is nothing to display or create (#3753)
- improve sessions user UI on mobile (dd868ab44e11e892d020e3b9412553c6a789e68d)
## [v1.7.0](https://github.com/flarum/framework/compare/v1.6.3...v1.7.0)
### Added
- (actions) allow running JS tests in GH actions [#3730]
- (core) PHP 8.2 Support [#3709]
- (jest) create jest config package for unit testing [#3678]
- (jest) mithril component testing [#3679]
- (phpstan) foundation for usage in extensions [#3666]
- (seo) Do not use h3 header for poster author in posts stream [#3732]
- (seo) Use h2 header for discussions on discussions list [#3731]
- (seo) shift h1 tag from logo to discussion title [#3724]
- (tags) admin tag selection component (reusable tag selection modal) [#3686]
- Admin User Search [#3712]
- access tokens user management UI [#3587]
- add display name column to admin users list [#3740]
- allow push additional items to the end of the poststream [#3691]
- allow using utf8 characters in tag slugs [#3588]
- expose queue driver, schedule status [#3593]
- expose {time} to eventPost data, fix renamed tooltip [#3698]
- frontend `Model` extender [#3646]
- global logout to clear all sessions, access tokens, email tokens and password tokens [#3605]
- improved page navigation for users list [#3741]
- introduce frontend extenders [#3645]
### Fixed
- (mentions) correctly convert a 3 char. hex color to a 6 char. one [#3694]
- (mentions) post reply mention missing notification on approval [#3738]
- (phpstan) adapt phpstan package for extension use [#3727]
- (tags) clickable tag labels have underline [#3737]
- (tags) tag text color contrast [#3653]
- 3 digit hex color value in color input not supported [#3706]
- column `id` can be ambiguous in group filter with extensions [#3696]
- disallow certain dangerous LESS features ([1761660](1761660c98ea5a3e9665fb8e6041d1f2ee62a444))
- evaluated page title content [#3684]
- invalid translation key for scheduler dashboard [#3736]
- load actor.groups on showforumcontroller [#3716]
- make go-to-page input number-like [#3743]
- normal logout affects all sessions [#3571]
- permissions table on mobile is unusable [#3722]
- post dropdown opens all dropdowns in `.Post-actions` [#3675]
- typo in Formatter extender docblock [#3676]
- undefined showing in dropdown active title [#3700]
### Changed
- (phpstan) enable phpstan in bundled extensions [#3667]
- Add missing states exports to `compat.ts` [#3683]
- Indicate cross-origin request in generic error message [#3669]
- Merge branch 'release/v1.6.2' ([e0b9dcf](e0b9dcfbcd7db175368dbc98255f9223da8df17d))
- The negate field doesn't get used, which means you cant exclude tags [#3713]
- Update forum.less to fix the misalignment of the choose tags button [#3726]
- `yarn audit-fix` ([8ddb0fe](8ddb0feb097dad06c5763107d7a7f7b5a55562c4))
- `yarn` ([ee1e04c](ee1e04cdc26b3e63057a58899f32f482901a95fd))
- convert `Dropdown` components to TS [#3608]
- fix php 8.1 on preg_match 2nd argument being null, which also optimizes slightly ([d7b9a03](d7b9a03f31847c39631ba495df8f515509774610))
- improve group mentions parsing [#3723]
- prepare `@flarum/jest-config` for release ([748cca6](748cca6d12f8b1744a6017c09395725bdbb4a118))
- remove use of deprecated phpunit assertion ([3af0481](3af0481f304277f5380fac9c9b169a7fa651f53b))
- set flarum version to 1.7.0 for dev ([2517bc0](2517bc0f70b0f0e3d3ea3f6ae06af8604d89b25d))
- update JS dependencies [#3695]
## [v1.6.3](https://github.com/flarum/framework/compare/v1.6.2...v1.6.3)
### Fixed
* Post mentions can be used to read any post on the forum without access control (ab1c868b978e8b0d09a5d682c54665dae17d0985).
* Notifications can leak restricted content (d0a2b95dca57d3dae9a0d77b610b1cb1d0b1766a).
* Any user including unactivated can reply in public discussions whose first post was permanently deleted (12f14112a0ecd1484d97330b82beb2a145919015).
* (subscriptions) Post notifications not getting access checked (https://github.com/flarum/framework/commit/e5f05166a062a9a6eb7c12e28728bfd5db7270e3).
## [v1.6.2](https://github.com/flarum/framework/compare/v1.6.1...v1.6.2)
### Fixed
* XSS Vulnerability in core (https://github.com/flarum/framework/pull/3684).
## [v1.6.1](https://github.com/flarum/framework/compare/v1.6.0...v1.6.1)
### Fixed
* JS dependencies update breaks utilities.
## [v1.6.0](https://github.com/flarum/framework/compare/v1.5.0...v1.6.0)
### Fixed
- (approval) posts approved for deleted users error ([b5874a0](b5874a08e482196f50af50aa78e43c93c29fb647))
- (regression) bad import ([5f2d7fb](5f2d7fb7b6e430d40cf2bb05eca7c73f6ca5a2cc))
- akismet fails when the extension is not on a version ([45d9121](45d91212f6bfa777cae9fc06c55c85d01ffd174d))
- apply flex for AppearancePage colors input [#3651]
- groupmentions have poor contrast on some backgrounds [#3672]
- larastan v1 incompatible with phpstan v1.9.0 [#3665]
- package manager failures not showing alerts [#3647]
- password reset leaks user existence [#3616]
- statistics previous period chart is unclear [#3654]
### Changed
- (package-manager) config composer to use web php version ([fd19645](fd196454a5641776784fa80886cc7577c840f8ed))
- (package-manager) set min core version and add warning ([31c3cfc](31c3cfc4eab4c314260b9b0d11e53ac2d4be158d))
- (statistics) prepare v1.5.1 ([dc215ab](dc215aba59145dfd7b0d6efad4388444f30e47fb))
- Apply fixes from StyleCI ([267f675](267f6759f80bd06f468337245ea6045635e827d9))
- Fix tag discussion count decreased by 2 when hiding before deleting [#3660]
- Log migration path when up/down keys are missing [#3664]
- Make it possible to extend SetupScript [#3643]
- Setup PHPStan Level 5 [#3553]
- `yarn format` ([c5c312d](c5c312db0d800e3b84b94a4abb9691e348dea742))
- add missing last period to custom date ranges [#3661]
- add priorities to profile settings page [#3657]
- allow specifying php extensions in workflow ([b0b47a0](b0b47a0888f513a459b67e9f89e72a61de38f1ce))
- format js ([06963df](06963df4079373fc8fc51b7479e9576f02beb098))
- group mentions [#3658]
- remove styleci from changelog ([b2fa28e](b2fa28e4b57094e46dbdb3d79fab74f290a17d17))
- set flarum version to dev for 1.6.0 ([fc743ba](fc743ba88872031db13597d7365a063b8004c78f))
- throw an exception when no serializer is provided to the controller [#3614]
### Added
- (statistics) support for custom date ranges [#3622]
- Allow additional login params, Introduce `LogInValidator` [#3670]
- Allow additional reset password params, introduce `ForgotPasswordValidator` [#3671]
- add statistics chart export button [#3662]
- allow specifying extensions when installing an instance [#3655]
- contrast util with yiq calculator [#3652]
- customizable session driver [#3610]
- replace `ColorPreviewInput` for GroupModal color input [#3650]
- send notifications of a new reply when post is approved [#3656]
## [v1.5.0](https://github.com/flarum/framework/compare/v1.4.0...v1.5.0)
### Fixed
- (a11y) add accessible labels to notification grid options [#3520]
- (a11y) present post streams as feeds [#3522]
- (a11y) set `aria-busy` when editing a post stream item [#3521]
- (compilation) versioner not inject into compilers [#3589]
- (mentions) accessing `id` of null `user` relation [#3618]
- (subscriptions) add missing table prefix for filter gambit [#3599]
- (tags) use default index sortmap [#3615]
- Move guzzle requirement to core [#3544]
- MyISAM tables for extensions during installation ([75aaef7](75aaef7d76317bc8578eac1439fed8091c87213b), [f926c58](f926c58e0143fe75a4a4c2e93810970c5910afc8))
- Set the translator locale to user preference for email notifications [#3525]
- `$events` property declared dynamically [#3598]
- core settings header has no priority ([33bf228](33bf2284c77863a1bb18d71d87b8516483056a74))
- html entities shown raw in page title [#3542]
- incorrect centring of deleted user avatars in notification list [#3569]
- intellisense imports defaulting to absolute path from `src` folder [#3549]
- minor backward compatible fix for php 8.1 in st_replace ([07b2f86](07b2f86dcc90a3ef17c8ee19a1a07e99a4b17360))
- post query wildcard selection causes ambiguity [#3621]
- potential static caching memory exhaustion [#3548]
- prepare release workflow has invalid layout ([70e483d](70e483d1b185332910be9513fd06cc6342830d49))
- remove deprecation warning for decoding null values ([590639f](590639f5f3e1fe883f28c41e1f175c2826b4b5f4))
- replace `.fa()` mixin usage with `.fas()` [#3537]
- return type hint static is php 8+ ([b01b75e](b01b75e36790d8026dd27ce59051d9581ad47940))
- sticky nav content displays below post stream [#3575]
- titles positioned wrongly with custom header height [#3550]
- typo in error message ([1a189f4](1a189f492320071365286a8835bc49d5a9571753))
- unread notifications are globally cached between users. [#3543]
- update workflow name ([628c281](628c281c39855f01069ddc40b698d80d29fec870))
- user has wrong discussion read status [#3591]
### Changed
- (approval, likes) use subscribers [#3577]
- (package-manager) last tweaks before beta tag ([335c602](335c602cea3fbaee9ad7c32ceecaaf222e5d89a7))
- (statistics) add release notes for 1.4.1 ([f4ace73](f4ace73a3c59434b8717efb2d83f50084f470fe4))
- (statistics) rewrite for performance on very large communities [#3531]
- (statistics) split timed data into per-model XHR requests [#3601]
- (tags) Replace event helper with event dispatcher [#3570]
- Add `loading="lazy"` attribute for avatars [#3578]
- Create CODEOWNERS ([6e48a03](6e48a0303e45bcf210e550ba3e0772bc8443a207))
- MyISAM tables for extensions during installation" ([f128190](f128190f143398dd1262fd1379e634794daee4c1))
- convert `AlertManager` `IndexPage` and `UserPage` components to TS [#3536]
- convert `Badge` `Checkbox` and `Navigation` components to TS [#3532]
- convert core modals to TypeScript [#3515]
- convert page components to TypeScript [#3538]
- debug line slipped in while rebasing a PR [#3580]
- don't pass password field between auth modals [#3626]
- fix github issue templates ([d3e456a](d3e456a1bf42d13b7cd2542c371f392712247c09))
- format code ([4954621](495462183bfb3b33046b293e6b1088ab225968df))
- getting the release workflow in ([5530400](5530400b093b5fd07d670e5c92d8a7da96634cfe))
- link logo at the top with the official website [#3552]
- prevent running both `push` and `pull_request` actions at the same time [#3597]
- refactor prefix matrix and add `MySQL 8.0` & `PHP 7.3` to workflows [#3595]
- relying on a third-party for avatar URL tests is unreliable [#3586]
- require guzzle 6 or 7 ([46b3b7a](46b3b7a9527b935c3c52269aaad2010c75dcb6d8))
- split FA imports into separate Less file for easy overriding [#3535]
- unify JS actions into one (rewritten `flarum/action-build`) [#3573]
- update version constant during cycle 22 ([d864405](d86440506dd37101e60adec591d4b017e7765ec6))
- use `isCollapsed` instead of `rangeCount` [#3581]
- use github issue template forms [#3526]
### Added
- (likes) Add likes tab to user profile [#3528]
- (likes) Option to prevent users liking their own posts [#3534]
- (modals) support stacking modals, remove bootstrap modals dependency [#3456]
- (subscriptions) add option to send notifications when not caught up [#3503]
- Add custom class for email confirmation alert [#3584]
- Admin debug mode warning [#3590]
- Delete all notifications [#3529]
- Queue package manager commands [#3418]
- Restart the queue worker after cache clearing, ext enable/disable, save settings [#3565]
- add createTableIfNotExists migration helper [#3576]
- add new workflow for generating release meta ([0901e59](0901e59a58a3e1f017762583a2adf419f7f34257))
- clear password & email tokens when appropriate [#3567]
- discussion UTF-8 slug driver [#3606]
- expose assets base url to frontend forum model [#3566]
- extender to add custom less variables [#3530]
- publish assets on admin dashboard cache clear [#3564]
- throttle email change, email confirmation, and password reset endpoints. [#3555]
## [1.4.0](https://github.com/flarum/framework/compare/v1.3.1...v1.4.0)
### Added
- `created_at` and `updated_at` columns added to several tables (https://github.com/flarum/framework/pull/3435)
- Priorities added to AdminNav links (https://github.com/flarum/framework/pull/3453)
- `app.translator` allows retrieving and setting locale (https://github.com/flarum/framework/pull/3451)
- Extensions can now declare custom settings components for use with `buildSettingComponent` (https://github.com/flarum/framework/pull/3494)
- Implement extensibility on `rel` and `target` attributes on links (https://github.com/flarum/framework/pull/3455)
- New backend tests were added to some of the bundled extensions (https://github.com/flarum/framework/issues/3508)
### Changed
- Split boot script for Flarum in HTML footer into two parts for CSP hashing (https://github.com/flarum/framework/pull/3461)
- Split asset compilation by giving assembling compilers its own method (https://github.com/flarum/framework/pull/3446)
- Increase visibility of Component typescript class for better extensibility (https://github.com/flarum/framework/pull/3437)
### Fixed
- Mentioning an event post breaks the notification dropdown (https://github.com/flarum/framework/pull/3493)
- Suspension modal shows after suspension is over (https://github.com/flarum/framework/pull/3449)
- CLI based installations don't exit with an error code on failure (https://github.com/flarum/framework/pull/3452)
- Tabbing through dropdown controls doesn't make them visible (https://github.com/flarum/framework/pull/3450)
- Requiring zero tags on new discussions forces the user to select tags (https://github.com/flarum/framework/pull/3448)
- Long topic titles in the notification list don't overflow (https://github.com/flarum/framework/pull/3500)
- Subtags of tags the user has access to are visible even if these are not accessible (https://github.com/flarum/framework/pull/3419)
- `assertAdmin` tests access based on wrong gate ability (https://github.com/flarum/framework/pull/3501)
- Increasing the composer header size causes elements to slip underneath (https://github.com/flarum/framework/pull/3502)
- The profile mentions tab errors when sorting by `created_at` (https://github.com/flarum/framework/pull/3506)
## [1.3.1](https://github.com/flarum/framework/compare/v1.3.0...v1.3.1)
### Changed

View File

@@ -1,4 +1,6 @@
<p align="center"><img src="https://flarum.org/assets/img/logo.png"></p>
<p align="center">
<a href="https://flarum.org/"><img src="https://flarum.org/assets/img/logo.png"></a>
</p>
<p align="center">
<a href="https://github.com/flarum/core/actions?query=workflow%3ATests"><img src="https://github.com/flarum/core/workflows/Tests/badge.svg" alt="PHP Tests"></a>

View File

@@ -29,8 +29,8 @@
}
],
"support": {
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/core",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/framework",
"docs": "https://docs.flarum.org",
"forum": "https://discuss.flarum.org",
"chat": "https://flarum.org/chat"
@@ -40,6 +40,7 @@
"Flarum\\": "framework/core/src",
"Flarum\\Akismet\\": "extensions/akismet/src",
"Flarum\\Approval\\": "extensions/approval/src",
"Flarum\\BBCode\\": "extensions/bbcode/src",
"Flarum\\Flags\\": "extensions/flags/src",
"Flarum\\Likes\\": "extensions/likes/src",
"Flarum\\Lock\\": "extensions/lock/src",
@@ -84,16 +85,15 @@
"flarum/testing": "self.version"
},
"require": {
"ext-json": "*",
"php": ">=7.3",
"axy/sourcemap": "^0.1.4",
"ext-json": "*",
"components/font-awesome": "^5.14.0",
"composer/composer": "^2.0",
"dflydev/fig-cookies": "^3.0.0",
"doctrine/dbal": "^2.7",
"dragonmantank/cron-expression": "^3.1.0",
"franzl/whoops-middleware": "^2.0.0",
"guzzlehttp/guzzle": "^7.4",
"guzzlehttp/guzzle": "^6.0|^7.4",
"illuminate/bus": "^8.0",
"illuminate/cache": "^8.0",
"illuminate/config": "^8.0",
@@ -111,8 +111,9 @@
"illuminate/validation": "^8.0",
"illuminate/view": "^8.0",
"intervention/image": "2.5.* || ^2.6.1",
"jenssegers/agent": "^2.6",
"laminas/laminas-diactoros": "^2.4.1",
"laminas/laminas-httphandlerrunner": "^1.2.0",
"laminas/laminas-httphandlerrunner": "^1.2.0 || ^2.3.0",
"laminas/laminas-stratigility": "^3.2.2",
"league/flysystem": "^1.0.11",
"matthiasmullie/minify": "^1.3",
@@ -127,6 +128,9 @@
"psr/http-server-middleware": "^1.0",
"pusher/pusher-php-server": "^2.2",
"s9e/text-formatter": "^2.3.6",
"staudenmeir/eloquent-eager-limit": "^1.0",
"sycho/json-api": "^0.5.0",
"sycho/sourcemap": "^2.0.0",
"symfony/config": "^5.2.2",
"symfony/console": "^5.2.2",
"symfony/event-dispatcher": "^5.2.2",
@@ -134,14 +138,13 @@
"symfony/polyfill-intl-messageformatter": "^1.22.0",
"symfony/translation": "^5.1.5",
"symfony/yaml": "^5.2.2",
"tobscure/json-api": "^0.3.0",
"wikimedia/less.php": "^3.0"
},
"require-dev": {
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^9.0",
"phpstan/phpstan-php-parser": "^1.0",
"phpstan/phpstan": "^1.2"
"phpstan/phpstan": ">=1.8.11 < 1.9.0",
"nunomaduro/larastan": "^1.0"
},
"config": {
"sort-packages": true
@@ -178,5 +181,12 @@
"extension.neon"
]
}
},
"scripts": {
"analyse:phpstan": "phpstan analyse",
"clear-cache:phpstan": "phpstan clear-result-cache"
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"
}
}

View File

@@ -1,19 +0,0 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
[*.{diff,md}]
trim_trailing_whitespace = false
[*.{php,xml,json}]
indent_size = 4

20
extensions/akismet/.gitattributes vendored Normal file
View File

@@ -0,0 +1,20 @@
**/.gitattributes export-ignore
**/.gitignore export-ignore
**/.gitmodules export-ignore
**/.github export-ignore
**/.travis export-ignore
**/.travis.yml export-ignore
**/.editorconfig export-ignore
**/.styleci.yml export-ignore
**/phpunit.xml export-ignore
**/tests export-ignore
**/js/dist/**/* -diff
**/js/dist/**/* linguist-generated
**/js/dist-typings/**/* -diff
**/js/dist-typings/**/* linguist-generated
**/js/yarn.lock -diff
**/js/package-lock.json -diff
* text=auto eol=lf

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/akismet",
"forum": "https://discuss.flarum.org"
},
@@ -19,9 +19,8 @@
}
],
"require": {
"flarum/core": "^1.3",
"flarum/approval": "^1.2",
"guzzlehttp/guzzle": "^7.4"
"flarum/core": "^1.8",
"flarum/approval": "^1.7"
},
"autoload": {
"psr-4": {

View File

@@ -13,6 +13,7 @@ use Flarum\Approval\Event\PostWasApproved;
use Flarum\Extend;
use Flarum\Post\Event\Hidden;
use Flarum\Post\Event\Saving;
use Flarum\Post\Post;
return [
(new Extend\Frontend('forum'))
@@ -30,4 +31,7 @@ return [
(new Extend\ServiceProvider())
->register(AkismetProvider::class),
(new Extend\Model(Post::class))
->cast('is_spam', 'bool'),
];

View File

@@ -1 +1 @@
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,kBAAkB,WACrCA,IAAAA,cAAAA,IACO,kBACJC,gBAAgB,CACfC,QAAS,yBACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,yDAE7BC,gBAAgB,CAEfC,QAAS,qCACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,mEAC5BK,KAAML,IAAAA,WAAAA,MAAqB,oEAE5BM,mBACC,CACEC,KAAM,kBACNH,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BQ,WAAY,iBAEd,a","sources":["webpack://@flarum/akismet/webpack/bootstrap","webpack://@flarum/akismet/webpack/runtime/compat get default export","webpack://@flarum/akismet/webpack/runtime/define property getters","webpack://@flarum/akismet/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/akismet/webpack/runtime/make namespace object","webpack://@flarum/akismet/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/akismet/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-akismet', () => {\n app.extensionData\n .for('flarum-akismet')\n .registerSetting({\n setting: 'flarum-akismet.api_key',\n type: 'text',\n label: app.translator.trans('flarum-akismet.admin.akismet_settings.api_key_label'),\n })\n .registerSetting({\n //https://blog.akismet.com/2014/04/23/theres-a-ninja-in-your-akismet/\n setting: 'flarum-akismet.delete_blatant_spam',\n type: 'boolean',\n label: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_label'),\n help: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_help'),\n })\n .registerPermission(\n {\n icon: 'fas fa-vote-yea',\n label: app.translator.trans('flarum-akismet.admin.permissions.bypass_akismet'),\n permission: 'bypassAkismet',\n },\n 'start'\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","help","registerPermission","icon","permission"],"sourceRoot":""}
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,kBAAkB,WACrCA,IAAAA,cAAAA,IACO,kBACJC,gBAAgB,CACfC,QAAS,yBACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,yDAE7BC,gBAAgB,CAEfC,QAAS,qCACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,mEAC5BK,KAAML,IAAAA,WAAAA,MAAqB,oEAE5BM,mBACC,CACEC,KAAM,kBACNH,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BQ,WAAY,iBAEd,QAEN,G","sources":["webpack://@flarum/akismet/webpack/bootstrap","webpack://@flarum/akismet/webpack/runtime/compat get default export","webpack://@flarum/akismet/webpack/runtime/define property getters","webpack://@flarum/akismet/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/akismet/webpack/runtime/make namespace object","webpack://@flarum/akismet/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/akismet/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-akismet', () => {\n app.extensionData\n .for('flarum-akismet')\n .registerSetting({\n setting: 'flarum-akismet.api_key',\n type: 'text',\n label: app.translator.trans('flarum-akismet.admin.akismet_settings.api_key_label'),\n })\n .registerSetting({\n //https://blog.akismet.com/2014/04/23/theres-a-ninja-in-your-akismet/\n setting: 'flarum-akismet.delete_blatant_spam',\n type: 'boolean',\n label: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_label'),\n help: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_help'),\n })\n .registerPermission(\n {\n icon: 'fas fa-vote-yea',\n label: app.translator.trans('flarum-akismet.admin.permissions.bypass_akismet'),\n permission: 'bypassAkismet',\n },\n 'start'\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","help","registerPermission","icon","permission"],"sourceRoot":""}

View File

@@ -1,2 +1,2 @@
(()=>{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const o=flarum.core.compat["common/extend"],r=flarum.core.compat["forum/app"];var a=t.n(r);const n=flarum.core.compat["forum/utils/PostControls"];var m=t.n(n);const s=flarum.core.compat["forum/components/CommentPost"];var l=t.n(s);a().initializers.add("flarum-akismet",(function(){(0,o.extend)(m(),"destructiveControls",(function(t,e){if(t.has("approve")){var o=e.flags();if(o&&o.some((function(t){return"akismet"===(null==t?void 0:t.type())}))){var r=t.get("approve");r&&"object"==typeof r&&"children"in r&&(r.children=a().translator.trans("flarum-akismet.forum.post.not_spam_button"))}}})),(0,o.override)(l().prototype,"flagReason",(function(t,e){return"akismet"===e.type()?a().translator.trans("flarum-akismet.forum.post.akismet_flagged_text"):t(e)}))}))})(),module.exports=e})();
(()=>{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const o=flarum.core.compat["common/extend"],r=flarum.core.compat["forum/app"];var a=t.n(r);const n=flarum.core.compat["forum/utils/PostControls"];var s=t.n(n);const l=flarum.core.compat["forum/components/Post"];var u=t.n(l);a().initializers.add("flarum-akismet",(function(){(0,o.extend)(s(),"destructiveControls",(function(t,e){if(t.has("approve")){var o=e.flags();if(o&&o.some((function(t){return"akismet"===(null==t?void 0:t.type())}))){var r=t.get("approve");r&&"object"==typeof r&&"children"in r&&(r.children=a().translator.trans("flarum-akismet.forum.post.not_spam_button"))}}})),(0,o.override)(u().prototype,"flagReason",(function(t,e){return"akismet"===e.type()?a().translator.trans("flarum-akismet.forum.post.akismet_flagged_text"):t(e)}))}))})(),module.exports=e})();
//# sourceMappingURL=forum.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCSxDC,IAAAA,aAAAA,IAAqB,kBAAkB,YACrCC,EAAAA,EAAAA,QAAOC,IAAc,uBAAuB,SAAUC,EAAmCC,GACvF,GAAID,EAAME,IAAI,WAAY,CACxB,IAAMC,EAAQF,EAAKE,QAEnB,GAAIA,GAASA,EAAMC,MAAK,SAACC,GAAD,MAA2B,aAAb,MAAJA,OAAA,EAAAA,EAAMC,WAAuB,CAC7D,IAAMC,EAAcP,EAAMf,IAAI,WAC1BsB,GAAsC,iBAAhBA,GAA4B,aAAcA,IAClEA,EAAYC,SAAWX,IAAAA,WAAAA,MAAqB,oDAMpDY,EAAAA,EAAAA,UAASC,IAAAA,UAAuB,cAAc,SAAUC,EAAUN,GAChE,MAAoB,YAAhBA,EAAKC,OACAT,IAAAA,WAAAA,MAAqB,kDAGvBc,EAASN,U","sources":["webpack://@flarum/akismet/webpack/bootstrap","webpack://@flarum/akismet/webpack/runtime/compat get default export","webpack://@flarum/akismet/webpack/runtime/define property getters","webpack://@flarum/akismet/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/akismet/webpack/runtime/make namespace object","webpack://@flarum/akismet/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/akismet/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/akismet/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@flarum/akismet/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@flarum/akismet/./src/forum/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport type Post from 'flarum/common/models/Post';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport type Mithril from 'mithril';\n\napp.initializers.add('flarum-akismet', () => {\n extend(PostControls, 'destructiveControls', function (items: ItemList<Mithril.Children>, post: Post) {\n if (items.has('approve')) {\n const flags = post.flags();\n\n if (flags && flags.some((flag) => flag?.type() === 'akismet')) {\n const approveItem = items.get('approve');\n if (approveItem && typeof approveItem === 'object' && 'children' in approveItem) {\n approveItem.children = app.translator.trans('flarum-akismet.forum.post.not_spam_button');\n }\n }\n }\n });\n\n override(CommentPost.prototype, 'flagReason', function (original, flag) {\n if (flag.type() === 'akismet') {\n return app.translator.trans('flarum-akismet.forum.post.akismet_flagged_text');\n }\n\n return original(flag);\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","extend","PostControls","items","post","has","flags","some","flag","type","approveItem","children","override","CommentPost","original"],"sourceRoot":""}
{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,yB,aCSxDC,IAAAA,aAAAA,IAAqB,kBAAkB,YACrCC,EAAAA,EAAAA,QAAOC,IAAc,uBAAuB,SAAUC,EAAmCC,GACvF,GAAID,EAAME,IAAI,WAAY,CACxB,IAAMC,EAAQF,EAAKE,QAEnB,GAAIA,GAASA,EAAMC,MAAK,SAACC,GAAI,MAAsB,aAAb,MAAJA,OAAI,EAAJA,EAAMC,OAAoB,IAAG,CAC7D,IAAMC,EAAcP,EAAMf,IAAI,WAC1BsB,GAAsC,iBAAhBA,GAA4B,aAAcA,IAClEA,EAAYC,SAAWX,IAAAA,WAAAA,MAAqB,6CAEhD,CACF,CACF,KAEAY,EAAAA,EAAAA,UAASC,IAAAA,UAAyB,cAAc,SAAUC,EAAUN,GAClE,MAAoB,YAAhBA,EAAKC,OACAT,IAAAA,WAAAA,MAAqB,kDAGvBc,EAASN,EAClB,GACF,G","sources":["webpack://@flarum/akismet/webpack/bootstrap","webpack://@flarum/akismet/webpack/runtime/compat get default export","webpack://@flarum/akismet/webpack/runtime/define property getters","webpack://@flarum/akismet/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/akismet/webpack/runtime/make namespace object","webpack://@flarum/akismet/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/akismet/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/akismet/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@flarum/akismet/external root \"flarum.core.compat['forum/components/Post']\"","webpack://@flarum/akismet/./src/forum/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Post'];","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport type Post from 'flarum/common/models/Post';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport PostComponent from 'flarum/forum/components/Post';\nimport type Mithril from 'mithril';\n\napp.initializers.add('flarum-akismet', () => {\n extend(PostControls, 'destructiveControls', function (items: ItemList<Mithril.Children>, post: Post) {\n if (items.has('approve')) {\n const flags = post.flags();\n\n if (flags && flags.some((flag) => flag?.type() === 'akismet')) {\n const approveItem = items.get('approve');\n if (approveItem && typeof approveItem === 'object' && 'children' in approveItem) {\n approveItem.children = app.translator.trans('flarum-akismet.forum.post.not_spam_button');\n }\n }\n }\n });\n\n override(PostComponent.prototype, 'flagReason', function (original, flag) {\n if (flag.type() === 'akismet') {\n return app.translator.trans('flarum-akismet.forum.post.akismet_flagged_text');\n }\n\n return original(flag);\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","extend","PostControls","items","post","has","flags","some","flag","type","approveItem","children","override","PostComponent","original"],"sourceRoot":""}

View File

@@ -9,18 +9,18 @@
"analyze": "cross-env ANALYZER=true yarn run build",
"format": "prettier --write src",
"format-check": "prettier --check src",
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
"check-typings-coverage": "typescript-coverage-report",
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
"build-typings": "yarn run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && yarn run post-build-typings",
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'"
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'",
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
"check-typings-coverage": "typescript-coverage-report"
},
"devDependencies": {
"@flarum/prettier-config": "^1.0.0",
"flarum-tsconfig": "^1.0.2",
"prettier": "^2.5.1",
"flarum-webpack-config": "^2.0.0",
"webpack": "^5.65.0",
"webpack": "^5.76.0",
"webpack-cli": "^4.9.1",
"typescript": "^4.5.4",
"typescript-coverage-report": "^0.6.1"

View File

@@ -4,7 +4,7 @@ import type Post from 'flarum/common/models/Post';
import type ItemList from 'flarum/common/utils/ItemList';
import PostControls from 'flarum/forum/utils/PostControls';
import CommentPost from 'flarum/forum/components/CommentPost';
import PostComponent from 'flarum/forum/components/Post';
import type Mithril from 'mithril';
app.initializers.add('flarum-akismet', () => {
@@ -21,7 +21,7 @@ app.initializers.add('flarum-akismet', () => {
}
});
override(CommentPost.prototype, 'flagReason', function (original, flag) {
override(PostComponent.prototype, 'flagReason', function (original, flag) {
if (flag.type() === 'akismet') {
return app.translator.trans('flarum-akismet.forum.post.akismet_flagged_text');
}

View File

@@ -4,14 +4,18 @@
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
// and also tells your Typescript server to read core's global typings for
// access to `dayjs` and `$` in the global namespace.
"include": ["src/**/*", "../vendor/*/*/js/dist-typings/@types/**/*", "@types/**/*"],
"include": [
"src/**/*",
"../../../framework/core/js/dist-typings/@types/**/*",
"../../flags/js/dist-typings/@types/**/*",
"@types/**/*"
],
"compilerOptions": {
// This will output typings to `dist-typings`
"declarationDir": "./dist-typings",
"baseUrl": ".",
"paths": {
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"],
"flarum/flags/*": ["../vendor/flarum/flags/js/dist-typings/*"]
"flarum/*": ["../../../framework/core/js/dist-typings/*"],
"flarum/flags/*": ["../../flags/js/dist-typings/*"]
}
}
}

View File

@@ -50,7 +50,7 @@ class ValidatePost
->withContent($post->content)
->withAuthorName($post->user->username)
->withAuthorEmail($post->user->email)
->withType($post->number == 1 ? 'forum-post' : 'reply')
->withType($post->number === 1 ? 'forum-post' : 'reply')
->withIp($post->ip_address)
->withUserAgent($_SERVER['HTTP_USER_AGENT'])
->checkSpam();

View File

@@ -38,7 +38,7 @@ class AkismetProvider extends AbstractServiceProvider
$settings->get('flarum-akismet.api_key'),
$url->to('forum')->base(),
$app::VERSION,
$extensions->getExtension('flarum-akismet')->getVersion(),
$extensions->getExtension('flarum-akismet')->getVersion() ?? 'unknown',
$config->inDebugMode()
);
});

View File

@@ -1,19 +0,0 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
[*.{diff,md}]
trim_trailing_whitespace = false
[*.{php,xml,json}]
indent_size = 4

20
extensions/approval/.gitattributes vendored Normal file
View File

@@ -0,0 +1,20 @@
**/.gitattributes export-ignore
**/.gitignore export-ignore
**/.gitmodules export-ignore
**/.github export-ignore
**/.travis export-ignore
**/.travis.yml export-ignore
**/.editorconfig export-ignore
**/.styleci.yml export-ignore
**/phpunit.xml export-ignore
**/tests export-ignore
**/js/dist/**/* -diff
**/js/dist/**/* linguist-generated
**/js/dist-typings/**/* -diff
**/js/dist-typings/**/* linguist-generated
**/js/yarn.lock -diff
**/js/package-lock.json -diff
* text=auto eol=lf

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/approval",
"forum": "https://discuss.flarum.org"
},
@@ -19,8 +19,8 @@
}
],
"require": {
"flarum/core": "^1.3",
"flarum/flags": "^1.2"
"flarum/core": "^1.8",
"flarum/flags": "^1.7"
},
"autoload": {
"psr-4": {
@@ -52,7 +52,7 @@
"prettier": true,
"typescript": false,
"bundlewatch": false,
"backendTesting": false,
"backendTesting": true,
"editorConfig": true,
"styleci": true
}
@@ -65,5 +65,28 @@
}
],
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"autoload-dev": {
"psr-4": {
"Flarum\\Approval\\Tests\\": "tests/"
}
},
"scripts": {
"test": [
"@test:unit",
"@test:integration"
],
"test:unit": "phpunit -c tests/phpunit.unit.xml",
"test:integration": "phpunit -c tests/phpunit.integration.xml",
"test:setup": "@php tests/integration/setup.php"
},
"scripts-descriptions": {
"test": "Runs all tests.",
"test:unit": "Runs all unit tests.",
"test:integration": "Runs all integration tests.",
"test:setup": "Sets up a database for use with integration tests. Execute this only once."
},
"require-dev": {
"flarum/testing": "^1.0.0"
}
}

View File

@@ -15,7 +15,6 @@ use Flarum\Approval\Listener;
use Flarum\Discussion\Discussion;
use Flarum\Extend;
use Flarum\Post\CommentPost;
use Flarum\Post\Event\Saving;
use Flarum\Post\Post;
use Flarum\Tags\Tag;
@@ -29,15 +28,17 @@ return [
// Discussions should be approved by default
(new Extend\Model(Discussion::class))
->default('is_approved', true),
->default('is_approved', true)
->cast('is_approved', 'bool'),
// Posts should be approved by default
(new Extend\Model(Post::class))
->default('is_approved', true),
->default('is_approved', true)
->cast('is_approved', 'bool'),
(new Extend\ApiSerializer(BasicDiscussionSerializer::class))
->attribute('isApproved', function ($serializer, Discussion $discussion) {
return (bool) $discussion->is_approved;
return $discussion->is_approved;
}),
(new Extend\ApiSerializer(PostSerializer::class))
@@ -50,9 +51,9 @@ return [
new Extend\Locales(__DIR__.'/locale'),
(new Extend\Event())
->listen(Saving::class, [Listener\ApproveContent::class, 'approvePost'])
->listen(Saving::class, [Listener\UnapproveNewContent::class, 'unapproveNewPosts'])
->listen(PostWasApproved::class, [Listener\ApproveContent::class, 'approveDiscussion']),
->listen(PostWasApproved::class, Listener\UpdateDiscussionAfterPostApproval::class)
->subscribe(Listener\ApproveContent::class)
->subscribe(Listener\UnapproveNewContent::class),
(new Extend\Policy())
->modelPolicy(Tag::class, Access\TagPolicy::class),

View File

@@ -1 +1 @@
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCGxDC,IAAAA,aAAAA,IAAqB,mBAAmB,YACtCC,EAAAA,EAAAA,QAAOD,IAAK,0BAA0B,SAAUE,EAAUC,GACrC,oCAAfA,GACFD,EAASE,KAAK,mBAEG,oCAAfD,GACFD,EAASE,KAAK,uBAIlBJ,IAAAA,cAAAA,IACO,mBACJK,mBACC,CACEC,KAAM,eACNC,MAAOP,IAAAA,WAAAA,MAAqB,8EAC5BG,WAAY,mCAEd,QACA,IAEDE,mBACC,CACEC,KAAM,eACNC,MAAOP,IAAAA,WAAAA,MAAqB,kEAC5BG,WAAY,mCAEd,QACA,IAEDE,mBACC,CACEC,KAAM,eACNC,MAAOP,IAAAA,WAAAA,MAAqB,yDAC5BG,WAAY,2BAEd,WACA,Q","sources":["webpack://@flarum/approval/webpack/bootstrap","webpack://@flarum/approval/webpack/runtime/compat get default export","webpack://@flarum/approval/webpack/runtime/define property getters","webpack://@flarum/approval/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/approval/webpack/runtime/make namespace object","webpack://@flarum/approval/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/approval/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/approval/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\n\napp.initializers.add('flarum-approval', () => {\n extend(app, 'getRequiredPermissions', function (required, permission) {\n if (permission === 'discussion.startWithoutApproval') {\n required.push('startDiscussion');\n }\n if (permission === 'discussion.replyWithoutApproval') {\n required.push('discussion.reply');\n }\n });\n\n app.extensionData\n .for('flarum-approval')\n .registerPermission(\n {\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.start_discussions_without_approval_label'),\n permission: 'discussion.startWithoutApproval',\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.reply_without_approval_label'),\n permission: 'discussion.replyWithoutApproval',\n },\n 'reply',\n 95\n )\n .registerPermission(\n {\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.approve_posts_label'),\n permission: 'discussion.approvePosts',\n },\n 'moderate',\n 65\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","extend","required","permission","push","registerPermission","icon","label"],"sourceRoot":""}
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCGxDC,IAAAA,aAAAA,IAAqB,mBAAmB,YACtCC,EAAAA,EAAAA,QAAOD,IAAK,0BAA0B,SAAUE,EAAUC,GACrC,oCAAfA,GACFD,EAASE,KAAK,mBAEG,oCAAfD,GACFD,EAASE,KAAK,mBAElB,IAEAJ,IAAAA,cAAAA,IACO,mBACJK,mBACC,CACEC,KAAM,eACNC,MAAOP,IAAAA,WAAAA,MAAqB,8EAC5BG,WAAY,mCAEd,QACA,IAEDE,mBACC,CACEC,KAAM,eACNC,MAAOP,IAAAA,WAAAA,MAAqB,kEAC5BG,WAAY,mCAEd,QACA,IAEDE,mBACC,CACEC,KAAM,eACNC,MAAOP,IAAAA,WAAAA,MAAqB,yDAC5BG,WAAY,2BAEd,WACA,GAEN,G","sources":["webpack://@flarum/approval/webpack/bootstrap","webpack://@flarum/approval/webpack/runtime/compat get default export","webpack://@flarum/approval/webpack/runtime/define property getters","webpack://@flarum/approval/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/approval/webpack/runtime/make namespace object","webpack://@flarum/approval/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/approval/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/approval/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\n\napp.initializers.add('flarum-approval', () => {\n extend(app, 'getRequiredPermissions', function (required, permission) {\n if (permission === 'discussion.startWithoutApproval') {\n required.push('startDiscussion');\n }\n if (permission === 'discussion.replyWithoutApproval') {\n required.push('discussion.reply');\n }\n });\n\n app.extensionData\n .for('flarum-approval')\n .registerPermission(\n {\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.start_discussions_without_approval_label'),\n permission: 'discussion.startWithoutApproval',\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.reply_without_approval_label'),\n permission: 'discussion.replyWithoutApproval',\n },\n 'reply',\n 95\n )\n .registerPermission(\n {\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.approve_posts_label'),\n permission: 'discussion.approvePosts',\n },\n 'moderate',\n 65\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","extend","required","permission","push","registerPermission","icon","label"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,7 @@
"devDependencies": {
"prettier": "^2.5.1",
"flarum-webpack-config": "^2.0.0",
"webpack": "^5.65.0",
"webpack": "^5.76.0",
"webpack-cli": "^4.9.1",
"@flarum/prettier-config": "^1.0.0"
},

View File

@@ -9,6 +9,7 @@
namespace Flarum\Approval\Access;
use Closure;
use Flarum\Discussion\Discussion;
use Flarum\User\User;
use Illuminate\Database\Eloquent\Builder;
@@ -39,14 +40,23 @@ class ScopePrivatePostVisibility
});
}
private function discussionWhereCanApprovePosts(User $actor)
/**
* Looks if the actor has permission to approve posts,
* within the discussion which the post is a part of.
*
* For example, the tags extension,
* turns the `approvePosts` ability into per tag basis.
*/
private function discussionWhereCanApprovePosts(User $actor): Closure
{
return function ($query) use ($actor) {
$query->selectRaw('1')
->from('discussions')
->whereColumn('discussions.id', 'posts.discussion_id')
->where(function ($query) use ($actor) {
Discussion::query()->setQuery($query)->whereVisibleTo($actor, 'approvePosts');
$query->whereRaw('1 != 1')->orWhere(function ($query) use ($actor) {
Discussion::query()->setQuery($query)->whereVisibleTo($actor, 'approvePosts');
});
});
};
}

View File

@@ -11,55 +11,51 @@ namespace Flarum\Approval\Listener;
use Flarum\Approval\Event\PostWasApproved;
use Flarum\Post\Event\Saving;
use Illuminate\Contracts\Events\Dispatcher;
class ApproveContent
{
/**
* @param Saving $event
* @param Dispatcher $events
*/
public static function approvePost(Saving $event)
public function subscribe(Dispatcher $events)
{
$events->listen(Saving::class, [$this, 'approvePost']);
}
public function approvePost(Saving $event)
{
$attributes = $event->data['attributes'];
$post = $event->post;
// Nothing to do if it is already approved.
if ($post->is_approved) {
return;
}
/*
* We approve a post in one of two cases:
* - The post was unapproved and the allowed action is approving it. We trigger an event.
* - The post was unapproved and the allowed actor is hiding or un-hiding it.
* We approve it silently if the action is unhiding.
*/
$approvingSilently = false;
if (isset($attributes['isApproved'])) {
$event->actor->assertCan('approve', $post);
$isApproved = (bool) $attributes['isApproved'];
} elseif (! empty($attributes['isHidden']) && $event->actor->can('approve', $post)) {
} elseif (isset($attributes['isHidden']) && $event->actor->can('approve', $post)) {
$isApproved = true;
$approvingSilently = $attributes['isHidden'];
}
if (! empty($isApproved)) {
$post->is_approved = true;
$post->raise(new PostWasApproved($post, $event->actor));
if (! $approvingSilently) {
$post->raise(new PostWasApproved($post, $event->actor));
}
}
}
/**
* @param PostWasApproved $event
*/
public static function approveDiscussion(PostWasApproved $event)
{
$post = $event->post;
$discussion = $post->discussion;
$user = $discussion->user;
$discussion->refreshCommentCount();
$discussion->refreshLastPost();
if ($post->number == 1) {
$discussion->is_approved = true;
$discussion->afterSave(function () use ($user) {
$user->refreshDiscussionCount();
});
}
$discussion->save();
$user->refreshCommentCount();
$user->save();
}
}

View File

@@ -9,17 +9,27 @@
namespace Flarum\Approval\Listener;
use Carbon\Carbon;
use Flarum\Discussion\Discussion;
use Flarum\Flags\Flag;
use Flarum\Post\CommentPost;
use Flarum\Post\Event\Saving;
use Illuminate\Contracts\Events\Dispatcher;
class UnapproveNewContent
{
/**
* @param Dispatcher $events
*/
public function subscribe(Dispatcher $events)
{
$events->listen(Saving::class, [$this, 'unapproveNewPosts']);
}
/**
* @param Saving $event
*/
public static function unapproveNewPosts(Saving $event)
public function unapproveNewPosts(Saving $event)
{
$post = $event->post;
@@ -46,7 +56,7 @@ class UnapproveNewContent
$flag->post_id = $post->id;
$flag->type = 'approval';
$flag->created_at = time();
$flag->created_at = Carbon::now();
$flag->save();
});

View File

@@ -0,0 +1,45 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Approval\Listener;
use Flarum\Approval\Event\PostWasApproved;
class UpdateDiscussionAfterPostApproval
{
public function handle(PostWasApproved $event)
{
$post = $event->post;
$discussion = $post->discussion;
$user = $discussion->user;
$discussion->refreshCommentCount();
$discussion->refreshLastPost();
if ($post->number === 1) {
$discussion->is_approved = true;
$discussion->afterSave(function () use ($user) {
$user->refreshDiscussionCount();
});
}
$discussion->save();
if ($discussion->user) {
$user->refreshCommentCount();
$user->save();
}
if ($post->user) {
$post->user->refreshCommentCount();
$post->user->save();
}
}
}

View File

View File

@@ -0,0 +1,75 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Approval\Tests\integration;
use Carbon\Carbon;
trait InteractsWithUnapprovedContent
{
protected function prepareUnapprovedDatabaseContent()
{
$this->prepareDatabase([
'users' => [
['id' => 1, 'username' => 'Muralf', 'email' => 'muralf@machine.local', 'is_email_confirmed' => 1],
$this->normalUser(),
['id' => 3, 'username' => 'acme', 'email' => 'acme@machine.local', 'is_email_confirmed' => 1],
['id' => 4, 'username' => 'luceos', 'email' => 'luceos@machine.local', 'is_email_confirmed' => 1],
],
'discussions' => [
['id' => 1, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 1, 'comment_count' => 1, 'is_approved' => 1, 'is_private' => 0],
['id' => 2, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 2, 'comment_count' => 1, 'is_approved' => 0, 'is_private' => 1],
['id' => 3, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 3, 'comment_count' => 1, 'is_approved' => 0, 'is_private' => 1],
['id' => 4, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 4, 'comment_count' => 1, 'is_approved' => 1, 'is_private' => 0],
['id' => 5, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 5, 'comment_count' => 1, 'is_approved' => 1, 'is_private' => 0],
['id' => 6, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 6, 'comment_count' => 1, 'is_approved' => 0, 'is_private' => 1],
['id' => 7, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 7, 'comment_count' => 1, 'is_approved' => 1, 'is_private' => 0],
],
'posts' => [
['id' => 1, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
['id' => 2, 'discussion_id' => 2, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
['id' => 3, 'discussion_id' => 3, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
['id' => 4, 'discussion_id' => 4, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
['id' => 5, 'discussion_id' => 5, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
['id' => 6, 'discussion_id' => 6, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
['id' => 7, 'discussion_id' => 7, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
['id' => 8, 'discussion_id' => 7, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 2],
['id' => 9, 'discussion_id' => 7, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 1, 'is_approved' => 0, 'number' => 3],
['id' => 10, 'discussion_id' => 7, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 4],
['id' => 11, 'discussion_id' => 7, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 1, 'is_approved' => 0, 'number' => 5],
],
'groups' => [
['id' => 4, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0]
],
'group_user' => [
['user_id' => 3, 'group_id' => 4]
],
'group_permission' => [
['permission' => 'discussion.approvePosts', 'group_id' => 4]
]
]);
}
/**
* null: Guest, 2: Normal User.
*/
public function unallowedUsers(): array
{
return [[null], [2]];
}
/**
* 1: Admin, 3: Permission Given, 4: Discussions Author.
*/
public function allowedUsers(): array
{
return [[1], [3], [4]];
}
}

View File

@@ -0,0 +1,62 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Approval\Tests\integration\api;
use Flarum\Approval\Tests\integration\InteractsWithUnapprovedContent;
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Illuminate\Support\Arr;
class ListDiscussionsTest extends TestCase
{
use RetrievesAuthorizedUsers;
use InteractsWithUnapprovedContent;
protected function setUp(): void
{
parent::setUp();
$this->extension('flarum-approval');
$this->prepareUnapprovedDatabaseContent();
}
/**
* @dataProvider unallowedUsers
* @test
*/
public function can_only_see_approved_if_not_allowed_to_approve(?int $authenticatedAs)
{
$response = $this->send(
$this->request('GET', '/api/discussions', compact('authenticatedAs'))
);
$body = json_decode($response->getBody()->getContents(), true);
$this->assertEquals(200, $response->getStatusCode());
$this->assertEqualsCanonicalizing([1, 4, 5, 7], Arr::pluck($body['data'], 'id'));
}
/**
* @dataProvider allowedUsers
* @test
*/
public function can_see_unapproved_if_allowed_to_approve(int $authenticatedAs)
{
$response = $this->send(
$this->request('GET', '/api/discussions', compact('authenticatedAs'))
);
$body = json_decode($response->getBody()->getContents(), true);
$this->assertEquals(200, $response->getStatusCode());
$this->assertEqualsCanonicalizing([1, 2, 3, 4, 5, 6, 7], Arr::pluck($body['data'], 'id'));
}
}

View File

@@ -0,0 +1,74 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Approval\Tests\integration\api;
use Flarum\Approval\Tests\integration\InteractsWithUnapprovedContent;
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Illuminate\Support\Arr;
class ListPostsTest extends TestCase
{
use RetrievesAuthorizedUsers;
use InteractsWithUnapprovedContent;
protected function setUp(): void
{
parent::setUp();
$this->extension('flarum-approval');
$this->prepareUnapprovedDatabaseContent();
}
/**
* @dataProvider unallowedUsers
* @test
*/
public function can_only_see_approved_if_not_allowed_to_approve(?int $authenticatedAs)
{
$response = $this->send(
$this
->request('GET', '/api/posts', compact('authenticatedAs'))
->withQueryParams([
'filter' => [
'discussion' => 7
]
])
);
$body = json_decode($response->getBody()->getContents(), true);
$this->assertEquals(200, $response->getStatusCode());
$this->assertEqualsCanonicalizing([7, 8, 10], Arr::pluck($body['data'], 'id'));
}
/**
* @dataProvider allowedUsers
* @test
*/
public function can_see_unapproved_if_allowed_to_approve(int $authenticatedAs)
{
$response = $this->send(
$this
->request('GET', '/api/posts', compact('authenticatedAs'))
->withQueryParams([
'filter' => [
'discussion' => 7
]
])
);
$body = json_decode($response->getBody()->getContents(), true);
$this->assertEquals(200, $response->getStatusCode());
$this->assertEqualsCanonicalizing([7, 8, 9, 10, 11], Arr::pluck($body['data'], 'id'));
}
}

View File

@@ -0,0 +1,16 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Testing\integration\Setup\SetupScript;
require __DIR__.'/../../vendor/autoload.php';
$setup = new SetupScript();
$setup->run();

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="true"
stopOnFailure="false"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">../src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Flarum Integration Tests">
<directory suffix="Test.php">./integration</directory>
<exclude>./integration/tmp</exclude>
</testsuite>
</testsuites>
</phpunit>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">../src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Flarum Unit Tests">
<directory suffix="Test.php">./unit</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="\Mockery\Adapter\Phpunit\TestListener" />
</listeners>
</phpunit>

View File

20
extensions/bbcode/.gitattributes vendored Normal file
View File

@@ -0,0 +1,20 @@
**/.gitattributes export-ignore
**/.gitignore export-ignore
**/.gitmodules export-ignore
**/.github export-ignore
**/.travis export-ignore
**/.travis.yml export-ignore
**/.editorconfig export-ignore
**/.styleci.yml export-ignore
**/phpunit.xml export-ignore
**/tests export-ignore
**/js/dist/**/* -diff
**/js/dist/**/* linguist-generated
**/js/dist-typings/**/* -diff
**/js/dist-typings/**/* linguist-generated
**/js/yarn.lock -diff
**/js/package-lock.json -diff
* text=auto eol=lf

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/bbcode",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,12 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.8"
},
"autoload": {
"psr-4": {
"Flarum\\BBCode\\": "src"
}
},
"extra": {
"branch-alias": {

View File

@@ -7,24 +7,14 @@
* LICENSE file that was distributed with this source code.
*/
use Flarum\Extend;
use s9e\TextFormatter\Configurator;
namespace Flarum\BBCode;
return (new Extend\Formatter)
->configure(function (Configurator $config) {
$config->BBCodes->addFromRepository('B');
$config->BBCodes->addFromRepository('I');
$config->BBCodes->addFromRepository('U');
$config->BBCodes->addFromRepository('S');
$config->BBCodes->addFromRepository('URL');
$config->BBCodes->addFromRepository('IMG');
$config->BBCodes->addFromRepository('EMAIL');
$config->BBCodes->addFromRepository('CODE');
$config->BBCodes->addFromRepository('QUOTE');
$config->BBCodes->addFromRepository('LIST');
$config->BBCodes->addFromRepository('DEL');
$config->BBCodes->addFromRepository('COLOR');
$config->BBCodes->addFromRepository('CENTER');
$config->BBCodes->addFromRepository('SIZE');
$config->BBCodes->addFromRepository('*');
});
use Flarum\Extend;
return [
new Extend\Locales(__DIR__.'/locale'),
(new Extend\Formatter)
->render(Render::class)
->configure(Configure::class),
];

View File

@@ -0,0 +1,10 @@
flarum-bbcode:
##
# UNIQUE KEYS - The following keys are used in only one location each.
##
# Translations in this namespace are used by the forum user interface.
forum:
quote:
wrote: wrote

View File

@@ -0,0 +1,59 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\BBCode;
use s9e\TextFormatter\Configurator;
class Configure
{
public function __invoke(Configurator $config)
{
$this->addTagsFromRepositories($config);
$this->adaptHighlightJs($config);
}
protected function addTagsFromRepositories(Configurator $config): void
{
$config->BBCodes->addFromRepository('B');
$config->BBCodes->addFromRepository('I');
$config->BBCodes->addFromRepository('U');
$config->BBCodes->addFromRepository('S');
$config->BBCodes->addFromRepository('URL');
$config->BBCodes->addFromRepository('IMG');
$config->BBCodes->addFromRepository('EMAIL');
$config->BBCodes->addFromRepository('CODE');
$config->BBCodes->addFromRepository('QUOTE', 'default', [
'authorStr' => '<xsl:value-of select="@author"/> <xsl:value-of select="$L_WROTE"/>'
]);
$config->BBCodes->addFromRepository('LIST');
$config->BBCodes->addFromRepository('DEL');
$config->BBCodes->addFromRepository('COLOR');
$config->BBCodes->addFromRepository('CENTER');
$config->BBCodes->addFromRepository('SIZE');
$config->BBCodes->addFromRepository('*');
}
/**
* Fix for highlight JS not working after changing post content.
*
* @link https://github.com/flarum/framework/issues/3794
*/
protected function adaptHighlightJs(Configurator $config): void
{
$codeTag = $config->tags->get('CODE');
$script = '
<script>
if(window.hljsLoader && !document.currentScript.parentNode.hasAttribute(\'data-s9e-livepreview-onupdate\')) {
window.hljsLoader.highlightBlocks(document.currentScript.parentNode);
}
</script>';
$codeTag->template = str_replace('</pre>', $script.'</pre>', $codeTag->template);
}
}

View File

@@ -0,0 +1,33 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\BBCode;
use s9e\TextFormatter\Renderer;
use Symfony\Contracts\Translation\TranslatorInterface;
class Render
{
/**
* @var TranslatorInterface
*/
protected $translator;
public function __construct(TranslatorInterface $translator)
{
$this->translator = $translator;
}
public function __invoke(Renderer $renderer, $context, string $xml): string
{
$renderer->setParameter('L_WROTE', $this->translator->trans('flarum-bbcode.forum.quote.wrote'));
return $xml;
}
}

View File

@@ -1,19 +0,0 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
[*.{diff,md}]
trim_trailing_whitespace = false
[*.{php,xml,json}]
indent_size = 4

20
extensions/embed/.gitattributes vendored Normal file
View File

@@ -0,0 +1,20 @@
**/.gitattributes export-ignore
**/.gitignore export-ignore
**/.gitmodules export-ignore
**/.github export-ignore
**/.travis export-ignore
**/.travis.yml export-ignore
**/.editorconfig export-ignore
**/.styleci.yml export-ignore
**/phpunit.xml export-ignore
**/tests export-ignore
**/js/dist/**/* -diff
**/js/dist/**/* linguist-generated
**/js/dist-typings/**/* -diff
**/js/dist-typings/**/* linguist-generated
**/js/yarn.lock -diff
**/js/package-lock.json -diff
* text=auto eol=lf

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/embed",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.8"
},
"autoload": {
"psr-4": {

File diff suppressed because one or more lines are too long

View File

@@ -9,7 +9,7 @@
"devDependencies": {
"prettier": "^2.5.1",
"flarum-webpack-config": "^2.0.0",
"webpack": "^5.65.0",
"webpack": "^5.76.0",
"webpack-cli": "^4.9.1",
"@flarum/prettier-config": "^1.0.0"
},

View File

@@ -1,19 +0,0 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
[*.{diff,md}]
trim_trailing_whitespace = false
[*.{php,xml,json}]
indent_size = 4

20
extensions/emoji/.gitattributes vendored Normal file
View File

@@ -0,0 +1,20 @@
**/.gitattributes export-ignore
**/.gitignore export-ignore
**/.gitmodules export-ignore
**/.github export-ignore
**/.travis export-ignore
**/.travis.yml export-ignore
**/.editorconfig export-ignore
**/.styleci.yml export-ignore
**/phpunit.xml export-ignore
**/tests export-ignore
**/js/dist/**/* -diff
**/js/dist/**/* linguist-generated
**/js/dist-typings/**/* -diff
**/js/dist-typings/**/* linguist-generated
**/js/yarn.lock -diff
**/js/package-lock.json -diff
* text=auto eol=lf

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/emoji",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.8"
},
"extra": {
"branch-alias": {

2
extensions/emoji/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -14,7 +14,7 @@
"prettier": "^2.5.1",
"typescript": "^4.5.4",
"typescript-coverage-report": "^0.6.1",
"webpack": "^5.65.0",
"webpack": "^5.76.0",
"webpack-cli": "^4.9.1"
},
"scripts": {
@@ -22,10 +22,6 @@
"build": "webpack --mode production",
"format": "prettier --write src",
"format-check": "prettier --check src",
"analyze": "cross-env ANALYZER=true yarn run build",
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
"build-typings": "npm run clean-typings && cp -r src/@types dist-typings/@types && tsc",
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
"check-typings-coverage": "typescript-coverage-report"
"analyze": "cross-env ANALYZER=true yarn run build"
}
}

View File

@@ -3,7 +3,7 @@ import emojiMap from 'simple-emoji-map';
import { extend } from 'flarum/common/extend';
import TextEditor from 'flarum/common/components/TextEditor';
import TextEditorButton from 'flarum/common/components/TextEditorButton';
import KeyboardNavigatable from 'flarum/forum/utils/KeyboardNavigatable';
import KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';
import AutocompleteDropdown from './fragments/AutocompleteDropdown';
import getEmojiIconCode from './helpers/getEmojiIconCode';
@@ -80,7 +80,7 @@ export default function addComposerAutocomplete() {
dropdown.setIndex($(this).parent().index() - 1);
}}
>
<img alt={emoji} class="emoji" draggable="false" loading="lazy" src={`${cdn}72x72/${code}.png`} />
<img alt={emoji} className="emoji" draggable="false" loading="lazy" src={`${cdn}72x72/${code}.png`} />
{name}
</button>
);

View File

@@ -1,19 +0,0 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
[*.{diff,md}]
trim_trailing_whitespace = false
[*.{php,xml,json}]
indent_size = 4

20
extensions/flags/.gitattributes vendored Normal file
View File

@@ -0,0 +1,20 @@
**/.gitattributes export-ignore
**/.gitignore export-ignore
**/.gitmodules export-ignore
**/.github export-ignore
**/.travis export-ignore
**/.travis.yml export-ignore
**/.editorconfig export-ignore
**/.styleci.yml export-ignore
**/phpunit.xml export-ignore
**/tests export-ignore
**/js/dist/**/* -diff
**/js/dist/**/* linguist-generated
**/js/dist-typings/**/* -diff
**/js/dist-typings/**/* linguist-generated
**/js/yarn.lock -diff
**/js/package-lock.json -diff
* text=auto eol=lf

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/flags",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.8"
},
"autoload": {
"psr-4": {

View File

@@ -46,7 +46,7 @@ return [
->delete('/posts/{id}/flags', 'flags.delete', DeleteFlagsController::class),
(new Extend\Model(User::class))
->dateAttribute('read_flags_at'),
->cast('read_flags_at', 'datetime'),
(new Extend\Model(Post::class))
->hasMany('flags', Flag::class, 'post_id'),

View File

@@ -1,4 +1,4 @@
declare var _default: {
declare const _default: {
'flags/addFlagsToPosts': typeof addFlagsToPosts;
'flags/addFlagControl': typeof addFlagControl;
'flags/addFlagsDropdown': typeof addFlagsDropdown;

View File

@@ -1,5 +1,7 @@
export default class FlagList {
export default class FlagList extends Component<import("flarum/common/Component").ComponentAttrs, undefined> {
constructor();
oninit(vnode: any): void;
state: any;
view(): JSX.Element;
}
import Component from "flarum/common/Component";

View File

@@ -1,12 +1,15 @@
export default class FlagPostModal {
/// <reference types="flarum/@types/translator-icu-rich" />
export default class FlagPostModal extends Modal<import("flarum/common/components/Modal").IInternalModalAttrs, undefined> {
constructor();
oninit(vnode: any): void;
success: boolean | undefined;
reason: any;
reasonDetail: any;
className(): string;
title(): any;
reason: Stream<string> | undefined;
reasonDetail: Stream<string> | undefined;
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
content(): JSX.Element;
flagReasons(): any;
flagReasons(): ItemList<any>;
onsubmit(e: any): void;
loading: boolean | undefined;
}
import Modal from "flarum/common/components/Modal";
import Stream from "flarum/common/utils/Stream";
import ItemList from "flarum/common/utils/ItemList";

View File

@@ -1,7 +1,7 @@
export default class FlagsDropdown {
export default class FlagsDropdown extends NotificationsDropdown<import("flarum/common/components/Dropdown").IDropdownAttrs> {
static initAttrs(attrs: any): void;
getMenu(): JSX.Element;
goToRoute(): void;
constructor();
getUnreadCount(): any;
getNewCount(): any;
getNewCount(): unknown;
}
import NotificationsDropdown from "flarum/forum/components/NotificationsDropdown";

2
extensions/flags/js/dist-typings/forum/extend.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
declare const _default: (import("flarum/common/extenders/Model").default | import("flarum/common/extenders/Routes").default | import("flarum/common/extenders/Store").default)[];
export default _default;

View File

@@ -1 +1 @@
export {};
export { default as extend } from './extend';

View File

@@ -1,9 +1,11 @@
import Model from 'flarum/common/Model';
import type Post from 'flarum/common/models/Post';
import type User from 'flarum/common/models/User';
export default class Flag extends Model {
type(): any;
reason(): any;
reasonDetail(): any;
createdAt(): any;
post(): any;
user(): any;
type(): string;
reason(): string | null;
reasonDetail(): string | null;
createdAt(): Date | null | undefined;
post(): false | Post;
user(): false | User | null;
}

View File

@@ -1 +1 @@
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,cAAAA,IACO,gBACJC,gBACC,CACEC,QAAS,8BACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,qDAE9B,IAEDC,gBAAgB,CACfC,QAAS,4BACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,sDAE7BK,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,WACA,IAGDF,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,QACA,Q","sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/webpack/runtime/compat get default export","webpack://@flarum/flags/webpack/runtime/define property getters","webpack://@flarum/flags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/flags/webpack/runtime/make namespace object","webpack://@flarum/flags/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/flags/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-flags', () => {\n app.extensionData\n .for('flarum-flags')\n .registerSetting(\n {\n setting: 'flarum-flags.guidelines_url',\n type: 'text',\n label: app.translator.trans('flarum-flags.admin.settings.guidelines_url_label'),\n },\n 15\n )\n .registerSetting({\n setting: 'flarum-flags.can_flag_own',\n type: 'boolean',\n label: app.translator.trans('flarum-flags.admin.settings.flag_own_posts_label'),\n })\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'),\n permission: 'discussion.viewFlags',\n },\n 'moderate',\n 65\n )\n\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.flag_posts_label'),\n permission: 'discussion.flagPosts',\n },\n 'reply',\n 65\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","registerPermission","icon","permission"],"sourceRoot":""}
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,cAAAA,IACO,gBACJC,gBACC,CACEC,QAAS,8BACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,qDAE9B,IAEDC,gBAAgB,CACfC,QAAS,4BACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,sDAE7BK,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,WACA,IAGDF,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,QACA,GAEN,G","sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/webpack/runtime/compat get default export","webpack://@flarum/flags/webpack/runtime/define property getters","webpack://@flarum/flags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/flags/webpack/runtime/make namespace object","webpack://@flarum/flags/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/flags/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-flags', () => {\n app.extensionData\n .for('flarum-flags')\n .registerSetting(\n {\n setting: 'flarum-flags.guidelines_url',\n type: 'text',\n label: app.translator.trans('flarum-flags.admin.settings.guidelines_url_label'),\n },\n 15\n )\n .registerSetting({\n setting: 'flarum-flags.can_flag_own',\n type: 'boolean',\n label: app.translator.trans('flarum-flags.admin.settings.flag_own_posts_label'),\n })\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'),\n permission: 'discussion.viewFlags',\n },\n 'moderate',\n 65\n )\n\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.flag_posts_label'),\n permission: 'discussion.flagPosts',\n },\n 'reply',\n 65\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","registerPermission","icon","permission"],"sourceRoot":""}

2
extensions/flags/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More