forum button schritt 1

This commit is contained in:
JM 2026-05-06 09:56:58 +02:00
parent b9fe9bcb42
commit 398441ad34
3 changed files with 24 additions and 12 deletions

View File

@ -4,36 +4,45 @@ import NotificationGrid from 'flarum/forum/components/NotificationGrid';
export default function addTeamsSettings() { export default function addTeamsSettings() {
extend(NotificationGrid.prototype, 'notificationTypes', function (items) { extend(NotificationGrid.prototype, 'notificationTypes', function (items) {
// Header
items.add('teams-header', { items.add('teams-header', {
name: 'teams-header', name: 'teams-header',
label: app.translator.trans('sbp-jm-msteams.forum.teams.header'), label: app.translator.trans(
children: [], 'sbp-jm-msteams.forum.teams.header'
),
}); });
// Reply
items.add('teams-newPost', { items.add('teams-newPost', {
name: 'teams-newPost', name: 'teams-newPost',
label: app.translator.trans('sbp-jm-msteams.forum.teams.newPost'), label: app.translator.trans(
'sbp-jm-msteams.forum.teams.newPost'
),
settings: { settings: {
teams: 'sbp-jm-msteams.types.newPost', teams: 'sbp-jm-msteams.types.newPost',
}, },
}); });
// Post mention
items.add('teams-postMentioned', { items.add('teams-postMentioned', {
name: 'teams-postMentioned', name: 'teams-postMentioned',
label: app.translator.trans('sbp-jm-msteams.forum.teams.postMentioned'), label: app.translator.trans(
'sbp-jm-msteams.forum.teams.postMentioned'
),
settings: { settings: {
teams: 'sbp-jm-msteams.types.postMentioned', teams: 'sbp-jm-msteams.types.postMentioned',
}, },
}); });
// User mention
items.add('teams-userMentioned', { items.add('teams-userMentioned', {
name: 'teams-userMentioned', name: 'teams-userMentioned',
label: app.translator.trans('sbp-jm-msteams.forum.teams.userMentioned'), label: app.translator.trans(
'sbp-jm-msteams.forum.teams.userMentioned'
),
settings: { settings: {
teams: 'sbp-jm-msteams.types.userMentioned', teams: 'sbp-jm-msteams.types.userMentioned',
}, },
}); });
}); });
} }

View File

@ -1,5 +1,6 @@
import app from 'flarum/forum/app'; import app from 'flarum/forum/app';
import addTeamsSettings from './addTeamsSettings';
app.initializers.add('sbp-jm-msteams-webhook-forum-test', () => { app.initializers.add('sbp-jm-msteams-webhook-forum', () => {
console.log('[sbp-jm-msteams-webhook] forum bundle loaded'); addTeamsSettings();
}); });

View File

@ -6,6 +6,8 @@ notification:
drivers: drivers:
teams: Microsoft Teams teams: Microsoft Teams
sbp-jm-msteams: sbp-jm-msteams:
forum: forum:
teams: teams: