@@ -68,8 +68,26 @@ angular.module('QuepidApp')
68
68
if ( angular . isUndefined ( $scope . pendingWizardSettings ) ) {
69
69
// When we run the case wizard, we assume that you want to use our Solr based TMDB demo setup.
70
70
// 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
+ }
72
89
}
90
+
73
91
var settings = settingsSvc . pickSettingsToUse ( $scope . pendingWizardSettings . searchEngine , $scope . pendingWizardSettings . searchUrl ) ;
74
92
$scope . pendingWizardSettings . additionalFields = settings . additionalFields ;
75
93
$scope . pendingWizardSettings . fieldSpec = settings . fieldSpec ;
@@ -86,7 +104,6 @@ angular.module('QuepidApp')
86
104
$scope . pendingWizardSettings . basicAuthCredential = settings . basicAuthCredential ;
87
105
$scope . pendingWizardSettings . mapperCode = settings . mapperCode ;
88
106
89
- //$scope.isHeaderConfigCollapsed = true;
90
107
91
108
var quepidStartsWithHttps = $location . protocol ( ) === 'https' ;
92
109
@@ -132,7 +149,7 @@ angular.module('QuepidApp')
132
149
$scope . pendingWizardSettings . searchUrl = searchEndpointToUse . endpointUrl ; // notice remapping
133
150
$scope . pendingWizardSettings . apiMethod = searchEndpointToUse . apiMethod ;
134
151
$scope . pendingWizardSettings . customHeaders = searchEndpointToUse . customHeaders ;
135
-
152
+
136
153
// Now grab default settings for the type of search endpoint you are using
137
154
var settings = settingsSvc . pickSettingsToUse ( $scope . pendingWizardSettings . searchEngine , $scope . pendingWizardSettings . searchUrl ) ;
138
155
$scope . pendingWizardSettings . additionalFields = settings . additionalFields ;
0 commit comments