From 42c345fdee36d2f5658b37ca6f4fe9628efd4350 Mon Sep 17 00:00:00 2001 From: WANGF Date: Mon, 16 Dec 2024 09:05:45 -0500 Subject: [PATCH] support section variable in manual url (#8494) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * support section variable in manual url * isoLang variable, help wording * Revert "isoLang variable, help wording" This reverts commit 0b000ce2 * ignore path "/" for default language replacement * Update web-ui/src/main/resources/catalog/locales/en-admin.json Co-authored-by: Jose García * remove double slash * remove double slash in error handler --------- Co-authored-by: Jose García --- .../components/common/needhelp/NeedHelpDirective.js | 9 ++++++++- web-ui/src/main/resources/catalog/locales/en-admin.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/common/needhelp/NeedHelpDirective.js b/web-ui/src/main/resources/catalog/components/common/needhelp/NeedHelpDirective.js index a957a360122..f47e68e93e6 100644 --- a/web-ui/src/main/resources/catalog/components/common/needhelp/NeedHelpDirective.js +++ b/web-ui/src/main/resources/catalog/components/common/needhelp/NeedHelpDirective.js @@ -184,7 +184,14 @@ var baseUrl = scope.helpBaseUrl .replace("{{lang}}", "") .replace("{{version}}", scope.applicationVersion); - var helpPageUrl = baseUrl + "/" + page; + var helpPageUrl; + if (baseUrl.includes("{{section}}")) { + helpPageUrl = baseUrl.replace("{{section}}", page); + } else { + helpPageUrl = baseUrl + "/" + page; + } + + helpPageUrl = processUrl(helpPageUrl); testAndOpen(helpPageUrl); } 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 85bfc45327d..a094d620fbe 100644 --- a/web-ui/src/main/resources/catalog/locales/en-admin.json +++ b/web-ui/src/main/resources/catalog/locales/en-admin.json @@ -627,7 +627,7 @@ "system/clickablehyperlinks/enable-help": "If set, GeoNetwork will display clickable hyperlinks in the metadata.", "system/documentation": "Documentation configuration", "system/documentation/url": "Base manual url", - "system/documentation/url-help": "Base application manual url. Defaults to the official manual page (https://docs.geonetwork-opensource.org/{version}/{lang}) and can be customised to use a self hosted documentation with a custom branding. The url can contain \\{\\{lang\\}\\} placeholder, to display the manual in different languages when available, and \\{\\{version\\}\\} placeholder to use the application version.", + "system/documentation/url-help": "Base application manual url. Defaults to the official manual page (https://docs.geonetwork-opensource.org/{version}/{lang}) and can be customised to use a self hosted documentation with a custom branding. The url can contain \\{\\{lang\\}\\} placeholder, to display the manual in different languages when available, \\{\\{version\\}\\} placeholder to use the application version, and \\{\\{section\\}\\} placeholder to parse sub section url from manual.json of the current page. When the \\{\\{section\\}\\} placeholder is not provided, the sub section value is automatically appended to the end of the url.", "system/publication": "Publication", "system/publication/doi/doienabled": "Allow creation of Digital Object Identifier (DOI)", "system/publication/doi/doipattern": "DOI pattern",