From faae69d793359de32e8bf5c0abb84c6275615f58 Mon Sep 17 00:00:00 2001 From: IlhemEssaadi <93516534+IlhemEssaadi@users.noreply.github.com> Date: Thu, 12 Oct 2023 16:50:44 +0100 Subject: [PATCH] feat: Configure automatic-translation navigation and pages for administration site - EXO-66546 - Meeds-io/MIPs#88 (#43) --- translations.properties | 3 +- .../portal/administration_en.properties | 22 +++ .../portal-configuration.xml | 108 +++++++++----- .../portal/administration/navigation.xml | 43 ++++++ .../portal/portal/administration/pages.xml | 138 ++++++++++++++++++ 5 files changed, 276 insertions(+), 38 deletions(-) create mode 100644 webapps/src/main/resources/locale/navigation/portal/administration_en.properties create mode 100644 webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal/portal/administration/navigation.xml create mode 100644 webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal/portal/administration/pages.xml diff --git a/translations.properties b/translations.properties index 4f657fff..9091e57a 100644 --- a/translations.properties +++ b/translations.properties @@ -23,4 +23,5 @@ baseDir=add-ons/automatic-translation/ automaticTranslationNavigation.properties=webapps/src/main/resources/locale/navigation/group/platform/administrators_en.properties automaticTranslation.properties=webapps/src/main/resources/locale/portlet/automaticTranslation/automaticTranslationAdministration_en.properties automaticTranslationExtension.properties=webapps/src/main/resources/locale/portlet/automaticTranslation/automaticTranslationExtension_en.properties -Analytics.properties=webapps/src/main/resources/locale/portlet/Analytics_en.properties \ No newline at end of file +Analytics.properties=webapps/src/main/resources/locale/portlet/Analytics_en.properties +administration.properties=webapps/src/main/resources/locale/navigation/portal/administration_en.properties \ No newline at end of file diff --git a/webapps/src/main/resources/locale/navigation/portal/administration_en.properties b/webapps/src/main/resources/locale/navigation/portal/administration_en.properties new file mode 100644 index 00000000..0de13cca --- /dev/null +++ b/webapps/src/main/resources/locale/navigation/portal/administration_en.properties @@ -0,0 +1,22 @@ +# +# Copyright (C) 2023 eXo Platform SAS. +# +# This 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 software 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 software; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA, or see the FSF site: http://www.fsf.org. +# +portal.administration.home=Platform settings +portal.administration.applications=Applications +portal.administration.translation=Automatic translation + diff --git a/webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal-configuration.xml b/webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal-configuration.xml index 598dc7e7..8e250ecc 100644 --- a/webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal-configuration.xml +++ b/webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal-configuration.xml @@ -1,39 +1,73 @@ - - - org.exoplatform.portal.config.UserPortalConfigService - - new.portal.config.user.listener - initListener - org.exoplatform.portal.config.NewPortalConfigListener - This listener creates Automatic Translation Admin Pages - - - group.configuration - description - - - - - /platform/administrators - - - - - group - - - ${exo.automatic-translation.portalConfig.metadata.override:true} - - - ${exo.automatic-translation.portalConfig.metadata.importmode:merge} - - - war:/conf/automatic-translation/portal - - - - - - + + + org.exoplatform.portal.config.UserPortalConfigService + + new.portal.config.user.listener + initListener + org.exoplatform.portal.config.NewPortalConfigListener + This listener creates Automatic Translation Admin Pages + + + group.configuration + description + + + + + /platform/administrators + + + + + group + + + ${exo.automatic-translation.portalConfig.metadata.override:true} + + + ${exo.automatic-translation.portalConfig.metadata.importmode:merge} + + + war:/conf/automatic-translation/portal + + + + + + + new.portal.config.user.listener + initListener + org.exoplatform.portal.config.NewPortalConfigListener + this listener init the portal configuration + + + portal.configuration + + + + + administration + + + + + portal + + + war:/conf/automatic-translation/portal + + + ${exo.automatic-translation.portalConfig.administration.override:true} + + + ${exo.automatic-translation.portalConfig.administration.importmode:merge} + + + + + + diff --git a/webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal/portal/administration/navigation.xml b/webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal/portal/administration/navigation.xml new file mode 100644 index 00000000..5ba887b7 --- /dev/null +++ b/webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal/portal/administration/navigation.xml @@ -0,0 +1,43 @@ + + + + 3 + + + + home + + fas fa-cog + + applications + + fas fa-boxes + + translation + + fas fa-language + portal::administration::automatic-translation + + + + + diff --git a/webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal/portal/administration/pages.xml b/webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal/portal/administration/pages.xml new file mode 100644 index 00000000..743ba272 --- /dev/null +++ b/webapps/src/main/webapp/WEB-INF/conf/automatic-translation/portal/portal/administration/pages.xml @@ -0,0 +1,138 @@ + + + + + automatic-translation + Automatic Translation + *:/platform/administrators + manager:/platform/administrators + false + + + + automatic-translation + automaticTranslationAdministration + + Automatic Translation + *:/platform/administrators + false + + + + Everyone + + Everyone + + + analytics + AnalyticsPortlet + + + settings + { + "offset": 0, + "filters": [ + { + "valueString": "translate", + "field": "operation", + "type": "EQUAL", + "range": null + }, + { + "valueString": "automatic-translation", + "field": "module", + "type": "EQUAL", + "range": null + } + ], + "lang": null, + "aggregations": [ + { + "field": "timestamp", + "type": "DATE", + "offset": null, + "interval": "month", + "useBounds": false, + "minBound": 0, + "maxBound": 0, + "sortDirection": "asc", + "limit": 0 + }, + { + "field": "messageLength", + "type": "SUM", + "offset": null, + "interval": null, + "useBounds": false, + "minBound": 0, + "maxBound": 0, + "sortDirection": "desc", + "limit": 0 + } + ], + "yAxisAggregation": { + "field": "messageLength", + "type": "SUM", + "offset": null, + "interval": null, + "useBounds": false, + "minBound": 0, + "maxBound": 0, + "sortDirection": "desc", + "limit": 0 + }, + "multipleChartsAggregation": null, + "xAxisAggregations": [ + { + "field": "timestamp", + "type": "DATE", + "offset": null, + "interval": "month", + "useBounds": false, + "minBound": 0, + "maxBound": 0, + "sortDirection": "asc", + "limit": 0 + } + ], + "multipleCharts": false, + "chartType": "bar", + "colors": null, + "multipleChartsField": null, + "limit": 0, + "timeZone": null, + "title": "automatic.translation.analytics.title.charTranslated" + } + + + + + Characters Translated + Everyone + false + + + + + \ No newline at end of file