Skip to content

Commit

Permalink
Directory entries / Fix parsing of sorting configuration (#8515)
Browse files Browse the repository at this point in the history
Co-authored-by: Jose García <[email protected]>
  • Loading branch information
geonetworkbuild and josegar74 authored Nov 26, 2024
1 parent 32aa526 commit fc96dfb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@
pre: function preLink(scope) {
var directorySearchSettings = gnGlobalSettings.gnCfg.mods.directory || {};

var sortConfig = (
directorySearchSettings.sortBy || gnSearchSettings.sortBy
).split("#");

scope.searchObj = {
any: "",
internal: true,
Expand All @@ -138,8 +142,8 @@
from: 1,
to: 20,
root: "gmd:CI_ResponsibleParty",
sortBy: directorySearchSettings.sortBy || gnSearchSettings.sortBy,
sortOrder: "",
sortBy: sortConfig[0] || "relevance",
sortOrder: sortConfig[1] || "",
resultType: "subtemplates",
queryBase:
directorySearchSettings.queryBase || gnSearchSettings.queryBase
Expand Down Expand Up @@ -639,6 +643,10 @@
pre: function preLink(scope) {
var directorySearchSettings = gnGlobalSettings.gnCfg.mods.directory || {};

var sortConfig = (
directorySearchSettings.sortBy || gnSearchSettings.sortBy
).split("#");

scope.searchObj = {
internal: true,
configId: "directoryInEditor",
Expand All @@ -648,7 +656,8 @@
from: 1,
to: 10,
root: "gmd:CI_ResponsibleParty",
sortBy: directorySearchSettings.sortBy || gnSearchSettings.sortBy,
sortBy: sortConfig[0] || "relevance",
sortOrder: sortConfig[1] || "",
queryBase:
directorySearchSettings.queryBase || gnSearchSettings.queryBase
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,17 @@

$scope.facetConfig = directorySearchSettings.facetConfig;

var sortConfig = (directorySearchSettings.sortBy || gnSearchSettings.sortBy).split(
"#"
);

$scope.defaultSearchObj = {
selectionBucket: "d101",
configId: "directory",
any: "",
params: {
sortBy: directorySearchSettings.sortBy || gnSearchSettings.sortBy,
sortBy: sortConfig[0] || "relevance",
sortOrder: sortConfig[1] || "",
isTemplate: ["s"],
from: 1,
to: 20,
Expand Down

0 comments on commit fc96dfb

Please sign in to comment.