Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support section variable in manual url #8494

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,25 @@

baseUrl = baseUrl.replace("{{version}}", scope.applicationVersion);

var helpPageUrl = baseUrl + "/" + page;
var helpPageUrl;
if (baseUrl.includes("{{section}}")) {
helpPageUrl = baseUrl.replace("{{section}}", page);
} else {
helpPageUrl = baseUrl + "/" + page;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add the "/"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the default original code.

The default manual.json of each section contains was appended at the end of the url and they contain no such "/". So the Javascript has to add them

"creating-metadata": "user-guide/describing-information/creating-metadata/",

}

testAndOpen(helpPageUrl).then(
function () {},
function () {
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;
}

testAndOpen(helpPageUrl);
}
Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/main/resources/catalog/locales/en-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,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.",
wangf1122 marked this conversation as resolved.
Show resolved Hide resolved
"system/csw": "Catalog Service for the Web (CSW)",
"system/csw/capabilityRecordUuid": "Record to use for GetCapabilities",
"system/csw/capabilityRecordUuid-help": "Choose the record to be used to build custom GetCapabilities document. If none exist, create a service metadata record (using ISO19139 or 19115-3 standards). To have a capabilities document with the main information required, set title, abstract, point of contact, keywords, constraints. If you need INSPIRE support also set properly the record main language and additional languages, INSPIRE themes and INSPIRE conformity.",
Expand Down