Compare commits

..

438 Commits
v1.8.2 ... 2.x

Author SHA1 Message Date
Simon
f19007f424
Merge commit from fork
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2025-04-18 09:45:41 +01:00
Robert Korulczyk
15112c2f40
Sanitize page in Tag (#4170) 2025-04-18 09:45:21 +01:00
flarum-bot
00ef0dd9d0 Bundled output for commit cae706a638944428cd248e8618e5e9a38a0c7347
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-04-18 08:40:38 +00:00
Sami Mazouz
cae706a638
feat: advanced admin registry extenders (#4209)
* feat: advanced admin registry extenders
* fix: admin extender execution order
2025-04-18 09:38:00 +01:00
flarum-bot
2be1932e54 Bundled output for commit 2339c23aae08b1d963c841b9fcb7012c65a60578
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-04-18 08:14:42 +00:00
Davide Iadeluca
2339c23aae
refactor(core): improve extensibility of AppearancePage (#4200) 2025-04-18 09:12:10 +01:00
StyleCI Bot
2b08c30a22
Apply fixes from StyleCI
Some checks failed
Backend Tests / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
2025-04-11 09:07:58 +00:00
Sami Mazouz
fa88731fe1
chore: increase composer job timeout 2025-04-11 10:07:17 +01:00
Daniël Klabbers
65d8c16580
fix: issue with smtp non-tls connections (#4203)
Some checks failed
Static Code Analysis / run (push) Has been cancelled
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
2025-02-27 18:34:31 +01:00
flarum-bot
1a206ff658 Bundled output for commit 0ca99dcba5f116e499072b3fcb9c8564a80b5a5c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-22 09:53:35 +00:00
Davide Iadeluca
0ca99dcba5
feat: improve extensibility of WelcomeHero (#4199) 2025-02-22 10:50:56 +01:00
Davide Iadeluca
12fc3aeec2
feat(tags): improve extensibility of TagHero (#4198) 2025-02-22 10:49:44 +01:00
flarum-bot
b07b310fdf Bundled output for commit e2221b5f748d1e27cad7216ca2e212fc78227083
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-21 08:48:16 +00:00
Davide Iadeluca
e2221b5f74
feat: allow extending PostPreview content (#4197) 2025-02-21 09:45:36 +01:00
flarum-bot
f54a5200cf Bundled output for commit 236a8e9e0ac84bc3de90009dbb7ca745bb2a1280
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-21 08:43:28 +00:00
Davide Iadeluca
236a8e9e0a
feat: improve extensibility of PostMeta component (#4196)
* refactor(core): create new method for selecting permalink

* refactor(core): improve extensibility of `PostMeta`

* chore: dummy commit
2025-02-21 09:40:44 +01:00
Davide Iadeluca
7feab89cca
fix(a11y): change starting position of aria-posinset (#4191) 2025-02-21 09:38:06 +01:00
flarum-bot
bbc4b6dd13 Bundled output for commit 561e22784a547c8aa92120e0972a9cc97ac21645
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-14 17:55:17 +00:00
Sami Mazouz
561e22784a
feat(messages): messages page extensible content 2025-02-14 18:49:57 +01:00
flarum-bot
469127ccf3 Bundled output for commit 80c116b3862d35c880ccfcf528a410792f1ae64a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-14 10:04:16 +00:00
Sami Mazouz
80c116b386
fix(regression): broken styling 2025-02-14 10:59:28 +01:00
flarum-bot
b74c7f9746 Bundled output for commit b7bab2811d86a25f60f964e42be2b722578b52e0
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-14 09:49:16 +00:00
Davide Iadeluca
b7bab2811d
feat: actions dropdown in admin user list (#4188) 2025-02-14 10:46:40 +01:00
flarum-bot
3cbc7f4de1 Bundled output for commit 1b9ff2b6fa90a9c991b6e1d9ab5bd959802bd099
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-14 09:02:41 +00:00
Sami Mazouz
1b9ff2b6fa
fix(phpstan): incompatibility with recent updates 2025-02-14 09:59:54 +01:00
flarum-bot
d02a924bb8 Bundled output for commit 973f4f6f6ba8574b9d56674df94a02f060464ca4
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-14 08:35:40 +00:00
Sami Mazouz
973f4f6f6b
chore: render after first post items once 2025-02-14 09:32:53 +01:00
flarum-bot
9977d491cf Bundled output for commit 9758592daae3710c44aa0d754e2d4d2d666cc5d3
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-14 08:29:43 +00:00
Davide Iadeluca
9758592daa
feat: make it easier to add content after the first post (#4186) 2025-02-14 09:27:10 +01:00
flarum-bot
60feaa0184 Bundled output for commit 5557bf82d34cdf4dec9deb14b5fbd94ff2a01b83
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-14 08:27:00 +00:00
Sami Mazouz
5557bf82d3
chore: minor changes 2025-02-14 09:24:13 +01:00
flarum-bot
090fd4dea5 Bundled output for commit ecb23a64fcde5d77970c69b5654ca72eb3335f46
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-14 08:21:40 +00:00
Davide Iadeluca
ecb23a64fc
feat: reusable component for showing IP address (#4187) 2025-02-14 09:19:01 +01:00
flarum-bot
7ba768bf68 Bundled output for commit f13dc058667540ce14f58eb25eef151ba14f524b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-11 19:28:15 +00:00
Davide Iadeluca
f13dc05866
fix: change condition when unread label is shown in Scrubber (#4185) 2025-02-11 20:25:26 +01:00
Davide Iadeluca
a34a5d4d62
fix: resolve a11y warnings in Admin Frontend (#4184) 2025-02-11 20:24:44 +01:00
Davide Iadeluca
79e969778e
fix: return empty object if selected mail driver is unavailable (#4183) 2025-02-11 20:23:50 +01:00
Davide Iadeluca
41d62b8c82
feat: improve extensibility of IndexPage (#4182) 2025-02-11 20:23:02 +01:00
Davide Iadeluca
5dc94bf4e8
feat: allow labels of PostStreamScrubber to be customized (#4181) 2025-02-11 20:21:18 +01:00
flarum-bot
fdaf09752c Bundled output for commit 975c2c936f5265be28e8d76e4057c30200c6b2b9
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-08 18:06:58 +00:00
Sami Mazouz
975c2c936f
feat(pm): delete own messages (#4180) 2025-02-08 19:04:20 +01:00
Sami Mazouz
ce5feca140
fix(em): skip incompatible extension updates (#4177) 2025-02-08 19:01:09 +01:00
Sami Mazouz
55cd0850c7
perf: optimize querying post index (#4178) 2025-02-08 18:35:44 +01:00
flarum-bot
6b31a47f05 Bundled output for commit db1e36d545aa0d483620b52ababd79ef1b2aa27c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-02-08 17:33:04 +00:00
Sami Mazouz
db1e36d545
feat(pm): messages anchor link (#4175) 2025-02-08 18:30:35 +01:00
Davide Iadeluca
333bbb11e2
fix(webpack): chunk module path checking fails with dotted directories (#4179)
Resolves issues when the path contains unexpected periods
2025-02-08 17:50:12 +01:00
flarum-bot
863d6526df Bundled output for commit 97e56af2cd8e97e4ef10235d3e584d0def2afffc
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-31 12:28:10 +00:00
Sami Mazouz
97e56af2cd
fix: visual bugs 2025-01-31 13:25:26 +01:00
flarum-bot
21da7758af Bundled output for commit 89ff98444640b13ffbd79faf91f1363dafbc5d6b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-31 12:00:13 +00:00
Sami Mazouz
89ff984446
fix: messages inconsistencies (#4174)
* fix: messages inconsistencies

* fix

* chore: message at the page

* fix: permission grid styling broken

* fix
2025-01-31 12:57:45 +01:00
flarum-bot
7136ad01d5 Bundled output for commit 875fd241b7da7b82083b43d123fc64ec8e1125c9
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-31 08:20:25 +00:00
Sami Mazouz
875fd241b7
fix: messages UI/UX improvement (#4173) 2025-01-31 09:17:51 +01:00
Davide Iadeluca
962d95746d
feat: make search debounce time extensible (#4172) 2025-01-31 09:17:21 +01:00
Sami Mazouz
0b995b96ef
fix: suspended_until serialized as date instead of datetime (#4169) 2025-01-31 09:15:46 +01:00
Sami Mazouz
76d8ea505e
fix: sendmail driver fails (#4168) 2025-01-31 09:12:41 +01:00
Sami Mazouz
cf7ef48906
fix: prevent users from seeing their own flags (#4167) 2025-01-31 09:12:12 +01:00
flarum-bot
670aa2e236 Bundled output for commit ac6133a768ef94c8ea8827569a5dfaf11f437a33
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-17 08:49:10 +00:00
Sami Mazouz
ac6133a768
chore: v2.0.0-beta.2 2025-01-17 09:44:27 +01:00
flarum-bot
48ec73f86e Bundled output for commit 00426c85e38efc91554af33644b088e72b3b3c1b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-12 12:06:04 +00:00
Sami Mazouz
00426c85e3
chore: extensibility improvements 2025-01-12 13:02:07 +01:00
Sami Mazouz
33121ed1cc
fix: mistakenly removed code
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2025-01-11 10:09:46 +01:00
flarum-bot
b2f6b4cf88 Bundled output for commit 1cd644d27feb4eeea5cbaedd009a3af2643af396
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-10 18:51:42 +00:00
Sami Mazouz
1cd644d27f
fix: conditional renders 0 2025-01-10 19:48:56 +01:00
Sami Mazouz
68faca4d5f
chore: flarum-webpack-config 3.0.1 2025-01-10 16:55:00 +01:00
flarum-bot
603140a0b1 Bundled output for commit 36d079560776cba31c11e2abea0686180f132713
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-10 15:51:01 +00:00
Sami Mazouz
36d0795607
fix: custom styles from 1.x can crash the app (#4159) 2025-01-10 16:48:24 +01:00
Sami Mazouz
a7d584f8e1
fix(webpack): produces incorrect ext namespace 2025-01-10 16:47:50 +01:00
Sami Mazouz
958dec5944
fix: invisible dropdown text when header is colored
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2025-01-10 09:58:07 +01:00
flarum-bot
55aa8a7723 Bundled output for commit e3943eebba4a9b8120d1c22ef5ca2280dda52fe8
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-05 11:02:16 +00:00
Sami Mazouz
e3943eebba
fix: discussion page renders before loading is finished (#4158) 2025-01-05 11:59:45 +01:00
Sami Mazouz
101ff98822
fix: select input cuts off (#4157)
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2025-01-05 10:36:26 +01:00
flarum-bot
6a9ce6f8e8 Bundled output for commit 23666660917628699ab2d33f877fdba938b08a24
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-05 09:34:10 +00:00
Sami Mazouz
2366666091
fix: discussion posts not always properly loaded (#4156) 2025-01-05 10:31:42 +01:00
flarum-bot
8c9a772635 Bundled output for commit 9d611d1ee2aad142461ed1bd1d17a6455fb14b73
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-04 10:08:20 +00:00
Sami Mazouz
9d611d1ee2
fix(em): incorrect extension compatibility check (#4155) 2025-01-04 11:05:38 +01:00
Sami Mazouz
e73ffee9e7
fix: fixed side nav missing top spacing (#4147) 2025-01-04 10:32:25 +01:00
flarum-bot
1b18f57353 Bundled output for commit 9ce03c6ec8cf44107c593db1bd3a33941e33541e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-03 16:20:34 +00:00
Sami Mazouz
9ce03c6ec8
fix: use correct human time format key (#4154) 2025-01-03 17:18:02 +01:00
Sami Mazouz
1bdfb66f6c
fix: tag selection icon alignment (#4153) 2025-01-03 17:06:44 +01:00
Sami Mazouz
a3461a8020
fix: bad modal alert text alignment (#4152) 2025-01-03 16:29:53 +01:00
flarum-bot
da8ebe439b Bundled output for commit 5d26485c04099ab207648736fc3bf21318eef733
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-03 14:19:07 +00:00
Sami Mazouz
5d26485c04
fix: code split fails with common module (#4151) 2025-01-03 15:16:37 +01:00
flarum-bot
38e1b49cc1 Bundled output for commit 0c40e19cdf6a313454c986c67e15363b6363f36b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-03 13:20:33 +00:00
Sami Mazouz
0c40e19cdf
fix: unexpected subscription breaks rendering (#4150) 2025-01-03 14:17:45 +01:00
flarum-bot
6d1e90c969 Bundled output for commit 3294941226da644f52fd8baa313b8a872e65b6a2
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-03 12:56:32 +00:00
Sami Mazouz
3294941226
fix: composer no longer autofocusing (#4149) 2025-01-03 13:53:59 +01:00
flarum-bot
87fa4a32dd Bundled output for commit e08a987842bb4330fa563007393bcba06038f585
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-01-03 10:44:03 +00:00
Sami Mazouz
e08a987842
fix: lazy module import always returns default module (#4148) 2025-01-03 11:41:28 +01:00
Sami Mazouz
9fe17b3c24
perf(mentions): only access related mentions if loaded
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-12-13 13:06:36 +01:00
Sami Mazouz
4dce4d40a3
fix(regression): phpstan errors 2024-12-13 13:06:08 +01:00
Sami Mazouz
a81d13e26c
fix: beta.1 early bugs
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-12-12 21:27:57 +01:00
Sami Mazouz
382991648c
chore: update changelog
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-12-08 15:18:49 +01:00
Sami Mazouz
b44d5175b6
fix(regression): cannot pass props
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-12-08 11:07:58 +01:00
flarum-bot
d9e79608fb Bundled output for commit 5d281b9471f235a251e416862a30d28243ed6854
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-12-07 20:07:49 +00:00
Sami Mazouz
5d281b9471
chore: graceful failure from extend/override errors (#4134) 2024-12-07 21:05:10 +01:00
Sami Mazouz
27087cc713
test: use new jest config version
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-12-07 09:54:35 +01:00
Sami Mazouz
d5f944023c
chore: prepare 2.0.0-beta.1 2024-12-07 09:50:31 +01:00
Sami Mazouz
153fb8684e
chore: change jest config version 2024-12-07 09:42:15 +01:00
Sami Mazouz
eca21fa1bf
chore(testing): add monorepo testing bin
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-12-06 20:23:34 +01:00
Sami Mazouz
c835bdb59a
chore(testing): use sqlite by default 2024-12-06 20:23:17 +01:00
Sami Mazouz
570580dcf0
fix: improve the flarum validator (#4133)
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-12-06 10:23:45 +01:00
Sami Mazouz
e43449c32d
chore: prepare 2.x for subsplitting 2024-12-06 09:20:55 +01:00
flarum-bot
bc695e9865 Bundled output for commit 6d88c9978261b6ec6b53ec12d8ce00eeebea4567
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-12-04 20:49:32 +00:00
Daniël Klabbers
6d88c99782
fix: typo in Dropdown.ts 2024-12-04 21:47:02 +01:00
Sami Mazouz
097a54289f
feat: separate mariadb driver (#4132)
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
* feat: separate mariadb driver
* chore: add mariadb install dump
2024-12-02 10:17:27 +01:00
flarum-bot
d90573f8f1 Bundled output for commit f6e84a0dc576d1cfe8539b7438244edf156e3b1a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-11-29 13:58:55 +00:00
Sami Mazouz
f6e84a0dc5
fix(em): production ready check 2024-11-29 14:56:20 +01:00
flarum-bot
22b74d0404 Bundled output for commit 94b0d67a4020e1b7027e0df53dee1d681dc822e1
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-11-29 13:41:10 +00:00
Sami Mazouz
94b0d67a40
fix(em): prevent use if missing php functions 2024-11-29 14:38:31 +01:00
StyleCI Bot
9920a9f2f0
Apply fixes from StyleCI
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-11-29 12:54:36 +00:00
Nicolas Peugnet
08b36149fd
test(testing): run flarum/testing package tests (#3844)
* chore(testing): run flarum/testing packages tests back again

These tests were not run on each framework build, I enabled them again.
Two of the tests were failing so I disabled them for now, it is more
important to have some tests running than none at all.

* chore(testing): remove flarum/testing dedicated workflow

It is useless now that the tests are run in the framework repo.
Also this workflow was not working anymore.

---------

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2024-11-29 13:54:20 +01:00
Sami Mazouz
7f001dfe3b
fix: validate required cli install args (#4093) 2024-11-29 11:17:30 +01:00
flarum-bot
5fbb9fe9a7 Bundled output for commit 33a72f5c14c00671eedcee5d64a0edf5d6db3441
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-11-29 09:57:59 +00:00
33a72f5c14
fix(tags): wrong tag input width with CJK chars (#4127) 2024-11-29 10:55:21 +01:00
Sami Mazouz
af2a32a3a4
fix: larastan changes frequently 2024-11-29 10:37:44 +01:00
dependabot[bot]
bcff06a362
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 (#4121)
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-29 10:12:04 +01:00
Sami Mazouz
e1c82a19dc
chore: improve form section group styling
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-11-23 14:36:03 +01:00
Sami Mazouz
770feabb59
fix(regression): improve discussion list item styling extensibility (#4128) 2024-11-23 14:31:03 +01:00
Sami Mazouz
464b67f848
fix: skip resource eager loading if manually eager loaded 2024-11-23 09:31:38 +01:00
Sami Mazouz
41e5ff2525
feat: recover support for ico favicon (#4126) 2024-11-22 16:53:19 +01:00
Davide Iadeluca
49064f6912
fix: increase length of email field (#4118) 2024-11-22 11:03:04 +01:00
flarum-bot
7cfa560b4e Bundled output for commit 70081a267f64464e99e80ff401752284ff307e5e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-11-22 09:29:22 +00:00
Sami Mazouz
70081a267f
fix: passing lazy loaded module to app.current.matches(...) 2024-11-22 10:26:39 +01:00
Sami Mazouz
70158aa0ef
fix(regression): reply button width 2024-11-22 10:26:20 +01:00
Sami Mazouz
5e7fbcb0e8
feat: allow adding endpoints before/after others (#4115) 2024-11-22 08:45:26 +01:00
Sami Mazouz
4feb4a3820
fix(regression): unnecessary breaking change 2024-11-15 15:44:55 +01:00
Daniël Klabbers
6323314ad7
fix(regression): cannot cast as json on mariadb 10 (#4110) 2024-11-15 08:46:11 +01:00
Sami Mazouz
3b69af2ae6
feat: add fieldsBefore and fieldsAfter ApiResource extenders (#4106) 2024-11-09 14:50:39 +01:00
flarum-bot
c401e678f3 Bundled output for commit 03fe885b56f4cccd57a2619d4a6c85e4621b8b2d
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-11-09 10:16:48 +00:00
Sami Mazouz
03fe885b56
fix: tests 2024-11-09 11:14:13 +01:00
flarum-bot
1ebceab85a Bundled output for commit dd45d75cd8b9c1789b093562eb312db1ad333c9c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-11-09 10:10:16 +00:00
Sami Mazouz
dd45d75cd8
fix: importing extA lazy module from extB 2024-11-09 11:01:36 +01:00
Sami Mazouz
820894a7c9
test: php 8.4 (#4103)
* test: php 8.4

* fix: php 8.4 deprecations

* fix: make argument required

* chore: review changes
2024-11-08 17:33:47 +01:00
flarum-bot
845228f251 Bundled output for commit 8c331038da9e3fda99a68ea2e0495b9a6160dde1
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-11-08 16:24:42 +00:00
Sami Mazouz
8c331038da
chore: recover local search component (#4104) 2024-11-08 17:22:12 +01:00
flarum-bot
04fe684db8 Bundled output for commit 75d05ee85dfcdcf017a92cea4ff3d130fbc95802
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-11-08 12:42:46 +00:00
Sami Mazouz
75d05ee85d
chore: allow conditionals in Admin extender 2024-11-08 13:40:05 +01:00
flarum-bot
8ba9f14642 Bundled output for commit c2b91ba1cd09fe21db69b5710682c928948a9efd
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-11-08 12:27:42 +00:00
Sami Mazouz
c2b91ba1cd
chore: allow extensibility of bool gambit 2024-11-08 13:25:08 +01:00
Sami Mazouz
5d10fdc66a
chore: laravel MariaDB min is 10.3
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-11-04 20:22:44 +01:00
Sami Mazouz
d7a54037c2
fix(phpstan): return type
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-11-04 11:36:41 +01:00
Sami Mazouz
ffea0db012
fix(regression): discussion creation fails 2024-11-04 11:28:57 +01:00
Sami Mazouz
b3a40115af
fix: null title error 2024-11-04 11:14:46 +01:00
StyleCI Bot
c754ced61c
Apply fixes from StyleCI
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-11-02 15:29:22 +00:00
Sami Mazouz
849faf8065
revert: recover start method used by ecosystem 2024-11-02 16:29:10 +01:00
flarum-bot
6e90945922 Bundled output for commit cf9d88f334ccf572489a01e45db763f023b5c8b6
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-11-02 14:38:55 +00:00
Sami Mazouz
cf9d88f334
chore: remove debugging code 2024-11-02 15:36:13 +01:00
Sami Mazouz
0c32184775
feat: use components for email templating (#4102)
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-11-02 12:09:51 +01:00
Sami Mazouz
0ac01b9053
chore: class naming
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-11-01 15:30:19 +01:00
Sami Mazouz
4d227a6dda
fix: header list item width 2024-11-01 15:04:50 +01:00
Sami Mazouz
535dbb4a10
fix: margin
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-11-01 09:47:06 +01:00
Sami Mazouz
bb29e8793e
fix: prevent wiping out existing database on install (#4092)
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-10-25 20:08:13 +01:00
Sami Mazouz
9817cb8a60
fix: phpstan 2024-10-25 16:13:39 +01:00
flarum-bot
ff7b02ac1b Bundled output for commit 9f87bf18c2f7d417c0904a8409419c8e1666afb3
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-25 15:03:06 +00:00
Sami Mazouz
9f87bf18c2
fix: header dropdown item might not be linkable 2024-10-25 16:00:32 +01:00
Sami Mazouz
1ead69e9b6
fix: allow use of an attribute named relationships 2024-10-25 16:00:32 +01:00
Sami Mazouz
53ac644516
chore: simplify checking of current composer 2024-10-25 16:00:32 +01:00
Sami Mazouz
6e5180dcfe
fix: hard to track error 2024-10-25 16:00:32 +01:00
flarum-bot
d09ff7176c Bundled output for commit 3af78c1a3da5b9c7c4fa70115c8efcb967bfe24e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-25 12:49:33 +00:00
Sami Mazouz
3af78c1a3d
fix: allow prefixing route names 2024-10-25 13:47:04 +01:00
flarum-bot
38585cf478 Bundled output for commit 5435d1758eb1170411765e9bd3a94f58a0ead73d
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-25 09:38:24 +00:00
Sami Mazouz
5435d1758e
fix: missing translation 2024-10-25 10:35:40 +01:00
flarum-bot
d6abfb0e26 Bundled output for commit 11c5a8a8ebce53d2b271245979758b9b6472a045
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-25 09:24:02 +00:00
Sami Mazouz
11c5a8a8eb
fix: missing translation 2024-10-25 10:21:29 +01:00
flarum-bot
017b90b97d Bundled output for commit 471529316447f19e3a3b4a80b6194e6148b13222
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-25 09:15:55 +00:00
Sami Mazouz
4715293164
fix: caught warnings and missing locale 2024-10-25 10:13:11 +01:00
Sami Mazouz
30c7602814
chore: update tsconfig version 2024-10-25 09:39:34 +01:00
Sami Mazouz
3b7b4055f1
test: prevent false negatives
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-10-24 20:09:27 +01:00
flarum-bot
4d8e6abff6 Bundled output for commit 3b66925a666ad1f5e3e0ba2c1513bd501d6470e2
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-24 17:49:43 +00:00
Sami Mazouz
3b66925a66
fix: Logout controller allows open redirects (#4091)
Co-authored-by: IanM <16573496+imorland@users.noreply.github.com>
2024-10-24 18:47:06 +01:00
flarum-bot
eae355ddaf Bundled output for commit 91fd28c3192061727fcaf94b74690f9b00d00ff4
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-24 15:52:33 +00:00
91fd28c319
fix(messages): missing tooltip translation (#4090) 2024-10-24 16:49:55 +01:00
cacf556c9a
fix(regression): app header container overflow on mobile (#4089) 2024-10-24 16:49:33 +01:00
Sami Mazouz
73a029641a
chore: switch formatter to format-message (#4088)
Co-authored-by: Robert Korulczyk <robert@korulczyk.pl>
2024-10-24 16:48:33 +01:00
Sami Mazouz
0464324485
chore: yarn format
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-10-23 11:31:45 +01:00
flarum-bot
1af7a36c18 Bundled output for commit e030c1ee8ccb4427750e4e8a2675bccdfe8258ba
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-23 10:26:15 +00:00
e030c1ee8c
fix: search box animating on small screen (#4076) 2024-10-23 11:23:47 +01:00
flarum-bot
ea9b059f70 Bundled output for commit d041515e19a146a245ca2e78c1e89fca737c520e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-23 10:13:32 +00:00
d041515e19
feat: date time formats from locales (#4029)
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2024-10-23 11:11:07 +01:00
flarum-bot
983d42160d Bundled output for commit dc5a7ac64714a4567a8ac34181c2c15fb9c7ab11
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-22 17:26:49 +00:00
dc5a7ac647
fix: alert component broken layout (#4087) 2024-10-22 18:24:20 +01:00
flarum-bot
51015b3ca4 Bundled output for commit 6a3be3301ef9baa4ddc02684084fe792d9bec319
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-22 12:56:37 +00:00
6a3be3301e
fix(messages): timezone is missing from datetime (#4086) 2024-10-22 13:53:43 +01:00
Daniel
f51df1c486
feat(nicknames): allow OAuth to provide a nickname (#4004) 2024-10-22 13:52:25 +01:00
flarum-bot
d8faf25383 Bundled output for commit f729a4d05477f9fd95f13de46d55d6db3fe173ba
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-22 09:11:49 +00:00
Tristian Kelly
f729a4d054
test(mentions): add integration test for reply approval notification (#3748)
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2024-10-22 10:09:18 +01:00
flarum-bot
808a060a0d Bundled output for commit d3002106d573519bef274149c67dc94eca646c54
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-22 08:31:21 +00:00
d3002106d5
fix(a11y): false aria-hidden causes inconsistent behavior (#4074) 2024-10-22 09:28:43 +01:00
Sami Mazouz
f97c67e2f9
test: prevent false negatives
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-10-21 19:16:12 +01:00
flarum-bot
8219e76da4 Bundled output for commit 30a6a9b697c4964a82b46e5141a2c14aece36411
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-21 18:13:23 +00:00
Sami Mazouz
30a6a9b697
chore: ignore deprecation errors in prod (#4072) 2024-10-21 19:10:57 +01:00
Chisato Nishikigi
a0311dfb2b
feat(sticky): make excerpt optional in sticky (#4016) 2024-10-21 19:09:48 +01:00
Davide Iadeluca
b86a4a0fe0
fix: inconsistent modal position (#3951)
Some checks are pending
Backend Tests / run (push) Waiting to run
Frontend Workflow / run (push) Waiting to run
Static Code Analysis / run (push) Waiting to run
2024-10-21 17:55:50 +01:00
Sami Mazouz
1584174e1c
test: prevent false negatives 2024-10-21 16:09:02 +01:00
flarum-bot
b75a51c271 Bundled output for commit 265d0e1dd1a18301eeea465d2821450cadb45f5e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-21 15:03:38 +00:00
Viktor Szépe
265d0e1dd1
chore: fix typos (#4021) 2024-10-21 16:00:56 +01:00
Tristian Kelly
084ae6fceb
feat: allow resetting settings to default (#3935)
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2024-10-21 15:17:24 +01:00
flarum-bot
ee60a7f8ca Bundled output for commit b9b52d85a77dffb1423211ad4a9ce8a6a662e749
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-21 10:52:15 +00:00
Sami Mazouz
b9b52d85a7
feat: define FLARUM_START constant (#4082) 2024-10-21 11:49:43 +01:00
flarum-bot
57879974ca Bundled output for commit a3333320d71863b2596e0886a6eb6a81a9db61ad
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-19 19:34:54 +00:00
Sami Mazouz
a3333320d7
fix(ci): skip node_modules typings 2024-10-19 20:32:20 +01:00
flarum-bot
dccf1535f9 Bundled output for commit 6f823731caa95439526ab7d8ec7dba13cd98e91b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-19 18:12:17 +00:00
Sami Mazouz
6f823731ca
fix(gh): ci failures on node 20 2024-10-19 19:08:53 +01:00
flarum-bot
caefacbecd Bundled output for commit a47bd2d45730f004e739d91c290f22330ab93dc4
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-19 17:44:34 +00:00
Sami Mazouz
a47bd2d457
chore: update js dependencies 2024-10-19 18:41:07 +01:00
Sami Mazouz
17ec1567a4
test: fix 2024-10-19 18:05:33 +01:00
flarum-bot
e3f969588c Bundled output for commit e9be7b9aea70a3a86fd649c316c1bd863cc09608
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-19 16:53:04 +00:00
Sami Mazouz
e9be7b9aea
perf: store message mentions for better performance (#4079)
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-10-19 17:49:58 +01:00
flarum-bot
8742790980 Bundled output for commit 321020ab83b715d00b44434f9313c91e66b863dd
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-19 16:48:34 +00:00
Sami Mazouz
321020ab83
fix: skip major updater if not ready for prod (#4080) 2024-10-19 17:45:30 +01:00
Sami Mazouz
a5a1f6a9d2
test: fix 2024-10-19 17:15:52 +01:00
flarum-bot
53de041194 Bundled output for commit 5d26a72e98a5e9d71b1da4108180f7801befa802
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-19 11:05:48 +00:00
Sami Mazouz
5d26a72e98
fix: typings 2024-10-19 12:02:06 +01:00
flarum-bot
09c70006c6 Bundled output for commit feff1a1e7ab65c1a0c0e3d9e3bf3e3a378ded1a9
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-19 10:58:33 +00:00
Sami Mazouz
feff1a1e7a
fix: post reply error 2024-10-19 11:55:05 +01:00
Sami Mazouz
356f97641e
chore: update frontend workflow
Some checks failed
Backend Tests / run (push) Has been cancelled
Frontend Workflow / run (push) Has been cancelled
Static Code Analysis / run (push) Has been cancelled
2024-10-17 20:18:32 +01:00
Sami Mazouz
bfb82fca4b
test: fix 2024-10-17 19:37:45 +01:00
flarum-bot
4acb6e36f5 Bundled output for commit 139adb0e65e3b3a455f875eb50b21592f023b888
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-17 18:31:38 +00:00
Sami Mazouz
139adb0e65
chore: fix typings 2024-10-17 19:28:30 +01:00
flarum-bot
fc8b58945d Bundled output for commit 675c6840ac589f2958d312760c7ad06c4bf46d5e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-17 15:58:32 +00:00
Sami Mazouz
675c6840ac
chore: phpstan 2024-10-17 16:55:25 +01:00
flarum-bot
b112fec3e7 Bundled output for commit 498b8dfe6a6ceb32a07ba00c4aaa8189286b380b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-17 15:48:18 +00:00
StyleCI Bot
498b8dfe6a
Apply fixes from StyleCI 2024-10-17 15:45:09 +00:00
Sami Mazouz
b866623c94
chore: phpstan 2024-10-17 16:44:55 +01:00
Sami Mazouz
07b98030df
chore(em): port fix from 1.x 2024-10-17 15:19:31 +01:00
flarum-bot
7264941f91 Bundled output for commit 876a964e1e77be111bfdbc8c36538b2b890742f4
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-17 12:29:35 +00:00
Sami Mazouz
876a964e1e
feat: add option for filtering read stickied on all discussions page (#4073)
Co-authored-by: Adrian McCay <2762877+adrianmccay@users.noreply.github.com>
2024-10-17 13:26:30 +01:00
flarum-bot
db17253ccd Bundled output for commit 0107c96fb7677cc61b119cee8b8b857f87bd4863
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-16 17:15:53 +00:00
Sami Mazouz
0107c96fb7 feat: extension list UI (#4066) 2024-10-16 18:12:46 +01:00
Sami Mazouz
b0e8f5ca36
refactor: remove listing of posts in the show discussion endpoint (#4067) 2024-10-16 18:02:46 +01:00
flarum-bot
40996de39a Bundled output for commit 7383bc94df39a03169349b6b7f2e07801fb7d981
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-16 16:54:33 +00:00
Sami Mazouz
7383bc94df
feat: add List-Unsubscribe header to emails (#4069) 2024-10-16 17:51:20 +01:00
flarum-bot
abe1a4cc30 Bundled output for commit f83020cd1fb62b90719921bbcc2add3fcf9f655d
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-12 13:40:26 +00:00
Sami Mazouz
f83020cd1f
feat: add Admin.generalIndexItems extender (#4068)
* feat: add `Admin.generalIndexItems` extender
* docs
2024-10-12 14:37:10 +01:00
flarum-bot
77f3685033 Bundled output for commit 4291918171c6f2405b7674182065d81ab6686d77
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-10-02 20:56:44 +00:00
Vijayan K S
4291918171
chore: convert HeaderPrimary to TypeScript (#4052) 2024-10-02 21:53:35 +01:00
flarum-bot
da441c77ca Bundled output for commit 1a12209fdcde19e3cdbbb3ec483ca29793057991
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-29 08:17:50 +00:00
Ngô Quốc Đạt
1a12209fdc
chore: update FontAwesome v6 icon search link (#4036) 2024-09-29 09:14:47 +01:00
flarum-bot
e5f124b696 Bundled output for commit f8560ef51b484f1c6369863673078053e3f53be9
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-28 16:11:55 +00:00
Ngô Quốc Đạt
f8560ef51b
chore: wrap RepositoryModal's fields in Form component (#4034)
* chore: wrap RepositoryModal's fields in Form component

* wip
2024-09-28 17:08:52 +01:00
Ngô Quốc Đạt
40a84fc3d8
chore: do not render form header when label or description is not present (#4035) 2024-09-28 17:07:46 +01:00
flarum-bot
6444ccd6a5 Bundled output for commit 1f3afca48235efaf0a0ba03fd124fd98be8f8a24
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-28 15:15:19 +00:00
Sami Mazouz
1f3afca482
fix: regression in typings 2024-09-28 16:11:50 +01:00
flarum-bot
d818e83235 Bundled output for commit 257be2b9db6f5365faa017bd9cc4a0e870efb449
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-28 14:51:19 +00:00
Sami Mazouz
257be2b9db
test: add frontend tests (#3991) 2024-09-28 15:47:45 +01:00
c0d3d976fa
fix: new webpack config doesn't work on windows (#4030) 2024-09-28 14:04:50 +01:00
flarum-bot
29bb477efe Bundled output for commit feca3d0da6c7e6780a42c6e34b474c7a4268a704
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-28 13:00:10 +00:00
Ngô Quốc Đạt
feca3d0da6
fix: respect user theme preference (#4033) 2024-09-28 13:56:45 +01:00
flarum-bot
077363a085 Bundled output for commit 5ff66fd033ad64efa7ae16575ec868eed6cabadf
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-28 12:41:10 +00:00
Sami Mazouz
5ff66fd033
fix: JS errors 2024-09-28 13:37:29 +01:00
flarum-bot
ae03e6d473 Bundled output for commit 35f76bce60361caac8001c41c421de30f567b221
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-28 11:55:36 +00:00
Sami Mazouz
35f76bce60
fix: move UserSearchResult to common 2024-09-28 12:52:04 +01:00
Sami Mazouz
124b7968f2
fix: no js tests 2024-09-28 11:51:27 +01:00
flarum-bot
53f4179134 Bundled output for commit 3a266d51958013dbbae711663d4070bb38ff959c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-28 10:48:53 +00:00
Sami Mazouz
3a266d5195
fix: wrong IDE inserted import 2024-09-28 11:45:24 +01:00
flarum-bot
4b2c787c3f Bundled output for commit e5389acd6e85dc392676609d9a895f3a6e368e26
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-28 10:42:10 +00:00
Sami Mazouz
e5389acd6e
fix: js errors 2024-09-28 11:38:38 +01:00
flarum-bot
94991862ed Bundled output for commit b74ecbfacf684eb0dc70e708c4763d36ebd93405
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-28 10:16:18 +00:00
Sami Mazouz
b74ecbfacf
feat: messages extension (#4028)
* feat: private messages
2024-09-28 11:12:52 +01:00
flarum-bot
bc4356a7f5 Bundled output for commit 5cea3d3b9bc4c5c6ae751bc4920a37bf032931af
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-28 08:38:54 +00:00
Sami Mazouz
5cea3d3b9b
feat: admin search UI (#4022) 2024-09-28 09:35:37 +01:00
Ngô Quốc Đạt
e08a9f6146
chore: Bisect should use CacheClearCommand in core instead (#4023) 2024-09-25 17:28:08 +01:00
flarum-bot
3f4b1592af Bundled output for commit c5b4ff7b27004120f8fbb0d9f214502253cfc3fe
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-20 08:43:37 +00:00
青石
c5b4ff7b27
feat(emoji): allow the user to set the cdn address (#3908) 2024-09-20 09:40:23 +01:00
flarum-bot
9b9fd76045 Bundled output for commit d3144ee23490189f8634d9478933e98f067a9e9a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-20 07:34:36 +00:00
Daniël Klabbers
d3144ee234
fix: cannot install without prefix (#4001) 2024-09-20 08:31:34 +01:00
Rafał Całka
e1a77fd7c8
fix: tag state loaded for wrong user (#4009) 2024-09-20 08:30:45 +01:00
aafc615d67
fix: reset save button state on failure in admin page (#4010) 2024-09-20 08:28:45 +01:00
Sami Mazouz
f13a1c8387
feat: fontawesome v6 (#4020) 2024-09-20 08:27:08 +01:00
flarum-bot
c28eee59b3 Bundled output for commit 2204157ac04daaa09fe9a15bcac48d9e21c32d9c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-19 21:38:28 +00:00
Sami Mazouz
2204157ac0
fix(a11y): convert empty links to buttons (#3926) 2024-09-19 22:35:20 +01:00
flarum-bot
3a8e8ecab9 Bundled output for commit 7ecc8b0cbaad47e4bd71c5a91335ca02a4ccdda7
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-19 16:37:22 +00:00
Sami Mazouz
7ecc8b0cba
fix 2024-09-19 17:34:05 +01:00
flarum-bot
f66a1b998f Bundled output for commit 1ab3029e7837071f3b05b587c5a26da5cc6eb10b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-19 16:05:15 +00:00
Sami Mazouz
1ab3029e78
feat: post search adapted with global search (#4019) 2024-09-19 17:01:58 +01:00
Sami Mazouz
06eb613c9b
chore: remove leftover debugging code 2024-09-11 12:18:35 +01:00
flarum-bot
9dc5f1572c Bundled output for commit b9037df05c456cec78fa4509dd06c45dc75befc4
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-09-11 10:33:19 +00:00
Sami Mazouz
b9037df05c
fix: code splitting on dev mode 2024-09-11 11:30:10 +01:00
Sami Mazouz
270ba09d08
chore: yarn format 2024-09-11 09:38:53 +01:00
Sami Mazouz
75399117e3
fix: code splitting bug 2024-09-10 18:11:35 +01:00
flarum-bot
4cb6b8fbb9 Bundled output for commit a00b0df4d8f0973c9af52412773d5a4d8b660dac
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-08-08 14:45:00 +00:00
Sami Mazouz
a00b0df4d8
chore: IndexSidebar class 2024-08-08 15:41:48 +01:00
flarum-bot
09b9b4a083 Bundled output for commit 6663b5dff02047c3ad753e5b84be33c1429ebeab
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-08-08 13:53:14 +00:00
Daniël Klabbers
6663b5dff0
fix: 3 char hex color is incorrectly modified to 6 (#4013)
The current logic creates `cdecde` from `cde`, it should be `ccddee`.

@dsevillamartin said this is the code to use instead and chat gpt said he's brilliant so..
2024-08-08 14:50:09 +01:00
Sami Mazouz
6b336c5ea8
chore: update dependencies (#4012)
* chore: phpunit 10

* chore: config

* Apply fixes from StyleCI

* chore: phpunit 11 (php 8.2 minimum requirement)

* feat: laravel 11

* Apply fixes from StyleCI

* feat: carbon v3

* fixes
2024-08-06 16:50:09 +01:00
flarum-bot
2f92a6c739 Bundled output for commit 770f9370af178e08da4e8ca2ebb9407f184e7de2
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-08-02 11:52:43 +00:00
Sami Mazouz
770f9370af
fix: 2.0 bugs (#4011) 2024-08-02 12:49:34 +01:00
Daniël Klabbers
2b56129d70 fix: duplicated mentionsUsers in extend.php 2024-06-28 21:42:36 +02:00
StyleCI Bot
873db6e00b
Apply fixes from StyleCI 2024-06-22 09:59:48 +00:00
Sami Mazouz
3f6e9e6b0c
chore 2024-06-22 10:59:30 +01:00
Ngô Quốc Đạt
19196c219c
Simplify variable assignment using null coalescing operator (#4000) 2024-06-22 10:53:00 +01:00
flarum-bot
f3c8921b09 Bundled output for commit c8dc8f692223a7a6e0f50b57c13096a9dd5b07e0
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-06-22 09:48:18 +00:00
Davide Iadeluca
c8dc8f6922
refactor: unify frontend initializers naming (#4003)
* refactor: use consistent naming for frontend initializers

* refactor: use arrow functions for frontend initializers
2024-06-22 10:45:17 +01:00
flarum-bot
d52068cf5b Bundled output for commit b91caec30bd1d6a6944268d3d786f2a9a9421150
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-06-22 07:08:06 +00:00
Sami Mazouz
b91caec30b
feat: vanilla CSS color scheme changes (#3996)
* feat: vanilla CSS color scheme changes
* chore: scheme mixin
* chore: remove darkmode & colored header less variables
* feat: high contrast schemes
2024-06-22 08:05:07 +01:00
Sami Mazouz
379298acb0
feat: add support for PgSQL (#3985)
* feat: add support for `PgSQL`
* chore: generate dump
* feat: query exception errors db driver hint
* feat: allow defining supported databases
* chore: review comments
* feat: setting for pgsql preferred search config
2024-06-22 08:03:56 +01:00
Daniël Klabbers
d04cda6ca3
fix: homepage screenshot missing after migration 2024-06-21 22:11:37 +02:00
Daniël Klabbers
6339446c82
chore: remove huntr reference in readme 2024-06-21 22:10:56 +02:00
Daniël Klabbers
a002571984
fix: logo is missing 2024-06-21 22:10:36 +02:00
Sami Mazouz
3dd2382ea0
chore: drop the need for a json-api-server fork (#3986)
* chore: drop the need for a json-api-server fork
* chore: custom Serializer
* chore
* chore: adapt
* fix
* phpstan
2024-06-21 10:46:24 +01:00
flarum-bot
d73cd0ecdd Bundled output for commit a8777c6198edd520011731d939ae92b45fcec176
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-06-21 08:39:52 +00:00
Sami Mazouz
a8777c6198
refactor: JSON:API (#3971)
* refactor: json:api refactor iteration 1
* chore: delete dead code
* fix: regressions
* chore: move additions/changes to package
* feat: AccessTokenResource
* feat: allow dependency injection in resources
* feat: `ApiResource` extender
* feat: improve
* feat: refactor tags extension
* feat: refactor flags extension
* fix: regressions
* fix: drop bc layer
* feat: refactor suspend extension
* feat: refactor subscriptions extension
* feat: refactor approval extension
* feat: refactor sticky extension
* feat: refactor nicknames extension
* feat: refactor mentions extension
* feat: refactor lock extension
* feat: refactor likes extension
* chore: merge conflicts
* feat: refactor extension-manager extension
* feat: context current endpoint helpers
* chore: minor
* feat: cleaner sortmap implementation
* chore: drop old package
* chore: not needed (auto scoping)
* fix: actor only fields
* refactor: simplify index endpoint
* feat: eager loading
* test: adapt
* test: phpstan
* test: adapt
* fix: typing
* fix: approving content
* tet: adapt frontend tests
* chore: typings
* chore: review
* fix: breaking change
2024-06-21 09:36:32 +01:00
flarum-bot
10514709f1 Bundled output for commit eb6e599df113921a9f807ed47a5e80192e92fb05
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-06-21 06:28:22 +00:00
Sami Mazouz
eb6e599df1
feat: add support for SQLite (#3984)
* feat: add support for sqlite

* chore: add warning on install

* fix: ignore constraints before transaction begins

* chore: update workflow

* Apply fixes from StyleCI

* chore: generate sqlite dump and manually add foreign keys

* chore: fix actions

* chore: fix actions

* chore: fix actions

* chore: fix actions

* chore: fix actions

* chore: fix actions

* test: fix

* Apply fixes from StyleCI

* fix: sqlite with db prefix

* Apply fixes from StyleCI

* fix: statistics sqlite
2024-06-21 07:25:11 +01:00
flarum-bot
5ce1aeab47 Bundled output for commit 389d004ddcf6fc4e56c0ea99ca18bdeba1866e95
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-06-16 15:55:43 +00:00
Ngô Quốc Đạt
389d004ddc
feat: Add conditional rendering for email status in MailPage.tsx (#3997) 2024-06-16 17:52:38 +02:00
Ngô Quốc Đạt
72f89c0209
fix: setting key safe_mode_extensions not exists (#3992) 2024-05-18 18:14:04 +01:00
Davide Iadeluca
1e7eddb61e
ci: allow custom actions runner to be defined (#3988) 2024-05-16 17:30:13 +01:00
flarum-bot
1302378141 Bundled output for commit 29ede5aa27e368020e8f786df3c17aebaa36c928
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-05-14 20:13:28 +00:00
Sami Mazouz
29ede5aa27
feat: JS Notification extender (#3974)
* feat: JS `Notification` extender

* fix
2024-05-14 21:10:07 +01:00
flarum-bot
d273b1920f Bundled output for commit b02f8190ea104e33b60a6a1d20c1fe0595c40270
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-05-03 13:23:30 +00:00
Sami Mazouz
b02f8190ea
feat: extension bisect (#3980)
* feat: extension bisect
* Apply fixes from StyleCI
* chore: review
* Apply suggestions from code review
* feat: add stop bisect button
* feat: redirect to result extension page

Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
2024-05-03 14:20:12 +01:00
flarum-bot
e0025df3e7 Bundled output for commit b8e17182e93560a28e8456e44f82c7f77c346bb8
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-05-03 13:09:21 +00:00
Sami Mazouz
b8e17182e9
feat: advanced maintenance modes (#3977)
* feat: low maintenance mode (maintenance with admin access) (#3975)
* feat: low maintenance mode (maintenance with admin access)
* Apply fixes from StyleCI
* chore: only required when basic
* chore: more concise code
* chore(review): enum
* feat: enable through settings
* Apply fixes from StyleCI
* core: typing
* feat: safe mode (#3978)
* feat: safe mode
* feat: add extension page warning
* feat: `safe_mode_extensions`
* Apply fixes from StyleCI
2024-05-03 14:05:58 +01:00
Sami Mazouz
2b917372a7
feat: eloquent factories (primarily for tests) (#3982) 2024-05-03 09:20:27 +01:00
Sami Mazouz
270188b5b0
fix: compiling split chunks in production 2024-04-26 14:25:31 +01:00
flarum-bot
9149ecc7aa Bundled output for commit 5fc2bb5eb662b1039ec43962e21a29cb0e51167d
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-04-07 12:23:32 +00:00
Sami Mazouz
5fc2bb5eb6
fix: broken assets 2024-04-07 13:19:57 +01:00
flarum-bot
24f3a6829f Bundled output for commit bf523b2325309c8d27d2c5d9ee745e9486bed027
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-04-06 13:55:44 +00:00
Sami Mazouz
bf523b2325
chore: extract buildSettingComponent method into a FormGroup component (#3927)
* chore: extract `buildSettingComponent` method into a `FormGroup` component

* chore: typings

* feat: move to common
2024-04-06 14:52:13 +01:00
Daniël Klabbers
e771b908d5
Patch vulnerability advisory (#3966)
Seems composer has a vulnerability, see https://github.com/advisories/GHSA-7c6p-848j-wh5h


Affected versions
>= 2.0.0-alpha1, < 2.2.23 -- patched in 2.2.23
>= 2.3.0-rc1, < 2.7.0 -- patched in 2.7.0

---

Let's raise the minimum to enforce the latest.

Thank you @peopleinside for reporting this.
2024-02-22 11:40:56 +01:00
flarum-bot
721e2eae3d Bundled output for commit 3fbe05fd1808c515f41469167b04566300fee031
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-01-22 18:01:17 +00:00
Sami Mazouz
3fbe05fd18
feat(em): port extension manager from 1.0 (#3959)
* feat(em): port extension manager from 1.0

* Apply fixes from StyleCI

* chore: phpstan

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2024-01-22 18:58:08 +01:00
IanM
8f29b7af82
feat: support composer auth (#3961) 2024-01-22 18:57:54 +01:00
Ngô Quốc Đạt
734f4a150c
chore: use hex_color rule for color validation (#3936) 2024-01-19 12:09:22 +01:00
flarum-bot
0186ca909e Bundled output for commit 1aa780624499c2ef947481ba4a3432df68d5cdf4
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-01-19 11:07:33 +00:00
Ngô Quốc Đạt
1aa7806244
Fix notify for all posts switch field loading state (#3938) 2024-01-19 12:04:25 +01:00
IanM
e3350543af
feat: upgrade intervention/image to 3.2 (#3947)
* chore: create standalone imageprovider

* chore: upgrade intervention to v3

* Apply fixes from StyleCI

* use new static instatiation

* Revert "Apply fixes from StyleCI"

This reverts commit 096b4d9a79fa41c948a7572cf65316ebc6b07d36.

* get avatar from remote

* Apply fixes from StyleCI

* fix: incorrect gid exception namespace

* fix test

* remove debug code

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2024-01-19 11:49:00 +01:00
Sami Mazouz
d400dcbc2f
feat: dispatch event to flarum/installation-packages on release (#3625) 2024-01-19 09:54:26 +01:00
Davide Iadeluca
430709bf5b
[2.x] fix(Mentions): allow renderer to be used without context (#3954)
* fix(Mentions): allow renderer to be used without context

* test(Mentions): implement test for rendering post without context

* Update UnparsePostMentions.php

* Update PostMentionsTest.php

---------

Co-authored-by: IanM <16573496+imorland@users.noreply.github.com>
2024-01-10 11:17:11 +00:00
flarum-bot
f784f48906 Bundled output for commit 3a34136e36d60b7d88c5b55e686579b4521a6f2c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-01-09 21:54:15 +00:00
Sami Mazouz
3a34136e36
feat: search UI/UX revamp (#3941)
* feat: first iteration

* chore: tweak

* feat: second iteration

* chore: incorrect code organization

* feat: gambit input suggestions

* feat: gambit keyboard navigation

* chore: bugs

* feat: negative gambits

* feat: improve gambit highlighting

* refactor: localize gambits

* feat: negative and positive gambit buttons

* fix: permissions

* chore: wat

* per: lazy load search modal

* fix: extensibility and bug fixes

* fix: bugs

* feat: reusable autocomplete dropdown

* chore: format

* fix: tag filter
2024-01-09 21:51:01 +00:00
flarum-bot
fb1703cd9b Bundled output for commit b58fec7ead155cd5acd1bcd9542a5bc61112917f
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-01-09 18:13:57 +00:00
Ngô Quốc Đạt
b58fec7ead
Fix width issue in edit user modal (#3939)
* Fix width input issue in EditUserModal

* update
2024-01-09 18:10:55 +00:00
flarum-bot
537f97a07a Bundled output for commit c1be00e79a191faefbfa9435bb3508af6b5b2a95
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-01-09 18:04:43 +00:00
Sami Mazouz
c1be00e79a
chore: improve debugging experience (#3944) 2024-01-09 18:01:29 +00:00
dependabot[bot]
91b89bc698
chore(deps): bump follow-redirects from 1.15.2 to 1.15.4 (#3957)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 18:19:28 +01:00
flarum-bot
278617a10d Bundled output for commit f793e5b8f8b0bf2ea5842d8b1d2f7ef1fa32a146
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-01-09 17:10:55 +00:00
IanM
f793e5b8f8
fix: ts error causing build to fail (#3956) 2024-01-09 17:07:38 +00:00
IanM
01598555a9
chore: larastan changed namespace (#3955) 2024-01-09 17:07:26 +00:00
StyleCI Bot
5399c86a1b
Apply fixes from StyleCI 2024-01-09 15:06:12 +00:00
IanM
74ce4cf1a7 chore: dummy commit for StyleCI purposes 2024-01-09 15:05:47 +00:00
Ngô Quốc Đạt
b4a82e81fc
fix: overflowing forum stats (#3940) 2023-12-01 11:42:36 +01:00
Rafał Całka
471ce0ea2a
fix(approval): PostWasApproved event triggered incorrectly 2023-11-23 18:50:47 +01:00
IanM
723cb73d48
Enable testing on PHP 8.3 (#3932) 2023-11-23 18:48:24 +01:00
flarum-bot
e4abf93763 Bundled output for commit 9310ce13d834c79851de67ba7d788654970886cb
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-23 17:19:53 +00:00
Sami Mazouz
9310ce13d8
chore: yarn format 2023-11-23 18:16:49 +01:00
flarum-bot
d4c532c949 Bundled output for commit 46357ee9a9b7ad2a76c91e03ed116bbb7777721e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-23 17:14:53 +00:00
Tristian Kelly
46357ee9a9
perf(flags): add pagination to flags list (#3931) 2023-11-23 18:11:46 +01:00
flarum-bot
6cbdfb6aa1 Bundled output for commit 4b126d9f4c654bbba8721a048e04eefeca14a35a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-11 18:46:13 +00:00
Sami Mazouz
4b126d9f4c
feat: revamp search (#3893)
* refactor: move gambits to frontend (#3885)
* refactor: move gambits to frontend
* test: GambitManager
* refactor: merge filterer and searcher concepts (#3892)
* chore: drop remaining backend regex gambits
* refactor: merge filterer & searcher concept
* refactor: adapt extenders
* refactor: no longer need to push gambits to `q`
* refactor: filters to gambits
* refactor: drop shred `Query` namespace
* chore: cleanup
* chore: leftover gambit references on the backend (#3894)
* chore: leftover gambit references on the backend
* chore: namespace
* feat: search driver backend extension API (#3902)
* feat: first iteration of search drivers
* feat: indexer API & tweaks
* feat: changes after POC driver
* fix: properly fire custom observables
* chore: remove debugging code
* fix: phpstan
* fix: custom eloquent events
* chore: drop POC usage
* test: indexer extender API
* fix: extension searcher fails without filters
* fix: phpstan
* fix: frontend created gambit
* feat: advanced page and localized driver settings (#3905)
* feat: allow getting total search results and replacing filters (#3906)
* feat: allow accessing total search results
* feat: allow replacing filters
* chore: phpstan
2023-11-11 19:43:09 +01:00
flarum-bot
9e04b010d8 Bundled output for commit 1c0e0933b0899e97a354df4bad98dbe9099ae330
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-11 18:38:17 +00:00
Sami Mazouz
1c0e0933b0
feat: improve emoji autocomplete (#3923)
* feat: improve emoji autocomplete
* chore: improve dropdown header
2023-11-11 19:31:53 +01:00
flarum-bot
60ffa78531 Bundled output for commit 294878291c94719747cc1ebaf0e2e392529538c0
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-10 22:16:11 +00:00
IanM
294878291c chore: format js 2023-11-10 22:09:50 +00:00
flarum-bot
05a7e24836 Bundled output for commit eaabeab8c922fe468209bd68a46ee5e72edd4b54
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-10 22:04:30 +00:00
Sami Mazouz
eaabeab8c9
chore: extract FormModal from Modal (#3922) 2023-11-10 21:59:34 +00:00
flarum-bot
9ef366493c Bundled output for commit 208b94dc1218b4acbf1aa669339ce576d52b4645
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-10 21:50:02 +00:00
Sami Mazouz
208b94dc12
chore(mentions,emoji): tie autocomplete to editor instance (#3913) 2023-11-10 21:44:00 +00:00
Sami Mazouz
5e3f8db095
fix: handled API errors break preloaded content (#3920)
* fix: handled API errors break preloaded content

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-11-10 21:39:08 +00:00
flarum-bot
deb99f0de4 Bundled output for commit 693bce912a0a002624bc33d275ca147965d37449
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-10 21:38:19 +00:00
Sami Mazouz
693bce912a
fix(testing): use cookie for testing authentication (#3924) 2023-11-10 21:35:24 +00:00
Sami Mazouz
3107319812
fix: paginated list limit hard to change (#3918)
* fix: paginated list limit hard to change

* chore: use the default value

* chore: apply to other list states

* chore: remove debugging code

* fix: typings
2023-11-10 21:31:46 +00:00
Sami Mazouz
a9756cb5eb
fix: only set actor on events that have it (#3914) 2023-11-10 21:25:10 +00:00
flarum-bot
bbdf3b5aba Bundled output for commit e2281a21230b23a635f742766ac3487b1d441f0a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-10 21:23:23 +00:00
Sami Mazouz
e2281a2123
chore: handle deprecations from 1.x (#3909)
* chore: drop deprecated `post_number_index` column

* chore: remove deprecated `FlagsWillBeDeleted` event

* chore: `Migration::addSettings` can still be needed

* chore: `settings->get` default can still be needed

* chore: deprecated `$default` in `Settings::serializeToForum` extender

* chore: deprecated request `actor` attribute

* chore: already handled

* chore: remove `RecompileFrontendAssets::whenSettingsSaved`

* chore: remove `getReadIds`

* chore: `Model::dateAttribute` extender

* chore: `evented` js util

* chore: `WelcomeHero` js hidden prop

* chore: attributes pushData with relations

* chore: app request options `extract`

* chore: itemlist deprecations

* chore: `search` state

* chore: `getMentionText`

* chore: deprecated non-registered store type

* chore: `Button` title

* chore: `Modal` deprecations

* chore

* chore: deprecated `less` mixins

* Apply fixes from StyleCI

* fix

* fix: phpstan

* fix

* fix

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-11-10 21:20:18 +00:00
flarum-bot
d01c0e5210 Bundled output for commit bee50bec7354f544c7f493dc4f91ebb983137bea
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-03 13:15:30 +00:00
Sami Mazouz
bee50bec73
fix: color input changes while typing (#3919) 2023-11-03 14:08:40 +01:00
flarum-bot
679d32729e Bundled output for commit e978e29e002df0246653e71908326aca3f1d9dd7
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-11-03 08:10:35 +00:00
IanM
e978e29e00
fix: add history push (#3916) 2023-11-03 09:07:25 +01:00
Sami Mazouz
5cdfa0f640
fix: load event mentioned tags on show discussion endpoint (#3915) 2023-11-01 13:43:00 +00:00
flarum-bot
a3192d2934 Bundled output for commit 96ba2f5f2d1d0e41557ecac576bc422986fff0a0
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-10-29 13:51:57 +00:00
dependabot[bot]
96ba2f5f2d
chore(deps): bump @babel/traverse from 7.20.1 to 7.23.2 (#3901)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.20.1 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-29 14:46:38 +01:00
Sami Mazouz
87a83d33b3
chore: avoid using .fa() mixins and @fa-var vars (#3912) 2023-10-29 14:45:50 +01:00
Ngô Quốc Đạt
015529ff1e
Use ::class syntax to fetch class name instead of get_class() function (#3910) 2023-10-29 14:43:58 +01:00
flarum-bot
2950290ad1 Bundled output for commit d15438846895a5cf7b5a584479ef63a6e3119925
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-10-29 12:32:28 +00:00
Sami Mazouz
d154388468
chore: function names 2023-10-29 13:27:34 +01:00
Gary Green
7c885c72fd
feat: frontend content flexible order priorities (#3765)
* Fix frontend factory so it includes controller content
* chore: more readable parameter passing
* feat: add priorities to frontend content
2023-10-29 12:59:48 +01:00
Sami Mazouz
577fc3e6a8
fix(webpack-config): split chunks can fail in dev mode (#3911) 2023-10-27 15:27:11 +01:00
IanM
e4e0fbff73
chore: remove ExtenderInterface[] as a conditional option, only support callable or ::class invoke (#3904)
* chore: remove ExtenderInterface[] as a conditional option, only support callable or ::class invoke

* Apply fixes from StyleCI

* stan

* review

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-21 17:37:07 +01:00
IanM
94de8b42b4
fix: console extender does not accept ::class attribute for schedule (#3903) 2023-10-21 17:34:48 +01:00
flarum-bot
db0d9cb006 Bundled output for commit 5ab5257ff521bede446613c1dcd61effdac99090
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-10-10 20:41:11 +00:00
Sami Mazouz
5ab5257ff5
feat: theming and extensibility improvements (#3876)
* feat: make page structure customizable across different pages (#3867)

* feat: create `PageStructure` component
* feat: apply to `DiscussionPage`
* feat: apply to `UserPage`
* feat: apply to `TagsPage`
* fix: adapt subscriptions ext
* chore: cleanup

* chore: use grid & flexbox for the discussion list item (#3868)

* chore: rename `DiscussionPage-list` to `DiscussionListPane`
* chore: itemlistify `DiscussionListItem`
* chore: use flex and grid for `DiscussionListItem`

* chore: use flexbox for `App-header` (#3869)

* chore: use flex and grid for `App-header`
* chore: drop search floats
* fix: adapt admin styles

* chore: use flexbox in dropdowns and SplitDropdown for subscriptions (#3874)

* chore: flexbox dropdown menu items
* chore: normalize subscriptions menu (use slit dropdown)
* chore: cleanup

* chore: misc flexbox/grid changes (#3875)

* chore: `TagsPage` to tsx
* chore: `TagsPage` flexbox/grid
* chore: `IndexPage-toolbar` flexbox
* chore: `UserCard` flexbox & itemlists
* fix: `Post` improve spacing logic
* chore: `Post` grid and proper spacing
* fix: avatar editor hover layer layout
* chore: `Button` flex

* chore: normalize form semantics (#3877)

* chore: normalize fieldsets
* fix: `LinkButton` spacing
* chore: consistent form semantics

* fix: styling regressions (#3878)

* fix: post spacing goes off in other pages
* fix: regression

* feat: extract reusable components from `NotificationsDropdown` (#3879)

* feat: extensible global notices (#3880)

* fix: js error on null item list
* feat: extensible global notices

* chore: housekeeping (#3881)

* chore: use CSS variables where still not using
* chore: cleanup suspension modal
* chore: cleanup post flag
* fix: badge vertical align
* chore: use CSS variables for custom coloring
* chore: `icon` helper to `Icon` component
* chore: `avatar` helper to `Avatar` component
* fix: chunk loading fails on admin frontend
* chore: format

* feat: reusable `UploadImageButton` component (#3882)

* chore: convert `UploadImageButton` to tsx
* feat: reusable `UploadImageButton` component
* feat: add `image-upload` setting type

* feat: extensible default footer component (#3883)

* chore: yarn format
2023-10-10 21:36:08 +01:00
flarum-bot
24d13e33bb Bundled output for commit 412cfafb3a2db2fb6c4137dc5bd33c6349e18309
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-09-29 15:39:58 +00:00
IanM
412cfafb3a
feat: notification unsubscribe & email overhaul with HTML multipart (#3872) 2023-09-29 16:34:54 +01:00
Sami Mazouz
ec5cb98c77
chore: merge the app with the container & implement the ApplicationContract (#3862)
* chore: merge the app with the container & implement the ApplicationContract

Illuminate components always expect the app to be the container, but also expect the app to be implementing the laravel app contract. This means that very often between minor illuminate updates we get a call to a method on the app that doesn't exist in the Flarum app. This fixes the issue once and for all.

* chore: improve concern implementation readability
* chore: service provider no longer has to change app type
* chore: unimplement `terminat(e/ing)`
* Apply fixes from StyleCI
* chore: recover `container` prop
* chore: return types
* fix: phpstan errors
2023-09-15 09:30:24 +01:00
flarum-bot
23fdddf185 Bundled output for commit be9eb16d7da2f4bb8becea6c25e381447eaa15ad
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-09-14 20:09:52 +00:00
Ngô Quốc Đạt
be9eb16d7d
chore: use str_contains (#3841) 2023-09-14 21:05:15 +01:00
IanM
ee34217b15
test: add MySQL 8.1 to the suite (#3870)
* Test using MySQL 8.1 also
* fix: db not added to matrix
* chore: add MySQL 8.1 to prefix tests
2023-09-14 21:04:25 +01:00
flarum-bot
e731fb6189 Bundled output for commit 229a7affa5cb0652da0cc4fd8b420900992c6f96
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-08-02 17:04:35 +00:00
Sami Mazouz
229a7affa5
feat: Code Splitting (#3860)
* feat: configure webpack to allow splitting chunks
* feat: `JsDirectoryCompiler` and expose js assets URL
* chore: support es2020 dynamic importing
* feat: control which URL to fetch chunks from
* feat: allow showing async modals & split 'LogInModal'
* feat: split `SignUpModal`
* feat: allow rendering async pages & split `UserSecurityPage`
* fix: module might not be listed in chunk
* feat: lazy load user pages
* feat: track the chunk containing each module
* chore: lightly warn
* chore: split `Composer`
* feat: add common frontend (for split common chunks)
* fix: jsDoc typing imports should be ignored
* feat: split `PostStream` `ForgotPasswordModal` and `EditUserModal`
* fix: multiple inline async imports not picked up
* chore: new `common` frontend assets only needs a jsdir compiler
* feat: add revision hash to chunk import URL
* fix: nothing to split for `admin` frontend yet
* chore: cleanup registry API
* chore: throw an error in debug mode if attempting to import a non-loaded module
* feat: defer `extend` & `override` until after module registration
* fix: plugin not picking up on all module sources
* fix: must override default chunk loader function from webpack plugin
* feat: split tags `TagDiscussionModal` and `TagSelectionModal`
* fix: wrong export name
* feat: import chunked modules from external packages
* feat: extensions compatibility
* feat: Router frontend extender async component
* chore: clean JS output path (removes stale chunks)
* fix: common chunks also need flushing
* chore: flush backend stale chunks
* Apply fixes from StyleCI
* feat: loading alert when async page component is loading
* chore: `yarn format`
* chore: typings
* chore: remove exception
* Apply fixes from StyleCI
* chore(infra): bundlewatch
* chore(infra): bundlewatch split chunks
* feat: split text editor
* chore: tag typings
* chore: bundlewatch
* fix: windows paths
* fix: wrong planned ext import format
2023-08-02 17:57:57 +01:00
Sami Mazouz
2ffbc44b4e
chore(infra): bundlewatch
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-07-27 16:23:19 +01:00
Sami Mazouz
b2a5a970e8
chore(infra): bundlewatch
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-07-27 16:11:38 +01:00
Sami Mazouz
781000e047
chore(infra): bundlewatch
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-07-27 15:54:17 +01:00
Sami Mazouz
608e2a7e5a
fix(phpstan): code analysis
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-07-27 13:52:58 +01:00
Sami Mazouz
7467beb72f
fix(regression): avoid overriding laravel schedule command to store last run
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-07-27 13:47:56 +01:00
Sami Mazouz
6ec0911cd1
chore: yarn format
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-07-27 13:47:25 +01:00
flarum-bot
992d85e3b8 Bundled output for commit 59586e63e11d7eb8a520ca34da64fc0f24171ea4
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-07-27 10:35:35 +00:00
Ngô Quốc Đạt
59586e63e1
chore: simplify if else conditions (#3843)
* chore: simplify if else conditions

* use nullsafe

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

---------

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2023-07-27 11:31:04 +01:00
IanM
76004ed844
feat: add whenExtensionDisabled to Conditional extender (#3847)
* feat: add  to  extender

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-07-27 11:30:05 +01:00
IanM
e014aa0105
feat: make WelcomeHero extensible (#3848)
* chore: make WelcomeHero extensible
* undo import mithril change
* reduce to one itemlist
2023-07-27 11:27:00 +01:00
dependabot[bot]
ce334156d5
chore(deps): bump tough-cookie from 4.1.2 to 4.1.3 (#3852)
Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.1.2...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-27 11:25:38 +01:00
dependabot[bot]
4d0190d4b0
chore(deps): bump word-wrap from 1.2.3 to 1.2.4 (#3856)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-27 11:25:14 +01:00
David Sevilla Martin
da1aa2aa92
fix: default labels with SettingDropdown and SelectDropdown (#3854)
* Remove modification to label in SelectDropdown
* Only set 'defaultLabel' if falsy and translate "Custom" default
2023-07-27 11:24:19 +01:00
David Sevilla Martin
c80220ad9b
fix(regression): Webpack not working on Windows with new export registry 2023-07-27 11:22:14 +01:00
dependabot[bot]
3593d53795
chore(deps): bump semver from 5.7.1 to 5.7.2 (#3853)
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 23:04:31 +01:00
Sami Mazouz
07623afacd
fix: installation command config path can be null
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-07-10 14:32:22 +01:00
flarum-bot
f2f7f16c68 Bundled output for commit f3b5313557ab666cab9e86f235777a1b9fb202ea
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-07-05 13:19:45 +00:00
Sami Mazouz
f3b5313557
chore: merge 1.8.1 mentions changes to 2.x 2023-07-05 14:15:01 +01:00
Sami Mazouz
0b128a5612
Merge branch '2.x' into 1.x 2023-07-05 10:29:03 +01:00
Sami Mazouz
40dcaf882c
chore: cleanup composer deps
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-07-02 14:54:49 +01:00
flarum-bot
9feb9dd4eb Bundled output for commit 016503d8c37eab107b36830b6fbcb5468bcb1226
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-06-29 18:24:31 +00:00
Sami Mazouz
016503d8c3
feat: export registry (#3842)
* feat: registry first iteration

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

* feat: improve webpack auto export loader

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

* chore: remove `compat` API

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

* chore: cleanup

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

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-06-29 18:57:53 +01:00
James
cf70865aa6
chore: corrected typos in routes comments 2023-06-24 09:28:59 +01:00
Ngô Quốc Đạt
b003736d75
chore: Remove unused vars in catch (#3839) 2023-06-21 16:38:24 +01:00
IanM
0cf2001478
chore: upgrade Wikimedia.less to 4.1 (#3837) 2023-06-21 15:28:01 +01:00
Sami Mazouz
5820a16a96
chore: increase phpstan level to 6 (#3836)
* chore: increase phpstan level to 6

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-06-21 14:31:24 +01:00
Nicolas Peugnet
4a966b830f
Do not catch exceptions when testing Console commands (#3813)
* Do not catch exceptions when testing Console commands

This allows to easily test a case where a command should throw using `$this->expectException()`.

* Rewrite ConsoleTest to use expectException

Now that the ConsoleApplication is set to not catch exceptions.

---------

Co-authored-by: IanM <16573496+imorland@users.noreply.github.com>
2023-06-21 08:14:12 +01:00
flarum-bot
7799c2fcd5 Bundled output for commit 11b4a810b7432c59d78dd04468a487faafb3e7b7
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-06-15 17:09:20 +00:00
Sami Mazouz
11b4a810b7
chore: upgrade to mithril 2.2 (#3831)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-06-15 18:04:41 +01:00
Sami Mazouz
493ffa0538
chore(phpstan): upgrade to be compatible with latest dependency updates (#3835) 2023-06-15 17:49:39 +01:00
Sami Mazouz
64b25b26c3
chore: improve test suite (#3814)
Allows running tests without constantly running `composer install` on each extension.
2023-06-15 13:26:39 +01:00
IanM
6bc19e2e52
chore: Upgrade dependencies (#3830)
* wip: laraval and symfony upgrades

* Apply fixes from StyleCI

* Apply fixes from StyleCI

* bump var dumper to 6.3

* require guzzle 7.7

* remove docbloc

* lock symfony/translation-contracts to 2.5

* fix: require mailgun package

* remove docblock

* fix: flysystem tests

* fix: instance flarum assets for testing

* Apply fixes from StyleCI

* downgrade intervention/image back to 2.x

* Apply fixes from StyleCI

* provide ImageManager to AvatarUploader

* fix larastan

* revert back some other intervention/image changes

* fix image resize

* Update framework/core/src/Http/Middleware/AuthenticateWithHeader.php

Co-authored-by: Daniël Klabbers <luceos@users.noreply.github.com>

* Apply fixes from StyleCI

* Update framework/core/src/Mail/SmtpDriver.php

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

* Update framework/core/src/User/LoginProvider.php

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

* use named attrs

* revert imagemanager in constructor

* revert to using Contract mailer

* reinstate and update FlarumLogTransport

* correct var typo, use one less temp var

* names attrs

* uncomment test

* mailer contract

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Daniël Klabbers <luceos@users.noreply.github.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2023-06-14 14:46:15 +01:00
flarum-bot
3757bde4fc Bundled output for commit f67ca5782a0b22d194526b6b11a2086443863921
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-06-07 10:45:14 +00:00
Sami Mazouz
f67ca5782a
chore: adapt frontend workflow to new main branch
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-06-07 11:20:29 +01:00
Sami Mazouz
fad818d1e5
chore: add script placeholders to allow running scripts globally
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-06-07 11:19:59 +01:00
David Wheatley
12ef1bfdbb
perf: transpile js to es6 (#3699) 2023-06-07 11:09:34 +01:00
Sami Mazouz
951f58e567
fix(regression): require flarum/testing:2.0
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-31 09:53:59 +01:00
Sami Mazouz
082f04d3c3
fix(regression): caught errors
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-31 09:50:39 +01:00
Sami Mazouz
04fe2616a4
Revert "fix(regression): caught errors"
This reverts commit c94c1404843033a407c306895ed0a64333f55bf9.
2023-05-31 09:47:30 +01:00
Sami Mazouz
c94c140484
fix(regression): caught errors
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-31 09:45:50 +01:00
Sami Mazouz
7b9605bb4e
chore: track 2.x in bundlewatch
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-30 18:56:04 +01:00
StyleCI Bot
6e783b9c78
Apply fixes from StyleCI 2023-05-30 10:36:45 +00:00
Sami Mazouz
6f11e044a7
chore: update codebase to php8.1 (#3827)
* chore: set minimum php version to 8.1

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

* chore: update codebase to php8.1

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

* Apply fixes from StyleCI

* chore: update workflow php version

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

* fix: caught errors

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

* fix: more caught errors

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

* fix: phpstan caught errors

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

* Apply fixes from StyleCI

* fix: test-caught errors

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

* fix: test-caught errors

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

* fix: test-caught errors

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

* fix: introduce `Flarum\Locale\TranslatorInterface`

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

* Apply fixes from StyleCI

* chore: remove mixin

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

* fix: test-caught errors

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

* fix: one last error

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-05-30 11:36:12 +01:00
Sami Mazouz
34a04b0746
chore: recover bundlewatch (#3829)
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-28 12:16:45 +01:00
flarum-bot
069677b2e3 Bundled output for commit 51bd7a7e32edc75c2bdeb24021505c297a81f978
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-27 18:38:40 +01:00
Darkle
57e05a5eaf Update the scheduler info link in admin (#3826) 2023-05-27 18:38:40 +01:00
Sami Mazouz
b6a6248dff
chore: prepare v2.0 development
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-24 08:52:14 +01:00
2388 changed files with 58271 additions and 40883 deletions

25
.bundlewatch.config.json Normal file
View File

@ -0,0 +1,25 @@
{
"files": [
{
"path": "./framework/core/js/dist/*.js",
"maxSize": "150KB"
},
{
"path": "./framework/core/js/dist/*/**/*.js",
"maxSize": "30KB"
},
{
"path": "./extensions/*/js/dist/*.js",
"maxSize": "30KB"
},
{
"path": "./extensions/*/js/dist/*/**/*.js",
"maxSize": "30KB"
}
],
"defaultCompression": "gzip",
"ci": {
"repoBranchBase": "2.x",
"trackBranches": ["2.x"]
}
}

View File

@ -18,8 +18,11 @@ trim_trailing_whitespace = false
[*.{php,xml,json}]
indent_size = 4
[{tsconfig.json,prettierrc.json}]
[{tsconfig.json,prettierrc.json,package.json}]
indent_size = 2
[*.neon]
indent_style = tab
[{install,update}.php]
indent_size = 2

View File

@ -40,7 +40,7 @@ body:
validations:
required: false
- type: textarea
id: enironment
id: environment
attributes:
label: Environment
value: |

View File

@ -21,11 +21,18 @@ on:
required: false
default: '.'
# Only relevant in mono-repos.
monorepo_tests:
description: "The list of directories to test in a monorepo. This should be a space-separated list of directories relative to the backend directory."
type: string
required: false
php_versions:
description: Versions of PHP to test with. Should be array of strings encoded as JSON array
type: string
required: false
default: '["7.3", "7.4", "8.0", "8.1", "8.2"]'
# Keep PHP versions synced with build-install-packages.yml
default: '["8.2", "8.3", "8.4"]'
php_extensions:
description: PHP extensions to install.
@ -37,7 +44,7 @@ on:
description: Versions of databases to test with. Should be array of strings encoded as JSON array
type: string
required: false
default: '["mysql:5.7", "mysql:8.0.30", "mariadb"]'
default: '["mysql:5.7", "mysql:8.0.30", "mysql:8.1.0", "mariadb", "sqlite:3", "postgres:10"]'
php_ini_values:
description: PHP ini values
@ -45,13 +52,29 @@ on:
required: false
default: error_reporting=E_ALL
runner_type:
description: The type of runner to use for the jobs. This should be one of the types supported by the `runs-on` keyword.
type: string
required: false
default: 'ubuntu-latest'
secrets:
composer_auth:
description: The Composer auth tokens to use for private packages.
required: false
env:
COMPOSER_ROOT_VERSION: dev-main
# `inputs.composer_directory` defaults to `inputs.backend_directory`
FLARUM_TEST_TMP_DIR_LOCAL: tests/integration/tmp
COMPOSER_AUTH: ${{ secrets.composer_auth }}
DB_DATABASE: flarum_test
DB_USERNAME: flarum
DB_PASSWORD: password
jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner_type }}
strategy:
matrix:
@ -65,52 +88,104 @@ jobs:
# Expands the matrix by naming DBs.
- service: 'mysql:5.7'
db: MySQL 5.7
driver: mysql
- service: 'mysql:8.0.30'
db: MySQL 8.0
driver: mysql
- service: mariadb
db: MariaDB
driver: mariadb
- service: 'mysql:8.1.0'
db: MySQL 8.1
driver: mysql
- service: 'sqlite:3'
db: SQLite
driver: sqlite
- service: 'postgres:10'
db: PostgreSQL 10
driver: pgsql
# 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
driver: mysql
prefix: flarum_
prefixStr: (prefix)
- php: ${{ fromJSON(inputs.php_versions)[0] }}
service: mariadb
db: MariaDB
driver: mariadb
prefix: flarum_
prefixStr: (prefix)
- php: ${{ fromJSON(inputs.php_versions)[0] }}
service: 'sqlite:3'
db: SQLite
driver: sqlite
prefix: flarum_
prefixStr: (prefix)
- php: ${{ fromJSON(inputs.php_versions)[0] }}
service: 'postgres:10'
db: PostgreSQL 10
driver: pgsql
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: ${{ 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
- php: ${{ fromJSON(inputs.php_versions)[0] }}
service: mariadb
- php: ${{ fromJSON(inputs.php_versions)[1] }}
service: mariadb
- php: ${{ fromJSON(inputs.php_versions)[0] }}
service: 'mysql:8.1.0'
- php: ${{ fromJSON(inputs.php_versions)[1] }}
service: 'mysql:8.1.0'
- php: ${{ fromJSON(inputs.php_versions)[0] }}
service: 'sqlite:3'
- php: ${{ fromJSON(inputs.php_versions)[1] }}
service: 'sqlite:3'
- php: ${{ fromJSON(inputs.php_versions)[0] }}
service: 'postgres:10'
- php: ${{ fromJSON(inputs.php_versions)[1] }}
service: 'postgres:10'
services:
mysql:
image: ${{ matrix.service }}
image: ${{ matrix.driver == 'mysql' && matrix.service || '' }}
env:
MYSQL_DATABASE: ${{ env.DB_DATABASE }}
MYSQL_USER: ${{ env.DB_USERNAME }}
MYSQL_PASSWORD: ${{ env.DB_PASSWORD }}
MYSQL_ROOT_PASSWORD: root
ports:
- 13306:3306
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10
mariadb:
image: ${{ matrix.driver == 'mariadb' && matrix.service || '' }}
env:
MARIADB_DATABASE: ${{ env.DB_DATABASE }}
MARIADB_USER: ${{ env.DB_USERNAME }}
MARIADB_PASSWORD: ${{ env.DB_PASSWORD }}
MARIADB_ROOT_PASSWORD: root
ports:
- 3306
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: ${{ matrix.driver == 'pgsql' && matrix.service || '' }}
env:
POSTGRES_DB: ${{ env.DB_DATABASE }}
POSTGRES_USER: ${{ env.DB_USERNAME }}
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
ports:
- 5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
name: 'PHP ${{ matrix.php }} / ${{ matrix.db }} ${{ matrix.prefixStr }}'
@ -119,7 +194,10 @@ jobs:
((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: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup PHP
uses: shivammathur/setup-php@v2
@ -130,39 +208,40 @@ jobs:
tools: phpunit, composer:v2
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
# When we drop support for PHP7.3, we should remove this from the setup.
- name: Create MySQL Database
run: |
sudo systemctl start mysql
mysql -uroot -proot -e 'CREATE DATABASE flarum_test;' --port 13306
mysql -uroot -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';" --port 13306
- name: Install Composer dependencies
run: composer install
working-directory: ${{ inputs.backend_directory }}
- name: Setup Composer tests
run: composer test:setup
# If we have a `inputs.monorepo_tests`, we will run tests for each item of the provided array in a ::group::item
# If we don't have a `inputs.monorepo_tests`, we will run tests for the current repository
# We also have to run the `composer test:setup` script first before running each test
- name: Run tests
run: |
if [ -z "${{ inputs.monorepo_tests }}" ]; then
composer test:setup
composer test
else
for test in ${{ inputs.monorepo_tests }}; do
echo "::group::Running tests for $test"
composer test:setup --working-dir=$test
composer test --working-dir=$test
echo "::endgroup::"
done
fi
working-directory: ${{ inputs.backend_directory }}
env:
DB_PORT: 13306
DB_PASSWORD: root
DB_HOST: 127.0.0.1
DB_PORT: ${{ (matrix.driver == 'mysql' && job.services.mysql.ports['3306']) || (matrix.driver == 'mariadb' && job.services.mariadb.ports['3306']) || (matrix.driver == 'pgsql' && job.services.postgres.ports['5432']) }}
DB_PREFIX: ${{ matrix.prefix }}
- name: Run Composer tests
run: composer test
working-directory: ${{ inputs.backend_directory }}
env:
DB_DRIVER: ${{ matrix.driver }}
COMPOSER_PROCESS_TIMEOUT: 600
phpstan:
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner_type }}
strategy:
matrix:
php: ${{ fromJSON(inputs.php_versions) }}
php: ${{ fromJson(inputs.php_versions) }}
name: 'PHPStan PHP ${{ matrix.php }}'
@ -186,5 +265,16 @@ jobs:
run: composer install
working-directory: ${{ inputs.backend_directory }}
- name: Create MySQL Database
run: |
sudo systemctl start mysql
mysql -uroot -proot -e 'CREATE DATABASE flarum_test;' --port 3306
- name: Run PHPStan
run: composer analyse:phpstan
env:
DB_USERNAME: root
DB_PORT: 3306
DB_PASSWORD: root
COMPOSER_PROCESS_TIMEOUT: 600
FLARUM_TEST_TMP_DIR_LOCAL: ./tmp

View File

@ -74,7 +74,7 @@ on:
description: The node version to use for the workflow.
type: number
required: false
default: 16
default: 20
js_package_manager:
description: "Enable TypeScript?"
@ -86,30 +86,41 @@ on:
type: string
required: false
runner_type:
description: The type of runner to use for the jobs. This should be one of the types supported by the `runs-on` keyword.
type: string
required: false
default: 'ubuntu-latest'
secrets:
bundlewatch_github_token:
description: The GitHub token to use for Bundlewatch.
required: false
composer_auth:
description: The Composer auth tokens to use for private packages.
required: false
env:
COMPOSER_ROOT_VERSION: dev-main
ci_script: ${{ inputs.js_package_manager == 'yarn' && 'yarn install --immutable' || 'npm ci' }}
cache_dependency_path: ${{ inputs.cache_dependency_path || format(inputs.js_package_manager == 'yarn' && '{0}/yarn.lock' || '{0}/package-lock.json', inputs.frontend_directory) }}
COMPOSER_AUTH: ${{ secrets.composer_auth }}
DISABLE_V8_COMPILE_CACHE: 1
jobs:
build:
name: Checks & Build
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner_type }}
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@v3
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
@ -132,7 +143,7 @@ jobs:
working-directory: ${{ inputs.frontend_directory }}
- name: JS Checks & Production Build
uses: flarum/action-build@v3
uses: flarum/action-build@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: ${{ inputs.build_script }}
@ -152,3 +163,4 @@ jobs:
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.bundlewatch_github_token }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_BRANCH_BASE: ${{ github.event.pull_request.base.ref }}

11
.github/workflows/backend.yml vendored Normal file
View File

@ -0,0 +1,11 @@
name: Backend Tests
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: .
monorepo_tests: "framework/core extensions/akismet extensions/approval extensions/flags extensions/likes extensions/mentions extensions/nicknames extensions/statistics extensions/sticky extensions/subscriptions extensions/suspend extensions/tags extensions/messages php-packages/testing/tests"

View File

@ -0,0 +1,29 @@
name: Build Install Packages
on:
release:
types: [released]
env:
VERSION: ${{ github.event.release.tag_name }}
PHP_VERSIONS: '8.2 8.3 8.4'
INSTALL_PACKAGES_INPUTS: '{ "flarum_version": "{0}", "php_versions": "{1}" }'
jobs:
delay:
name: Wait for packagist to publish new packages
runs-on: ubuntu-latest
steps:
- run: sleep 30m
build:
name: Build Installation Packages
runs-on: ubuntu-latest
steps:
- name: Trigger build in flarum/installation-packages
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Build Flarum Install Packages
repo: flarum/installation-packages
token: ${{ secrets.PACKAGES_BUILD_TOKEN }}
inputs: ${{ format(env.INSTALL_PACKAGES_INPUTS, env.VERSION, env.PHP_VERSIONS) }}

View File

@ -1,11 +0,0 @@
name: Akismet PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/akismet

View File

@ -1,11 +0,0 @@
name: Approval PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/approval

View File

@ -1,11 +0,0 @@
name: Core PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./framework/core

View File

@ -1,11 +0,0 @@
name: Embed PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
backend_directory: ./extensions/embed

View File

@ -1,11 +0,0 @@
name: Emoji PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
backend_directory: ./extensions/emoji

View File

@ -1,11 +0,0 @@
name: Flags PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/flags

View File

@ -1,11 +0,0 @@
name: Likes PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/likes

View File

@ -1,11 +0,0 @@
name: Lock PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
backend_directory: ./extensions/lock

View File

@ -1,11 +0,0 @@
name: Markdown PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
backend_directory: ./extensions/markdown

View File

@ -1,11 +0,0 @@
name: Mentions PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/mentions

View File

@ -1,11 +0,0 @@
name: Nicknames PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/nicknames

View File

@ -1,11 +0,0 @@
name: Package Manager PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
backend_directory: ./extensions/package-manager

View File

@ -1,11 +0,0 @@
name: Pusher PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
backend_directory: ./extensions/pusher

View File

@ -1,11 +0,0 @@
name: Statistics PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/statistics

View File

@ -1,11 +0,0 @@
name: Sticky PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/sticky

View File

@ -1,11 +0,0 @@
name: Subscriptions PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/subscriptions

View File

@ -1,11 +0,0 @@
name: Suspend PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/suspend

View File

@ -1,11 +0,0 @@
name: Tags PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/tags

View File

@ -1,4 +1,4 @@
name: Framework JS
name: Frontend Workflow
on: [workflow_dispatch, push, pull_request]
@ -10,10 +10,9 @@ jobs:
backend_directory: ./
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: 1.x
main_git_branch: 2.x
enable_tests: true
# @TODO: fix bundlewatch
enable_bundlewatch: false
enable_bundlewatch: true
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

View File

@ -1,4 +1,4 @@
name: Framework PHP
name: Static Code Analysis
on: [workflow_dispatch, push, pull_request]
@ -8,5 +8,4 @@ jobs:
with:
enable_backend_testing: false
enable_phpstan: true
backend_directory: .

View File

@ -1,9 +1,147 @@
# Changelog
## [v1.8.2](https://github.com/flarum/framework/compare/v1.8.1...v1.8.2)
## [v2.0.0-beta.2](https://github.com/flarum/framework/compare/v2.0.0-beta.1...v2.0.0-beta.2)
### Fixed
* suspended users can abuse avatar upload [#3890]
* missing compat exports [#3888]
- (em) incorrect extension compatibility check [#4155]
- (webpack) produces incorrect ext namespace (a7d584f8e1ec650035dafd660a70586d1d0d6bb9)
- bad modal alert text alignment [#4152]
- beta.1 early bugs (a81d13e26c1c2191859493de2ad45a515ad07b90)
- code split fails with common module [#4151]
- composer no longer autofocusing [#4149]
- conditional renders 0 (1cd644d27feb4eeea5cbaedd009a3af2643af396)
- custom styles from 1.x can crash the app [#4159]
- discussion page renders before loading is finished [#4158]
- discussion posts not always properly loaded [#4156]
- fixed side nav missing top spacing [#4147]
- invisible dropdown text when header is colored (958dec594486cbc14cf8f922db324a8ffc0245e3)
- lazy module import always returns default module [#4148]
- mistakenly removed code (33121ed1cc260bf967f0b8c4d10ab5099410bac0)
- select input cuts off [#4157]
- tag selection icon alignment [#4153]
- unexpected subscription breaks rendering [#4150]
- use correct human time format key [#4154]
### Changed
- (mentions) only access related mentions if loaded (9fe17b3c24c5b9236e419a00c1230b2994b8c009)
- extensibility improvements (00426c85e38efc91554af33644b088e72b3b3c1b)
## [v2.0.0-beta.1](https://github.com/flarum/framework/compare/v1.8.9...v2.0.0-beta.1)
### Changed
- php 8.4 [#4103]
- JSON:API refactor [#3971]
- (mentions) allow renderer to be used without context [#3954]
- (flags) add pagination to flags list [#3931]
- (mentions) add integration test for reply approval notification [#3748]
- (mentions,emoji) tie autocomplete to editor instance [#3913]
- (phpstan) upgrade to be compatible with latest dependency updates [#3835]
- (tags) prevent loading tag state if loaded previously [#4009]
- (testing) run flarum/testing packages tests back again [#3844]
- Do not catch exceptions when testing Console commands [#3813]
- Patch vulnerability advisory [#3966]
- Search box improvements on tablet devices [#4076]
- Test using MySQL 8.1 [#3870]
- Upgrade dependencies [#3830], [#4012]
- Upgrade `intervention/image` to 3.2 [#3947]
- Upgrade Wikimedia/less.php to 4.1 [#3837]
- Upgrade Mithril to 2.2 [#3831]
- (tags) Wrong tag input width if contains CJK characters [#4127]
- allow custom actions runner to be defined [#3988]
- avoid using `.fa()` mixins and `@fa-var` vars [#3912]
- cleanup composer deps (40dcaf882cd017463ca792762d4aa11de8c5c7da)
- corrected typos in routes comments [#3840]
- extract `FormModal` from `Modal` [#3922]
- extract `buildSettingComponent` method into a `FormGroup` component [#3927]
- fix typos [#4021]
- function names (d15438846895a5cf7b5a584479ef63a6e3119925)
- handle deprecations from 1.x [#3909]
- ignore deprecation errors in prod [#4072]
- improve debugging experience [#3944]
- improve test suite [#3814]
- increase phpstan level to 6 [#3836]
- `HeaderPrimary.js` converted to typescript [#4052]
- merge the app with the container & implement the ApplicationContract [#3862]
- recover bundlewatch [#3829]
- remove ExtenderInterface[] as a conditional option, only support callable or ::class invoke [#3904]
- remove listing of posts in the show discussion endpoint [#4067]
- remove unused vars in catch [#3839]
- simplify if else conditions [#3843]
- simplify variable assignment using null coalescing operator [#4000]
- support composer auth in workflows [#3961]
- switch formatter to `format-message` [#4088]
- transpile js to es6 [#3699]
- unify frontend initializers naming [#4003]
- update FontAwesome v6 icon search link [#4036]
- use `::class` syntax to fetch class name instead of `get_class()` function [#3910]
- use `hex_color` rule for color validation [#3936]
- use `str_contains` instead of `strpos` [#3841]
- graceful failure from extend/override errors [#4134]
### Fixed
- (a11y) convert empty links to buttons [#3926]
- (approval) `PostWasApproved` event triggered incorrectly [#3930]
- (em) prevent use if missing php functions (94b0d67a4020e1b7027e0df53dee1d681dc822e1)
- (em) production ready check (f6e84a0dc576d1cfe8539b7438244edf156e3b1a)
- (testing) use cookie for testing authentication [#3924]
- 3 char hex color is incorrectly modified to 6 [#4013]
- Add conditional rendering for email status in MailPage.tsx [#3997]
- Logout controller allows open redirects [#3948], [#4091]
- allow use of an attribute named `relationships` (1ead69e9b66ae9bc335be663498b7ea706adbf73)
- cannot install without db prefix [#4001]
- change length of email field [#4118]
- color input changes while typing [#3919]
- console extender does not accept `::class` attribute for schedule [#3903]
- default labels with `SettingDropdown` and `SelectDropdown` [#3854]
- duplicated `mentionsUsers` in extend.php (2b56129d70d18686a73d044ff65b418eef83f388)
- handled API errors break preloaded content [#3920]
- improve the flarum validator [#4133]
- installation command config path can be null (07623afacde590c45a20537add3b72a919050819)
- larastan changed namespace [#3955]
- larastan changes frequently (af2a32a3a4f50874c63785f5168e1df60f947553)
- load event mentioned tags on show discussion endpoint [#3915]
- move `UserSearchResult` to common (35f76bce60361caac8001c41c421de30f567b221)
- notify for all posts switch field loading state [#3938]
- only set actor on events that have it [#3914]
- overflowing forum stats [#3940]
- paginated list limit hard to change [#3918]
- prevent wiping out existing database on install [#4092]
- reset save button state when an error occurs in admin page [#4010]
- usage of `aria-hidden=false` might cause inconsistent behavior [#4074]
- use dynamic viewport units for height of Modals [#3951]
- user pages history not registered [#3916]
- validate required cli install args [#4093]
- make `WelcomeHero` extensible [#3848]
- Update the scheduler info link in admin (#3826)
### Added
- Export Registry [#3842]
- Code Splitting [#3860]
- Fontawesome v6 [#4020]
- extension bisect [#3980]
- extension list UI [#4066]
- admin search UI [#4022]
- add support for `PgSQL` [#3985]
- add support for `SQLite` [#3984]
- separate `MariaDB` driver [#4132]
- advanced maintenance modes [#3977]
- notification unsubscribe links [#3872]
- email overhaul with HTML multipart [#3872]
- date time formats from locales [#4029]
- messages extension [#4028]
- search drivers (revamp search system) [#3893]
- search UI/UX revamp [#3941]
- post search adapted with global search [#4019]
- vanilla CSS color scheme changes [#3996]
- (emoji) allow the user to set the CDN address [#3908]
- (nicknames) allow OAuth to provide a nickname [#4004]
- (sticky) make excerpt optional in sticky [#4016]
- JS `Notification` extender [#3974]
- add `whenExtensionDisabled` to `Conditional` extender [#3847]
- add option for filtering read stickied on all discussions page [#4073]
- allow resetting settings to default [#3935]
- define `FLARUM_START` constant [#4082]
- dispatch event to `flarum/installation-packages` on release [#3625]
- eloquent factories (primarily for tests) [#3982]
- frontend content flexible order priorities [#3765]
- improve emoji autocomplete [#3923]
- recover support for ico favicon [#4126]
- theming and extensibility improvements [#3876]
## [v1.8.1](https://github.com/flarum/framework/compare/v1.8.0...v1.8.1)
### Fixed
@ -475,7 +613,7 @@ looks rather complex and messy compared to the full list of changes made for thi
- Pass filter params to getApiDocument (https://github.com/flarum/framework/pull/3037)
- Use author filter instead of gambit to get a user's discussions (https://github.com/flarum/framework/pull/3068)
- [A11Y] Accessibility improvements for the Search component (https://github.com/flarum/framework/pull/3017)
- Add determinsm to extension order resolution (https://github.com/flarum/framework/pull/3076)
- Add determinism to extension order resolution (https://github.com/flarum/framework/pull/3076)
- Add cache control headers to the admin area (https://github.com/flarum/framework/pull/3097)
### Fixed

View File

@ -1,5 +1,5 @@
<p align="center">
<a href="https://flarum.org/"><img src="https://flarum.org/assets/img/logo.png"></a>
<a href="https://flarum.org/"><img src="https://flarum.org/images/flarum.svg"></a>
</p>
<p align="center">
@ -7,7 +7,6 @@
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/packagist/dt/flarum/core" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/github/v/release/flarum/core?sort=semver" alt="Latest Version"></a>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/packagist/l/flarum/core" alt="License"></a>
<a href="https://huntr.dev/bounties/disclose/?target=https://github.com/flarum/core"><img src="https://cdn.huntr.dev/huntr_security_badge_mono.svg" alt="huntr"></a>
<a href="https://github.styleci.io/repos/28257573"><img src="https://github.styleci.io/repos/28257573/shield?style=flat" alt="StyleCI"></a>
</p>
@ -21,7 +20,7 @@
* **Powerful and extensible.** Customize, extend, and integrate Flarum to suit your community. Flarum’s architecture is amazingly flexible, with a powerful Extension API.
![Screenshot of a Flarum instance, showing multiple discussions and tags.](https://flarum.org/assets/img/home-screenshot.png)
![Screenshot of a Flarum instance, showing multiple discussions and tags.](https://flarum.org/assets/flarum/home-screenshot.png)
## Installation
@ -38,3 +37,4 @@ If you discover a security vulnerability within Flarum, please send an e-mail to
## License
Flarum is open-source software licensed under the [MIT License](https://github.com/flarum/flarum/blob/master/LICENSE).

16
bin/test.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
MONOREPO_TEST="framework/core extensions/akismet extensions/approval extensions/flags extensions/likes extensions/mentions extensions/nicknames extensions/statistics extensions/sticky extensions/subscriptions extensions/suspend extensions/tags extensions/messages php-packages/testing/tests"
for test in $MONOREPO_TEST; do
echo ""
echo "===> Testing $test"
echo ""
# composer test:setup --working-dir=$test
composer test --working-dir=$test
echo ""
echo "===> Done testing $test"
echo ""
done

View File

@ -46,13 +46,14 @@
"Flarum\\Lock\\": "extensions/lock/src",
"Flarum\\Mentions\\": "extensions/mentions/src",
"Flarum\\Nicknames\\": "extensions/nicknames/src",
"Flarum\\PackageManager\\": "extensions/package-manager/src",
"Flarum\\ExtensionManager\\": "extensions/package-manager/src",
"Flarum\\Pusher\\": "extensions/pusher/src",
"Flarum\\Statistics\\": "extensions/statistics/src",
"Flarum\\Sticky\\": "extensions/sticky/src",
"Flarum\\Subscriptions\\": "extensions/subscriptions/src",
"Flarum\\Suspend\\": "extensions/suspend/src",
"Flarum\\Tags\\": "extensions/tags/src",
"Flarum\\Messages\\": "extensions/messages/src",
"Flarum\\PHPStan\\": "php-packages/phpstan/src",
"Flarum\\Testing\\": "php-packages/testing/src"
},
@ -60,6 +61,27 @@
"framework/core/src/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Flarum\\Tests\\": "tests",
"Flarum\\Akismet\\Tests\\": "extensions/akismet/tests",
"Flarum\\Approval\\Tests\\": "extensions/approval/tests",
"Flarum\\Flags\\Tests\\": "extensions/flags/tests",
"Flarum\\Likes\\Tests\\": "extensions/likes/tests",
"Flarum\\Lock\\Tests\\": "extensions/lock/tests",
"Flarum\\Mentions\\Tests\\": "extensions/mentions/tests",
"Flarum\\Nicknames\\Tests\\": "extensions/nicknames/tests",
"Flarum\\ExtensionManager\\Tests\\": "extensions/package-manager/tests",
"Flarum\\Pusher\\Tests\\": "extensions/pusher/tests",
"Flarum\\Statistics\\Tests\\": "extensions/statistics/tests",
"Flarum\\Sticky\\Tests\\": "extensions/sticky/tests",
"Flarum\\Subscriptions\\Tests\\": "extensions/subscriptions/tests",
"Flarum\\Suspend\\Tests\\": "extensions/suspend/tests",
"Flarum\\Tags\\Tests\\": "extensions/tags/tests",
"Flarum\\Messages\\Tests\\": "extensions/messages/tests",
"Flarum\\Testing\\Tests\\": "php-packages/testing/tests"
}
},
"replace": {
"flarum/core": "self.version",
"flarum/akismet": "self.version",
@ -74,77 +96,84 @@
"flarum/markdown": "self.version",
"flarum/mentions": "self.version",
"flarum/nicknames": "self.version",
"flarum/package-manager": "self.version",
"flarum/extension-manager": "self.version",
"flarum/pusher": "self.version",
"flarum/statistics": "self.version",
"flarum/sticky": "self.version",
"flarum/subscriptions": "self.version",
"flarum/suspend": "self.version",
"flarum/tags": "self.version",
"flarum/messages": "self.version",
"flarum/phpstan": "self.version",
"flarum/testing": "self.version"
},
"require": {
"php": ">=7.3",
"php": "^8.2",
"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": "^6.0|^7.4",
"illuminate/bus": "^8.0",
"illuminate/cache": "^8.0",
"illuminate/config": "^8.0",
"illuminate/console": "^8.0",
"illuminate/container": "^8.0",
"illuminate/contracts": "^8.0",
"illuminate/database": "^8.0",
"illuminate/events": "^8.0",
"illuminate/filesystem": "^8.0",
"illuminate/hashing": "^8.0",
"illuminate/mail": "^8.0",
"illuminate/queue": "^8.0",
"illuminate/session": "^8.0",
"illuminate/support": "^8.0",
"illuminate/validation": "^8.0",
"illuminate/view": "^8.0",
"intervention/image": "2.5.* || ^2.6.1",
"components/font-awesome": "^6.5.2",
"composer/composer": "^2.7",
"dflydev/fig-cookies": "^3.0",
"doctrine/dbal": "^3.6.2",
"dragonmantank/cron-expression": "^3.3",
"fakerphp/faker": "^1.9.1",
"flarum/json-api-server": "^0.1.0",
"franzl/whoops-middleware": "2.0",
"guzzlehttp/guzzle": "*",
"illuminate/bus": "^11.0",
"illuminate/cache": "^11.0",
"illuminate/config": "^11.0",
"illuminate/console": "^11.0",
"illuminate/container": "^11.0",
"illuminate/contracts": "^11.0",
"illuminate/database": "^11.0",
"illuminate/events": "^11.0",
"illuminate/filesystem": "^11.0",
"illuminate/hashing": "^11.0",
"illuminate/mail": "^11.0",
"illuminate/queue": "^11.0",
"illuminate/session": "^11.0",
"illuminate/support": "^11.0",
"illuminate/validation": "^11.0",
"illuminate/view": "^11.0",
"intervention/image": "^3.2",
"jenssegers/agent": "^2.6",
"laminas/laminas-diactoros": "^2.4.1",
"laminas/laminas-httphandlerrunner": "^1.2.0 || ^2.3.0",
"laminas/laminas-stratigility": "^3.2.2",
"league/flysystem": "^1.0.11",
"laminas/laminas-diactoros": "^3.0",
"laminas/laminas-httphandlerrunner": "^2.6",
"laminas/laminas-stratigility": "^3.10",
"league/flysystem": "^3.15",
"league/flysystem-memory": "^3.15",
"matthiasmullie/minify": "^1.3",
"middlewares/base-path": "^2.0.1",
"middlewares/base-path": "^v2.1",
"middlewares/base-path-router": "^2.0.1",
"middlewares/request-handler": "^2.0.1",
"monolog/monolog": "^1.16.0",
"nesbot/carbon": "^2.0",
"nikic/fast-route": "^0.6",
"psr/http-message": "^1.0",
"psr/http-server-handler": "^1.0",
"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",
"middlewares/request-handler": "^2.0.2",
"monolog/monolog": "^3.3",
"nesbot/carbon": "^3.0",
"nikic/fast-route": "^1.3",
"psr/http-message": "^1.1",
"psr/http-server-handler": "^1.0.2",
"psr/http-server-middleware": "^1.0.2",
"pusher/pusher-php-server": "^7.2",
"s9e/text-formatter": "^2.13",
"sycho/sourcemap": "^2.0.0",
"symfony/config": "^5.2.2",
"symfony/console": "^5.2.2",
"symfony/event-dispatcher": "^5.2.2",
"symfony/mime": "^5.2.0",
"symfony/polyfill-intl-messageformatter": "^1.22.0",
"symfony/translation": "^5.1.5",
"symfony/yaml": "^5.2.2",
"wikimedia/less.php": "^3.0"
"symfony/config": "^7.0",
"symfony/console": "^7.0",
"symfony/event-dispatcher": "^7.0",
"symfony/http-client": "^7.0",
"symfony/mailgun-mailer": "^7.0",
"symfony/mime": "^7.0",
"symfony/polyfill-intl-messageformatter": "^1.27",
"symfony/postmark-mailer": "^7.0",
"symfony/translation": "^7.0",
"symfony/yaml": "^7.0",
"wikimedia/less.php": "^4.1"
},
"require-dev": {
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^9.0",
"phpstan/phpstan": ">=1.8.11 < 1.9.0",
"nunomaduro/larastan": "^1.0"
"mockery/mockery": "^1.5",
"phpunit/phpunit": "^11.0",
"phpstan/phpstan": "^1.10.0",
"larastan/larastan": "2.9.14",
"symfony/var-dumper": "^7.0",
"flarum/testing-tests": "*@dev"
},
"config": {
"sort-packages": true
@ -171,10 +200,11 @@
"extensions/sticky",
"extensions/subscriptions",
"extensions/suspend",
"extensions/tags"
"extensions/tags",
"extensions/messages"
],
"branch-alias": {
"dev-main": "1.x-dev"
"dev-main": "2.x-dev"
},
"phpstan": {
"includes": [
@ -188,5 +218,11 @@
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"
}
},
"repositories": [
{
"type": "path",
"url": "php-packages/testing/tests"
}
]
}

View File

@ -4,6 +4,7 @@ composer.phar
.DS_Store
Thumbs.db
tests/.phpunit.cache
tests/.phpunit.result.cache
/tests/integration/tmp
.vagrant

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019-2021 Stichting Flarum (Flarum Foundation)
Copyright (c) 2019-2024 Stichting Flarum (Flarum Foundation)
Copyright (c) 2014-2019 Toby Zerner (toby.zerner@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -19,8 +19,8 @@
}
],
"require": {
"flarum/core": "^1.8",
"flarum/approval": "^1.7"
"flarum/core": "^2.0.0-beta.2",
"flarum/approval": "^2.0"
},
"autoload": {
"psr-4": {
@ -29,7 +29,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.x-dev"
"dev-main": "2.x-dev"
},
"flarum-extension": {
"title": "Akismet",
@ -75,7 +75,7 @@
"test:setup": "Sets up a database for use with integration tests. Execute this only once."
},
"require-dev": {
"flarum/testing": "^1.0.0"
"flarum/testing": "^2.0"
},
"repositories": [
{

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

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

View File

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

View File

@ -1,2 +1,2 @@
(()=>{var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t);const a=flarum.core.compat["admin/app"];var r=e.n(a);r().initializers.add("flarum-akismet",(function(){r().extensionData.for("flarum-akismet").registerSetting({setting:"flarum-akismet.api_key",type:"text",label:r().translator.trans("flarum-akismet.admin.akismet_settings.api_key_label")}).registerSetting({setting:"flarum-akismet.delete_blatant_spam",type:"boolean",label:r().translator.trans("flarum-akismet.admin.akismet_settings.delete_blatant_spam_label"),help:r().translator.trans("flarum-akismet.admin.akismet_settings.delete_blatant_spam_help")}).registerPermission({icon:"fas fa-vote-yea",label:r().translator.trans("flarum-akismet.admin.permissions.bypass_akismet"),permission:"bypassAkismet"},"start")}))})(),module.exports=t})();
(()=>{var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var s in a)e.o(a,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:a[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t),e.d(t,{extend:()=>n});const a=flarum.reg.get("core","admin/app");var s=e.n(a);const r=flarum.reg.get("core","common/extenders"),n=[(new(e.n(r)().Admin)).setting((()=>({setting:"flarum-akismet.api_key",type:"text",label:s().translator.trans("flarum-akismet.admin.akismet_settings.api_key_label")}))).setting((()=>({setting:"flarum-akismet.delete_blatant_spam",type:"boolean",label:s().translator.trans("flarum-akismet.admin.akismet_settings.delete_blatant_spam_label"),help:s().translator.trans("flarum-akismet.admin.akismet_settings.delete_blatant_spam_help")}))).permission((()=>({icon:"fas fa-vote-yea",label:s().translator.trans("flarum-akismet.admin.permissions.bypass_akismet"),permission:"bypassAkismet"})),"start")];s().initializers.add("flarum-akismet",(()=>{}))})(),module.exports=t})();
//# sourceMappingURL=admin.js.map

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,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":""}
{"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,qDCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,a,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,oBCE5D,IAAgB,I,MAAI,WAAeW,SAAQ,KAAM,CAC/CA,QAAS,yBACTC,KAAM,OACNC,MAAO,eAAeC,MAAM,2DAC1BH,SAAQ,KAAM,CAEhBA,QAAS,qCACTC,KAAM,UACNC,MAAO,eAAeC,MAAM,mEAC5BC,KAAM,eAAeD,MAAM,sEACzBE,YAAW,KAAM,CACnBC,KAAM,kBACNJ,MAAO,eAAeC,MAAM,mDAC5BE,WAAY,mBACV,UCdJ,iBAAiBE,IAAI,kBAAkB,Q","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.reg.get('core', 'admin/app')\"","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/akismet/./src/admin/extend.tsx","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.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","import Extend from 'flarum/common/extenders';\nimport app from 'flarum/admin/app';\nexport default [new Extend.Admin().setting(() => ({\n setting: 'flarum-akismet.api_key',\n type: 'text',\n label: app.translator.trans('flarum-akismet.admin.akismet_settings.api_key_label')\n})).setting(() => ({\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})).permission(() => ({\n icon: 'fas fa-vote-yea',\n label: app.translator.trans('flarum-akismet.admin.permissions.bypass_akismet'),\n permission: 'bypassAkismet'\n}), 'start')];","import app from 'flarum/admin/app';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-akismet', () => {\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","reg","setting","type","label","trans","help","permission","icon","add"],"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 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})();
(()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};(()=>{"use strict";const t=flarum.reg.get("core","common/extend"),r=flarum.reg.get("core","forum/app");var o=e.n(r);const a=flarum.reg.get("core","forum/utils/PostControls");var n=e.n(a);const s=flarum.reg.get("core","forum/components/Post");var m=e.n(s);o().initializers.add("flarum-akismet",(()=>{(0,t.extend)(n(),"destructiveControls",(function(e,t){if(e.has("approve")){const r=t.flags();if(r&&r.some((e=>"akismet"===e?.type()))){const t=e.get("approve");t&&"object"==typeof t&&"children"in t&&(t.children=o().translator.trans("flarum-akismet.forum.post.not_spam_button"))}}})),(0,t.override)(m().prototype,"flagReason",(function(e,t){return"akismet"===t.type()?o().translator.trans("flarum-akismet.forum.post.akismet_flagged_text"):e(t)}))}))})(),module.exports={}})();
//# 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,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":""}
{"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,I,mBCAlF,MAAM,EAA+BI,OAAOC,IAAIP,IAAI,OAAQ,iBCAtD,EAA+BM,OAAOC,IAAIP,IAAI,OAAQ,a,aCA5D,MAAM,EAA+BM,OAAOC,IAAIP,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BM,OAAOC,IAAIP,IAAI,OAAQ,yB,aCI5D,iBAAiBQ,IAAI,kBAAkB,MACrC,IAAAC,QAAO,IAAc,uBAAuB,SAAUC,EAAOC,GAC3D,GAAID,EAAME,IAAI,WAAY,CACxB,MAAMC,EAAQF,EAAKE,QACnB,GAAIA,GAASA,EAAMC,MAAKC,GAAyB,YAAjBA,GAAMC,SAAuB,CAC3D,MAAMC,EAAcP,EAAMV,IAAI,WAC1BiB,GAAsC,iBAAhBA,GAA4B,aAAcA,IAClEA,EAAYC,SAAW,eAAeC,MAAM,6CAEhD,CACF,CACF,KACA,IAAAC,UAAS,cAAyB,cAAc,SAAUC,EAAUN,GAClE,MAAoB,YAAhBA,EAAKC,OACA,eAAeG,MAAM,kDAEvBE,EAASN,EAClB,GAAE,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/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'forum/utils/PostControls')\"","webpack://@flarum/akismet/external root \"flarum.reg.get('core', '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))","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/PostControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Post');","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport PostComponent from 'flarum/forum/components/Post';\napp.initializers.add('flarum-akismet', () => {\n extend(PostControls, 'destructiveControls', function (items, post) {\n if (items.has('approve')) {\n const flags = post.flags();\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 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 return original(flag);\n });\n});"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","flarum","reg","add","extend","items","post","has","flags","some","flag","type","approveItem","children","trans","override","original"],"sourceRoot":""}

View File

@ -17,9 +17,9 @@
},
"devDependencies": {
"@flarum/prettier-config": "^1.0.0",
"flarum-tsconfig": "^1.0.2",
"flarum-tsconfig": "^2.0.0",
"prettier": "^2.5.1",
"flarum-webpack-config": "^2.0.0",
"flarum-webpack-config": "^3.0.0",
"webpack": "^5.76.0",
"webpack-cli": "^4.9.1",
"typescript": "^4.5.4",

View File

@ -0,0 +1,26 @@
import Extend from 'flarum/common/extenders';
import app from 'flarum/admin/app';
export default [
new Extend.Admin()
.setting(() => ({
setting: 'flarum-akismet.api_key',
type: 'text',
label: app.translator.trans('flarum-akismet.admin.akismet_settings.api_key_label'),
}))
.setting(() => ({
// https://blog.akismet.com/2014/04/23/theres-a-ninja-in-your-akismet/
setting: 'flarum-akismet.delete_blatant_spam',
type: 'boolean',
label: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_label'),
help: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_help'),
}))
.permission(
() => ({
icon: 'fas fa-vote-yea',
label: app.translator.trans('flarum-akismet.admin.permissions.bypass_akismet'),
permission: 'bypassAkismet',
}),
'start'
),
];

View File

@ -1,26 +1,7 @@
import app from 'flarum/admin/app';
export { default as extend } from './extend';
app.initializers.add('flarum-akismet', () => {
app.extensionData
.for('flarum-akismet')
.registerSetting({
setting: 'flarum-akismet.api_key',
type: 'text',
label: app.translator.trans('flarum-akismet.admin.akismet_settings.api_key_label'),
})
.registerSetting({
//https://blog.akismet.com/2014/04/23/theres-a-ninja-in-your-akismet/
setting: 'flarum-akismet.delete_blatant_spam',
type: 'boolean',
label: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_label'),
help: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_help'),
})
.registerPermission(
{
icon: 'fas fa-vote-yea',
label: app.translator.trans('flarum-akismet.admin.permissions.bypass_akismet'),
permission: 'bypassAkismet',
},
'start'
);
// ...
});

View File

@ -15,7 +15,7 @@
"declarationDir": "./dist-typings",
"paths": {
"flarum/*": ["../../../framework/core/js/dist-typings/*"],
"flarum/flags/*": ["../../flags/js/dist-typings/*"]
"ext:flarum/flags/*": ["../../flags/js/dist-typings/*"]
}
}
}

View File

@ -15,22 +15,19 @@ use Psr\Http\Message\ResponseInterface;
class Akismet
{
private $apiKey;
private $apiUrl;
private $flarumVersion;
private $extensionVersion;
private string $apiUrl;
private array $params = [];
private $params = [];
public function __construct(string $apiKey, string $homeUrl, string $flarumVersion, string $extensionVersion, bool $inDebugMode = false)
{
$this->apiKey = $apiKey;
public function __construct(
private readonly string $apiKey,
string $homeUrl,
private readonly string $flarumVersion,
private readonly string $extensionVersion,
bool $inDebugMode = false
) {
$this->apiUrl = "https://$apiKey.rest.akismet.com/1.1";
$this->params['blog'] = $homeUrl;
$this->flarumVersion = $flarumVersion;
$this->extensionVersion = $extensionVersion;
if ($inDebugMode) {
$this->params['is_test'] = true;
}
@ -50,7 +47,7 @@ class Akismet
$client = new Client();
return $client->request('POST', "$this->apiUrl/$type", [
'headers' => [
'headers' => [
'User-Agent' => "Flarum/$this->flarumVersion | Akismet/$this->extensionVersion",
],
'form_params' => $this->params,
@ -73,7 +70,7 @@ class Akismet
/**
* @throws GuzzleException
*/
public function submitSpam()
public function submitSpam(): void
{
$this->sendRequest('submit-spam');
}
@ -81,7 +78,7 @@ class Akismet
/**
* @throws GuzzleException
*/
public function submitHam()
public function submitHam(): void
{
$this->sendRequest('submit-ham');
}
@ -90,7 +87,7 @@ class Akismet
* Allows you to set additional parameter
* This lets you use Akismet features not supported directly in this util.
*/
public function withParam(string $key, $value): Akismet
public function withParam(string $key, mixed $value): Akismet
{
$new = clone $this;
$new->params[$key] = $value;

View File

@ -14,17 +14,12 @@ use Flarum\Approval\Event\PostWasApproved;
class SubmitHam
{
/**
* @var Akismet
*/
protected $akismet;
public function __construct(Akismet $akismet)
{
$this->akismet = $akismet;
public function __construct(
protected Akismet $akismet
) {
}
public function handle(PostWasApproved $event)
public function handle(PostWasApproved $event): void
{
if (! $this->akismet->isConfigured()) {
return;

View File

@ -14,17 +14,12 @@ use Flarum\Post\Event\Hidden;
class SubmitSpam
{
/**
* @var Akismet
*/
protected $akismet;
public function __construct(Akismet $akismet)
{
$this->akismet = $akismet;
public function __construct(
protected Akismet $akismet
) {
}
public function handle(Hidden $event)
public function handle(Hidden $event): void
{
if (! $this->akismet->isConfigured()) {
return;

View File

@ -18,22 +18,13 @@ use Flarum\Settings\SettingsRepositoryInterface;
class ValidatePost
{
/**
* @var Akismet
*/
protected $akismet;
/**
* @var SettingsRepositoryInterface
*/
private $settings;
public function __construct(Akismet $akismet, SettingsRepositoryInterface $settings)
{
$this->akismet = $akismet;
$this->settings = $settings;
public function __construct(
protected Akismet $akismet,
protected SettingsRepositoryInterface $settings
) {
}
public function handle(Saving $event)
public function handle(Saving $event): void
{
if (! $this->akismet->isConfigured()) {
return;

View File

@ -20,7 +20,7 @@ use Illuminate\Container\Container;
class AkismetProvider extends AbstractServiceProvider
{
public function register()
public function register(): void
{
$this->container->bind(Akismet::class, function (Container $container) {
/** @var SettingsRepositoryInterface $settings */

View File

@ -7,10 +7,6 @@
* LICENSE file that was distributed with this source code.
*/
use Flarum\Testing\integration\Setup\SetupScript;
require __DIR__.'/../../vendor/autoload.php';
$setup = new SetupScript();
$setup = require __DIR__.'/../../../../php-packages/testing/bootstrap/monorepo.php';
$setup->run();

View File

@ -1,21 +1,20 @@
<?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"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="true"
stopOnFailure="false"
bootstrap="../../../php-packages/testing/bootstrap/monorepo.php"
>
<coverage processUncoveredFiles="true">
<source>
<include>
<directory suffix=".php">../src/</directory>
</include>
</coverage>
</source>
<testsuites>
<testsuite name="Flarum Integration Tests">
<directory suffix="Test.php">./integration</directory>

View File

@ -1,27 +1,23 @@
<?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"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="../../../php-packages/testing/bootstrap/monorepo.php"
>
<coverage processUncoveredFiles="true">
<source>
<include>
<directory suffix=".php">../src/</directory>
</include>
</coverage>
</source>
<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

@ -4,6 +4,7 @@ composer.phar
.DS_Store
Thumbs.db
tests/.phpunit.cache
tests/.phpunit.result.cache
/tests/integration/tmp
.vagrant

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019-2021 Stichting Flarum (Flarum Foundation)
Copyright (c) 2019-2024 Stichting Flarum (Flarum Foundation)
Copyright (c) 2014-2019 Toby Zerner (toby.zerner@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -19,8 +19,8 @@
}
],
"require": {
"flarum/core": "^1.8",
"flarum/flags": "^1.7"
"flarum/core": "^2.0.0-beta.2",
"flarum/flags": "^2.0"
},
"autoload": {
"psr-4": {
@ -29,7 +29,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.x-dev"
"dev-main": "2.x-dev"
},
"flarum-extension": {
"title": "Approval",
@ -87,6 +87,6 @@
"test:setup": "Sets up a database for use with integration tests. Execute this only once."
},
"require-dev": {
"flarum/testing": "^1.0.0"
"flarum/testing": "^2.0"
}
}

View File

@ -7,9 +7,10 @@
* LICENSE file that was distributed with this source code.
*/
use Flarum\Api\Serializer\BasicDiscussionSerializer;
use Flarum\Api\Serializer\PostSerializer;
use Flarum\Api\Resource;
use Flarum\Api\Schema;
use Flarum\Approval\Access;
use Flarum\Approval\Api\PostResourceFields;
use Flarum\Approval\Event\PostWasApproved;
use Flarum\Approval\Listener;
use Flarum\Discussion\Discussion;
@ -36,17 +37,13 @@ return [
->default('is_approved', true)
->cast('is_approved', 'bool'),
(new Extend\ApiSerializer(BasicDiscussionSerializer::class))
->attribute('isApproved', function ($serializer, Discussion $discussion) {
return $discussion->is_approved;
}),
(new Extend\ApiResource(Resource\DiscussionResource::class))
->fields(fn () => [
Schema\Boolean::make('isApproved'),
]),
(new Extend\ApiSerializer(PostSerializer::class))
->attribute('isApproved', function ($serializer, Post $post) {
return (bool) $post->is_approved;
})->attribute('canApprove', function (PostSerializer $serializer, Post $post) {
return (bool) $serializer->getActor()->can('approvePosts', $post->discussion);
}),
(new Extend\ApiResource(Resource\PostResource::class))
->fields(PostResourceFields::class),
new Extend\Locales(__DIR__.'/locale'),
@ -65,8 +62,8 @@ return [
->scope(Access\ScopePrivateDiscussionVisibility::class, 'viewPrivate'),
(new Extend\ModelPrivate(Discussion::class))
->checker([Listener\UnapproveNewContent::class, 'markUnapprovedContentAsPrivate']),
->checker(Listener\UnapproveNewContent::markUnapprovedContentAsPrivate(...)),
(new Extend\ModelPrivate(CommentPost::class))
->checker([Listener\UnapproveNewContent::class, 'markUnapprovedContentAsPrivate']),
->checker(Listener\UnapproveNewContent::markUnapprovedContentAsPrivate(...)),
];

View File

@ -1,2 +1,2 @@
(()=>{var r={n:s=>{var e=s&&s.__esModule?()=>s.default:()=>s;return r.d(e,{a:e}),e},d:(s,e)=>{for(var a in e)r.o(e,a)&&!r.o(s,a)&&Object.defineProperty(s,a,{enumerable:!0,get:e[a]})},o:(r,s)=>Object.prototype.hasOwnProperty.call(r,s),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},s={};(()=>{"use strict";r.r(s);const e=flarum.core.compat["common/extend"],a=flarum.core.compat["admin/app"];var o=r.n(a);o().initializers.add("flarum-approval",(function(){(0,e.extend)(o(),"getRequiredPermissions",(function(r,s){"discussion.startWithoutApproval"===s&&r.push("startDiscussion"),"discussion.replyWithoutApproval"===s&&r.push("discussion.reply")})),o().extensionData.for("flarum-approval").registerPermission({icon:"fas fa-check",label:o().translator.trans("flarum-approval.admin.permissions.start_discussions_without_approval_label"),permission:"discussion.startWithoutApproval"},"start",95).registerPermission({icon:"fas fa-check",label:o().translator.trans("flarum-approval.admin.permissions.reply_without_approval_label"),permission:"discussion.replyWithoutApproval"},"reply",95).registerPermission({icon:"fas fa-check",label:o().translator.trans("flarum-approval.admin.permissions.approve_posts_label"),permission:"discussion.approvePosts"},"moderate",65)}))})(),module.exports=s})();
(()=>{var e={n:r=>{var s=r&&r.__esModule?()=>r.default:()=>r;return e.d(s,{a:s}),s},d:(r,s)=>{for(var o in s)e.o(s,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:s[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};(()=>{"use strict";e.r(r),e.d(r,{extend:()=>i});const s=flarum.reg.get("core","common/extend"),o=flarum.reg.get("core","admin/app");var a=e.n(o);const t=flarum.reg.get("core","common/extenders"),i=[(new(e.n(t)().Admin)).permission((()=>({icon:"fas fa-check",label:a().translator.trans("flarum-approval.admin.permissions.start_discussions_without_approval_label"),permission:"discussion.startWithoutApproval"})),"start",95).permission((()=>({icon:"fas fa-check",label:a().translator.trans("flarum-approval.admin.permissions.reply_without_approval_label"),permission:"discussion.replyWithoutApproval"})),"reply",95).permission((()=>({icon:"fas fa-check",label:a().translator.trans("flarum-approval.admin.permissions.approve_posts_label"),permission:"discussion.approvePosts"})),"moderate",65)];a().initializers.add("flarum-approval",(()=>{(0,s.extend)(a(),"getRequiredPermissions",(function(e,r){"discussion.startWithoutApproval"===r&&e.push("startDiscussion"),"discussion.replyWithoutApproval"===r&&e.push("discussion.reply")}))}))})(),module.exports=r})();
//# sourceMappingURL=admin.js.map

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,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":""}
{"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,qDCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,iBCAtD,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,a,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,oBCE5D,IAAgB,I,MAAI,WAAeW,YAAW,KAAM,CAClDC,KAAM,eACNC,MAAO,eAAeC,MAAM,8EAC5BH,WAAY,qCACV,QAAS,IAAIA,YAAW,KAAM,CAChCC,KAAM,eACNC,MAAO,eAAeC,MAAM,kEAC5BH,WAAY,qCACV,QAAS,IAAIA,YAAW,KAAM,CAChCC,KAAM,eACNC,MAAO,eAAeC,MAAM,yDAC5BH,WAAY,6BACV,WAAY,KCXhB,iBAAiBI,IAAI,mBAAmB,MACtC,IAAAC,QAAO,IAAK,0BAA0B,SAAUC,EAAUN,GACrC,oCAAfA,GACFM,EAASC,KAAK,mBAEG,oCAAfP,GACFM,EAASC,KAAK,mBAElB,GAAE,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.reg.get('core', 'common/extend')\"","webpack://@flarum/approval/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/approval/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/approval/./src/admin/extend.tsx","webpack://@flarum/approval/./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.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","import Extend from 'flarum/common/extenders';\nimport app from 'flarum/admin/app';\nexport default [new Extend.Admin().permission(() => ({\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.start_discussions_without_approval_label'),\n permission: 'discussion.startWithoutApproval'\n}), 'start', 95).permission(() => ({\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.reply_without_approval_label'),\n permission: 'discussion.replyWithoutApproval'\n}), 'reply', 95).permission(() => ({\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.approve_posts_label'),\n permission: 'discussion.approvePosts'\n}), 'moderate', 65)];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\nexport { default as extend } from './extend';\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});"],"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","reg","permission","icon","label","trans","add","extend","required","push"],"sourceRoot":""}

View File

@ -1,2 +1,2 @@
(()=>{var o={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return o.d(r,{a:r}),r},d:(t,r)=>{for(var e in r)o.o(r,e)&&!o.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:r[e]})},o:(o,t)=>Object.prototype.hasOwnProperty.call(o,t),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},t={};(()=>{"use strict";o.r(t);const r=flarum.core.compat["common/extend"],e=flarum.core.compat["forum/app"];var a=o.n(e);const p=flarum.core.compat["common/models/Discussion"];var n=o.n(p);const s=flarum.core.compat["common/models/Post"];var i=o.n(s);const c=flarum.core.compat["common/components/Badge"];var u=o.n(c);const l=flarum.core.compat["forum/components/DiscussionListItem"];var d=o.n(l);const v=flarum.core.compat["forum/components/Post"];var f=o.n(v);const A=flarum.core.compat["forum/components/CommentPost"];var y=o.n(A);const b=flarum.core.compat["common/components/Button"];var g=o.n(b);const h=flarum.core.compat["forum/utils/PostControls"];var _=o.n(h);a().initializers.add("flarum-approval",(function(){n().prototype.isApproved=n().attribute("isApproved"),(0,r.extend)(n().prototype,"badges",(function(o){this.isApproved()||o.has("hidden")||o.add("awaitingApproval",m(u(),{type:"awaitingApproval",icon:"fas fa-gavel",label:a().translator.trans("flarum-approval.forum.badge.awaiting_approval_tooltip")}))})),i().prototype.isApproved=i().attribute("isApproved"),i().prototype.canApprove=i().attribute("canApprove"),(0,r.extend)(d().prototype,"elementAttrs",(function(o){this.attrs.discussion.isApproved()||(o.className+=" DiscussionListItem--unapproved")})),(0,r.extend)(f().prototype,"elementAttrs",(function(o){this.attrs.post.isApproved()||(o.className+=" Post--unapproved")})),(0,r.extend)(y().prototype,"headerItems",(function(o){this.attrs.post.isApproved()||this.attrs.post.isHidden()||o.add("unapproved",a().translator.trans("flarum-approval.forum.post.awaiting_approval_text"))})),(0,r.override)(f().prototype,"flagReason",(function(o,t){return"approval"===t.type()?a().translator.trans("flarum-approval.forum.post.awaiting_approval_text"):o(t)})),(0,r.extend)(_(),"destructiveControls",(function(o,t){!t.isApproved()&&t.canApprove()&&o.add("approve",m(g(),{icon:"fas fa-check",onclick:_().approveAction.bind(t)},a().translator.trans("flarum-approval.forum.post_controls.approve_button")),10)})),_().approveAction=function(){this.save({isApproved:!0}),1===this.number()&&this.discussion().pushAttributes({isApproved:!0})}}),-10)})(),module.exports=t})();
(()=>{var t={n:o=>{var r=o&&o.__esModule?()=>o.default:()=>o;return t.d(r,{a:r}),r},d:(o,r)=>{for(var e in r)t.o(r,e)&&!t.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:r[e]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o)};(()=>{"use strict";const o=flarum.reg.get("core","common/extend"),r=flarum.reg.get("core","forum/app");var e=t.n(r);const a=flarum.reg.get("core","common/models/Discussion");var n=t.n(a);const p=flarum.reg.get("core","common/models/Post");var s=t.n(p);const i=flarum.reg.get("core","common/components/Badge");var c=t.n(i);const u=flarum.reg.get("core","forum/components/DiscussionListItem");var l=t.n(u);const d=flarum.reg.get("core","forum/components/Post");var v=t.n(d);const f=flarum.reg.get("core","forum/components/CommentPost");var g=t.n(f);const A=flarum.reg.get("core","common/components/Button");var h=t.n(A);const b=flarum.reg.get("core","forum/utils/PostControls");var y=t.n(b);e().initializers.add("flarum-approval",(()=>{n().prototype.isApproved=n().attribute("isApproved"),(0,o.extend)(n().prototype,"badges",(function(t){this.isApproved()||t.has("hidden")||t.add("awaitingApproval",m(c(),{type:"awaitingApproval",icon:"fas fa-gavel",label:e().translator.trans("flarum-approval.forum.badge.awaiting_approval_tooltip")}))})),s().prototype.isApproved=s().attribute("isApproved"),s().prototype.canApprove=s().attribute("canApprove"),(0,o.extend)(l().prototype,"elementAttrs",(function(t){this.attrs.discussion.isApproved()||(t.className+=" DiscussionListItem--unapproved")})),(0,o.extend)(v().prototype,"elementAttrs",(function(t){this.attrs.post.isApproved()||(t.className+=" Post--unapproved")})),(0,o.extend)(g().prototype,"headerItems",(function(t){this.attrs.post.isApproved()||this.attrs.post.isHidden()||t.add("unapproved",e().translator.trans("flarum-approval.forum.post.awaiting_approval_text"))})),(0,o.override)(v().prototype,"flagReason",(function(t,o){return"approval"===o.type()?e().translator.trans("flarum-approval.forum.post.awaiting_approval_text"):t(o)})),(0,o.extend)(y(),"destructiveControls",(function(t,o){!o.isApproved()&&o.canApprove()&&t.add("approve",m(h(),{icon:"fas fa-check",onclick:y().approveAction.bind(o)},e().translator.trans("flarum-approval.forum.post_controls.approve_button")),10)})),y().approveAction=function(){this.save({isApproved:!0}),1===this.number()&&this.discussion().pushAttributes({isApproved:!0})}}),-10)})(),module.exports={}})();
//# sourceMappingURL=forum.js.map

File diff suppressed because one or more lines are too long

View File

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

View File

@ -1,43 +1,33 @@
import { extend } from 'flarum/common/extend';
import Extend from 'flarum/common/extenders';
import app from 'flarum/admin/app';
app.initializers.add('flarum-approval', () => {
extend(app, 'getRequiredPermissions', function (required, permission) {
if (permission === 'discussion.startWithoutApproval') {
required.push('startDiscussion');
}
if (permission === 'discussion.replyWithoutApproval') {
required.push('discussion.reply');
}
});
app.extensionData
.for('flarum-approval')
.registerPermission(
{
export default [
new Extend.Admin()
.permission(
() => ({
icon: 'fas fa-check',
label: app.translator.trans('flarum-approval.admin.permissions.start_discussions_without_approval_label'),
permission: 'discussion.startWithoutApproval',
},
}),
'start',
95
)
.registerPermission(
{
.permission(
() => ({
icon: 'fas fa-check',
label: app.translator.trans('flarum-approval.admin.permissions.reply_without_approval_label'),
permission: 'discussion.replyWithoutApproval',
},
}),
'reply',
95
)
.registerPermission(
{
.permission(
() => ({
icon: 'fas fa-check',
label: app.translator.trans('flarum-approval.admin.permissions.approve_posts_label'),
permission: 'discussion.approvePosts',
},
}),
'moderate',
65
);
});
),
];

View File

@ -0,0 +1,15 @@
import { extend } from 'flarum/common/extend';
import app from 'flarum/admin/app';
export { default as extend } from './extend';
app.initializers.add('flarum-approval', () => {
extend(app, 'getRequiredPermissions', function (required, permission) {
if (permission === 'discussion.startWithoutApproval') {
required.push('startDiscussion');
}
if (permission === 'discussion.replyWithoutApproval') {
required.push('discussion.reply');
}
});
});

View File

@ -0,0 +1,15 @@
{
// Use Flarum's tsconfig as a starting point
"extends": "flarum-tsconfig",
// 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/**/*", "../../../*/*/js/dist-typings/@types/**/*", "@types/**/*"],
"compilerOptions": {
// This will output typings to `dist-typings`
"declarationDir": "./dist-typings",
"paths": {
"flarum/*": ["../../../framework/core/js/dist-typings/*"]
}
}
}

View File

@ -14,11 +14,7 @@ use Illuminate\Database\Eloquent\Builder;
class ScopePrivateDiscussionVisibility
{
/**
* @param Builder $query
* @param User $actor
*/
public function __invoke(User $actor, Builder $query)
public function __invoke(User $actor, Builder $query): void
{
// All statements need to be wrapped in an orWhere, since we're adding a
// subset of private discussions that should be visible, not restricting the visible

View File

@ -16,11 +16,7 @@ use Illuminate\Database\Eloquent\Builder;
class ScopePrivatePostVisibility
{
/**
* @param Builder $query
* @param User $actor
*/
public function __invoke(User $actor, Builder $query)
public function __invoke(User $actor, Builder $query): void
{
// All statements need to be wrapped in an orWhere, since we're adding a
// subset of private posts that should be visible, not restricting the visible

View File

@ -15,10 +15,7 @@ use Flarum\User\User;
class TagPolicy extends AbstractPolicy
{
/**
* @return bool|null
*/
public function addToDiscussion(User $actor, Tag $tag)
public function addToDiscussion(User $actor, Tag $tag): bool
{
return $actor->can('discussion.startWithoutApproval', $tag);
}

View File

@ -0,0 +1,29 @@
<?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\Api;
use Flarum\Api\Context;
use Flarum\Api\Schema;
use Flarum\Post\Post;
class PostResourceFields
{
public function __invoke(): array
{
return [
Schema\Boolean::make('isApproved')
->writable(fn (Post $post, Context $context) => $context->getActor()->can('approve', $post))
// set by the ApproveContent listener.
->set(fn () => null),
Schema\Boolean::make('canApprove')
->get(fn (Post $post, Context $context) => $context->getActor()->can('approvePosts', $post->discussion)),
];
}
}

View File

@ -14,25 +14,9 @@ use Flarum\User\User;
class PostWasApproved
{
/**
* The post that was approved.
*
* @var Post
*/
public $post;
/**
* @var User
*/
public $actor;
/**
* @param Post $post
* @param User $actor
*/
public function __construct(Post $post, User $actor)
{
$this->post = $post;
$this->actor = $actor;
public function __construct(
public Post $post,
public User $actor
) {
}
}

View File

@ -11,35 +11,52 @@ namespace Flarum\Approval\Listener;
use Flarum\Approval\Event\PostWasApproved;
use Flarum\Post\Event\Saving;
use Flarum\User\Exception\PermissionDeniedException;
use Illuminate\Contracts\Events\Dispatcher;
class ApproveContent
{
/**
* @param Dispatcher $events
*/
public function subscribe(Dispatcher $events)
public function subscribe(Dispatcher $events): void
{
$events->listen(Saving::class, [$this, 'approvePost']);
$events->listen(Saving::class, $this->approvePost(...));
}
public function approvePost(Saving $event)
/**
* @throws PermissionDeniedException
*/
public function approvePost(Saving $event): void
{
$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));
}
}
}
}

View File

@ -18,18 +18,12 @@ use Illuminate\Contracts\Events\Dispatcher;
class UnapproveNewContent
{
/**
* @param Dispatcher $events
*/
public function subscribe(Dispatcher $events)
public function subscribe(Dispatcher $events): void
{
$events->listen(Saving::class, [$this, 'unapproveNewPosts']);
$events->listen(Saving::class, $this->unapproveNewPosts(...));
}
/**
* @param Saving $event
*/
public function unapproveNewPosts(Saving $event)
public function unapproveNewPosts(Saving $event): void
{
$post = $event->post;
@ -63,14 +57,12 @@ class UnapproveNewContent
}
}
/**
* @param Discussion|CommentPost $instance
* @return bool|null
*/
public static function markUnapprovedContentAsPrivate($instance)
public static function markUnapprovedContentAsPrivate(Discussion|CommentPost $instance): ?bool
{
if (! $instance->is_approved) {
return true;
}
return null;
}
}

View File

@ -13,7 +13,7 @@ use Flarum\Approval\Event\PostWasApproved;
class UpdateDiscussionAfterPostApproval
{
public function handle(PostWasApproved $event)
public function handle(PostWasApproved $event): void
{
$post = $event->post;
$discussion = $post->discussion;

View File

@ -10,19 +10,23 @@
namespace Flarum\Approval\Tests\integration;
use Carbon\Carbon;
use Flarum\Discussion\Discussion;
use Flarum\Group\Group;
use Flarum\Post\Post;
use Flarum\User\User;
trait InteractsWithUnapprovedContent
{
protected function prepareUnapprovedDatabaseContent()
{
$this->prepareDatabase([
'users' => [
User::class => [
['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' => [
Discussion::class => [
['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],
@ -31,7 +35,7 @@ trait InteractsWithUnapprovedContent
['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' => [
Post::class => [
['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],
@ -45,7 +49,7 @@ trait InteractsWithUnapprovedContent
['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' => [
Group::class => [
['id' => 4, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0]
],
'group_user' => [
@ -60,7 +64,7 @@ trait InteractsWithUnapprovedContent
/**
* null: Guest, 2: Normal User.
*/
public function unallowedUsers(): array
public static function unallowedUsers(): array
{
return [[null], [2]];
}
@ -68,7 +72,7 @@ trait InteractsWithUnapprovedContent
/**
* 1: Admin, 3: Permission Given, 4: Discussions Author.
*/
public function allowedUsers(): array
public static function allowedUsers(): array
{
return [[1], [3], [4]];
}

View File

@ -0,0 +1,122 @@
<?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 Carbon\Carbon;
use Flarum\Approval\Tests\integration\InteractsWithUnapprovedContent;
use Flarum\Discussion\Discussion;
use Flarum\Group\Group;
use Flarum\Post\Post;
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Flarum\User\User;
use PHPUnit\Framework\Attributes\Test;
class ApprovePostsTest extends TestCase
{
use RetrievesAuthorizedUsers;
use InteractsWithUnapprovedContent;
protected function setUp(): void
{
parent::setUp();
$this->extension('flarum-approval');
$this->prepareDatabase([
User::class => [
['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],
],
Discussion::class => [
['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],
],
Post::class => [
['id' => 1, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => null, 'is_approved' => 1, 'number' => 1],
['id' => 2, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => null, 'is_approved' => 1, 'number' => 2],
['id' => 3, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => null, 'is_approved' => 0, 'number' => 3],
['id' => 4, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => Carbon::now(), 'is_approved' => 1, 'number' => 4],
['id' => 5, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => null, 'is_approved' => 0, 'number' => 5],
],
Group::class => [
['id' => 4, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0],
['id' => 5, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0],
],
'group_user' => [
['user_id' => 3, 'group_id' => 4],
],
'group_permission' => [
['group_id' => 4, 'permission' => 'discussion.approvePosts'],
]
]);
}
#[Test]
public function can_approve_unapproved_post()
{
$response = $this->send(
$this->request('PATCH', '/api/posts/3', [
'authenticatedAs' => 3,
'json' => [
'data' => [
'attributes' => [
'isApproved' => true
]
]
]
])
);
$this->assertEquals(200, $response->getStatusCode(), $response->getBody()->getContents());
$this->assertEquals(1, $this->database()->table('posts')->where('id', 3)->where('is_approved', 1)->count());
}
#[Test]
public function cannot_approve_post_without_permission()
{
$response = $this->send(
$this->request('PATCH', '/api/posts/3', [
'authenticatedAs' => 4,
'json' => [
'data' => [
'attributes' => [
'isApproved' => true
]
]
]
])
);
$this->assertEquals(403, $response->getStatusCode(), $response->getBody()->getContents());
$this->assertEquals(0, $this->database()->table('posts')->where('id', 3)->where('is_approved', 1)->count());
}
#[Test]
public function hiding_post_silently_approves_it()
{
$response = $this->send(
$this->request('PATCH', '/api/posts/5', [
'authenticatedAs' => 3,
'json' => [
'data' => [
'attributes' => [
'isHidden' => true
]
]
]
])
);
$this->assertEquals(200, $response->getStatusCode(), $response->getBody()->getContents());
$this->assertEquals(1, $this->database()->table('posts')->where('id', 5)->where('is_approved', 1)->count());
}
}

View File

@ -0,0 +1,155 @@
<?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 Carbon\Carbon;
use Flarum\Approval\Tests\integration\InteractsWithUnapprovedContent;
use Flarum\Discussion\Discussion;
use Flarum\Group\Group;
use Flarum\Post\Post;
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Flarum\User\User;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test;
class CreatePostsTest extends TestCase
{
use RetrievesAuthorizedUsers;
use InteractsWithUnapprovedContent;
protected function setUp(): void
{
parent::setUp();
$this->extension('flarum-flags', 'flarum-approval');
$this->prepareDatabase([
User::class => [
['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],
],
Discussion::class => [
['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],
['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],
['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],
],
Post::class => [
['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' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 2],
['id' => 3, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 3],
['id' => 4, 'discussion_id' => 2, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
['id' => 5, 'discussion_id' => 2, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 2],
['id' => 6, 'discussion_id' => 2, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 3],
['id' => 7, 'discussion_id' => 3, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
['id' => 8, 'discussion_id' => 3, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 2],
['id' => 9, 'discussion_id' => 3, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 0, 'number' => 3],
],
Group::class => [
['id' => 4, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0],
['id' => 5, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0],
],
'group_user' => [
['user_id' => 3, 'group_id' => 4],
['user_id' => 2, 'group_id' => 5],
],
'group_permission' => [
['group_id' => 4, 'permission' => 'discussion.startWithoutApproval'],
['group_id' => 5, 'permission' => 'discussion.replyWithoutApproval'],
['group_id' => Group::MEMBER_ID, 'permission' => 'postWithoutThrottle'],
]
]);
}
#[Test]
#[DataProvider('startDiscussionDataProvider')]
public function can_start_discussion_without_approval_when_allowed(int $authenticatedAs, bool $allowed)
{
$this->database()->table('group_permission')->where('group_id', Group::MEMBER_ID)->where('permission', 'discussion.startWithoutApproval')->delete();
$response = $this->send(
$this->request('POST', '/api/discussions', [
'authenticatedAs' => $authenticatedAs,
'json' => [
'data' => [
'type' => 'discussions',
'attributes' => [
'title' => 'This is a new discussion',
'content' => 'This is a new discussion',
]
]
]
])
);
$body = $response->getBody()->getContents();
$json = json_decode($body, true);
$this->assertEquals(201, $response->getStatusCode(), $body);
$this->assertEquals($allowed ? 1 : 0, $this->database()->table('discussions')->where('id', $json['data']['id'])->value('is_approved'));
}
#[Test]
#[DataProvider('replyToDiscussionDataProvider')]
public function can_reply_without_approval_when_allowed(?int $authenticatedAs, bool $allowed)
{
$this->database()->table('group_permission')->where('group_id', Group::MEMBER_ID)->where('permission', 'discussion.replyWithoutApproval')->delete();
$response = $this->send(
$this->request('POST', '/api/posts', [
'authenticatedAs' => $authenticatedAs,
'json' => [
'data' => [
'type' => 'posts',
'attributes' => [
'content' => 'This is a new reply',
],
'relationships' => [
'discussion' => [
'data' => [
'type' => 'discussions',
'id' => 1
]
]
]
]
]
])
);
$body = $response->getBody()->getContents();
$json = json_decode($body, true);
$this->assertEquals(201, $response->getStatusCode(), $body);
$this->assertEquals($allowed ? 1 : 0, $this->database()->table('posts')->where('id', $json['data']['id'])->value('is_approved'));
}
public static function startDiscussionDataProvider(): array
{
return [
'Admin' => [1, true],
'User without permission' => [2, false],
'Permission Given' => [3, true],
'Another user without permission' => [4, false],
];
}
public static function replyToDiscussionDataProvider(): array
{
return [
'Admin' => [1, true],
'User without permission' => [3, false],
'Permission Given' => [2, true],
'Another user without permission' => [4, false],
];
}
}

View File

@ -13,6 +13,8 @@ use Flarum\Approval\Tests\integration\InteractsWithUnapprovedContent;
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Illuminate\Support\Arr;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test;
class ListDiscussionsTest extends TestCase
{
@ -28,10 +30,8 @@ class ListDiscussionsTest extends TestCase
$this->prepareUnapprovedDatabaseContent();
}
/**
* @dataProvider unallowedUsers
* @test
*/
#[Test]
#[DataProvider('unallowedUsers')]
public function can_only_see_approved_if_not_allowed_to_approve(?int $authenticatedAs)
{
$response = $this->send(
@ -44,10 +44,8 @@ class ListDiscussionsTest extends TestCase
$this->assertEqualsCanonicalizing([1, 4, 5, 7], Arr::pluck($body['data'], 'id'));
}
/**
* @dataProvider allowedUsers
* @test
*/
#[Test]
#[DataProvider('allowedUsers')]
public function can_see_unapproved_if_allowed_to_approve(int $authenticatedAs)
{
$response = $this->send(

View File

@ -13,6 +13,8 @@ use Flarum\Approval\Tests\integration\InteractsWithUnapprovedContent;
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Illuminate\Support\Arr;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test;
class ListPostsTest extends TestCase
{
@ -28,10 +30,8 @@ class ListPostsTest extends TestCase
$this->prepareUnapprovedDatabaseContent();
}
/**
* @dataProvider unallowedUsers
* @test
*/
#[Test]
#[DataProvider('unallowedUsers')]
public function can_only_see_approved_if_not_allowed_to_approve(?int $authenticatedAs)
{
$response = $this->send(
@ -50,10 +50,8 @@ class ListPostsTest extends TestCase
$this->assertEqualsCanonicalizing([7, 8, 10], Arr::pluck($body['data'], 'id'));
}
/**
* @dataProvider allowedUsers
* @test
*/
#[Test]
#[DataProvider('allowedUsers')]
public function can_see_unapproved_if_allowed_to_approve(int $authenticatedAs)
{
$response = $this->send(

View File

@ -7,10 +7,6 @@
* LICENSE file that was distributed with this source code.
*/
use Flarum\Testing\integration\Setup\SetupScript;
require __DIR__.'/../../vendor/autoload.php';
$setup = new SetupScript();
$setup = require __DIR__.'/../../../../php-packages/testing/bootstrap/monorepo.php';
$setup->run();

View File

@ -1,21 +1,20 @@
<?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"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="true"
stopOnFailure="false"
bootstrap="../../../php-packages/testing/bootstrap/monorepo.php"
>
<coverage processUncoveredFiles="true">
<source>
<include>
<directory suffix=".php">../src/</directory>
</include>
</coverage>
</source>
<testsuites>
<testsuite name="Flarum Integration Tests">
<directory suffix="Test.php">./integration</directory>

View File

@ -1,27 +1,23 @@
<?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"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="../../../php-packages/testing/bootstrap/monorepo.php"
>
<coverage processUncoveredFiles="true">
<source>
<include>
<directory suffix=".php">../src/</directory>
</include>
</coverage>
</source>
<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

@ -4,6 +4,7 @@ composer.phar
.DS_Store
Thumbs.db
tests/.phpunit.cache
tests/.phpunit.result.cache
/tests/integration/tmp
.vagrant

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019-2021 Stichting Flarum (Flarum Foundation)
Copyright (c) 2019-2024 Stichting Flarum (Flarum Foundation)
Copyright (c) 2014-2019 Toby Zerner (toby.zerner@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.8"
"flarum/core": "^2.0.0-beta.2"
},
"autoload": {
"psr-4": {
@ -28,7 +28,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.x-dev"
"dev-main": "2.x-dev"
},
"flarum-extension": {
"title": "BBCode",

View File

@ -13,7 +13,7 @@ use s9e\TextFormatter\Configurator;
class Configure
{
public function __invoke(Configurator $config)
public function __invoke(Configurator $config): void
{
$this->addTagsFromRepositories($config);
$this->adaptHighlightJs($config);

View File

@ -9,19 +9,14 @@
namespace Flarum\BBCode;
use Flarum\Locale\TranslatorInterface;
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 __construct(
protected TranslatorInterface $translator
) {
}
public function __invoke(Renderer $renderer, $context, string $xml): string

View File

@ -4,6 +4,7 @@ composer.phar
.DS_Store
Thumbs.db
tests/.phpunit.cache
tests/.phpunit.result.cache
/tests/integration/tmp
.vagrant

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019-2021 Stichting Flarum (Flarum Foundation)
Copyright (c) 2019-2024 Stichting Flarum (Flarum Foundation)
Copyright (c) 2014-2019 Toby Zerner (toby.zerner@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.8"
"flarum/core": "^2.0.0-beta.2"
},
"autoload": {
"psr-4": {
@ -28,7 +28,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.x-dev"
"dev-main": "2.x-dev"
},
"flarum-extension": {
"title": "Embed",

2
extensions/embed/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

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

View File

@ -4,8 +4,6 @@ import { override, extend } from 'flarum/common/extend';
import app from 'flarum/forum/app';
import Stream from 'flarum/common/utils/Stream';
import ForumApplication from 'flarum/forum/ForumApplication';
import Composer from 'flarum/forum/components/Composer';
import PostStream from 'flarum/forum/components/PostStream';
import ModalManager from 'flarum/common/components/ModalManager';
import PostMeta from 'flarum/forum/components/PostMeta';
@ -13,7 +11,7 @@ import DiscussionPage from 'flarum/forum/components/DiscussionPage';
extend(ForumApplication.prototype, 'mount', function () {
if (m.route.param('hideFirstPost')) {
extend(PostStream.prototype, 'view', (vdom) => {
extend('flarum/forum/components/PostStream', 'view', (vdom) => {
if (vdom.children[0].attrs['data-number'] === 1) {
vdom.children.splice(0, 1);
}
@ -42,7 +40,7 @@ const reposition = function () {
};
extend(ModalManager.prototype, 'show', reposition);
extend(Composer.prototype, 'show', reposition);
extend('flarum/forum/components/Composer', 'show', reposition);
window.iFrameResizer = {
readyCallback: function () {
@ -50,7 +48,7 @@ window.iFrameResizer = {
},
};
extend(PostStream.prototype, 'goToNumber', function (promise, number) {
extend('flarum/forum/components/PostStream', 'goToNumber', function (promise, number) {
if (number === 'reply' && 'parentIFrame' in window && app.composer.isFullScreen()) {
const itemTop = this.$('.PostStream-item:last').offset().top;
window.parentIFrame.scrollToOffset(0, itemTop);

View File

@ -50,7 +50,7 @@
padding: 15px 15px;
.scrolled & {
.box-shadow(0 2px 6px @shadow-color);
box-shadow: 0 2px 6px var(--shadow-color);
}
}
@ -69,7 +69,7 @@
margin: 0;
&, a {
color: @muted-color;
color: var(--muted-color);
}
}
}

View File

@ -4,6 +4,7 @@ composer.phar
.DS_Store
Thumbs.db
tests/.phpunit.cache
tests/.phpunit.result.cache
/tests/integration/tmp
.vagrant

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019-2021 Stichting Flarum (Flarum Foundation)
Copyright (c) 2019-2024 Stichting Flarum (Flarum Foundation)
Copyright (c) 2014-2019 Toby Zerner (toby.zerner@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -19,11 +19,11 @@
}
],
"require": {
"flarum/core": "^1.8"
"flarum/core": "^2.0.0-beta.2"
},
"extra": {
"branch-alias": {
"dev-main": "1.x-dev"
"dev-main": "2.x-dev"
},
"flarum-extension": {
"title": "Emoji",

View File

@ -11,9 +11,13 @@ use Flarum\Extend;
use s9e\TextFormatter\Configurator;
return [
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less'),
->css(__DIR__.'/less/forum.less')
->jsDirectory(__DIR__.'/js/dist/forum'),
(new Extend\Formatter)
->configure(function (Configurator $config) {
@ -29,4 +33,8 @@ return [
}),
new Extend\Locales(__DIR__.'/locale'),
(new Extend\Settings)
->serializeToForum('flarum-emoji.cdn', 'flarum-emoji.cdn')
->default('flarum-emoji.cdn', 'https://cdn.jsdelivr.net/gh/twitter/twemoji@[version]/assets/'),
];

View File

@ -1,6 +0,0 @@
{
"printWidth": 150,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}

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