Skip to content

Commit

Permalink
Merge pull request v17development#19 from datlechin/main
Browse files Browse the repository at this point in the history
Badges visible on `UserCard`
  • Loading branch information
jaspervriends authored Jul 1, 2022
2 parents 97f45a6 + 240e48c commit 32ee110
Show file tree
Hide file tree
Showing 61 changed files with 8,100 additions and 13,501 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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 changes: 20 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: User badges PHP

on: [workflow_dispatch, push, pull_request]

# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.

jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
with:
enable_backend_testing: false

backend_directory: .
23 changes: 23 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: User badges JS

on: [workflow_dispatch, push, pull_request]

# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.

jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false

frontend_directory: ./js
backend_directory: .
js_package_manager: npm
main_git_branch: main

secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/vendor
composer.lock
composer.phar
.idea

.DS_Store
Thumbs.db
node_modules
tests/.phpunit.result.cache
/tests/integration/tmp
.vagrant
.idea/*
.vscode
js/coverage-ts
14 changes: 14 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
preset: recommended

enabled:
- logical_not_operators_with_successor_space

disabled:
- align_double_arrow
- blank_line_after_opening_tag
- multiline_array_trailing_comma
- new_with_braces
- phpdoc_align
- phpdoc_order
- phpdoc_separation
- phpdoc_types
21 changes: 19 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"require": {
"ext-json": "*",
"flarum/core": "^1.0.0"
"flarum/core": "^1.3.1"
},
"suggest": {
"askvortsov/flarum-auto-moderator": "Allows you to automatically hand out badges to users"
Expand All @@ -38,8 +38,25 @@
"color": "#225650"
},
"optional-dependencies": [
"askvortsov/flarum-auto-moderator"
"askvortsov/flarum-auto-moderator"
]
},
"flarum-cli": {
"modules": {
"admin": true,
"forum": true,
"js": true,
"jsCommon": true,
"css": true,
"gitConf": true,
"githubActions": true,
"prettier": true,
"typescript": false,
"bundlewatch": false,
"backendTesting": false,
"editorConfig": true,
"styleci": true
}
}
}
}
9 changes: 7 additions & 2 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
$extend = [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__ . '/less/Forum.less')
->css(__DIR__ . '/less/forum.less')
->route('/badges', 'badges.overview', Controllers\BadgeOverviewController::class)
->route('/badges/{id}', 'badges.item', Controllers\BadgeOverviewController::class)
,
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js')
->css(__DIR__ . '/less/Admin.less'),
->css(__DIR__ . '/less/admin.less'),

(new Extend\Routes('api'))
// Badges
Expand Down Expand Up @@ -78,6 +78,11 @@
->type(Notification\BadgeReceivedBlueprint::class, Api\Serializer\UserBadgeSerializer::class, ['alert']),

new Extend\Locales(__DIR__ . '/locale'),

(new Extend\Settings)
->serializeToForum('showBadgesOnUserCard', 'v17development-user-badges.show_badges_on_user_card', 'boolval')
->serializeToForum('numberOfBadgesOnUserCard', 'v17development-user-badges.number_of_badges_on_user_card', 'intval')
->default('v17development-user-badges.number_of_badges_on_user_card', 5),
];

/**
Expand Down
9 changes: 9 additions & 0 deletions js/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

node_modules
3 changes: 2 additions & 1 deletion js/admin.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './src/admin';
export * from './src/common';
export * from './src/admin';
10 changes: 2 additions & 8 deletions js/dist/admin.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions js/dist/admin.js.LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/admin.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/forum.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './src/common';
export * from './src/forum';
Loading

0 comments on commit 32ee110

Please sign in to comment.