From a073073523b28d294ecf66d3218cc765a7110f6d Mon Sep 17 00:00:00 2001 From: WANGF Date: Fri, 23 Feb 2024 13:29:13 -0500 Subject: [PATCH 1/3] static page for record view menu --- .../java/org/fao/geonet/domain/page/Page.java | 2 +- .../components/pages/GnStaticPagesDirective.js | 18 +++++++++++++----- .../templates/recordView/recordView.html | 9 +++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/domain/src/main/java/org/fao/geonet/domain/page/Page.java b/domain/src/main/java/org/fao/geonet/domain/page/Page.java index fb3247a4308..c778952efd3 100644 --- a/domain/src/main/java/org/fao/geonet/domain/page/Page.java +++ b/domain/src/main/java/org/fao/geonet/domain/page/Page.java @@ -86,7 +86,7 @@ public enum PageFormat { // These are the sections where is shown the link to the Page object public enum PageSection { - TOP, FOOTER, MENU, SUBMENU, CUSTOM_MENU1, CUSTOM_MENU2, CUSTOM_MENU3; + TOP, FOOTER, MENU, SUBMENU, RECORD_VIEW_MENU, CUSTOM_MENU1, CUSTOM_MENU2, CUSTOM_MENU3; } public enum PageExtension { diff --git a/web-ui/src/main/resources/catalog/components/pages/GnStaticPagesDirective.js b/web-ui/src/main/resources/catalog/components/pages/GnStaticPagesDirective.js index 2fc26e928fc..d2793f722d2 100644 --- a/web-ui/src/main/resources/catalog/components/pages/GnStaticPagesDirective.js +++ b/web-ui/src/main/resources/catalog/components/pages/GnStaticPagesDirective.js @@ -87,11 +87,19 @@ link: function ($scope) { $scope.pagesMenu = []; - var configKey = $scope.section === "footer" ? "footer" : "header"; - $scope.pagesConfig = - gnGlobalSettings.gnCfg.mods[configKey][$scope.section + "CustomMenu"]; - - if ($scope.pagesConfig && $scope.pagesConfig.length === 0) { + if ($scope.section === "header" || $scope.section === "footer") { + $scope.pagesConfig = + gnGlobalSettings.gnCfg.mods[$scope.section][$scope.section + "CustomMenu"]; + if ($scope.pagesConfig && $scope.pagesConfig.length === 0) { + gnStaticPagesService + .loadPages($scope.language, $scope.section) + .then(function (response) { + $scope.pagesConfig = response.data.map(function (p) { + return p.pageId; + }); + }); + } + } else { gnStaticPagesService .loadPages($scope.language, $scope.section) .then(function (response) { diff --git a/web-ui/src/main/resources/catalog/views/default/templates/recordView/recordView.html b/web-ui/src/main/resources/catalog/views/default/templates/recordView/recordView.html index 0f84a95c23e..6c6c6bbdb17 100644 --- a/web-ui/src/main/resources/catalog/views/default/templates/recordView/recordView.html +++ b/web-ui/src/main/resources/catalog/views/default/templates/recordView/recordView.html @@ -81,6 +81,15 @@
+ +
+ +
Date: Mon, 26 Feb 2024 17:26:12 -0500 Subject: [PATCH 2/3] Additional link drop down contains static pages --- .../admin/uiconfig/partials/uiconfig.html | 2 +- .../components/search/mdview/mdviewModule.js | 10 ++++++++++ .../main/resources/catalog/js/CatController.js | 1 + .../resources/catalog/locales/en-admin.json | 2 ++ .../resources/catalog/locales/en-search.json | 3 ++- .../templates/recordView/recordView.html | 18 ++++++++++++++++-- 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/admin/uiconfig/partials/uiconfig.html b/web-ui/src/main/resources/catalog/components/admin/uiconfig/partials/uiconfig.html index 786d13aabfc..6123ef00643 100644 --- a/web-ui/src/main/resources/catalog/components/admin/uiconfig/partials/uiconfig.html +++ b/web-ui/src/main/resources/catalog/components/admin/uiconfig/partials/uiconfig.html @@ -802,7 +802,7 @@

{{('ui-mod-' + m) | translate}}

diff --git a/web-ui/src/main/resources/catalog/components/search/mdview/mdviewModule.js b/web-ui/src/main/resources/catalog/components/search/mdview/mdviewModule.js index f4ec405e092..14e711dc9f5 100644 --- a/web-ui/src/main/resources/catalog/components/search/mdview/mdviewModule.js +++ b/web-ui/src/main/resources/catalog/components/search/mdview/mdviewModule.js @@ -104,6 +104,16 @@ $scope.showStatusTopBarFor = gnGlobalSettings.gnCfg.mods.recordview.showStatusTopBarFor; + $scope.showStaticPageMenu = + gnGlobalSettings.gnCfg.mods.recordview.showStaticPageMenu; + + console.log("111 gnGlobalSettings.gnCfg.mods", gnGlobalSettings.gnCfg.mods); + console.log( + "111 gnGlobalSettings.gnCfg.mods.page.enabled", + gnGlobalSettings.gnCfg.mods.page.enabled + ); + console.log("111 $scope.showStaticPageMenu", $scope.showStaticPageMenu); + gnConfigService.load().then(function (c) { $scope.isRecordHistoryEnabled = gnConfig["system.metadata.history.enabled"]; $scope.isPreferGroupLogo = gnConfig["system.metadata.prefergrouplogo"]; diff --git a/web-ui/src/main/resources/catalog/js/CatController.js b/web-ui/src/main/resources/catalog/js/CatController.js index 53b904557eb..f5f561a18a8 100644 --- a/web-ui/src/main/resources/catalog/js/CatController.js +++ b/web-ui/src/main/resources/catalog/js/CatController.js @@ -859,6 +859,7 @@ isSocialbarEnabled: true, showStatusWatermarkFor: "", showStatusTopBarFor: "", + showStaticPageMenu: false, showCitation: { enabled: false, // if: {'documentStandard': ['iso19115-3.2018']} diff --git a/web-ui/src/main/resources/catalog/locales/en-admin.json b/web-ui/src/main/resources/catalog/locales/en-admin.json index f2c5fe118b7..4cea4c53b2c 100644 --- a/web-ui/src/main/resources/catalog/locales/en-admin.json +++ b/web-ui/src/main/resources/catalog/locales/en-admin.json @@ -1318,6 +1318,8 @@ "ui-isSocialbarEnabled-help": "Show the button bar with all the social buttons (facebook, twitter, etc.)", "ui-showStatusWatermarkFor": "Show a watermark", "ui-showStatusWatermarkFor-help": "List of codelist values (eg. completed,historicalArchive,obsolete,superseded) for which the record status as a watermark displayed through the text", + "ui-showStaticPageMenu": "Show Additional Links", + "ui-showStaticPageMenu-help": "List of Additional Links configured as Static Pages type Record View Page", "ui-showStatusTopBarFor": "Show status bar", "ui-showStatusTopBarFor-help": "List of codelist values (eg. completed,historicalArchive,obsolete,superseded) for which the record status as a bar at the top of the record", "ui-isLogoInHeader": "Show the logo in header", diff --git a/web-ui/src/main/resources/catalog/locales/en-search.json b/web-ui/src/main/resources/catalog/locales/en-search.json index 0822492f999..a90353923a7 100644 --- a/web-ui/src/main/resources/catalog/locales/en-search.json +++ b/web-ui/src/main/resources/catalog/locales/en-search.json @@ -546,5 +546,6 @@ "fieldEmailNotValid": "A valid email address is required", "addLayerPrefix": "Add layer", "addLayerPostfix": "to the map", - "submit": "Submit" + "submit": "Submit", + "additionalLinks": "Additional Links" } diff --git a/web-ui/src/main/resources/catalog/views/default/templates/recordView/recordView.html b/web-ui/src/main/resources/catalog/views/default/templates/recordView/recordView.html index 6c6c6bbdb17..165cae633c2 100644 --- a/web-ui/src/main/resources/catalog/views/default/templates/recordView/recordView.html +++ b/web-ui/src/main/resources/catalog/views/default/templates/recordView/recordView.html @@ -82,14 +82,28 @@