Skip to content

Commit

Permalink
Update for Flarum 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkwinkelmann committed Jun 17, 2021
1 parent 1d94389 commit b4cfe46
Show file tree
Hide file tree
Showing 18 changed files with 1,209 additions and 905 deletions.
8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "flarum-extension",
"license": "MIT",
"require": {
"flarum/core": ">=0.1.0-beta.16 <0.1.0-beta.17",
"flarum/core": "^1.0",
"flarum/tags": "*",
"fof/follow-tags": "*",
"ext-json": "*"
Expand All @@ -32,7 +32,7 @@
"extra": {
"flarum-extension": {
"title": "Follow Tags Prompt",
"category": "discussion",
"category": "feature",
"icon": {
"name": "fas fa-user-tag",
"backgroundColor": "#684ba6",
Expand All @@ -45,7 +45,5 @@
},
"config": {
"sort-packages": true
},
"minimum-stability": "beta",
"prefer-stable": true
}
}
12 changes: 7 additions & 5 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace ClarkWinkelmann\FollowTagsPrompt;

use Carbon\Carbon;
use Flarum\Api\Controller\ShowForumController;
use Flarum\Api\Serializer\ForumSerializer;
use Flarum\Extend;
use Flarum\Settings\SettingsRepositoryInterface;
use Flarum\Tags\Api\Serializer\TagSerializer;
use Flarum\Tags\Tag;
use Flarum\User\Event\Saving;
use Flarum\User\Exception\PermissionDeniedException;

Expand Down Expand Up @@ -37,10 +37,12 @@
];
}),

(new Extend\ApiSerializer(TagSerializer::class))
->attribute('clarkwinkelmannFollowTagsPromptAvailable', function (TagSerializer $serializer, Tag $tag) {
return AvailableTagsStrategy::isAvailable($tag);
}),
(new Extend\ApiSerializer(ForumSerializer::class))
->hasMany('clarkwinkelmannFollowTagsList', TagSerializer::class),

(new Extend\ApiController(ShowForumController::class))
->addInclude(['clarkwinkelmannFollowTagsList'])
->prepareDataForSerialization(LoadPromptTags::class),

(new Extend\Event())
->listen(Saving::class, function (Saving $event) {
Expand Down
2 changes: 1 addition & 1 deletion js/dist/admin.js

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

Loading

0 comments on commit b4cfe46

Please sign in to comment.