From ae7e8fa3a63e99802bd9f2c0c7a2693f2e76e141 Mon Sep 17 00:00:00 2001 From: Azmi TOUIL <42934070+AzmiTouil@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:21:01 +0100 Subject: [PATCH] feat: Add remind where or what to do the action for wallet events - MEED-3334 - Meeds-io/MIPs#105 (#496) This PR will add information in the action detail drawer so it can be useful to remind where or what to do the action --- .../locale/addon/Gamification_en.properties | 2 + .../main/webapp/WEB-INF/gatein-resources.xml | 23 ++++++++ .../components/WalletEvent.vue | 54 +++++++++++++++++++ .../connectorEventExtensions/extensions.js | 30 +++++++++++ .../initComponents.js | 26 +++++++++ wallet-webapps/webpack.prod.js | 1 + 6 files changed, 136 insertions(+) create mode 100644 wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/components/WalletEvent.vue create mode 100644 wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/extensions.js create mode 100644 wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/initComponents.js diff --git a/wallet-services/src/main/resources/locale/addon/Gamification_en.properties b/wallet-services/src/main/resources/locale/addon/Gamification_en.properties index 4833ada90..635e3558a 100644 --- a/wallet-services/src/main/resources/locale/addon/Gamification_en.properties +++ b/wallet-services/src/main/resources/locale/addon/Gamification_en.properties @@ -1,2 +1,4 @@ gamification.event.title.createWallet=Wallet: Initialize the wallet gamification.event.description.createWallet=You Initialize your wallet + +gamification.event.display.yourWallet=Your Wallet diff --git a/wallet-webapps/src/main/webapp/WEB-INF/gatein-resources.xml b/wallet-webapps/src/main/webapp/WEB-INF/gatein-resources.xml index 3a7b33bc6..b680f68b0 100644 --- a/wallet-webapps/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/wallet-webapps/src/main/webapp/WEB-INF/gatein-resources.xml @@ -509,6 +509,29 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + engagementCenterConnectorEventsWalletExtensions + engagement-center-connector-event-extensions + + + vue + + + vuetify + + + eXoVueI18n + + + extensionRegistry + + + commonVueComponents + + + walletNotificationExtension notificationGRP diff --git a/wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/components/WalletEvent.vue b/wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/components/WalletEvent.vue new file mode 100644 index 000000000..3183c78d7 --- /dev/null +++ b/wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/components/WalletEvent.vue @@ -0,0 +1,54 @@ + + + \ No newline at end of file diff --git a/wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/extensions.js b/wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/extensions.js new file mode 100644 index 000000000..91c21a7e3 --- /dev/null +++ b/wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/extensions.js @@ -0,0 +1,30 @@ +/* + * This file is part of the Meeds project (https://meeds.io/). + * + * Copyright (C) 2020 - 2024 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 '../connectorEventExtensions/initComponents'; + +export function init() { + extensionRegistry.registerComponent('engagementCenterEvent', 'connector-event-extensions', { + id: 'wallet-event', + name: 'wallet', + vueComponent: Vue.options.components['wallet-event'], + isEnabled: (params) => [ + 'createWallet' + ].includes(params?.trigger), + }); +} \ No newline at end of file diff --git a/wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/initComponents.js b/wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/initComponents.js new file mode 100644 index 000000000..3a4fe8486 --- /dev/null +++ b/wallet-webapps/src/main/webapp/vue-app/connectorEventExtensions/initComponents.js @@ -0,0 +1,26 @@ +/* + * This file is part of the Meeds project (https://meeds.io/). + * Copyright (C) 2020 - 2024 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 WalletEvent from './components/WalletEvent.vue'; + +const components = { + 'wallet-event': WalletEvent, +}; + +for (const key in components) { + Vue.component(key, components[key]); +} \ No newline at end of file diff --git a/wallet-webapps/webpack.prod.js b/wallet-webapps/webpack.prod.js index 5850acb37..cf2b934ae 100644 --- a/wallet-webapps/webpack.prod.js +++ b/wallet-webapps/webpack.prod.js @@ -31,6 +31,7 @@ const config = merge(webpackCommonConfig, { walletOverview: './src/main/webapp/vue-app/wallet-common/wallet-overview/main.js', rewardApp: './src/main/webapp/vue-app/wallet-reward/main.js', engagementCenterExtensions: './src/main/webapp/vue-app/engagementCenterExtensions/extensions.js', + connectorEventExtensions: './src/main/webapp/vue-app/connectorEventExtensions/extensions.js', notificationExtension: './src/main/webapp/vue-app/notification-extension/main.js', }, output: {