diff --git a/kudos-services/src/main/resources/locale/notification/KudosNotification_en.properties b/kudos-services/src/main/resources/locale/notification/KudosNotification_en.properties index b386c8d88..c3f283b2f 100644 --- a/kudos-services/src/main/resources/locale/notification/KudosNotification_en.properties +++ b/kudos-services/src/main/resources/locale/notification/KudosNotification_en.properties @@ -10,3 +10,4 @@ Notification.kudos.received=You have received a kudos from {0} Notification.kudos.spaceReceived=Space {0} has received a kudos from {1} Notification.label.SayHello=Hi Notification.label.ViewFullDiscussion=View the full discussion +Notification.plugin.NewUserKudosButtonTitle=Say welcome diff --git a/kudos-webapps/package-lock.json b/kudos-webapps/package-lock.json index 0082f01a8..f532e71a4 100644 --- a/kudos-webapps/package-lock.json +++ b/kudos-webapps/package-lock.json @@ -5879,9 +5879,7 @@ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "dev": true, - "requires": { - "ajv": "^8.0.0" - } + "requires": {} }, "ajv-keywords": { "version": "5.1.0", diff --git a/kudos-webapps/src/main/webapp/WEB-INF/gatein-resources.xml b/kudos-webapps/src/main/webapp/WEB-INF/gatein-resources.xml index d042c8ae1..e93198325 100644 --- a/kudos-webapps/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/kudos-webapps/src/main/webapp/WEB-INF/gatein-resources.xml @@ -144,4 +144,24 @@ + + kudosNotificationExtension + notificationGRP + + + vue + + + vuetify + + + eXoVueI18n + + + extensionRegistry + + + diff --git a/kudos-webapps/src/main/webapp/vue-app/notification-extension/components/NewUserKudosButton.vue b/kudos-webapps/src/main/webapp/vue-app/notification-extension/components/NewUserKudosButton.vue new file mode 100644 index 000000000..75e4982f0 --- /dev/null +++ b/kudos-webapps/src/main/webapp/vue-app/notification-extension/components/NewUserKudosButton.vue @@ -0,0 +1,31 @@ + + \ No newline at end of file diff --git a/kudos-webapps/src/main/webapp/vue-app/notification-extension/extensions.js b/kudos-webapps/src/main/webapp/vue-app/notification-extension/extensions.js new file mode 100644 index 000000000..4bb323bd9 --- /dev/null +++ b/kudos-webapps/src/main/webapp/vue-app/notification-extension/extensions.js @@ -0,0 +1,24 @@ +/* + * This file is part of the Meeds project (https://meeds.io/). + * + * Copyright (C) 2020 - 2023 Meeds Association contact@meeds.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +extensionRegistry.registerComponent('WebNotification', 'NewUserPlugin-actions', { + type: 'NewUserKudosButton', + rank: 10, + vueComponent: Vue.options.components['user-notification-new-user-kudos'], +}); diff --git a/kudos-webapps/src/main/webapp/vue-app/notification-extension/initComponents.js b/kudos-webapps/src/main/webapp/vue-app/notification-extension/initComponents.js new file mode 100644 index 000000000..5bcffef99 --- /dev/null +++ b/kudos-webapps/src/main/webapp/vue-app/notification-extension/initComponents.js @@ -0,0 +1,28 @@ +/* + * This file is part of the Meeds project (https://meeds.io/). + * + * Copyright (C) 2020 - 2023 Meeds Association contact@meeds.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import NewUserKudosButton from './components/NewUserKudosButton.vue'; + +const components = { + 'user-notification-new-user-kudos': NewUserKudosButton, +}; + +for (const key in components) { + Vue.component(key, components[key]); +} diff --git a/kudos-webapps/src/main/webapp/vue-app/notification-extension/main.js b/kudos-webapps/src/main/webapp/vue-app/notification-extension/main.js new file mode 100644 index 000000000..840f14549 --- /dev/null +++ b/kudos-webapps/src/main/webapp/vue-app/notification-extension/main.js @@ -0,0 +1,33 @@ +/* + * This file is part of the Meeds project (https://meeds.io/). + * + * Copyright (C) 2020 - 2023 Meeds Association contact@meeds.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import './initComponents.js'; +import './extensions.js'; + +const lang = eXo.env.portal.language; +const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.notification.KudosNotification-${lang}.json`; + +export function init() { + return exoi18n.loadLanguageAsync(lang, url) + .then(() => { + new Vue({ + i18n: exoi18n.i18n, + }); + }); +} diff --git a/kudos-webapps/webpack.common.js b/kudos-webapps/webpack.common.js index 82711d5d4..b5d29b775 100644 --- a/kudos-webapps/webpack.common.js +++ b/kudos-webapps/webpack.common.js @@ -8,7 +8,8 @@ const config = { kudos: './src/main/webapp/vue-app/kudos/main.js', kudosAdmin: './src/main/webapp/vue-app/kudos-admin/main.js', kudosOverview: './src/main/webapp/vue-app/kudos-overview/main.js', - engagementCenterExtensions: './src/main/webapp/vue-app/engagementCenterExtensions/extensions.js' + engagementCenterExtensions: './src/main/webapp/vue-app/engagementCenterExtensions/extensions.js', + notificationExtension: './src/main/webapp/vue-app/notification-extension/main.js', }, module: { rules: [