alles aber noch ohne npm!
This commit is contained in:
parent
523449ad04
commit
6a93e77a17
13
extend.php
13
extend.php
|
|
@ -5,22 +5,23 @@ declare(strict_types=1);
|
|||
use Flarum\Extend;
|
||||
use SbpJm\FlarumMSTeamsWebhook\Console\TestTeamsUserCommand;
|
||||
use SbpJm\FlarumMSTeamsWebhook\Listener\MirrorAlertsToTeams;
|
||||
use SbpJm\FlarumMSTeamsWebhook\Notification\TeamsDriver;
|
||||
|
||||
return [
|
||||
(new Extend\Locales(__DIR__ . '/locale')),
|
||||
|
||||
// Admin UI (Settings etc.)
|
||||
(new Extend\Frontend('admin'))
|
||||
->js(__DIR__ . '/js/dist/admin.js'),
|
||||
|
||||
// Forum UI (User notification settings – Teams checkbox)
|
||||
(new Extend\Frontend('forum'))
|
||||
->js(__DIR__ . '/js/dist/forum.js'),
|
||||
|
||||
// CLI test command
|
||||
(new Extend\Console())
|
||||
->command(TestTeamsUserCommand::class),
|
||||
|
||||
// ✅ EXISTING hook (unchanged)
|
||||
// ✅ EINZIGER Notification-Hook (richtig für Flarum 1.8.x)
|
||||
(new Extend\Notification())
|
||||
->beforeSending(MirrorAlertsToTeams::class),
|
||||
|
||||
// ✅ NEW: Microsoft Teams notification driver
|
||||
(new Extend\Notification())
|
||||
->driver('teams', TeamsDriver::class),
|
||||
];
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
import app from 'flarum/forum/app';
|
||||
import { extend } from 'flarum/common/extend';
|
||||
import NotificationGrid from 'flarum/forum/components/NotificationGrid';
|
||||
|
||||
export default function addTeamsSettings() {
|
||||
extend(NotificationGrid.prototype, 'notificationTypes', function (items) {
|
||||
|
||||
items.add('teams-header', {
|
||||
name: 'teams-header',
|
||||
label: app.translator.trans('sbp-jm-msteams.forum.teams.header'),
|
||||
children: [],
|
||||
});
|
||||
|
||||
items.add('teams-newPost', {
|
||||
name: 'teams-newPost',
|
||||
label: app.translator.trans('sbp-jm-msteams.forum.teams.newPost'),
|
||||
settings: {
|
||||
teams: 'sbp-jm-msteams.types.newPost',
|
||||
},
|
||||
});
|
||||
|
||||
items.add('teams-postMentioned', {
|
||||
name: 'teams-postMentioned',
|
||||
label: app.translator.trans('sbp-jm-msteams.forum.teams.postMentioned'),
|
||||
settings: {
|
||||
teams: 'sbp-jm-msteams.types.postMentioned',
|
||||
},
|
||||
});
|
||||
|
||||
items.add('teams-userMentioned', {
|
||||
name: 'teams-userMentioned',
|
||||
label: app.translator.trans('sbp-jm-msteams.forum.teams.userMentioned'),
|
||||
settings: {
|
||||
teams: 'sbp-jm-msteams.types.userMentioned',
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import addTeamsSettings from './addTeamsSettings';
|
||||
|
||||
export default function () {
|
||||
addTeamsSettings();
|
||||
}
|
||||
|
|
@ -5,3 +5,11 @@ sbp-jm-msteams-webhook:
|
|||
notification:
|
||||
drivers:
|
||||
teams: Microsoft Teams
|
||||
|
||||
sbp-jm-msteams:
|
||||
forum:
|
||||
teams:
|
||||
header: Microsoft Teams
|
||||
newPost: Someone replies to a discussion I am following
|
||||
postMentioned: Someone mentions me in a post
|
||||
userMentioned: Someone mentions me
|
||||
Loading…
Reference in New Issue