Skip to content

Commit

Permalink
chore: maintenance (#41)
Browse files Browse the repository at this point in the history
* Webpack5

* Default settings extender

* Provide settings placeholder

* Set user bio priority to -100 so it appears last in the UserCard
  • Loading branch information
imorland authored May 20, 2022
1 parent c470810 commit ee44cb6
Show file tree
Hide file tree
Showing 7 changed files with 2,249 additions and 7,217 deletions.
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
}
],
"require": {
"flarum/core": "^1.0.0"
"flarum/core": "^1.2.0"
},
"authors": [
{
"name": "Charlie K",
"email": "[email protected]",
"homepage": "https://redevs.org",
"role": "Developer"
},
{
"name": "IanM",
"email": "[email protected]",
"role": "Developer"
}
],
"autoload": {
Expand Down
3 changes: 2 additions & 1 deletion extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
->modelPolicy(User::class, Access\UserPolicy::class),

(new Extend\Settings())
->serializeToForum('fof-user-bio.maxLength', 'fof-user-bio.maxLength', 'intVal'),
->serializeToForum('fof-user-bio.maxLength', 'fof-user-bio.maxLength', 'intVal')
->default('fof-user-bio.maxLength', 200),
];
9,437 changes: 2,233 additions & 7,204 deletions js/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"autolink-js": "1.0.2",
"@flarum/prettier-config": "^1.0.0",
"flarum-tsconfig": "^1.0.2",
"flarum-webpack-config": "^1.0.0",
"webpack": "^4.44.2",
"webpack-cli": "^4.9.1"
"flarum-webpack-config": "^2.0.0",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2"
},
"devDependencies": {
"prettier": "^2.4.1"
"prettier": "^2.6.2"
},
"scripts": {
"dev": "webpack --mode development --watch",
Expand Down
1 change: 1 addition & 0 deletions js/src/admin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ app.initializers.add('fof-user-bio', () => {
label: app.translator.trans('fof-user-bio.admin.setting.bioLimit'),
setting: 'fof-user-bio.maxLength',
type: 'number',
placeholder: 200
});
});
2 changes: 1 addition & 1 deletion js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ app.initializers.add('fof-user-bio', () => {
return;
}

items.add('bio', <UserBio user={user} />);
items.add('bio', <UserBio user={user} />, -100);
});
});
8 changes: 2 additions & 6 deletions migrations/2021_01_17_000000_set_default_bio_length.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@

return [
'up' => function (Builder $schema) {
/**
* @var \Flarum\Settings\SettingsRepositoryInterface
*/
$settings = resolve('flarum.settings');

$settings->set('fof-user-bio.maxLength', 200);
// nothing required here.
},
'down' => function (Builder $schema) {
// remove the settings, if any were saved.
/**
* @var \Flarum\Settings\SettingsRepositoryInterface
*/
Expand Down

0 comments on commit ee44cb6

Please sign in to comment.