Skip to content

refactor(core): improve improve extensibility of PostStreamScrubber #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
24e88d1
chore: dummy commit to trigger style CI on 1.x
imorland Sep 26, 2024
e43530e
Apply fixes from StyleCI
StyleCIBot Sep 26, 2024
80e70f4
fix: reset admin page save button in catch (#3963)
YUCLing Sep 26, 2024
07a1781
Bundled output for commit 80e70f4980d2447dd47bc9d565e4b659eb9ae9b4
flarum-bot Sep 26, 2024
e0adf90
Export all missing modules in compat (#4006)
DavideIadeluca Sep 27, 2024
4d59ec4
Bundled output for commit e0adf90453cca66fdafcddcbbcfcaf9d5bdea17f
flarum-bot Sep 27, 2024
46cdaf5
chore: bump version to 1.8.6
imorland Sep 28, 2024
c79d289
feat: [1.x] [extensibility] feat: allow to be extended (#4025)
imorland Sep 28, 2024
77d1a3d
Bundled output for commit c79d2892de1eeaf86dc648e73160c825ec2bd530
flarum-bot Sep 28, 2024
7540ede
feat: allow modifying the discussion title on PostsUserPage (#4031)
imorland Sep 28, 2024
d5882d9
Bundled output for commit 7540ede8974b6b26e46f2f74b3a94da1eb873d14
flarum-bot Sep 28, 2024
c942f31
Revert "Export all missing modules in compat (#4006)" (#4032)
imorland Sep 28, 2024
bf0d895
chore: fix Flarum logo url, remove huntr link
imorland Sep 28, 2024
84414c6
Bundled output for commit bf0d895106fd20fd79024711cf6efa8b82272e61
flarum-bot Sep 28, 2024
7f657da
feat: make it easier to modify AppearancePage, BasicsPage, MailPage (…
imorland Sep 29, 2024
5855134
Bundled output for commit 7f657dac048aa860457ca6bcc85dc17522a84256
flarum-bot Sep 29, 2024
3743bc0
chore: point fontawesome links at v5 free (#4038)
imorland Sep 29, 2024
f8c30c9
Bundled output for commit 3743bc0886d2ed74ec422b031eab97d43400758d
flarum-bot Sep 29, 2024
9038ff6
[suspend][core] [1.x] fix: suspended users can remove avatar (#3998)
imorland Sep 29, 2024
3ebd218
chore: make WelcomeHero extensible (#4039)
imorland Sep 29, 2024
444df80
Bundled output for commit 3ebd21858836cbee8ba125d366efa5e8de508c48
flarum-bot Sep 29, 2024
6dd0c0e
[1.x] [extensibility] chore: make PostMeta extensible (#4040)
imorland Sep 29, 2024
e9c8890
Bundled output for commit 6dd0c0e915609437b03dd09b6b45383eb5381ddd
flarum-bot Sep 29, 2024
54fbcde
chore: extensible TagHero (#4041)
imorland Sep 29, 2024
de36551
Bundled output for commit 54fbcdedd5375d7680b8330097a4b134cb77f198
flarum-bot Sep 29, 2024
df14216
chore: allow extending PostPreview content (#4043)
imorland Sep 29, 2024
c9bd7da
Bundled output for commit df14216e1b72810a023b96dc743f1bc29f42886c
flarum-bot Sep 29, 2024
2c4d64c
[1.x] [extensibility] feat: allow classes that extends `AbstractJob` …
imorland Sep 29, 2024
5076da9
feat: use common component for ip address display (#4042)
imorland Sep 29, 2024
9bc8c7d
Bundled output for commit 5076da9b3833b0787f7beabd715720e5a7e98185
flarum-bot Sep 29, 2024
e3d07cb
feat: make it easier to add content after the first post (#4050)
imorland Sep 30, 2024
306d0bc
Bundled output for commit e3d07cb8cc55623d99f157db08ee02bb2f121c23
flarum-bot Sep 30, 2024
dce2549
[1.x] [extensibility] refactor(core): improve extensibility of `Index…
DavideIadeluca Sep 30, 2024
ca6d826
Bundled output for commit dce2549ff771fcee0fa39a1c56e8a1143d0deec4
flarum-bot Sep 30, 2024
4912a2e
[1.x] [extensibility] refactor(core): improve extensibility of `Discu…
DavideIadeluca Sep 30, 2024
845c38d
Bundled output for commit 4912a2e059a0b7e803f00c4a7f12a004252f2cb0
flarum-bot Sep 30, 2024
7d8cfdf
refactor(core): backport & improve extensibility of `DiscussionListIt…
DavideIadeluca Sep 30, 2024
b49b310
Bundled output for commit 7d8cfdfaec09e7e1e8af972e57b8fa1050ffee5c
flarum-bot Sep 30, 2024
1fee96a
fix(core): revert extensibility improvements for `replyCountItem()` (…
DavideIadeluca Sep 30, 2024
256c184
Bundled output for commit 1fee96aebefda91769144ffc17c1d164d29ec289
flarum-bot Sep 30, 2024
d4fe5f5
[1.x] [extensibility] refactor(core, flags): improve & use extensibil…
DavideIadeluca Oct 2, 2024
4d75da3
Bundled output for commit d4fe5f5a7acdd5fbe0e1c80c77dae9b7069eb11a
flarum-bot Oct 2, 2024
449ba48
[1.x] [extensibility] Export all missing modules in compat (#4044)
DavideIadeluca Oct 2, 2024
71717f9
Bundled output for commit 449ba48ba3d78b22a3122361e38a9d03b64b080e
flarum-bot Oct 2, 2024
4707e4e
refactor(core): allow labels to be customized
DavideIadeluca Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<p align="center">
<a href="https://flarum.org/"><img src="https://flarum.org/assets/img/logo.png"></a>
<a href="https://flarum.org/"><img src="https://flarum.org/images/flarum.svg"></a>
</p>

<p align="center">
<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>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/packagist/dt/flarum/core" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/github/v/release/flarum/core?sort=semver" alt="Latest Version"></a>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/packagist/l/flarum/core" alt="License"></a>
<a href="https://huntr.dev/bounties/disclose/?target=https://github.com/flarum/core"><img src="https://cdn.huntr.dev/huntr_security_badge_mono.svg" alt="huntr"></a>
<a href="https://github.styleci.io/repos/28257573"><img src="https://github.styleci.io/repos/28257573/shield?style=flat" alt="StyleCI"></a>
</p>

Expand Down Expand Up @@ -38,3 +37,4 @@ If you discover a security vulnerability within Flarum, please send an e-mail to
## License

Flarum is open-source software licensed under the [MIT License](https://github.com/flarum/flarum/blob/master/LICENSE).

1 change: 1 addition & 0 deletions extensions/akismet/js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"declarationDir": "./dist-typings",
"paths": {
"flarum/*": ["../../../framework/core/js/dist-typings/*"],
"@flarum/core/*": ["../../../framework/core/js/dist-typings/*"],
"flarum/flags/*": ["../../flags/js/dist-typings/*"]
}
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/akismet/src/Akismet.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function sendRequest(string $type): ResponseInterface
$client = new Client();

return $client->request('POST', "$this->apiUrl/$type", [
'headers' => [
'headers' => [
'User-Agent' => "Flarum/$this->flarumVersion | Akismet/$this->extensionVersion",
],
'form_params' => $this->params,
Expand Down
2 changes: 1 addition & 1 deletion extensions/emoji/js/dist/forum.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions extensions/emoji/js/src/forum/compat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import AutocompleteDropdown from './fragments/AutocompleteDropdown';
import getEmojiIconCode from './helpers/getEmojiIconCode';

export default {
'emoji/fragments/AutocompleteDropdown': AutocompleteDropdown,
'emoji/helpers/getEmojiIconCode': getEmojiIconCode,
};
6 changes: 6 additions & 0 deletions extensions/emoji/js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ app.initializers.add('flarum-emoji', () => {
// render emoji as image in Posts content and title.
renderEmoji();
});

// Expose compat API
import emojiCompat from './compat';
import { compat } from '@flarum/core/forum';

Object.assign(compat, emojiCompat);
2 changes: 2 additions & 0 deletions extensions/flags/js/dist-typings/forum/compat.d.ts

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

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions extensions/flags/js/src/forum/addFlagsToPosts.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,25 @@ export default function () {
return items;
};

extend(Post.prototype, 'content', function (vdom) {
extend(Post.prototype, 'viewItems', function (items) {
const post = this.attrs.post;
const flags = post.flags();

if (!flags.length) return;

if (post.isHidden()) this.revealContent = true;

vdom.unshift(
items.add(
'flagged',
<div className="Post-flagged">
<div className="Post-flagged-flags">
{flags.map((flag) => (
<div className="Post-flagged-flag">{this.flagReason(flag)}</div>
))}
</div>
<div className="Post-flagged-actions">{this.flagActionItems().toArray()}</div>
</div>
</div>,
110
);
});

Expand Down
2 changes: 2 additions & 0 deletions extensions/flags/js/src/forum/compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import FlagList from './components/FlagList';
import FlagPostModal from './components/FlagPostModal';
import FlagsPage from './components/FlagsPage';
import FlagsDropdown from './components/FlagsDropdown';
import FlagListState from './states/FlagListState';

export default {
'flags/addFlagsToPosts': addFlagsToPosts,
Expand All @@ -16,4 +17,5 @@ export default {
'flags/components/FlagPostModal': FlagPostModal,
'flags/components/FlagsPage': FlagsPage,
'flags/components/FlagsDropdown': FlagsDropdown,
'flags/states/FlagListState': FlagListState,
};
1 change: 1 addition & 0 deletions extensions/flags/src/AddCanFlagAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ protected function checkFlagOwnPostSetting(User $actor, Post $post): bool
// If $actor is the post author, check to see if the setting is enabled
return (bool) $this->settings->get('flarum-flags.can_flag_own');
}

// $actor is not the post author
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions extensions/flags/src/Api/Serializer/FlagSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ protected function getDefaultAttributes($flag)
}

return [
'type' => $flag->type,
'reason' => $flag->reason,
'type' => $flag->type,
'reason' => $flag->reason,
'reasonDetail' => $flag->reason_detail,
'createdAt' => $this->formatDate($flag->created_at),
'createdAt' => $this->formatDate($flag->created_at),
];
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/likes/js/dist/forum.js

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

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

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions extensions/likes/js/src/forum/compat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import LikesUserPage from './components/LikesUserPage';
import PostLikedNotification from './components/PostLikedNotification';
import PostLikesModal from './components/PostLikesModal';
import PostLikesModalState from './states/PostLikesModalState';

export default {
'likes/components/LikesUserPage': LikesUserPage,
'likes/components/PostLikedNotification': PostLikedNotification,
'likes/components/PostLikesModal': PostLikesModal,
'likes/states/PostLikesModalState': PostLikesModalState,
};
6 changes: 6 additions & 0 deletions extensions/likes/js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ app.initializers.add('flarum-likes', () => {
});
});
});

// Expose compat API
import likesCompat from './compat';
import { compat } from '@flarum/core/forum';

Object.assign(compat, likesCompat);
Loading
Loading