mirror of
https://github.com/flarum/core.git
synced 2025-08-13 20:04:24 +02:00
Compare commits
147 Commits
dk/likes/l
...
v1.5.0
Author | SHA1 | Date | |
---|---|---|---|
|
a35df8c139 | ||
|
8aec252452 | ||
|
32961d480c | ||
|
27e3d322ec | ||
|
9eab1085da | ||
|
c305f9a105 | ||
|
3b773e2677 | ||
|
6e48a0303e | ||
|
31f1ffd6a5 | ||
|
9897f682a0 | ||
|
f3156c65c9 | ||
|
2719042c71 | ||
|
ffd0b90a83 | ||
|
87aaaf6971 | ||
|
6ffa9e3736 | ||
|
434c459246 | ||
|
7f2f3e34f5 | ||
|
f7dd609b26 | ||
|
ec97ee41f9 | ||
|
335c602cea | ||
|
082117d8bc | ||
|
11a9b73610 | ||
|
974f003fe3 | ||
|
352a50e3ad | ||
|
5637fe8041 | ||
|
3d167749cb | ||
|
1a189f4923 | ||
|
6de8113720 | ||
|
f74f7f58cd | ||
|
34b7686d8a | ||
|
4eb2112282 | ||
|
25122fd355 | ||
|
1d14ea6b45 | ||
|
eab5093012 | ||
|
1948f25151 | ||
|
44825f1b94 | ||
|
d02bf0faa1 | ||
|
b28606b8ef | ||
|
631b4c194c | ||
|
b20961cc9d | ||
|
495462183b | ||
|
40fa7a2c9b | ||
|
f69210b6d1 | ||
|
bb5f7b87bc | ||
|
e2f568252b | ||
|
bca7d48d99 | ||
|
3bdb0af993 | ||
|
d345734a8e | ||
|
4b25c2d425 | ||
|
54e1966ec8 | ||
|
f073c22212 | ||
|
71731819fb | ||
|
b01b75e367 | ||
|
71b444b6f6 | ||
|
bb641144b6 | ||
|
590639f5f3 | ||
|
b06be43988 | ||
|
237076e5b7 | ||
|
737783a8a8 | ||
|
7d3147d4e1 | ||
|
61c4421bd2 | ||
|
85d4fb6ce2 | ||
|
da855c654e | ||
|
7147d39975 | ||
|
f4ace73a3c | ||
|
0b299d0003 | ||
|
70e483d1b1 | ||
|
628c281c39 | ||
|
0901e59a58 | ||
|
5530400b09 | ||
|
e7af009fbc | ||
|
2b31b185e4 | ||
|
f96f914576 | ||
|
f610f8aa67 | ||
|
021793fc52 | ||
|
9ab1680b17 | ||
|
8dde6a27bf | ||
|
44f30ad51e | ||
|
6911e3a71d | ||
|
cad6280a45 | ||
|
7d67cfd1e7 | ||
|
e911b52b4c | ||
|
2defb17cc2 | ||
|
fe20e2c212 | ||
|
795a500adb | ||
|
75aaef7d76 | ||
|
f128190f14 | ||
|
f926c58e01 | ||
|
e5a3598bf6 | ||
|
7cafd9f51a | ||
|
e9fec9b22f | ||
|
31a00eeb95 | ||
|
6b577e6f1f | ||
|
64f0ae7c33 | ||
|
343fe0e317 | ||
|
07b2f86dcc | ||
|
ffaea861e5 | ||
|
46b3b7a952 | ||
|
78544ce68d | ||
|
af3116bce9 | ||
|
6dde236d77 | ||
|
d0998be8fa | ||
|
8dcfa6c474 | ||
|
744927215a | ||
|
54c21459d6 | ||
|
91f8bd34b1 | ||
|
4e52f0e420 | ||
|
ac23d79fe7 | ||
|
29179e27c6 | ||
|
cd610a1cf2 | ||
|
0c017c2aa0 | ||
|
5721a2f487 | ||
|
b673d36f33 | ||
|
bacb095382 | ||
|
7471ef64d5 | ||
|
707ca2d16d | ||
|
3246f5a8f6 | ||
|
bf6f63cfe1 | ||
|
819602520a | ||
|
16f59f514b | ||
|
759f7ef327 | ||
|
9c825aaa2b | ||
|
952a5891bb | ||
|
0daa24cf4b | ||
|
33bf2284c7 | ||
|
d3e456a1bf | ||
|
51472625ba | ||
|
ec22162cf4 | ||
|
1af506d4b8 | ||
|
d86440506d | ||
|
556d461cfb | ||
|
6cfebe381a | ||
|
8ab2827f4c | ||
|
024155a608 | ||
|
4da21463c1 | ||
|
abc12b4ba5 | ||
|
d8d4eae9f5 | ||
|
d82a73feed | ||
|
ab6cee1a25 | ||
|
2e840dc73d | ||
|
ae9139bd73 | ||
|
2e3d6dfa2c | ||
|
7cd28710bc | ||
|
bc1d6f9e91 | ||
|
bf4c543692 | ||
|
709c5566bb | ||
|
9a62c32c28 |
@@ -17,3 +17,6 @@ trim_trailing_whitespace = false
|
||||
|
||||
[*.{php,xml,json}]
|
||||
indent_size = 4
|
||||
|
||||
[tsconfig.json]
|
||||
indent_size = 2
|
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* @flarum/core
|
39
.github/ISSUE_TEMPLATE/bug-report.md
vendored
39
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@@ -1,39 +0,0 @@
|
||||
---
|
||||
name: "🐛 Bug Report"
|
||||
about: "If something isn't working as expected"
|
||||
|
||||
---
|
||||
## Bug Report
|
||||
|
||||
**Current Behavior**
|
||||
A clear and concise description of the behavior.
|
||||
|
||||
**Steps to Reproduce**
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected Behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Environment**
|
||||
- Flarum version: x.y.z
|
||||
- Website URL: http://example.com
|
||||
- Webserver: [e.g. apache, nginx]
|
||||
- Hosting environment: [e.g. shared, vps]
|
||||
- PHP version: x.y.z
|
||||
- Browser: [e.g. chrome 67, safari 11]
|
||||
|
||||
```
|
||||
Output of "php flarum info", run this in terminal in your Flarum directory.
|
||||
```
|
||||
|
||||
**Possible Solution**
|
||||
<!--- Only if you have suggestions or a fix for the bug -->
|
||||
|
||||
**Additional Context**
|
||||
Add any other context about the problem here.
|
78
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
78
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
name: "🐛 Bug Report"
|
||||
description: If something isn't working as expected
|
||||
labels: ["type/bug"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report!
|
||||
- type: textarea
|
||||
id: current_behavior
|
||||
attributes:
|
||||
label: Current Behavior
|
||||
description: A clear and concise description of the behavior.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: steps_to_reproduce
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: The exact steps to reproduce the bug.
|
||||
placeholder: |
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error message '....'
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots
|
||||
description: If applicable, add screenshots to help explain your problem.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: enironment
|
||||
attributes:
|
||||
label: Environment
|
||||
value: |
|
||||
- Flarum version: x.y.z
|
||||
- Website URL: http://example.com
|
||||
- Webserver: [e.g. apache, nginx]
|
||||
- Hosting environment: [e.g. shared, vps]
|
||||
- PHP version: x.y.z
|
||||
- Browser: [e.g. chrome 67, safari 11]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: php_flarum_info
|
||||
attributes:
|
||||
label: "Output of `php flarum info`"
|
||||
value: |
|
||||
```
|
||||
Output of "php flarum info", run this in terminal in your Flarum directory.
|
||||
```
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: possible_solution
|
||||
attributes:
|
||||
label: Possible Solution
|
||||
description: Only if you have suggestions or a fix for the bug.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: additional_context
|
||||
attributes:
|
||||
label: Additional Context
|
||||
description: Add any other context about the problem here.
|
||||
validations:
|
||||
required: false
|
17
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
17
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: "🚀 Feature Request"
|
||||
url: https://discuss.flarum.org/t/proposals
|
||||
about: |
|
||||
Thanks for taking the time to fill out this feature request!
|
||||
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future.
|
||||
For feature requests, ideas and feedback please post in the Flarum Community.
|
||||
Feature requests are added to GitHub only when they have been accepted by the development team and implementation details have been laid out.
|
||||
- name: "🙋 Support Question"
|
||||
url: https://discuss.flarum.org/t/support
|
||||
about: |
|
||||
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future; for usage and support questions, please check out these resources below. Thanks!
|
||||
|
||||
* Flarum Community: https://discuss.flarum.org/
|
||||
* Discord Chat: https://flarum.org/discord/
|
||||
* Twitter: https://twitter.com/Flarum
|
7
.github/ISSUE_TEMPLATE/feature-request.md
vendored
7
.github/ISSUE_TEMPLATE/feature-request.md
vendored
@@ -1,7 +0,0 @@
|
||||
---
|
||||
name: "🚀 Feature Request"
|
||||
about: "If you have a suggestion please head over to our forum!"
|
||||
|
||||
---
|
||||
|
||||
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future. For feature requests, ideas and feedback please post in the Flarum Community: https://discuss.flarum.org/t/proposals. Feature requests are added to GitHub only when they have been accepted by the development team and implementation details have been laid out.
|
11
.github/ISSUE_TEMPLATE/support-question.md
vendored
11
.github/ISSUE_TEMPLATE/support-question.md
vendored
@@ -1,11 +0,0 @@
|
||||
---
|
||||
name: "🙋 Support Question"
|
||||
about: "If you have a question, please check out our forum or Discord!"
|
||||
|
||||
---
|
||||
|
||||
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future; for usage and support questions, please check out these resources below. Thanks!
|
||||
|
||||
* Flarum Community: https://discuss.flarum.org/
|
||||
* Discord Chat: https://flarum.org/discord/
|
||||
* Twitter: https://twitter.com/Flarum
|
44
.github/workflows/REUSABLE_backend.yml
vendored
44
.github/workflows/REUSABLE_backend.yml
vendored
@@ -19,12 +19,12 @@ on:
|
||||
description: Versions of PHP to test with. Should be array of strings encoded as JSON array
|
||||
type: string
|
||||
required: false
|
||||
default: '["7.4", "8.0", "8.1"]'
|
||||
default: '["7.3", "7.4", "8.0", "8.1"]'
|
||||
db_versions:
|
||||
description: Versions of databases to test with. Should be array of strings encoded as JSON array
|
||||
type: string
|
||||
required: false
|
||||
default: '["mysql:5.7", "mariadb"]'
|
||||
default: '["mysql:5.7", "mysql:8.0.30", "mariadb"]'
|
||||
|
||||
php_ini_values:
|
||||
description: PHP ini values
|
||||
@@ -44,23 +44,41 @@ jobs:
|
||||
matrix:
|
||||
php: ${{ fromJSON(inputs.php_versions) }}
|
||||
service: ${{ fromJSON(inputs.db_versions) }}
|
||||
prefix: ['', flarum_]
|
||||
prefix: ['']
|
||||
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude
|
||||
include:
|
||||
# Expands the matrix by naming DBs.
|
||||
- service: 'mysql:5.7'
|
||||
db: MySQL
|
||||
db: MySQL 5.7
|
||||
- service: 'mysql:8.0.30'
|
||||
db: MySQL 8.0
|
||||
- service: mariadb
|
||||
db: MariaDB
|
||||
- prefix: flarum_
|
||||
|
||||
# Include Database prefix tests with only one PHP version.
|
||||
- php: ${{ fromJSON(inputs.php_versions)[0] }}
|
||||
service: 'mysql:5.7'
|
||||
db: MySQL 5.7
|
||||
prefix: flarum_
|
||||
prefixStr: (prefix)
|
||||
- php: ${{ fromJSON(inputs.php_versions)[0] }}
|
||||
service: 'mysql:8.0.30'
|
||||
db: MySQL 8.0
|
||||
prefix: flarum_
|
||||
prefixStr: (prefix)
|
||||
- php: ${{ fromJSON(inputs.php_versions)[0] }}
|
||||
service: mariadb
|
||||
db: MariaDB
|
||||
prefix: flarum_
|
||||
prefixStr: (prefix)
|
||||
|
||||
# To reduce number of actions, we exclude some PHP versions from running with some DB versions.
|
||||
exclude:
|
||||
- php: 8.0
|
||||
service: 'mysql:5.7'
|
||||
prefix: flarum_
|
||||
- php: 8.0
|
||||
service: mariadb
|
||||
prefix: flarum_
|
||||
- php: ${{ fromJSON(inputs.php_versions)[1] }}
|
||||
service: 'mysql:8.0.30'
|
||||
- php: ${{ fromJSON(inputs.php_versions)[2] }}
|
||||
service: 'mysql:8.0.30'
|
||||
|
||||
services:
|
||||
mysql:
|
||||
@@ -70,7 +88,9 @@ jobs:
|
||||
|
||||
name: 'PHP ${{ matrix.php }} / ${{ matrix.db }} ${{ matrix.prefixStr }}'
|
||||
|
||||
if: inputs.enable_backend_testing
|
||||
if: >-
|
||||
inputs.enable_backend_testing &&
|
||||
((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || github.event_name != 'pull_request')
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
167
.github/workflows/REUSABLE_frontend.yml
vendored
167
.github/workflows/REUSABLE_frontend.yml
vendored
@@ -3,6 +3,32 @@ name: Flarum Frontend Jobs
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build_script:
|
||||
description: "Script to run for production build. Empty value to disable."
|
||||
type: string
|
||||
required: false
|
||||
default: build
|
||||
build_typings_script:
|
||||
description: "Script to run for typings build. Empty value to disable."
|
||||
type: string
|
||||
required: false
|
||||
default: build-typings
|
||||
format_script:
|
||||
description: "Script to run for code formatting. Empty value to disable."
|
||||
type: string
|
||||
required: false
|
||||
default: format-check
|
||||
check_typings_script:
|
||||
description: "Script to run for tyiping check. Empty value to disable."
|
||||
type: string
|
||||
required: false
|
||||
default: check-typings
|
||||
type_coverage_script:
|
||||
description: "Script to run for type coverage. Empty value to disable."
|
||||
type: string
|
||||
required: false
|
||||
default: check-typings-coverage
|
||||
|
||||
enable_bundlewatch:
|
||||
description: "Enable Bundlewatch?"
|
||||
type: boolean
|
||||
@@ -61,66 +87,12 @@ env:
|
||||
cache_dependency_path: ${{ inputs.cache_dependency_path || format(inputs.js_package_manager == 'yarn' && '{0}/yarn.lock' || '{0}/package-lock.json', inputs.frontend_directory) }}
|
||||
|
||||
jobs:
|
||||
bundlewatch:
|
||||
name: Bundlewatch
|
||||
build:
|
||||
name: Checks & Build
|
||||
runs-on: ubuntu-latest
|
||||
if: inputs.enable_bundlewatch
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ inputs.node_version }}
|
||||
cache: ${{ inputs.js_package_manager }}
|
||||
cache-dependency-path: ${{ env.cache_dependency_path }}
|
||||
|
||||
- name: Build production assets
|
||||
uses: flarum/action-build@2
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
build_script: build
|
||||
package_manager: ${{ inputs.js_package_manager }}
|
||||
js_path: ${{ inputs.frontend_directory }}
|
||||
do_not_commit: true
|
||||
|
||||
- name: Check bundle size change
|
||||
run: node_modules/.bin/bundlewatch --config .bundlewatch.config.json
|
||||
working-directory: ${{ inputs.frontend_directory }}
|
||||
env:
|
||||
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.bundlewatch_github_token }}
|
||||
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
prettier:
|
||||
name: Prettier
|
||||
runs-on: ubuntu-latest
|
||||
if: inputs.enable_prettier
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ inputs.node_version }}
|
||||
cache: ${{ inputs.js_package_manager }}
|
||||
cache-dependency-path: ${{ env.cache_dependency_path }}
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: ${{ env.ci_script }}
|
||||
working-directory: ${{ inputs.frontend_directory }}
|
||||
|
||||
- name: Check JS formatting
|
||||
run: ${{ inputs.js_package_manager }} run format-check
|
||||
working-directory: ${{ inputs.frontend_directory }}
|
||||
|
||||
typecheck:
|
||||
name: Typecheck
|
||||
runs-on: ubuntu-latest
|
||||
if: inputs.enable_typescript
|
||||
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
|
||||
@@ -149,72 +121,23 @@ jobs:
|
||||
run: ${{ env.ci_script }}
|
||||
working-directory: ${{ inputs.frontend_directory }}
|
||||
|
||||
- name: Typecheck
|
||||
run: ${{ inputs.js_package_manager }} run check-typings
|
||||
working-directory: ${{ inputs.frontend_directory }}
|
||||
|
||||
type-coverage:
|
||||
name: Type Coverage
|
||||
runs-on: ubuntu-latest
|
||||
if: inputs.enable_typescript
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ inputs.node_version }}
|
||||
cache: ${{ inputs.js_package_manager }}
|
||||
cache-dependency-path: ${{ env.cache_dependency_path }}
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: ${{ env.ci_script }}
|
||||
working-directory: ${{ inputs.frontend_directory }}
|
||||
|
||||
- name: Check type coverage
|
||||
run: ${{ inputs.js_package_manager }} run check-typings-coverage
|
||||
working-directory: ${{ inputs.frontend_directory }}
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
if: "always() && !contains(needs.*.result, 'failed') && !contains(needs.*.result, 'cancelled')"
|
||||
needs: [bundlewatch, prettier, typecheck, type-coverage]
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ inputs.node_version }}
|
||||
cache: ${{ inputs.js_package_manager }}
|
||||
cache-dependency-path: ${{ env.cache_dependency_path }}
|
||||
|
||||
# Our action will install npm/yarn, cd into `${{ inputs.frontend_directory }}`, build dist JS and typings,
|
||||
# then commit and upload any changes iff we are on the main branch and have just pushed.
|
||||
- name: Build production JS
|
||||
if: inputs.enable_typescript
|
||||
uses: flarum/action-build@2
|
||||
- name: JS Checks & Production Build
|
||||
uses: flarum/action-build@3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
build_script: build
|
||||
package_manager: ${{ inputs.js_package_manager }}
|
||||
typings_script: build-typings
|
||||
js_path: ${{ inputs.frontend_directory }}
|
||||
do_not_commit: ${{ github.ref != format('refs/heads/{0}', inputs.main_git_branch) || github.event_name != 'push' }}
|
||||
|
||||
# Our action will install npm/yarn, cd into `${{ inputs.frontend_directory }}`, build dist JS and typings,
|
||||
# then commit and upload any changes iff we are on the main branch and have just pushed.
|
||||
- name: Build production JS
|
||||
if: "! inputs.enable_typescript"
|
||||
uses: flarum/action-build@2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
build_script: build
|
||||
build_script: ${{ inputs.build_script }}
|
||||
build_typings_script: ${{ inputs.build_typings_script }}
|
||||
format_script: ${{ inputs.enable_prettier == true && inputs.format_script || '' }}
|
||||
check_typings_script: ${{ inputs.enable_typescript == true && inputs.check_typings_script || '' }}
|
||||
type_coverage_script: ${{ inputs.enable_typescript == true && inputs.type_coverage_script || '' }}
|
||||
package_manager: ${{ inputs.js_package_manager }}
|
||||
js_path: ${{ inputs.frontend_directory }}
|
||||
do_not_commit: ${{ github.ref != format('refs/heads/{0}', inputs.main_git_branch) || github.event_name != 'push' }}
|
||||
|
||||
- name: Check bundle size change
|
||||
if: ${{ inputs.enable_bundlewatch }}
|
||||
run: node_modules/.bin/bundlewatch --config .bundlewatch.config.json
|
||||
working-directory: ${{ inputs.frontend_directory }}
|
||||
env:
|
||||
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.bundlewatch_github_token }}
|
||||
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
|
20
.github/workflows/flarum-akismet-frontend.yml
vendored
20
.github/workflows/flarum-akismet-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Akismet JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: true
|
||||
|
||||
frontend_directory: ./extensions/akismet/js
|
||||
backend_directory: ./extensions/akismet
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
@@ -6,6 +6,6 @@ jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_backend.yml
|
||||
with:
|
||||
enable_backend_testing: false
|
||||
enable_backend_testing: true
|
||||
|
||||
backend_directory: ./extensions/approval
|
||||
|
20
.github/workflows/flarum-approval-frontend.yml
vendored
20
.github/workflows/flarum-approval-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Approval JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/approval/js
|
||||
backend_directory: ./extensions/approval
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
20
.github/workflows/flarum-embed-frontend.yml
vendored
20
.github/workflows/flarum-embed-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Embed JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/embed/js
|
||||
backend_directory: ./extensions/embed
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
20
.github/workflows/flarum-emoji-frontend.yml
vendored
20
.github/workflows/flarum-emoji-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Emoji JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/emoji/js
|
||||
backend_directory: ./extensions/emoji
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
20
.github/workflows/flarum-flags-frontend.yml
vendored
20
.github/workflows/flarum-flags-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Flags JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: true
|
||||
|
||||
frontend_directory: ./extensions/flags/js
|
||||
backend_directory: ./extensions/flags
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
2
.github/workflows/flarum-likes-backend.yml
vendored
2
.github/workflows/flarum-likes-backend.yml
vendored
@@ -6,6 +6,6 @@ jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_backend.yml
|
||||
with:
|
||||
enable_backend_testing: false
|
||||
enable_backend_testing: true
|
||||
|
||||
backend_directory: ./extensions/likes
|
||||
|
20
.github/workflows/flarum-likes-frontend.yml
vendored
20
.github/workflows/flarum-likes-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Likes JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/likes/js
|
||||
backend_directory: ./extensions/likes
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
20
.github/workflows/flarum-lock-frontend.yml
vendored
20
.github/workflows/flarum-lock-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Lock JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/lock/js
|
||||
backend_directory: ./extensions/lock
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
20
.github/workflows/flarum-markdown-frontend.yml
vendored
20
.github/workflows/flarum-markdown-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Markdown JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/markdown/js
|
||||
backend_directory: ./extensions/markdown
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
20
.github/workflows/flarum-mentions-frontend.yml
vendored
20
.github/workflows/flarum-mentions-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Mentions JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/mentions/js
|
||||
backend_directory: ./extensions/mentions
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
20
.github/workflows/flarum-nicknames-frontend.yml
vendored
20
.github/workflows/flarum-nicknames-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Nicknames JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/nicknames/js
|
||||
backend_directory: ./extensions/nicknames
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
@@ -1,20 +0,0 @@
|
||||
name: Package Manager JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: true
|
||||
|
||||
frontend_directory: ./extensions/package-manager/js
|
||||
backend_directory: ./extensions/package-manager
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
20
.github/workflows/flarum-pusher-frontend.yml
vendored
20
.github/workflows/flarum-pusher-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Pusher JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: true
|
||||
|
||||
frontend_directory: ./extensions/pusher/js
|
||||
backend_directory: ./extensions/pusher
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
20
.github/workflows/flarum-statistics-frontend.yml
vendored
20
.github/workflows/flarum-statistics-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Statistics JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: true
|
||||
|
||||
frontend_directory: ./extensions/statistics/js
|
||||
backend_directory: ./extensions/statistics
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
2
.github/workflows/flarum-sticky-backend.yml
vendored
2
.github/workflows/flarum-sticky-backend.yml
vendored
@@ -6,6 +6,6 @@ jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_backend.yml
|
||||
with:
|
||||
enable_backend_testing: false
|
||||
enable_backend_testing: true
|
||||
|
||||
backend_directory: ./extensions/sticky
|
||||
|
20
.github/workflows/flarum-sticky-frontend.yml
vendored
20
.github/workflows/flarum-sticky-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Sticky JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/sticky/js
|
||||
backend_directory: ./extensions/sticky
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
@@ -6,6 +6,6 @@ jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_backend.yml
|
||||
with:
|
||||
enable_backend_testing: false
|
||||
enable_backend_testing: true
|
||||
|
||||
backend_directory: ./extensions/subscriptions
|
||||
|
@@ -1,20 +0,0 @@
|
||||
name: Subscriptions JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/subscriptions/js
|
||||
backend_directory: ./extensions/subscriptions
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
2
.github/workflows/flarum-suspend-backend.yml
vendored
2
.github/workflows/flarum-suspend-backend.yml
vendored
@@ -6,6 +6,6 @@ jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_backend.yml
|
||||
with:
|
||||
enable_backend_testing: false
|
||||
enable_backend_testing: true
|
||||
|
||||
backend_directory: ./extensions/suspend
|
||||
|
20
.github/workflows/flarum-suspend-frontend.yml
vendored
20
.github/workflows/flarum-suspend-frontend.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Suspend JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/suspend/js
|
||||
backend_directory: ./extensions/suspend
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
19
.github/workflows/flarum-tags-frontend.yml
vendored
19
.github/workflows/flarum-tags-frontend.yml
vendored
@@ -1,19 +0,0 @@
|
||||
name: Tags JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: true
|
||||
|
||||
frontend_directory: ./extensions/tags/js
|
||||
backend_directory: ./extensions/tags
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
@@ -1,4 +1,4 @@
|
||||
name: Core JS
|
||||
name: Framework JS
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
@@ -6,12 +6,8 @@ jobs:
|
||||
run:
|
||||
uses: ./.github/workflows/REUSABLE_frontend.yml
|
||||
with:
|
||||
enable_bundlewatch: true
|
||||
enable_prettier: true
|
||||
enable_typescript: true
|
||||
|
||||
frontend_directory: ./framework/core/js
|
||||
backend_directory: ./framework/core
|
||||
frontend_directory: ./
|
||||
backend_directory: ./
|
||||
js_package_manager: yarn
|
||||
cache_dependency_path: ./yarn.lock
|
||||
main_git_branch: main
|
26
.github/workflows/prepare-release.yml
vendored
Normal file
26
.github/workflows/prepare-release.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Prepare Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version to release'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare release
|
||||
uses: flarum/action-release@master
|
||||
env:
|
||||
NEXT_TAG: ${{ inputs.version }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OPEN_COLLECTIVE_TOKEN: ${{ secrets.OPEN_COLLECTIVE_TOKEN }}
|
106
CHANGELOG.md
106
CHANGELOG.md
@@ -1,5 +1,111 @@
|
||||
# Changelog
|
||||
|
||||
## [v1.5.0](https://github.com/flarum/framework/compare/v1.4.0...v1.5.0)
|
||||
### Fixed
|
||||
- (a11y) add accessible labels to notification grid options [#3520]
|
||||
- (a11y) present post streams as feeds [#3522]
|
||||
- (a11y) set `aria-busy` when editing a post stream item [#3521]
|
||||
- (compilation) versioner not inject into compilers [#3589]
|
||||
- (mentions) accessing `id` of null `user` relation [#3618]
|
||||
- (subscriptions) add missing table prefix for filter gambit [#3599]
|
||||
- (tags) use default index sortmap [#3615]
|
||||
- Move guzzle requirement to core [#3544]
|
||||
- MyISAM tables for extensions during installation ([75aaef7](75aaef7d76317bc8578eac1439fed8091c87213b), [f926c58](f926c58e0143fe75a4a4c2e93810970c5910afc8))
|
||||
- Set the translator locale to user preference for email notifications [#3525]
|
||||
- `$events` property declared dynamically [#3598]
|
||||
- core settings header has no priority ([33bf228](33bf2284c77863a1bb18d71d87b8516483056a74))
|
||||
- html entities shown raw in page title [#3542]
|
||||
- incorrect centring of deleted user avatars in notification list [#3569]
|
||||
- intellisense imports defaulting to absolute path from `src` folder [#3549]
|
||||
- minor backward compatible fix for php 8.1 in st_replace ([07b2f86](07b2f86dcc90a3ef17c8ee19a1a07e99a4b17360))
|
||||
- post query wildcard selection causes ambiguity [#3621]
|
||||
- potential static caching memory exhaustion [#3548]
|
||||
- prepare release workflow has invalid layout ([70e483d](70e483d1b185332910be9513fd06cc6342830d49))
|
||||
- remove deprecation warning for decoding null values ([590639f](590639f5f3e1fe883f28c41e1f175c2826b4b5f4))
|
||||
- replace `.fa()` mixin usage with `.fas()` [#3537]
|
||||
- return type hint static is php 8+ ([b01b75e](b01b75e36790d8026dd27ce59051d9581ad47940))
|
||||
- sticky nav content displays below post stream [#3575]
|
||||
- titles positioned wrongly with custom header height [#3550]
|
||||
- typo in error message ([1a189f4](1a189f492320071365286a8835bc49d5a9571753))
|
||||
- unread notifications are globally cached between users. [#3543]
|
||||
- update workflow name ([628c281](628c281c39855f01069ddc40b698d80d29fec870))
|
||||
- user has wrong discussion read status [#3591]
|
||||
### Changed
|
||||
- (approval, likes) use subscribers [#3577]
|
||||
- (package-manager) last tweaks before beta tag ([335c602](335c602cea3fbaee9ad7c32ceecaaf222e5d89a7))
|
||||
- (statistics) add release notes for 1.4.1 ([f4ace73](f4ace73a3c59434b8717efb2d83f50084f470fe4))
|
||||
- (statistics) rewrite for performance on very large communities [#3531]
|
||||
- (statistics) split timed data into per-model XHR requests [#3601]
|
||||
- (tags) Replace event helper with event dispatcher [#3570]
|
||||
- Add `loading="lazy"` attribute for avatars [#3578]
|
||||
- Apply fixes from StyleCI ([bb64114](bb641144b6bc5c59798351459fbf8df8cbf6aec6))
|
||||
- Create CODEOWNERS ([6e48a03](6e48a0303e45bcf210e550ba3e0772bc8443a207))
|
||||
- MyISAM tables for extensions during installation" ([f128190](f128190f143398dd1262fd1379e634794daee4c1))
|
||||
- convert `AlertManager` `IndexPage` and `UserPage` components to TS [#3536]
|
||||
- convert `Badge` `Checkbox` and `Navigation` components to TS [#3532]
|
||||
- convert core modals to TypeScript [#3515]
|
||||
- convert page components to TypeScript [#3538]
|
||||
- debug line slipped in while rebasing a PR [#3580]
|
||||
- don't pass password field between auth modals [#3626]
|
||||
- fix github issue templates ([d3e456a](d3e456a1bf42d13b7cd2542c371f392712247c09))
|
||||
- format code ([4954621](495462183bfb3b33046b293e6b1088ab225968df))
|
||||
- getting the release workflow in ([5530400](5530400b093b5fd07d670e5c92d8a7da96634cfe))
|
||||
- link logo at the top with the official website [#3552]
|
||||
- prevent running both `push` and `pull_request` actions at the same time [#3597]
|
||||
- refactor prefix matrix and add `MySQL 8.0` & `PHP 7.3` to workflows [#3595]
|
||||
- relying on a third-party for avatar URL tests is unreliable [#3586]
|
||||
- require guzzle 6 or 7 ([46b3b7a](46b3b7a9527b935c3c52269aaad2010c75dcb6d8))
|
||||
- split FA imports into separate Less file for easy overriding [#3535]
|
||||
- unify JS actions into one (rewritten `flarum/action-build`) [#3573]
|
||||
- update version constant during cycle 22 ([d864405](d86440506dd37101e60adec591d4b017e7765ec6))
|
||||
- use `isCollapsed` instead of `rangeCount` [#3581]
|
||||
- use github issue template forms [#3526]
|
||||
### Added
|
||||
- (likes) Add likes tab to user profile [#3528]
|
||||
- (likes) Option to prevent users liking their own posts [#3534]
|
||||
- (modals) support stacking modals, remove bootstrap modals dependency [#3456]
|
||||
- (subscriptions) add option to send notifications when not caught up [#3503]
|
||||
- Add custom class for email confirmation alert [#3584]
|
||||
- Admin debug mode warning [#3590]
|
||||
- Delete all notifications [#3529]
|
||||
- Queue package manager commands [#3418]
|
||||
- Restart the queue worker after cache clearing, ext enable/disable, save settings [#3565]
|
||||
- add createTableIfNotExists migration helper [#3576]
|
||||
- add new workflow for generating release meta ([0901e59](0901e59a58a3e1f017762583a2adf419f7f34257))
|
||||
- clear password & email tokens when appropriate [#3567]
|
||||
- discussion UTF-8 slug driver [#3606]
|
||||
- expose assets base url to frontend forum model [#3566]
|
||||
- extender to add custom less variables [#3530]
|
||||
- publish assets on admin dashboard cache clear [#3564]
|
||||
- throttle email change, email confirmation, and password reset endpoints. [#3555]
|
||||
|
||||
## [1.4.0](https://github.com/flarum/framework/compare/v1.3.1...v1.4.0)
|
||||
|
||||
### Added
|
||||
- `created_at` and `updated_at` columns added to several tables (https://github.com/flarum/framework/pull/3435)
|
||||
- Priorities added to AdminNav links (https://github.com/flarum/framework/pull/3453)
|
||||
- `app.translator` allows retrieving and setting locale (https://github.com/flarum/framework/pull/3451)
|
||||
- Extensions can now declare custom settings components for use with `buildSettingComponent` (https://github.com/flarum/framework/pull/3494)
|
||||
- Implement extensibility on `rel` and `target` attributes on links (https://github.com/flarum/framework/pull/3455)
|
||||
- New backend tests were added to some of the bundled extensions (https://github.com/flarum/framework/issues/3508)
|
||||
|
||||
### Changed
|
||||
- Split boot script for Flarum in HTML footer into two parts for CSP hashing (https://github.com/flarum/framework/pull/3461)
|
||||
- Split asset compilation by giving assembling compilers its own method (https://github.com/flarum/framework/pull/3446)
|
||||
- Increase visibility of Component typescript class for better extensibility (https://github.com/flarum/framework/pull/3437)
|
||||
|
||||
### Fixed
|
||||
- Mentioning an event post breaks the notification dropdown (https://github.com/flarum/framework/pull/3493)
|
||||
- Suspension modal shows after suspension is over (https://github.com/flarum/framework/pull/3449)
|
||||
- CLI based installations don't exit with an error code on failure (https://github.com/flarum/framework/pull/3452)
|
||||
- Tabbing through dropdown controls doesn't make them visible (https://github.com/flarum/framework/pull/3450)
|
||||
- Requiring zero tags on new discussions forces the user to select tags (https://github.com/flarum/framework/pull/3448)
|
||||
- Long topic titles in the notification list don't overflow (https://github.com/flarum/framework/pull/3500)
|
||||
- Subtags of tags the user has access to are visible even if these are not accessible (https://github.com/flarum/framework/pull/3419)
|
||||
- `assertAdmin` tests access based on wrong gate ability (https://github.com/flarum/framework/pull/3501)
|
||||
- Increasing the composer header size causes elements to slip underneath (https://github.com/flarum/framework/pull/3502)
|
||||
- The profile mentions tab errors when sorting by `created_at` (https://github.com/flarum/framework/pull/3506)
|
||||
|
||||
## [1.3.1](https://github.com/flarum/framework/compare/v1.3.0...v1.3.1)
|
||||
|
||||
### Changed
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<p align="center"><img src="https://flarum.org/assets/img/logo.png"></p>
|
||||
<p align="center">
|
||||
<a href="https://flarum.org/"><img src="https://flarum.org/assets/img/logo.png"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/flarum/core/actions?query=workflow%3ATests"><img src="https://github.com/flarum/core/workflows/Tests/badge.svg" alt="PHP Tests"></a>
|
||||
|
@@ -29,8 +29,8 @@
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/flarum/core/issues",
|
||||
"source": "https://github.com/flarum/core",
|
||||
"issues": "https://github.com/flarum/framework/issues",
|
||||
"source": "https://github.com/flarum/framework",
|
||||
"docs": "https://docs.flarum.org",
|
||||
"forum": "https://discuss.flarum.org",
|
||||
"chat": "https://flarum.org/chat"
|
||||
@@ -86,14 +86,13 @@
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"php": ">=7.3",
|
||||
"axy/sourcemap": "^0.1.4",
|
||||
"components/font-awesome": "^5.14.0",
|
||||
"composer/composer": "^2.0",
|
||||
"dflydev/fig-cookies": "^3.0.0",
|
||||
"doctrine/dbal": "^2.7",
|
||||
"dragonmantank/cron-expression": "^3.1.0",
|
||||
"franzl/whoops-middleware": "^2.0.0",
|
||||
"guzzlehttp/guzzle": "^7.4",
|
||||
"guzzlehttp/guzzle": "^6.0|^7.4",
|
||||
"illuminate/bus": "^8.0",
|
||||
"illuminate/cache": "^8.0",
|
||||
"illuminate/config": "^8.0",
|
||||
@@ -127,6 +126,8 @@
|
||||
"psr/http-server-middleware": "^1.0",
|
||||
"pusher/pusher-php-server": "^2.2",
|
||||
"s9e/text-formatter": "^2.3.6",
|
||||
"sycho/json-api": "^0.5.0",
|
||||
"sycho/sourcemap": "^2.0.0",
|
||||
"symfony/config": "^5.2.2",
|
||||
"symfony/console": "^5.2.2",
|
||||
"symfony/event-dispatcher": "^5.2.2",
|
||||
@@ -134,7 +135,6 @@
|
||||
"symfony/polyfill-intl-messageformatter": "^1.22.0",
|
||||
"symfony/translation": "^5.1.5",
|
||||
"symfony/yaml": "^5.2.2",
|
||||
"tobscure/json-api": "^0.3.0",
|
||||
"wikimedia/less.php": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
@@ -1,19 +0,0 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{php,xml,json}]
|
||||
indent_size = 4
|
20
extensions/akismet/.gitattributes
vendored
Normal file
20
extensions/akismet/.gitattributes
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
**/.gitattributes export-ignore
|
||||
**/.gitignore export-ignore
|
||||
**/.gitmodules export-ignore
|
||||
**/.github export-ignore
|
||||
**/.travis export-ignore
|
||||
**/.travis.yml export-ignore
|
||||
**/.editorconfig export-ignore
|
||||
**/.styleci.yml export-ignore
|
||||
|
||||
**/phpunit.xml export-ignore
|
||||
**/tests export-ignore
|
||||
|
||||
**/js/dist/**/* -diff
|
||||
**/js/dist/**/* linguist-generated
|
||||
**/js/dist-typings/**/* -diff
|
||||
**/js/dist-typings/**/* linguist-generated
|
||||
**/js/yarn.lock -diff
|
||||
**/js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"support": {
|
||||
"issues": "https://github.com/flarum/core/issues",
|
||||
"issues": "https://github.com/flarum/framework/issues",
|
||||
"source": "https://github.com/flarum/akismet",
|
||||
"forum": "https://discuss.flarum.org"
|
||||
},
|
||||
@@ -19,9 +19,8 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"flarum/core": "^1.3",
|
||||
"flarum/approval": "^1.2",
|
||||
"guzzlehttp/guzzle": "^7.4"
|
||||
"flarum/core": "^1.5",
|
||||
"flarum/approval": "^1.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
2
extensions/akismet/js/dist/admin.js.map
generated
vendored
2
extensions/akismet/js/dist/admin.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,kBAAkB,WACrCA,IAAAA,cAAAA,IACO,kBACJC,gBAAgB,CACfC,QAAS,yBACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,yDAE7BC,gBAAgB,CAEfC,QAAS,qCACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,mEAC5BK,KAAML,IAAAA,WAAAA,MAAqB,oEAE5BM,mBACC,CACEC,KAAM,kBACNH,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BQ,WAAY,iBAEd,a","sources":["webpack://@flarum/akismet/webpack/bootstrap","webpack://@flarum/akismet/webpack/runtime/compat get default export","webpack://@flarum/akismet/webpack/runtime/define property getters","webpack://@flarum/akismet/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/akismet/webpack/runtime/make namespace object","webpack://@flarum/akismet/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/akismet/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-akismet', () => {\n app.extensionData\n .for('flarum-akismet')\n .registerSetting({\n setting: 'flarum-akismet.api_key',\n type: 'text',\n label: app.translator.trans('flarum-akismet.admin.akismet_settings.api_key_label'),\n })\n .registerSetting({\n //https://blog.akismet.com/2014/04/23/theres-a-ninja-in-your-akismet/\n setting: 'flarum-akismet.delete_blatant_spam',\n type: 'boolean',\n label: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_label'),\n help: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_help'),\n })\n .registerPermission(\n {\n icon: 'fas fa-vote-yea',\n label: app.translator.trans('flarum-akismet.admin.permissions.bypass_akismet'),\n permission: 'bypassAkismet',\n },\n 'start'\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","help","registerPermission","icon","permission"],"sourceRoot":""}
|
||||
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,kBAAkB,WACrCA,IAAAA,cAAAA,IACO,kBACJC,gBAAgB,CACfC,QAAS,yBACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,yDAE7BC,gBAAgB,CAEfC,QAAS,qCACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,mEAC5BK,KAAML,IAAAA,WAAAA,MAAqB,oEAE5BM,mBACC,CACEC,KAAM,kBACNH,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BQ,WAAY,iBAEd,QAEL,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":""}
|
2
extensions/akismet/js/dist/forum.js.map
generated
vendored
2
extensions/akismet/js/dist/forum.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCSxDC,IAAAA,aAAAA,IAAqB,kBAAkB,YACrCC,EAAAA,EAAAA,QAAOC,IAAc,uBAAuB,SAAUC,EAAmCC,GACvF,GAAID,EAAME,IAAI,WAAY,CACxB,IAAMC,EAAQF,EAAKE,QAEnB,GAAIA,GAASA,EAAMC,MAAK,SAACC,GAAD,MAA2B,aAAb,MAAJA,OAAA,EAAAA,EAAMC,WAAuB,CAC7D,IAAMC,EAAcP,EAAMf,IAAI,WAC1BsB,GAAsC,iBAAhBA,GAA4B,aAAcA,IAClEA,EAAYC,SAAWX,IAAAA,WAAAA,MAAqB,oDAMpDY,EAAAA,EAAAA,UAASC,IAAAA,UAAuB,cAAc,SAAUC,EAAUN,GAChE,MAAoB,YAAhBA,EAAKC,OACAT,IAAAA,WAAAA,MAAqB,kDAGvBc,EAASN,U","sources":["webpack://@flarum/akismet/webpack/bootstrap","webpack://@flarum/akismet/webpack/runtime/compat get default export","webpack://@flarum/akismet/webpack/runtime/define property getters","webpack://@flarum/akismet/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/akismet/webpack/runtime/make namespace object","webpack://@flarum/akismet/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/akismet/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/akismet/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@flarum/akismet/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@flarum/akismet/./src/forum/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport type Post from 'flarum/common/models/Post';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport type Mithril from 'mithril';\n\napp.initializers.add('flarum-akismet', () => {\n extend(PostControls, 'destructiveControls', function (items: ItemList<Mithril.Children>, post: Post) {\n if (items.has('approve')) {\n const flags = post.flags();\n\n if (flags && flags.some((flag) => flag?.type() === 'akismet')) {\n const approveItem = items.get('approve');\n if (approveItem && typeof approveItem === 'object' && 'children' in approveItem) {\n approveItem.children = app.translator.trans('flarum-akismet.forum.post.not_spam_button');\n }\n }\n }\n });\n\n override(CommentPost.prototype, 'flagReason', function (original, flag) {\n if (flag.type() === 'akismet') {\n return app.translator.trans('flarum-akismet.forum.post.akismet_flagged_text');\n }\n\n return original(flag);\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","extend","PostControls","items","post","has","flags","some","flag","type","approveItem","children","override","CommentPost","original"],"sourceRoot":""}
|
||||
{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCSxDC,IAAAA,aAAAA,IAAqB,kBAAkB,YACrCC,EAAAA,EAAAA,QAAOC,IAAc,uBAAuB,SAAUC,EAAmCC,GACvF,GAAID,EAAME,IAAI,WAAY,CACxB,IAAMC,EAAQF,EAAKE,QAEnB,GAAIA,GAASA,EAAMC,MAAK,SAACC,GAAD,MAA2B,aAAb,MAAJA,OAAA,EAAAA,EAAMC,OAAhB,IAAuC,CAC7D,IAAMC,EAAcP,EAAMf,IAAI,WAC1BsB,GAAsC,iBAAhBA,GAA4B,aAAcA,IAClEA,EAAYC,SAAWX,IAAAA,WAAAA,MAAqB,6CAE/C,CACF,CACF,KAEDY,EAAAA,EAAAA,UAASC,IAAAA,UAAuB,cAAc,SAAUC,EAAUN,GAChE,MAAoB,YAAhBA,EAAKC,OACAT,IAAAA,WAAAA,MAAqB,kDAGvBc,EAASN,EACjB,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/CommentPost']\"","webpack://@flarum/akismet/./src/forum/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport type Post from 'flarum/common/models/Post';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport type Mithril from 'mithril';\n\napp.initializers.add('flarum-akismet', () => {\n extend(PostControls, 'destructiveControls', function (items: ItemList<Mithril.Children>, post: Post) {\n if (items.has('approve')) {\n const flags = post.flags();\n\n if (flags && flags.some((flag) => flag?.type() === 'akismet')) {\n const approveItem = items.get('approve');\n if (approveItem && typeof approveItem === 'object' && 'children' in approveItem) {\n approveItem.children = app.translator.trans('flarum-akismet.forum.post.not_spam_button');\n }\n }\n }\n });\n\n override(CommentPost.prototype, 'flagReason', function (original, flag) {\n if (flag.type() === 'akismet') {\n return app.translator.trans('flarum-akismet.forum.post.akismet_flagged_text');\n }\n\n return original(flag);\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","extend","PostControls","items","post","has","flags","some","flag","type","approveItem","children","override","CommentPost","original"],"sourceRoot":""}
|
@@ -9,11 +9,11 @@
|
||||
"analyze": "cross-env ANALYZER=true yarn run build",
|
||||
"format": "prettier --write src",
|
||||
"format-check": "prettier --check src",
|
||||
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
||||
"check-typings-coverage": "typescript-coverage-report",
|
||||
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
|
||||
"build-typings": "yarn run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && yarn run post-build-typings",
|
||||
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'"
|
||||
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'",
|
||||
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
||||
"check-typings-coverage": "typescript-coverage-report"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@flarum/prettier-config": "^1.0.0",
|
||||
|
@@ -4,14 +4,18 @@
|
||||
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
|
||||
// and also tells your Typescript server to read core's global typings for
|
||||
// access to `dayjs` and `$` in the global namespace.
|
||||
"include": ["src/**/*", "../vendor/*/*/js/dist-typings/@types/**/*", "@types/**/*"],
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"../../../framework/core/js/dist-typings/@types/**/*",
|
||||
"../../flags/js/dist-typings/@types/**/*",
|
||||
"@types/**/*"
|
||||
],
|
||||
"compilerOptions": {
|
||||
// This will output typings to `dist-typings`
|
||||
"declarationDir": "./dist-typings",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"],
|
||||
"flarum/flags/*": ["../vendor/flarum/flags/js/dist-typings/*"]
|
||||
"flarum/*": ["../../../framework/core/js/dist-typings/*"],
|
||||
"flarum/flags/*": ["../../flags/js/dist-typings/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,19 +0,0 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{php,xml,json}]
|
||||
indent_size = 4
|
20
extensions/approval/.gitattributes
vendored
Normal file
20
extensions/approval/.gitattributes
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
**/.gitattributes export-ignore
|
||||
**/.gitignore export-ignore
|
||||
**/.gitmodules export-ignore
|
||||
**/.github export-ignore
|
||||
**/.travis export-ignore
|
||||
**/.travis.yml export-ignore
|
||||
**/.editorconfig export-ignore
|
||||
**/.styleci.yml export-ignore
|
||||
|
||||
**/phpunit.xml export-ignore
|
||||
**/tests export-ignore
|
||||
|
||||
**/js/dist/**/* -diff
|
||||
**/js/dist/**/* linguist-generated
|
||||
**/js/dist-typings/**/* -diff
|
||||
**/js/dist-typings/**/* linguist-generated
|
||||
**/js/yarn.lock -diff
|
||||
**/js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"support": {
|
||||
"issues": "https://github.com/flarum/core/issues",
|
||||
"issues": "https://github.com/flarum/framework/issues",
|
||||
"source": "https://github.com/flarum/approval",
|
||||
"forum": "https://discuss.flarum.org"
|
||||
},
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"flarum/core": "^1.3",
|
||||
"flarum/core": "^1.5",
|
||||
"flarum/flags": "^1.2"
|
||||
},
|
||||
"autoload": {
|
||||
@@ -52,7 +52,7 @@
|
||||
"prettier": true,
|
||||
"typescript": false,
|
||||
"bundlewatch": false,
|
||||
"backendTesting": false,
|
||||
"backendTesting": true,
|
||||
"editorConfig": true,
|
||||
"styleci": true
|
||||
}
|
||||
@@ -65,5 +65,28 @@
|
||||
}
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
"prefer-stable": true,
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Flarum\\Approval\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": [
|
||||
"@test:unit",
|
||||
"@test:integration"
|
||||
],
|
||||
"test:unit": "phpunit -c tests/phpunit.unit.xml",
|
||||
"test:integration": "phpunit -c tests/phpunit.integration.xml",
|
||||
"test:setup": "@php tests/integration/setup.php"
|
||||
},
|
||||
"scripts-descriptions": {
|
||||
"test": "Runs all tests.",
|
||||
"test:unit": "Runs all unit tests.",
|
||||
"test:integration": "Runs all integration tests.",
|
||||
"test:setup": "Sets up a database for use with integration tests. Execute this only once."
|
||||
},
|
||||
"require-dev": {
|
||||
"flarum/testing": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
@@ -10,12 +10,10 @@
|
||||
use Flarum\Api\Serializer\BasicDiscussionSerializer;
|
||||
use Flarum\Api\Serializer\PostSerializer;
|
||||
use Flarum\Approval\Access;
|
||||
use Flarum\Approval\Event\PostWasApproved;
|
||||
use Flarum\Approval\Listener;
|
||||
use Flarum\Discussion\Discussion;
|
||||
use Flarum\Extend;
|
||||
use Flarum\Post\CommentPost;
|
||||
use Flarum\Post\Event\Saving;
|
||||
use Flarum\Post\Post;
|
||||
use Flarum\Tags\Tag;
|
||||
|
||||
@@ -50,9 +48,8 @@ return [
|
||||
new Extend\Locales(__DIR__.'/locale'),
|
||||
|
||||
(new Extend\Event())
|
||||
->listen(Saving::class, [Listener\ApproveContent::class, 'approvePost'])
|
||||
->listen(Saving::class, [Listener\UnapproveNewContent::class, 'unapproveNewPosts'])
|
||||
->listen(PostWasApproved::class, [Listener\ApproveContent::class, 'approveDiscussion']),
|
||||
->subscribe(Listener\ApproveContent::class)
|
||||
->subscribe(Listener\UnapproveNewContent::class),
|
||||
|
||||
(new Extend\Policy())
|
||||
->modelPolicy(Tag::class, Access\TagPolicy::class),
|
||||
|
2
extensions/approval/js/dist/admin.js.map
generated
vendored
2
extensions/approval/js/dist/admin.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCGxDC,IAAAA,aAAAA,IAAqB,mBAAmB,YACtCC,EAAAA,EAAAA,QAAOD,IAAK,0BAA0B,SAAUE,EAAUC,GACrC,oCAAfA,GACFD,EAASE,KAAK,mBAEG,oCAAfD,GACFD,EAASE,KAAK,uBAIlBJ,IAAAA,cAAAA,IACO,mBACJK,mBACC,CACEC,KAAM,eACNC,MAAOP,IAAAA,WAAAA,MAAqB,8EAC5BG,WAAY,mCAEd,QACA,IAEDE,mBACC,CACEC,KAAM,eACNC,MAAOP,IAAAA,WAAAA,MAAqB,kEAC5BG,WAAY,mCAEd,QACA,IAEDE,mBACC,CACEC,KAAM,eACNC,MAAOP,IAAAA,WAAAA,MAAqB,yDAC5BG,WAAY,2BAEd,WACA,Q","sources":["webpack://@flarum/approval/webpack/bootstrap","webpack://@flarum/approval/webpack/runtime/compat get default export","webpack://@flarum/approval/webpack/runtime/define property getters","webpack://@flarum/approval/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/approval/webpack/runtime/make namespace object","webpack://@flarum/approval/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/approval/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/approval/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\n\napp.initializers.add('flarum-approval', () => {\n extend(app, 'getRequiredPermissions', function (required, permission) {\n if (permission === 'discussion.startWithoutApproval') {\n required.push('startDiscussion');\n }\n if (permission === 'discussion.replyWithoutApproval') {\n required.push('discussion.reply');\n }\n });\n\n app.extensionData\n .for('flarum-approval')\n .registerPermission(\n {\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.start_discussions_without_approval_label'),\n permission: 'discussion.startWithoutApproval',\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.reply_without_approval_label'),\n permission: 'discussion.replyWithoutApproval',\n },\n 'reply',\n 95\n )\n .registerPermission(\n {\n icon: 'fas fa-check',\n label: app.translator.trans('flarum-approval.admin.permissions.approve_posts_label'),\n permission: 'discussion.approvePosts',\n },\n 'moderate',\n 65\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","extend","required","permission","push","registerPermission","icon","label"],"sourceRoot":""}
|
||||
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCGxDC,IAAAA,aAAAA,IAAqB,mBAAmB,YACtCC,EAAAA,EAAAA,QAAOD,IAAK,0BAA0B,SAAUE,EAAUC,GACrC,oCAAfA,GACFD,EAASE,KAAK,mBAEG,oCAAfD,GACFD,EAASE,KAAK,mBAEjB,IAEDJ,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,GAEL,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":""}
|
2
extensions/approval/js/dist/forum.js.map
generated
vendored
2
extensions/approval/js/dist/forum.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace Flarum\Approval\Access;
|
||||
|
||||
use Closure;
|
||||
use Flarum\Discussion\Discussion;
|
||||
use Flarum\User\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -39,14 +40,23 @@ class ScopePrivatePostVisibility
|
||||
});
|
||||
}
|
||||
|
||||
private function discussionWhereCanApprovePosts(User $actor)
|
||||
/**
|
||||
* Looks if the actor has permission to approve posts,
|
||||
* within the discussion which the post is a part of.
|
||||
*
|
||||
* For example, the tags extension,
|
||||
* turns the `approvePosts` ability into per tag basis.
|
||||
*/
|
||||
private function discussionWhereCanApprovePosts(User $actor): Closure
|
||||
{
|
||||
return function ($query) use ($actor) {
|
||||
$query->selectRaw('1')
|
||||
->from('discussions')
|
||||
->whereColumn('discussions.id', 'posts.discussion_id')
|
||||
->where(function ($query) use ($actor) {
|
||||
Discussion::query()->setQuery($query)->whereVisibleTo($actor, 'approvePosts');
|
||||
$query->whereRaw('1 != 1')->orWhere(function ($query) use ($actor) {
|
||||
Discussion::query()->setQuery($query)->whereVisibleTo($actor, 'approvePosts');
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@@ -11,13 +11,23 @@ namespace Flarum\Approval\Listener;
|
||||
|
||||
use Flarum\Approval\Event\PostWasApproved;
|
||||
use Flarum\Post\Event\Saving;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
class ApproveContent
|
||||
{
|
||||
/**
|
||||
* @param Dispatcher $events
|
||||
*/
|
||||
public function subscribe(Dispatcher $events)
|
||||
{
|
||||
$events->listen(Saving::class, [$this, 'approvePost']);
|
||||
$events->listen(PostWasApproved::class, [$this, 'approveDiscussion']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Saving $event
|
||||
*/
|
||||
public static function approvePost(Saving $event)
|
||||
public function approvePost(Saving $event)
|
||||
{
|
||||
$attributes = $event->data['attributes'];
|
||||
$post = $event->post;
|
||||
@@ -40,7 +50,7 @@ class ApproveContent
|
||||
/**
|
||||
* @param PostWasApproved $event
|
||||
*/
|
||||
public static function approveDiscussion(PostWasApproved $event)
|
||||
public function approveDiscussion(PostWasApproved $event)
|
||||
{
|
||||
$post = $event->post;
|
||||
$discussion = $post->discussion;
|
||||
|
@@ -13,13 +13,22 @@ use Flarum\Discussion\Discussion;
|
||||
use Flarum\Flags\Flag;
|
||||
use Flarum\Post\CommentPost;
|
||||
use Flarum\Post\Event\Saving;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
class UnapproveNewContent
|
||||
{
|
||||
/**
|
||||
* @param Dispatcher $events
|
||||
*/
|
||||
public function subscribe(Dispatcher $events)
|
||||
{
|
||||
$events->listen(Saving::class, [$this, 'unapproveNewPosts']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Saving $event
|
||||
*/
|
||||
public static function unapproveNewPosts(Saving $event)
|
||||
public function unapproveNewPosts(Saving $event)
|
||||
{
|
||||
$post = $event->post;
|
||||
|
||||
|
0
extensions/approval/tests/fixtures/.gitkeep
vendored
Normal file
0
extensions/approval/tests/fixtures/.gitkeep
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* For detailed copyright and license information, please view the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Approval\Tests\integration;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
trait InteractsWithUnapprovedContent
|
||||
{
|
||||
protected function prepareUnapprovedDatabaseContent()
|
||||
{
|
||||
$this->prepareDatabase([
|
||||
'users' => [
|
||||
['id' => 1, 'username' => 'Muralf', 'email' => 'muralf@machine.local', 'is_email_confirmed' => 1],
|
||||
$this->normalUser(),
|
||||
['id' => 3, 'username' => 'acme', 'email' => 'acme@machine.local', 'is_email_confirmed' => 1],
|
||||
['id' => 4, 'username' => 'luceos', 'email' => 'luceos@machine.local', 'is_email_confirmed' => 1],
|
||||
],
|
||||
'discussions' => [
|
||||
['id' => 1, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 1, 'comment_count' => 1, 'is_approved' => 1, 'is_private' => 0],
|
||||
['id' => 2, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 2, 'comment_count' => 1, 'is_approved' => 0, 'is_private' => 1],
|
||||
['id' => 3, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 3, 'comment_count' => 1, 'is_approved' => 0, 'is_private' => 1],
|
||||
['id' => 4, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 4, 'comment_count' => 1, 'is_approved' => 1, 'is_private' => 0],
|
||||
['id' => 5, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 5, 'comment_count' => 1, 'is_approved' => 1, 'is_private' => 0],
|
||||
['id' => 6, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 6, 'comment_count' => 1, 'is_approved' => 0, 'is_private' => 1],
|
||||
['id' => 7, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 7, 'comment_count' => 1, 'is_approved' => 1, 'is_private' => 0],
|
||||
],
|
||||
'posts' => [
|
||||
['id' => 1, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
|
||||
['id' => 2, 'discussion_id' => 2, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
|
||||
['id' => 3, 'discussion_id' => 3, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
|
||||
['id' => 4, 'discussion_id' => 4, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
|
||||
['id' => 5, 'discussion_id' => 5, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
|
||||
['id' => 6, 'discussion_id' => 6, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
|
||||
['id' => 7, 'discussion_id' => 7, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1],
|
||||
|
||||
['id' => 8, 'discussion_id' => 7, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 2],
|
||||
['id' => 9, 'discussion_id' => 7, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 1, 'is_approved' => 0, 'number' => 3],
|
||||
['id' => 10, 'discussion_id' => 7, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 4],
|
||||
['id' => 11, 'discussion_id' => 7, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 1, 'is_approved' => 0, 'number' => 5],
|
||||
],
|
||||
'groups' => [
|
||||
['id' => 4, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0]
|
||||
],
|
||||
'group_user' => [
|
||||
['user_id' => 3, 'group_id' => 4]
|
||||
],
|
||||
'group_permission' => [
|
||||
['permission' => 'discussion.approvePosts', 'group_id' => 4]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* null: Guest, 2: Normal User.
|
||||
*/
|
||||
public function unallowedUsers(): array
|
||||
{
|
||||
return [[null], [2]];
|
||||
}
|
||||
|
||||
/**
|
||||
* 1: Admin, 3: Permission Given, 4: Discussions Author.
|
||||
*/
|
||||
public function allowedUsers(): array
|
||||
{
|
||||
return [[1], [3], [4]];
|
||||
}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* For detailed copyright and license information, please view the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Approval\Tests\integration\api;
|
||||
|
||||
use Flarum\Approval\Tests\integration\InteractsWithUnapprovedContent;
|
||||
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
|
||||
use Flarum\Testing\integration\TestCase;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class ListDiscussionsTest extends TestCase
|
||||
{
|
||||
use RetrievesAuthorizedUsers;
|
||||
use InteractsWithUnapprovedContent;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->extension('flarum-approval');
|
||||
|
||||
$this->prepareUnapprovedDatabaseContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider unallowedUsers
|
||||
* @test
|
||||
*/
|
||||
public function can_only_see_approved_if_not_allowed_to_approve(?int $authenticatedAs)
|
||||
{
|
||||
$response = $this->send(
|
||||
$this->request('GET', '/api/discussions', compact('authenticatedAs'))
|
||||
);
|
||||
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
$this->assertEqualsCanonicalizing([1, 4, 5, 7], Arr::pluck($body['data'], 'id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider allowedUsers
|
||||
* @test
|
||||
*/
|
||||
public function can_see_unapproved_if_allowed_to_approve(int $authenticatedAs)
|
||||
{
|
||||
$response = $this->send(
|
||||
$this->request('GET', '/api/discussions', compact('authenticatedAs'))
|
||||
);
|
||||
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
$this->assertEqualsCanonicalizing([1, 2, 3, 4, 5, 6, 7], Arr::pluck($body['data'], 'id'));
|
||||
}
|
||||
}
|
74
extensions/approval/tests/integration/api/ListPostsTest.php
Normal file
74
extensions/approval/tests/integration/api/ListPostsTest.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* For detailed copyright and license information, please view the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Approval\Tests\integration\api;
|
||||
|
||||
use Flarum\Approval\Tests\integration\InteractsWithUnapprovedContent;
|
||||
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
|
||||
use Flarum\Testing\integration\TestCase;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class ListPostsTest extends TestCase
|
||||
{
|
||||
use RetrievesAuthorizedUsers;
|
||||
use InteractsWithUnapprovedContent;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->extension('flarum-approval');
|
||||
|
||||
$this->prepareUnapprovedDatabaseContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider unallowedUsers
|
||||
* @test
|
||||
*/
|
||||
public function can_only_see_approved_if_not_allowed_to_approve(?int $authenticatedAs)
|
||||
{
|
||||
$response = $this->send(
|
||||
$this
|
||||
->request('GET', '/api/posts', compact('authenticatedAs'))
|
||||
->withQueryParams([
|
||||
'filter' => [
|
||||
'discussion' => 7
|
||||
]
|
||||
])
|
||||
);
|
||||
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
$this->assertEqualsCanonicalizing([7, 8, 10], Arr::pluck($body['data'], 'id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider allowedUsers
|
||||
* @test
|
||||
*/
|
||||
public function can_see_unapproved_if_allowed_to_approve(int $authenticatedAs)
|
||||
{
|
||||
$response = $this->send(
|
||||
$this
|
||||
->request('GET', '/api/posts', compact('authenticatedAs'))
|
||||
->withQueryParams([
|
||||
'filter' => [
|
||||
'discussion' => 7
|
||||
]
|
||||
])
|
||||
);
|
||||
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
$this->assertEqualsCanonicalizing([7, 8, 9, 10, 11], Arr::pluck($body['data'], 'id'));
|
||||
}
|
||||
}
|
16
extensions/approval/tests/integration/setup.php
Normal file
16
extensions/approval/tests/integration/setup.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* For detailed copyright and license information, please view the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Flarum\Testing\integration\Setup\SetupScript;
|
||||
|
||||
require __DIR__.'/../../vendor/autoload.php';
|
||||
|
||||
$setup = new SetupScript();
|
||||
|
||||
$setup->run();
|
25
extensions/approval/tests/phpunit.integration.xml
Normal file
25
extensions/approval/tests/phpunit.integration.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="true"
|
||||
stopOnFailure="false"
|
||||
>
|
||||
<coverage processUncoveredFiles="true">
|
||||
<include>
|
||||
<directory suffix=".php">../src/</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
<testsuites>
|
||||
<testsuite name="Flarum Integration Tests">
|
||||
<directory suffix="Test.php">./integration</directory>
|
||||
<exclude>./integration/tmp</exclude>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
27
extensions/approval/tests/phpunit.unit.xml
Normal file
27
extensions/approval/tests/phpunit.unit.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
>
|
||||
<coverage processUncoveredFiles="true">
|
||||
<include>
|
||||
<directory suffix=".php">../src/</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
<testsuites>
|
||||
<testsuite name="Flarum Unit Tests">
|
||||
<directory suffix="Test.php">./unit</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<listeners>
|
||||
<listener class="\Mockery\Adapter\Phpunit\TestListener" />
|
||||
</listeners>
|
||||
</phpunit>
|
0
extensions/approval/tests/unit/.gitkeep
Normal file
0
extensions/approval/tests/unit/.gitkeep
Normal file
20
extensions/bbcode/.gitattributes
vendored
Normal file
20
extensions/bbcode/.gitattributes
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
**/.gitattributes export-ignore
|
||||
**/.gitignore export-ignore
|
||||
**/.gitmodules export-ignore
|
||||
**/.github export-ignore
|
||||
**/.travis export-ignore
|
||||
**/.travis.yml export-ignore
|
||||
**/.editorconfig export-ignore
|
||||
**/.styleci.yml export-ignore
|
||||
|
||||
**/phpunit.xml export-ignore
|
||||
**/tests export-ignore
|
||||
|
||||
**/js/dist/**/* -diff
|
||||
**/js/dist/**/* linguist-generated
|
||||
**/js/dist-typings/**/* -diff
|
||||
**/js/dist-typings/**/* linguist-generated
|
||||
**/js/yarn.lock -diff
|
||||
**/js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"support": {
|
||||
"issues": "https://github.com/flarum/core/issues",
|
||||
"issues": "https://github.com/flarum/framework/issues",
|
||||
"source": "https://github.com/flarum/bbcode",
|
||||
"forum": "https://discuss.flarum.org"
|
||||
},
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"flarum/core": "^1.3"
|
||||
"flarum/core": "^1.5"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@@ -1,19 +0,0 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{php,xml,json}]
|
||||
indent_size = 4
|
20
extensions/embed/.gitattributes
vendored
Normal file
20
extensions/embed/.gitattributes
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
**/.gitattributes export-ignore
|
||||
**/.gitignore export-ignore
|
||||
**/.gitmodules export-ignore
|
||||
**/.github export-ignore
|
||||
**/.travis export-ignore
|
||||
**/.travis.yml export-ignore
|
||||
**/.editorconfig export-ignore
|
||||
**/.styleci.yml export-ignore
|
||||
|
||||
**/phpunit.xml export-ignore
|
||||
**/tests export-ignore
|
||||
|
||||
**/js/dist/**/* -diff
|
||||
**/js/dist/**/* linguist-generated
|
||||
**/js/dist-typings/**/* -diff
|
||||
**/js/dist-typings/**/* linguist-generated
|
||||
**/js/yarn.lock -diff
|
||||
**/js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"support": {
|
||||
"issues": "https://github.com/flarum/core/issues",
|
||||
"issues": "https://github.com/flarum/framework/issues",
|
||||
"source": "https://github.com/flarum/embed",
|
||||
"forum": "https://discuss.flarum.org"
|
||||
},
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"flarum/core": "^1.3"
|
||||
"flarum/core": "^1.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
2
extensions/embed/js/dist/forum.js.map
generated
vendored
2
extensions/embed/js/dist/forum.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -1,19 +0,0 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{php,xml,json}]
|
||||
indent_size = 4
|
20
extensions/emoji/.gitattributes
vendored
Normal file
20
extensions/emoji/.gitattributes
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
**/.gitattributes export-ignore
|
||||
**/.gitignore export-ignore
|
||||
**/.gitmodules export-ignore
|
||||
**/.github export-ignore
|
||||
**/.travis export-ignore
|
||||
**/.travis.yml export-ignore
|
||||
**/.editorconfig export-ignore
|
||||
**/.styleci.yml export-ignore
|
||||
|
||||
**/phpunit.xml export-ignore
|
||||
**/tests export-ignore
|
||||
|
||||
**/js/dist/**/* -diff
|
||||
**/js/dist/**/* linguist-generated
|
||||
**/js/dist-typings/**/* -diff
|
||||
**/js/dist-typings/**/* linguist-generated
|
||||
**/js/yarn.lock -diff
|
||||
**/js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"support": {
|
||||
"issues": "https://github.com/flarum/core/issues",
|
||||
"issues": "https://github.com/flarum/framework/issues",
|
||||
"source": "https://github.com/flarum/emoji",
|
||||
"forum": "https://discuss.flarum.org"
|
||||
},
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"flarum/core": "^1.3"
|
||||
"flarum/core": "^1.5"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
2
extensions/emoji/js/dist/forum.js.map
generated
vendored
2
extensions/emoji/js/dist/forum.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -22,10 +22,6 @@
|
||||
"build": "webpack --mode production",
|
||||
"format": "prettier --write src",
|
||||
"format-check": "prettier --check src",
|
||||
"analyze": "cross-env ANALYZER=true yarn run build",
|
||||
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
|
||||
"build-typings": "npm run clean-typings && cp -r src/@types dist-typings/@types && tsc",
|
||||
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
||||
"check-typings-coverage": "typescript-coverage-report"
|
||||
"analyze": "cross-env ANALYZER=true yarn run build"
|
||||
}
|
||||
}
|
||||
|
@@ -1,19 +0,0 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{php,xml,json}]
|
||||
indent_size = 4
|
20
extensions/flags/.gitattributes
vendored
Normal file
20
extensions/flags/.gitattributes
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
**/.gitattributes export-ignore
|
||||
**/.gitignore export-ignore
|
||||
**/.gitmodules export-ignore
|
||||
**/.github export-ignore
|
||||
**/.travis export-ignore
|
||||
**/.travis.yml export-ignore
|
||||
**/.editorconfig export-ignore
|
||||
**/.styleci.yml export-ignore
|
||||
|
||||
**/phpunit.xml export-ignore
|
||||
**/tests export-ignore
|
||||
|
||||
**/js/dist/**/* -diff
|
||||
**/js/dist/**/* linguist-generated
|
||||
**/js/dist-typings/**/* -diff
|
||||
**/js/dist-typings/**/* linguist-generated
|
||||
**/js/yarn.lock -diff
|
||||
**/js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"support": {
|
||||
"issues": "https://github.com/flarum/core/issues",
|
||||
"issues": "https://github.com/flarum/framework/issues",
|
||||
"source": "https://github.com/flarum/flags",
|
||||
"forum": "https://discuss.flarum.org"
|
||||
},
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"flarum/core": "^1.3"
|
||||
"flarum/core": "^1.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
4
extensions/flags/js/dist-typings/forum/components/FlagList.d.ts
generated
vendored
4
extensions/flags/js/dist-typings/forum/components/FlagList.d.ts
generated
vendored
@@ -1,5 +1,7 @@
|
||||
export default class FlagList {
|
||||
export default class FlagList extends Component<import("flarum/common/Component").ComponentAttrs, undefined> {
|
||||
constructor();
|
||||
oninit(vnode: any): void;
|
||||
state: any;
|
||||
view(): JSX.Element;
|
||||
}
|
||||
import Component from "flarum/common/Component";
|
||||
|
17
extensions/flags/js/dist-typings/forum/components/FlagPostModal.d.ts
generated
vendored
17
extensions/flags/js/dist-typings/forum/components/FlagPostModal.d.ts
generated
vendored
@@ -1,12 +1,15 @@
|
||||
export default class FlagPostModal {
|
||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
||||
export default class FlagPostModal extends Modal<import("flarum/common/components/Modal").IInternalModalAttrs> {
|
||||
constructor();
|
||||
oninit(vnode: any): void;
|
||||
success: boolean | undefined;
|
||||
reason: any;
|
||||
reasonDetail: any;
|
||||
className(): string;
|
||||
title(): any;
|
||||
reason: Stream<string> | undefined;
|
||||
reasonDetail: Stream<string> | undefined;
|
||||
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
||||
content(): JSX.Element;
|
||||
flagReasons(): any;
|
||||
flagReasons(): ItemList<any>;
|
||||
onsubmit(e: any): void;
|
||||
loading: boolean | undefined;
|
||||
}
|
||||
import Modal from "flarum/common/components/Modal";
|
||||
import Stream from "flarum/common/utils/Stream";
|
||||
import ItemList from "flarum/common/utils/ItemList";
|
||||
|
2
extensions/flags/js/dist-typings/forum/components/FlagsDropdown.d.ts
generated
vendored
2
extensions/flags/js/dist-typings/forum/components/FlagsDropdown.d.ts
generated
vendored
@@ -3,5 +3,5 @@ export default class FlagsDropdown {
|
||||
getMenu(): JSX.Element;
|
||||
goToRoute(): void;
|
||||
getUnreadCount(): any;
|
||||
getNewCount(): any;
|
||||
getNewCount(): unknown;
|
||||
}
|
||||
|
14
extensions/flags/js/dist-typings/forum/models/Flag.d.ts
generated
vendored
14
extensions/flags/js/dist-typings/forum/models/Flag.d.ts
generated
vendored
@@ -1,9 +1,11 @@
|
||||
import Model from 'flarum/common/Model';
|
||||
import type Post from 'flarum/common/models/Post';
|
||||
import type User from 'flarum/common/models/User';
|
||||
export default class Flag extends Model {
|
||||
type(): any;
|
||||
reason(): any;
|
||||
reasonDetail(): any;
|
||||
createdAt(): any;
|
||||
post(): any;
|
||||
user(): any;
|
||||
type(): string;
|
||||
reason(): string | null;
|
||||
reasonDetail(): string | null;
|
||||
createdAt(): Date | null | undefined;
|
||||
post(): false | Post;
|
||||
user(): false | User | null;
|
||||
}
|
||||
|
2
extensions/flags/js/dist/admin.js.map
generated
vendored
2
extensions/flags/js/dist/admin.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,cAAAA,IACO,gBACJC,gBACC,CACEC,QAAS,8BACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,qDAE9B,IAEDC,gBAAgB,CACfC,QAAS,4BACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,sDAE7BK,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,WACA,IAGDF,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,QACA,Q","sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/webpack/runtime/compat get default export","webpack://@flarum/flags/webpack/runtime/define property getters","webpack://@flarum/flags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/flags/webpack/runtime/make namespace object","webpack://@flarum/flags/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/flags/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-flags', () => {\n app.extensionData\n .for('flarum-flags')\n .registerSetting(\n {\n setting: 'flarum-flags.guidelines_url',\n type: 'text',\n label: app.translator.trans('flarum-flags.admin.settings.guidelines_url_label'),\n },\n 15\n )\n .registerSetting({\n setting: 'flarum-flags.can_flag_own',\n type: 'boolean',\n label: app.translator.trans('flarum-flags.admin.settings.flag_own_posts_label'),\n })\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'),\n permission: 'discussion.viewFlags',\n },\n 'moderate',\n 65\n )\n\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.flag_posts_label'),\n permission: 'discussion.flagPosts',\n },\n 'reply',\n 65\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","registerPermission","icon","permission"],"sourceRoot":""}
|
||||
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,cAAAA,IACO,gBACJC,gBACC,CACEC,QAAS,8BACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,qDAE9B,IAEDC,gBAAgB,CACfC,QAAS,4BACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,sDAE7BK,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,WACA,IAGDF,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,QACA,GAEL,G","sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/webpack/runtime/compat get default export","webpack://@flarum/flags/webpack/runtime/define property getters","webpack://@flarum/flags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/flags/webpack/runtime/make namespace object","webpack://@flarum/flags/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/flags/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-flags', () => {\n app.extensionData\n .for('flarum-flags')\n .registerSetting(\n {\n setting: 'flarum-flags.guidelines_url',\n type: 'text',\n label: app.translator.trans('flarum-flags.admin.settings.guidelines_url_label'),\n },\n 15\n )\n .registerSetting({\n setting: 'flarum-flags.can_flag_own',\n type: 'boolean',\n label: app.translator.trans('flarum-flags.admin.settings.flag_own_posts_label'),\n })\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'),\n permission: 'discussion.viewFlags',\n },\n 'moderate',\n 65\n )\n\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.flag_posts_label'),\n permission: 'discussion.flagPosts',\n },\n 'reply',\n 65\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","registerPermission","icon","permission"],"sourceRoot":""}
|
2
extensions/flags/js/dist/forum.js.map
generated
vendored
2
extensions/flags/js/dist/forum.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -17,13 +17,13 @@
|
||||
"scripts": {
|
||||
"dev": "webpack --mode development --watch",
|
||||
"build": "webpack --mode production",
|
||||
"analyze": "cross-env ANALYZER=true yarn run build",
|
||||
"format": "prettier --write src",
|
||||
"format-check": "prettier --check src",
|
||||
"analyze": "cross-env ANALYZER=true yarn run build",
|
||||
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
|
||||
"build-typings": "yarn run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && yarn run post-build-typings",
|
||||
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'",
|
||||
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
||||
"check-typings-coverage": "typescript-coverage-report",
|
||||
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'"
|
||||
"check-typings-coverage": "typescript-coverage-report"
|
||||
}
|
||||
}
|
||||
|
@@ -4,14 +4,13 @@
|
||||
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
|
||||
// and also tells your Typescript server to read core's global typings for
|
||||
// access to `dayjs` and `$` in the global namespace.
|
||||
"include": ["src/**/*", "../vendor/*/*/js/dist-typings/@types/**/*", "@types/**/*"],
|
||||
"include": ["src/**/*", "../../../*/*/js/dist-typings/@types/**/*", "@types/**/*"],
|
||||
"compilerOptions": {
|
||||
// This will output typings to `dist-typings`
|
||||
"declarationDir": "./dist-typings",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"],
|
||||
"@flarum/core/*": ["../vendor/flarum/core/js/dist-typings/*"]
|
||||
"flarum/*": ["../../../framework/core/js/dist-typings/*"],
|
||||
"@flarum/core/*": ["../../../framework/core/js/dist-typings/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,19 +0,0 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{php,xml,json}]
|
||||
indent_size = 4
|
20
extensions/lang-english/.gitattributes
vendored
Normal file
20
extensions/lang-english/.gitattributes
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
**/.gitattributes export-ignore
|
||||
**/.gitignore export-ignore
|
||||
**/.gitmodules export-ignore
|
||||
**/.github export-ignore
|
||||
**/.travis export-ignore
|
||||
**/.travis.yml export-ignore
|
||||
**/.editorconfig export-ignore
|
||||
**/.styleci.yml export-ignore
|
||||
|
||||
**/phpunit.xml export-ignore
|
||||
**/tests export-ignore
|
||||
|
||||
**/js/dist/**/* -diff
|
||||
**/js/dist/**/* linguist-generated
|
||||
**/js/dist-typings/**/* -diff
|
||||
**/js/dist-typings/**/* linguist-generated
|
||||
**/js/yarn.lock -diff
|
||||
**/js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"flarum/core": "^1.3"
|
||||
"flarum/core": "^1.5"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@@ -1,19 +0,0 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{php,xml,json}]
|
||||
indent_size = 4
|
20
extensions/likes/.gitattributes
vendored
Normal file
20
extensions/likes/.gitattributes
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
**/.gitattributes export-ignore
|
||||
**/.gitignore export-ignore
|
||||
**/.gitmodules export-ignore
|
||||
**/.github export-ignore
|
||||
**/.travis export-ignore
|
||||
**/.travis.yml export-ignore
|
||||
**/.editorconfig export-ignore
|
||||
**/.styleci.yml export-ignore
|
||||
|
||||
**/phpunit.xml export-ignore
|
||||
**/tests export-ignore
|
||||
|
||||
**/js/dist/**/* -diff
|
||||
**/js/dist/**/* linguist-generated
|
||||
**/js/dist-typings/**/* -diff
|
||||
**/js/dist-typings/**/* linguist-generated
|
||||
**/js/yarn.lock -diff
|
||||
**/js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"support": {
|
||||
"issues": "https://github.com/flarum/core/issues",
|
||||
"issues": "https://github.com/flarum/framework/issues",
|
||||
"source": "https://github.com/flarum/likes",
|
||||
"forum": "https://discuss.flarum.org"
|
||||
},
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"flarum/core": "^1.3"
|
||||
"flarum/core": "^1.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@@ -51,7 +51,7 @@
|
||||
"prettier": true,
|
||||
"typescript": false,
|
||||
"bundlewatch": false,
|
||||
"backendTesting": false,
|
||||
"backendTesting": true,
|
||||
"editorConfig": true,
|
||||
"styleci": true
|
||||
}
|
||||
@@ -64,5 +64,28 @@
|
||||
}
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
"prefer-stable": true,
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Flarum\\Likes\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": [
|
||||
"@test:unit",
|
||||
"@test:integration"
|
||||
],
|
||||
"test:unit": "phpunit -c tests/phpunit.unit.xml",
|
||||
"test:integration": "phpunit -c tests/phpunit.integration.xml",
|
||||
"test:setup": "@php tests/integration/setup.php"
|
||||
},
|
||||
"scripts-descriptions": {
|
||||
"test": "Runs all tests.",
|
||||
"test:unit": "Runs all unit tests.",
|
||||
"test:integration": "Runs all integration tests.",
|
||||
"test:setup": "Sets up a database for use with integration tests. Execute this only once."
|
||||
},
|
||||
"require-dev": {
|
||||
"flarum/testing": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
@@ -7,16 +7,17 @@
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Likes;
|
||||
|
||||
use Flarum\Api\Controller;
|
||||
use Flarum\Api\Serializer\BasicUserSerializer;
|
||||
use Flarum\Api\Serializer\PostSerializer;
|
||||
use Flarum\Extend;
|
||||
use Flarum\Likes\Event\PostWasLiked;
|
||||
use Flarum\Likes\Event\PostWasUnliked;
|
||||
use Flarum\Likes\Listener;
|
||||
use Flarum\Likes\Notification\PostLikedBlueprint;
|
||||
use Flarum\Post\Event\Deleted;
|
||||
use Flarum\Post\Event\Saving;
|
||||
use Flarum\Likes\Query\LikedByFilter;
|
||||
use Flarum\Post\Filter\PostFilterer;
|
||||
use Flarum\Post\Post;
|
||||
use Flarum\User\User;
|
||||
|
||||
@@ -57,6 +58,14 @@ return [
|
||||
(new Extend\Event())
|
||||
->listen(PostWasLiked::class, Listener\SendNotificationWhenPostIsLiked::class)
|
||||
->listen(PostWasUnliked::class, Listener\SendNotificationWhenPostIsUnliked::class)
|
||||
->listen(Deleted::class, [Listener\SaveLikesToDatabase::class, 'whenPostIsDeleted'])
|
||||
->listen(Saving::class, [Listener\SaveLikesToDatabase::class, 'whenPostIsSaving']),
|
||||
->subscribe(Listener\SaveLikesToDatabase::class),
|
||||
|
||||
(new Extend\Filter(PostFilterer::class))
|
||||
->addFilter(LikedByFilter::class),
|
||||
|
||||
(new Extend\Settings())
|
||||
->default('flarum-likes.like_own_post', true),
|
||||
|
||||
(new Extend\Policy())
|
||||
->modelPolicy(Post::class, Access\LikePostPolicy::class),
|
||||
];
|
||||
|
2
extensions/likes/js/dist/admin.js
generated
vendored
2
extensions/likes/js/dist/admin.js
generated
vendored
@@ -1,2 +1,2 @@
|
||||
(()=>{var e={n:r=>{var o=r&&r.__esModule?()=>r.default:()=>r;return e.d(o,{a:o}),o},d:(r,o)=>{for(var t in o)e.o(o,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:o[t]})},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);const o=flarum.core.compat["admin/app"];var t=e.n(o);t().initializers.add("flarum-likes",(function(){t().extensionData.for("flarum-likes").registerPermission({icon:"far fa-thumbs-up",label:t().translator.trans("flarum-likes.admin.permissions.like_posts_label"),permission:"discussion.likePosts"},"reply")}))})(),module.exports=r})();
|
||||
(()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var s in r)e.o(r,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:r[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);const r=flarum.core.compat["admin/app"];var s=e.n(r);s().initializers.add("flarum-likes",(function(){s().extensionData.for("flarum-likes").registerPermission({icon:"far fa-thumbs-up",label:s().translator.trans("flarum-likes.admin.permissions.like_posts_label"),permission:"discussion.likePosts"},"reply").registerSetting({setting:"flarum-likes.like_own_post",type:"bool",label:s().translator.trans("flarum-likes.admin.settings.like_own_posts_label"),help:s().translator.trans("flarum-likes.admin.settings.like_own_posts_help")})}))})(),module.exports=t})();
|
||||
//# sourceMappingURL=admin.js.map
|
2
extensions/likes/js/dist/admin.js.map
generated
vendored
2
extensions/likes/js/dist/admin.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,cAAAA,IAAsB,gBAAgBC,mBACpC,CACEC,KAAM,mBACNC,MAAOH,IAAAA,WAAAA,MAAqB,mDAC5BI,WAAY,wBAEd,a","sources":["webpack://@flarum/likes/webpack/bootstrap","webpack://@flarum/likes/webpack/runtime/compat get default export","webpack://@flarum/likes/webpack/runtime/define property getters","webpack://@flarum/likes/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/likes/webpack/runtime/make namespace object","webpack://@flarum/likes/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/likes/./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['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-likes', () => {\n app.extensionData.for('flarum-likes').registerPermission(\n {\n icon: 'far fa-thumbs-up',\n label: app.translator.trans('flarum-likes.admin.permissions.like_posts_label'),\n permission: 'discussion.likePosts',\n },\n '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","core","compat","app","registerPermission","icon","label","permission"],"sourceRoot":""}
|
||||
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,cAAAA,IACO,gBACJC,mBACC,CACEC,KAAM,mBACNC,MAAOH,IAAAA,WAAAA,MAAqB,mDAC5BI,WAAY,wBAEd,SAEDC,gBAAgB,CACfC,QAAS,6BACTC,KAAM,OACNJ,MAAOH,IAAAA,WAAAA,MAAqB,oDAC5BQ,KAAMR,IAAAA,WAAAA,MAAqB,oDAEhC,G","sources":["webpack://@flarum/likes/webpack/bootstrap","webpack://@flarum/likes/webpack/runtime/compat get default export","webpack://@flarum/likes/webpack/runtime/define property getters","webpack://@flarum/likes/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/likes/webpack/runtime/make namespace object","webpack://@flarum/likes/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/likes/./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['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-likes', () => {\n app.extensionData\n .for('flarum-likes')\n .registerPermission(\n {\n icon: 'far fa-thumbs-up',\n label: app.translator.trans('flarum-likes.admin.permissions.like_posts_label'),\n permission: 'discussion.likePosts',\n },\n 'reply'\n )\n .registerSetting({\n setting: 'flarum-likes.like_own_post',\n type: 'bool',\n label: app.translator.trans('flarum-likes.admin.settings.like_own_posts_label'),\n help: app.translator.trans('flarum-likes.admin.settings.like_own_posts_help'),\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","registerPermission","icon","label","permission","registerSetting","setting","type","help"],"sourceRoot":""}
|
2
extensions/likes/js/dist/forum.js
generated
vendored
2
extensions/likes/js/dist/forum.js
generated
vendored
File diff suppressed because one or more lines are too long
2
extensions/likes/js/dist/forum.js.map
generated
vendored
2
extensions/likes/js/dist/forum.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -1,12 +1,20 @@
|
||||
import app from 'flarum/admin/app';
|
||||
|
||||
app.initializers.add('flarum-likes', () => {
|
||||
app.extensionData.for('flarum-likes').registerPermission(
|
||||
{
|
||||
icon: 'far fa-thumbs-up',
|
||||
label: app.translator.trans('flarum-likes.admin.permissions.like_posts_label'),
|
||||
permission: 'discussion.likePosts',
|
||||
},
|
||||
'reply'
|
||||
);
|
||||
app.extensionData
|
||||
.for('flarum-likes')
|
||||
.registerPermission(
|
||||
{
|
||||
icon: 'far fa-thumbs-up',
|
||||
label: app.translator.trans('flarum-likes.admin.permissions.like_posts_label'),
|
||||
permission: 'discussion.likePosts',
|
||||
},
|
||||
'reply'
|
||||
)
|
||||
.registerSetting({
|
||||
setting: 'flarum-likes.like_own_post',
|
||||
type: 'bool',
|
||||
label: app.translator.trans('flarum-likes.admin.settings.like_own_posts_label'),
|
||||
help: app.translator.trans('flarum-likes.admin.settings.like_own_posts_help'),
|
||||
});
|
||||
});
|
||||
|
21
extensions/likes/js/src/forum/addLikesTabToUserProfile.tsx
Normal file
21
extensions/likes/js/src/forum/addLikesTabToUserProfile.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { extend } from 'flarum/common/extend';
|
||||
import app from 'flarum/forum/app';
|
||||
import UserPage from 'flarum/forum/components/UserPage';
|
||||
import LinkButton from 'flarum/common/components/LinkButton';
|
||||
import LikesUserPage from './components/LikesUserPage';
|
||||
import ItemList from 'flarum/common/utils/ItemList';
|
||||
import type Mithril from 'mithril';
|
||||
|
||||
export default function addLikesTabToUserProfile() {
|
||||
app.routes['user.likes'] = { path: '/u/:username/likes', component: LikesUserPage };
|
||||
extend(UserPage.prototype, 'navItems', function (items: ItemList<Mithril.Children>) {
|
||||
const user = this.user;
|
||||
items.add(
|
||||
'likes',
|
||||
<LinkButton href={app.route('user.likes', { username: user.slug() })} icon="far fa-thumbs-up">
|
||||
{app.translator.trans('flarum-likes.forum.user.likes_link')}
|
||||
</LinkButton>,
|
||||
88
|
||||
);
|
||||
});
|
||||
}
|
24
extensions/likes/js/src/forum/components/LikesUserPage.tsx
Normal file
24
extensions/likes/js/src/forum/components/LikesUserPage.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import app from 'flarum/forum/app';
|
||||
import PostsUserPage from 'flarum/forum/components/PostsUserPage';
|
||||
|
||||
/**
|
||||
* The `LikesUserPage` component shows posts which user the user liked.
|
||||
*/
|
||||
export default class LikesUserPage extends PostsUserPage {
|
||||
/**
|
||||
* Load a new page of the user's activity feed.
|
||||
*
|
||||
* @param offset The position to start getting results from.
|
||||
* @protected
|
||||
*/
|
||||
loadResults(offset: number) {
|
||||
return app.store.find('posts', {
|
||||
filter: {
|
||||
type: 'comment',
|
||||
likedBy: this.user.id(),
|
||||
},
|
||||
page: { offset, limit: this.loadLimit },
|
||||
sort: '-createdAt',
|
||||
});
|
||||
}
|
||||
}
|
@@ -7,6 +7,7 @@ import NotificationGrid from 'flarum/forum/components/NotificationGrid';
|
||||
import addLikeAction from './addLikeAction';
|
||||
import addLikesList from './addLikesList';
|
||||
import PostLikedNotification from './components/PostLikedNotification';
|
||||
import addLikesTabToUserProfile from './addLikesTabToUserProfile';
|
||||
|
||||
app.initializers.add('flarum-likes', () => {
|
||||
app.notificationComponents.postLiked = PostLikedNotification;
|
||||
@@ -16,6 +17,7 @@ app.initializers.add('flarum-likes', () => {
|
||||
|
||||
addLikeAction();
|
||||
addLikesList();
|
||||
addLikesTabToUserProfile();
|
||||
|
||||
extend(NotificationGrid.prototype, 'notificationTypes', function (items) {
|
||||
items.add('postLiked', {
|
||||
|
@@ -11,6 +11,10 @@ flarum-likes:
|
||||
permissions:
|
||||
like_posts_label: Like posts
|
||||
|
||||
settings:
|
||||
like_own_posts_help: When enabled, subject to permission, users may 'like' their own posts on the forum. To prevent users placing a 'like' on their own posts, disable this setting.
|
||||
like_own_posts_label: Users may like their own posts
|
||||
|
||||
# Translations in this namespace are used by the forum user interface.
|
||||
forum:
|
||||
|
||||
@@ -35,3 +39,7 @@ flarum-likes:
|
||||
# These translations are used in the Settings page.
|
||||
settings:
|
||||
notify_post_liked_label: Someone likes one of my posts
|
||||
|
||||
# These translations are used in the User profile page.
|
||||
user:
|
||||
likes_link: Likes
|
||||
|
35
extensions/likes/src/Access/LikePostPolicy.php
Normal file
35
extensions/likes/src/Access/LikePostPolicy.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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\Likes\Access;
|
||||
|
||||
use Flarum\Post\Post;
|
||||
use Flarum\Settings\SettingsRepositoryInterface;
|
||||
use Flarum\User\Access\AbstractPolicy;
|
||||
use Flarum\User\User;
|
||||
|
||||
class LikePostPolicy extends AbstractPolicy
|
||||
{
|
||||
/**
|
||||
* @var SettingsRepositoryInterface
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
public function __construct(SettingsRepositoryInterface $settings)
|
||||
{
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
public function like(User $actor, Post $post)
|
||||
{
|
||||
if ($actor->id === $post->user_id && ! (bool) $this->settings->get('flarum-likes.like_own_post')) {
|
||||
return $this->deny();
|
||||
}
|
||||
}
|
||||
}
|
@@ -13,13 +13,23 @@ use Flarum\Likes\Event\PostWasLiked;
|
||||
use Flarum\Likes\Event\PostWasUnliked;
|
||||
use Flarum\Post\Event\Deleted;
|
||||
use Flarum\Post\Event\Saving;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
class SaveLikesToDatabase
|
||||
{
|
||||
/**
|
||||
* @param Dispatcher $events
|
||||
*/
|
||||
public function subscribe(Dispatcher $events)
|
||||
{
|
||||
$events->listen(Saving::class, [$this, 'whenPostIsSaving']);
|
||||
$events->listen(Deleted::class, [$this, 'whenPostIsDeleted']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Saving $event
|
||||
*/
|
||||
public static function whenPostIsSaving(Saving $event)
|
||||
public function whenPostIsSaving(Saving $event)
|
||||
{
|
||||
$post = $event->post;
|
||||
$data = $event->data;
|
||||
@@ -47,7 +57,7 @@ class SaveLikesToDatabase
|
||||
/**
|
||||
* @param Deleted $event
|
||||
*/
|
||||
public static function whenPostIsDeleted(Deleted $event)
|
||||
public function whenPostIsDeleted(Deleted $event)
|
||||
{
|
||||
$event->post->likes()->detach();
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user