From fad6c061688697527a570b34775721341942c720 Mon Sep 17 00:00:00 2001 From: Azmi TOUIL <42934070+AzmiTouil@users.noreply.github.com> Date: Thu, 7 Dec 2023 17:08:37 +0100 Subject: [PATCH] fix: Implement new common connector extension - MEED-2962 - MEED-3080 - Meeds-io/meeds#1442 - Meeds-io/MIPs#105 --- .../main/webapp/WEB-INF/gatein-resources.xml | 20 +++++++++++ .../vue-app/connectorExtensions/extensions.js | 34 +++++++++++++++++++ .../extension.js | 10 ------ gamification-github-webapp/webpack.prod.js | 1 + 4 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 gamification-github-webapp/src/main/webapp/vue-app/connectorExtensions/extensions.js diff --git a/gamification-github-webapp/src/main/webapp/WEB-INF/gatein-resources.xml b/gamification-github-webapp/src/main/webapp/WEB-INF/gatein-resources.xml index 694ba766..98619eea 100644 --- a/gamification-github-webapp/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/gamification-github-webapp/src/main/webapp/WEB-INF/gatein-resources.xml @@ -89,5 +89,25 @@ + + engagementCenterConnectorsGitHubExtensions + engagement-center-connector-extensions + + + vue + + + vuetify + + + eXoVueI18n + + + extensionRegistry + + + diff --git a/gamification-github-webapp/src/main/webapp/vue-app/connectorExtensions/extensions.js b/gamification-github-webapp/src/main/webapp/vue-app/connectorExtensions/extensions.js new file mode 100644 index 00000000..728e422f --- /dev/null +++ b/gamification-github-webapp/src/main/webapp/vue-app/connectorExtensions/extensions.js @@ -0,0 +1,34 @@ +/* + * 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. + * + */ +export function init() { + extensionRegistry.registerExtension('engagementCenterConnectors', 'connector-extensions', { + id: 'github', + name: 'github', + icon: 'fab fa-github', + iconColorClass: 'text-color', + title: 'Github', + description: 'githubConnector.admin.label.description', + rank: 20, + init: () => { + const lang = window.eXo?.env?.portal?.language || 'en'; + const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.portlet.GitHubWebHookManagement-${lang}.json`; + return exoi18n.loadLanguageAsync(lang, url); + } + }); +} \ No newline at end of file diff --git a/gamification-github-webapp/src/main/webapp/vue-app/githubAdminConnectorExtension/extension.js b/gamification-github-webapp/src/main/webapp/vue-app/githubAdminConnectorExtension/extension.js index 467bf4d2..cbb7cc00 100644 --- a/gamification-github-webapp/src/main/webapp/vue-app/githubAdminConnectorExtension/extension.js +++ b/gamification-github-webapp/src/main/webapp/vue-app/githubAdminConnectorExtension/extension.js @@ -21,16 +21,6 @@ export function init() { extensionRegistry.registerComponent('gamification-admin-connector', 'admin-connector-item', { id: 'githubSetting', name: 'github', - icon: 'fab fa-github', - iconColorClass: 'text-color', - title: 'Github', - description: 'githubConnector.admin.label.description', - rank: 20, - init: () => { - const lang = window.eXo?.env?.portal?.language || 'en'; - const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.portlet.GitHubWebHookManagement-${lang}.json`; - return exoi18n.loadLanguageAsync(lang, url); - }, vueComponent: Vue.options.components['github-admin-connector-item'], }); } \ No newline at end of file diff --git a/gamification-github-webapp/webpack.prod.js b/gamification-github-webapp/webpack.prod.js index c2a04f09..024ba76c 100644 --- a/gamification-github-webapp/webpack.prod.js +++ b/gamification-github-webapp/webpack.prod.js @@ -23,6 +23,7 @@ const config = { }, entry: { engagementCenterExtensions: './src/main/webapp/vue-app/engagementCenterExtensions/extensions.js', + connectorExtensions: './src/main/webapp/vue-app/connectorExtensions/extensions.js', githubUserConnectorExtension: './src/main/webapp/vue-app/githubUserConnectorExtension/extension.js', githubAdminConnectorExtension: './src/main/webapp/vue-app/githubAdminConnectorExtension/extension.js' },