From 52bbfed619f605cd66a0808eac7cbc49cccdb69c Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 18 Jan 2023 14:27:06 -0600 Subject: [PATCH 1/5] Issue 494: Provide a link to a wiki page on Github regarding search help. Opted to use an icon to fit in with the current available space. The URL is exposed via the new `searchHelpUrl` appConfig setting. --- build/appConfig.js.template | 3 ++- .../app/controllers/discoveryContextController.js | 2 ++ .../resources/styles/sass/discovery-context/_all.scss | 11 +++++++++++ .../webapp/app/views/discovery/discovery-context.html | 3 +++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/build/appConfig.js.template b/build/appConfig.js.template index e7aabd6c..9b5f2183 100644 --- a/build/appConfig.js.template +++ b/build/appConfig.js.template @@ -61,6 +61,7 @@ var appConfig = { 'defaultThumbnailURI': "resources/images/default-thumbnail.jpg", 'defaultLoadingThumbnailURI': "resources/images/loading2.gif", - 'avalonUrl': '${AVALON_URL}' + 'avalonUrl': '${AVALON_URL}', + 'searchHelpUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching', }; diff --git a/src/main/webapp/app/controllers/discoveryContextController.js b/src/main/webapp/app/controllers/discoveryContextController.js index 19a721d1..260990e3 100644 --- a/src/main/webapp/app/controllers/discoveryContextController.js +++ b/src/main/webapp/app/controllers/discoveryContextController.js @@ -8,6 +8,8 @@ sage.controller('DiscoveryContextController', function ($controller, $scope, $ro $scope.defaultThumbnailURI = appConfig.defaultThumbnailURI; + $scope.searchHelpUrl = appConfig.searchHelpUrl; + $scope.rowOptions = []; var options = [10, 25, 50, 100]; diff --git a/src/main/webapp/app/resources/styles/sass/discovery-context/_all.scss b/src/main/webapp/app/resources/styles/sass/discovery-context/_all.scss index 6e7b9c9e..df5a398f 100644 --- a/src/main/webapp/app/resources/styles/sass/discovery-context/_all.scss +++ b/src/main/webapp/app/resources/styles/sass/discovery-context/_all.scss @@ -143,6 +143,17 @@ height: 40px; } + .dc-search-help { + font-size: 1rem; + + .dc-search-help-link { + cursor: help; + + padding: 8px 8px; + margin: 0px 4px; + } + } + } .dc-active-filters { diff --git a/src/main/webapp/app/views/discovery/discovery-context.html b/src/main/webapp/app/views/discovery/discovery-context.html index 45e59e5d..9b48a9a2 100644 --- a/src/main/webapp/app/views/discovery/discovery-context.html +++ b/src/main/webapp/app/views/discovery/discovery-context.html @@ -60,6 +60,9 @@

+ + + From 910c868ca8181f3a7c154a05629ff32f76385fc4 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 19 Jan 2023 13:41:59 -0600 Subject: [PATCH 2/5] Issue 494: Provide more granular links that point to the currently selecting searching algorithms. We are using the Github Wiki which lacks most of the structural functionality that would allow for the code here to be simpler. Ideally, something like "id" tags can be used on a single page to only need a single link. This is not possible with the current Github Wiki functionality. This solution, which is far from ideal, uses a separate URL for each of the combinations between the Parser and the Operands. Text with a link is provided on the management page because landscape is readily available. --- build/appConfig.js.template | 9 ++++++-- .../controllers/discoveryContextController.js | 22 ++++++++++++++++++- .../discoveryViewManagementController.js | 4 +++- .../modals/updateDiscoveryViewModal.html | 5 +++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/build/appConfig.js.template b/build/appConfig.js.template index 9b5f2183..c8ca3af9 100644 --- a/build/appConfig.js.template +++ b/build/appConfig.js.template @@ -62,6 +62,11 @@ var appConfig = { 'defaultThumbnailURI': "resources/images/default-thumbnail.jpg", 'defaultLoadingThumbnailURI': "resources/images/loading2.gif", 'avalonUrl': '${AVALON_URL}', - 'searchHelpUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching', - + 'searchHelpManageUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching', + 'searchHelpDismaxAndUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Dismax-And', + 'searchHelpDismaxOrUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Dismax-Or', + 'searchHelpEdismaxAndUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Edismax-And', + 'searchHelpEdismaxOrUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Edismax-Or', + 'searchHelpLuceneAndUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Lucene-And', + 'searchHelpLuceneOrUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Lucene-Or', }; diff --git a/src/main/webapp/app/controllers/discoveryContextController.js b/src/main/webapp/app/controllers/discoveryContextController.js index 260990e3..7d6904e4 100644 --- a/src/main/webapp/app/controllers/discoveryContextController.js +++ b/src/main/webapp/app/controllers/discoveryContextController.js @@ -8,7 +8,7 @@ sage.controller('DiscoveryContextController', function ($controller, $scope, $ro $scope.defaultThumbnailURI = appConfig.defaultThumbnailURI; - $scope.searchHelpUrl = appConfig.searchHelpUrl; + $scope.searchHelpUrl = ""; $scope.rowOptions = []; @@ -23,6 +23,26 @@ sage.controller('DiscoveryContextController', function ($controller, $scope, $ro }); $scope.discoveryContext.ready().then(function() { + $scope.isAndOperand = function() { + if (angular.isDefined($scope.discoveryContext.defaultOperand) && $scope.discoveryContext.defaultOperand == "AND") { + return true; + } + + return false; + }; + + if (angular.isDefined($scope.discoveryContext.queryParser)) { + if ($scope.discoveryContext.queryParser == "EDISMAX") { + $scope.searchHelpUrl = $scope.isAndOperand() ? appConfig.searchHelpEdismaxAndUrl : appConfig.searchHelpEdismaxOrUrl; + } + else if ($scope.discoveryContext.queryParser == "DISMAX") { + $scope.searchHelpUrl = $scope.isAndOperand() ? appConfig.searchHelpDismaxAndUrl : appConfig.searchHelpDismaxOrUrl; + } + } + + if ($scope.searchHelpUrl == "") { + $scope.searchHelpUrl = $scope.isAndOperand() ? appConfig.searchHelpLuceneAndUrl : appConfig.searchHelpLuceneOrUrl; + } // Prevent search value from being initially set as the string 'undefined'. $scope.currentSearchValue = ""; diff --git a/src/main/webapp/app/controllers/management/discoveryViewManagementController.js b/src/main/webapp/app/controllers/management/discoveryViewManagementController.js index 529c21a4..7c10ae3b 100644 --- a/src/main/webapp/app/controllers/management/discoveryViewManagementController.js +++ b/src/main/webapp/app/controllers/management/discoveryViewManagementController.js @@ -1,4 +1,4 @@ -sage.controller('DiscoveryViewManagementController', function ($controller, $scope, $timeout, DiscoveryView, DiscoveryViewRepo, FacetField, MetadataField, NgTableParams, SearchField, SourceRepo) { +sage.controller('DiscoveryViewManagementController', function ($controller, $scope, $timeout, DiscoveryView, DiscoveryViewRepo, FacetField, MetadataField, NgTableParams, SearchField, SourceRepo, appConfig) { angular.extend(this, $controller('AbstractController', { $scope: $scope @@ -17,6 +17,8 @@ sage.controller('DiscoveryViewManagementController', function ($controller, $sco $scope.queryParsers = [ "", "EDISMAX", "DISMAX" ]; $scope.queryOperands = [ "", "AND", "OR" ]; + $scope.searchHelpUrl = appConfig.searchHelpManageUrl; + $scope.fields = []; $scope.discoveryViewForms = { diff --git a/src/main/webapp/app/views/modals/updateDiscoveryViewModal.html b/src/main/webapp/app/views/modals/updateDiscoveryViewModal.html index 42e9d4a6..198d6d2f 100644 --- a/src/main/webapp/app/views/modals/updateDiscoveryViewModal.html +++ b/src/main/webapp/app/views/modals/updateDiscoveryViewModal.html @@ -150,6 +150,11 @@ results="discoveryViewForms.getResults()" autocomplete="off"> +
+ View the + search operands and parsers external documentation + for more details. +
From bb6f2c568ea0b64d320c2791e3002ea07f42dc26 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 19 Jan 2023 14:03:03 -0600 Subject: [PATCH 3/5] Issue 494: Update help documentation URLs. --- build/appConfig.js.template | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/appConfig.js.template b/build/appConfig.js.template index c8ca3af9..4e8897a8 100644 --- a/build/appConfig.js.template +++ b/build/appConfig.js.template @@ -63,10 +63,10 @@ var appConfig = { 'defaultLoadingThumbnailURI': "resources/images/loading2.gif", 'avalonUrl': '${AVALON_URL}', 'searchHelpManageUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching', - 'searchHelpDismaxAndUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Dismax-And', - 'searchHelpDismaxOrUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Dismax-Or', - 'searchHelpEdismaxAndUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Edismax-And', - 'searchHelpEdismaxOrUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Edismax-Or', - 'searchHelpLuceneAndUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Lucene-And', - 'searchHelpLuceneOrUrl': 'https://github.com/TAMULib/SAGE/wiki/Searching-Lucene-Or', + 'searchHelpDismaxAndUrl': 'https://github.com/TAMULib/SAGE/wiki/Search-Syntax-Using-Dismax-And', + 'searchHelpDismaxOrUrl': 'https://github.com/TAMULib/SAGE/wiki/Search-Syntax-Using-Dismax-Or', + 'searchHelpEdismaxAndUrl': 'https://github.com/TAMULib/SAGE/wiki/Search-Syntax-Using-Edismax-And', + 'searchHelpEdismaxOrUrl': 'https://github.com/TAMULib/SAGE/wiki/Search-Syntax-Using-Edismax-Or', + 'searchHelpLuceneAndUrl': 'https://github.com/TAMULib/SAGE/wiki/Search-Syntax-Using-Lucene-And', + 'searchHelpLuceneOrUrl': 'https://github.com/TAMULib/SAGE/wiki/Search-Syntax-Using-Lucene-Or', }; From 47ec43f5c69f6b41695b665f901ea8838da9986a Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 19 Jan 2023 16:38:49 -0600 Subject: [PATCH 4/5] Issue 494: The create and clone discover view management needs the link. --- .../webapp/app/views/modals/cloneDiscoveryViewModal.html | 5 +++++ .../webapp/app/views/modals/createDiscoveryViewModal.html | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/main/webapp/app/views/modals/cloneDiscoveryViewModal.html b/src/main/webapp/app/views/modals/cloneDiscoveryViewModal.html index 71d540d1..e76f9e6f 100644 --- a/src/main/webapp/app/views/modals/cloneDiscoveryViewModal.html +++ b/src/main/webapp/app/views/modals/cloneDiscoveryViewModal.html @@ -151,6 +151,11 @@ results="discoveryViewForms.getResults()" autocomplete="off"> +
+ View the + search operands and parsers external documentation + for more details. +
diff --git a/src/main/webapp/app/views/modals/createDiscoveryViewModal.html b/src/main/webapp/app/views/modals/createDiscoveryViewModal.html index 78adc666..af8b856b 100644 --- a/src/main/webapp/app/views/modals/createDiscoveryViewModal.html +++ b/src/main/webapp/app/views/modals/createDiscoveryViewModal.html @@ -147,6 +147,11 @@ results="discoveryViewForms.getResults()" autocomplete="off"> +
+ View the + search operands and parsers external documentation + for more details. +
From 225c306862e69375e96f868e65e46c4d5117af75 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 19 Jan 2023 16:40:12 -0600 Subject: [PATCH 5/5] Issue 494: Hide the search help link when searching "all_fields". --- src/main/webapp/app/controllers/discoveryContextController.js | 4 ++++ src/main/webapp/app/views/discovery/discovery-context.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/app/controllers/discoveryContextController.js b/src/main/webapp/app/controllers/discoveryContextController.js index 7d6904e4..a4d2bc5a 100644 --- a/src/main/webapp/app/controllers/discoveryContextController.js +++ b/src/main/webapp/app/controllers/discoveryContextController.js @@ -225,6 +225,10 @@ sage.controller('DiscoveryContextController', function ($controller, $scope, $ro return typeof $scope.discoveryContext.search.value === "string" && $scope.discoveryContext.search.value !== ""; }; + $scope.notAllSearch = function() { + return angular.isDefined($scope.currentSearchField) && $scope.currentSearchField.key !== "all_fields"; + }; + $scope.presentCollectionText = function(value) { return $sce.trustAsHtml(value); }; diff --git a/src/main/webapp/app/views/discovery/discovery-context.html b/src/main/webapp/app/views/discovery/discovery-context.html index 9b48a9a2..04ab2fdc 100644 --- a/src/main/webapp/app/views/discovery/discovery-context.html +++ b/src/main/webapp/app/views/discovery/discovery-context.html @@ -60,7 +60,7 @@

- +