diff --git a/js/src/forum/addTeamsSettings.js b/js/src/forum/addTeamsSettings.js index 945d7db..0775b5f 100644 --- a/js/src/forum/addTeamsSettings.js +++ b/js/src/forum/addTeamsSettings.js @@ -4,36 +4,45 @@ import NotificationGrid from 'flarum/forum/components/NotificationGrid'; export default function addTeamsSettings() { extend(NotificationGrid.prototype, 'notificationTypes', function (items) { - + // Header items.add('teams-header', { name: 'teams-header', - label: app.translator.trans('sbp-jm-msteams.forum.teams.header'), - children: [], + label: app.translator.trans( + 'sbp-jm-msteams.forum.teams.header' + ), }); + // Reply items.add('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: { teams: 'sbp-jm-msteams.types.newPost', }, }); + // Post mention items.add('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: { teams: 'sbp-jm-msteams.types.postMentioned', }, }); + // User mention items.add('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: { teams: 'sbp-jm-msteams.types.userMentioned', }, }); - }); -} \ No newline at end of file +} diff --git a/js/src/forum/index.js b/js/src/forum/index.js index 908a00b..2dc6dfc 100644 --- a/js/src/forum/index.js +++ b/js/src/forum/index.js @@ -1,5 +1,6 @@ import app from 'flarum/forum/app'; +import addTeamsSettings from './addTeamsSettings'; -app.initializers.add('sbp-jm-msteams-webhook-forum-test', () => { - console.log('[sbp-jm-msteams-webhook] forum bundle loaded'); -}); +app.initializers.add('sbp-jm-msteams-webhook-forum', () => { + addTeamsSettings(); +}); \ No newline at end of file diff --git a/locale/en.yml b/locale/en.yml index 0bceccb..e6c6262 100644 --- a/locale/en.yml +++ b/locale/en.yml @@ -6,10 +6,12 @@ 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 \ No newline at end of file + userMentioned: Someone mentions me