Skip to content

Commit 2f165c3

Browse files
authoredJun 13, 2024··
Fixes #1005 (#1035)
* Fixes #1005 * lint
1 parent c2b3904 commit 2f165c3

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed
 

‎app/assets/javascripts/controllers/wizardModal.js

+20-3
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,26 @@ angular.module('QuepidApp')
6868
if (angular.isUndefined($scope.pendingWizardSettings)){
6969
// When we run the case wizard, we assume that you want to use our Solr based TMDB demo setup.
7070
// We then give you options to change from there.
71-
$scope.pendingWizardSettings = angular.copy(settingsSvc.tmdbSettings['solr']);
71+
72+
// If we are reloading, then use the new one we picked, otherwise
73+
// we default to Solr.
74+
let searchEngineToUse = null;
75+
if (angular.isDefined($location.search().searchEngine)){
76+
searchEngineToUse = $location.search().searchEngine;
77+
}
78+
else {
79+
searchEngineToUse = 'solr';
80+
}
81+
$scope.pendingWizardSettings = {
82+
searchEngine: searchEngineToUse
83+
};
84+
85+
// Helps us distingush if we are using tmdb demo setup or no
86+
if (angular.isDefined($location.search().searchUrl)){
87+
$scope.pendingWizardSettings.searchUrl = $location.search().searchUrl;
88+
}
7289
}
90+
7391
var settings = settingsSvc.pickSettingsToUse($scope.pendingWizardSettings.searchEngine, $scope.pendingWizardSettings.searchUrl);
7492
$scope.pendingWizardSettings.additionalFields = settings.additionalFields;
7593
$scope.pendingWizardSettings.fieldSpec = settings.fieldSpec;
@@ -86,7 +104,6 @@ angular.module('QuepidApp')
86104
$scope.pendingWizardSettings.basicAuthCredential = settings.basicAuthCredential;
87105
$scope.pendingWizardSettings.mapperCode = settings.mapperCode;
88106

89-
//$scope.isHeaderConfigCollapsed = true;
90107

91108
var quepidStartsWithHttps = $location.protocol() === 'https';
92109

@@ -132,7 +149,7 @@ angular.module('QuepidApp')
132149
$scope.pendingWizardSettings.searchUrl = searchEndpointToUse.endpointUrl; // notice remapping
133150
$scope.pendingWizardSettings.apiMethod = searchEndpointToUse.apiMethod;
134151
$scope.pendingWizardSettings.customHeaders = searchEndpointToUse.customHeaders;
135-
152+
136153
// Now grab default settings for the type of search endpoint you are using
137154
var settings = settingsSvc.pickSettingsToUse($scope.pendingWizardSettings.searchEngine, $scope.pendingWizardSettings.searchUrl);
138155
$scope.pendingWizardSettings.additionalFields = settings.additionalFields;

‎app/assets/javascripts/services/settingsSvc.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ angular.module('QuepidApp')
7676
' "query": {',
7777
' "multi_match": {',
7878
' "query": "#$query##",',
79-
' "type": "best_fields",',
80-
' "fields": ["REPLACE_ME"]',
79+
' "fields": ["*"]',
8180
' }',
8281
' }',
8382
'}',

‎app/assets/templates/views/wizardModal.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ <h2>What Search Endpoint do you want to connect to?</h2>
8181
<div ng-show="showTLSChangeWarning" class="alert alert-warning">
8282
<span>
8383
You have specified a search endpoint url that is on a different protocol ( <code>{{protocolToSwitchTo}}</code> ) than Quepid is running,
84-
and this triggers your browser to prevent communciation with the search endpoint. Option 1: Reload Quepid to run on the correct protocol
85-
or Option 2: Proxy the requests THROUGH the Quepid server.
84+
and this triggers your browser to prevent communciation with the search endpoint. <br/>Option 1: Reload Quepid to run on the correct protocol
85+
<br/>Option 2: Proxy the requests THROUGH the Quepid server.
8686
</span>
8787
</div>
8888
<div ng-show="invalidProxyApiMethod" class="alert alert-danger">
@@ -401,8 +401,8 @@ <h2>CSV</h2>
401401
<div ng-show="showTLSChangeWarning" class="alert alert-warning">
402402
<span>
403403
You have specified a search endpoint url that is on a different protocol ( <code>{{protocolToSwitchTo}}</code> ) than Quepid is running,
404-
and this triggers your browser to prevent communciation with the search endpoint. Option 1: Reload Quepid to run on the correct protocol
405-
or Option 2: Proxy the requests THROUGH the Quepid server.
404+
and this triggers your browser to prevent communciation with the search endpoint. <br/>Option 1: Reload Quepid to run on the correct protocol
405+
<br/>Option 2: Proxy the requests THROUGH the Quepid server.
406406
</span>
407407
</div>
408408
<div class="row" style="margin-top: 50px;">

0 commit comments

Comments
 (0)
Please sign in to comment.