diff --git a/app/assets/images/vectara-icon.png b/app/assets/images/vectara-icon.png new file mode 100644 index 000000000..a4608f1b7 Binary files /dev/null and b/app/assets/images/vectara-icon.png differ diff --git a/app/assets/javascripts/controllers/mainCtrl.js b/app/assets/javascripts/controllers/mainCtrl.js index ba6ca2d39..f4007e09a 100644 --- a/app/assets/javascripts/controllers/mainCtrl.js +++ b/app/assets/javascripts/controllers/mainCtrl.js @@ -28,9 +28,9 @@ angular.module('QuepidApp') }; var getSearchEngine = function(tryNo) { - var sett = settingsSvc.editableSettings(); - if (sett.hasOwnProperty('getTry')) { - var aTry = sett.getTry(tryNo); + var settings = settingsSvc.editableSettings(); + if (settings.hasOwnProperty('getTry')) { + var aTry = settings.getTry(tryNo); if (aTry) { return aTry.searchUrl; } diff --git a/app/assets/javascripts/controllers/queryParams.js b/app/assets/javascripts/controllers/queryParams.js index 98a5d2e54..a117850a2 100644 --- a/app/assets/javascripts/controllers/queryParams.js +++ b/app/assets/javascripts/controllers/queryParams.js @@ -21,7 +21,22 @@ angular.module('QuepidApp') $scope.showTLSChangeWarning = false; - $scope.searchEndpoints = searchEndpointSvc.list(); + $scope.haveSearchEndpoints = false; + + searchEndpointSvc.list() + .then(function() { + $scope.searchEndpoints = searchEndpointSvc.searchEndpoints; + if ($scope.searchEndpoints.length > 0) { + $scope.haveSearchEndpoints = true; + } + else { + $scope.haveSearchEndpoints = false; + } + }); + + $scope.listSearchEndpoints = function() { + return $scope.searchEndpoints; + }; $scope.validateSearchEngineUrl = function() { if (!angular.isUndefined($scope.settings.searchUrl)){ @@ -95,6 +110,8 @@ angular.module('QuepidApp') name: $scope.settings.selectedTry.name, number_of_rows: $scope.settings.selectedTry.numberOfRows, query_params: $scope.settings.selectedTry.queryParams, + search_endpoint_id: $scope.settings.selectedTry.searchEndpointId, + endpoint_name: $scope.settings.selectedTry.endpointName, search_engine: $scope.settings.selectedTry.searchEngine, search_url: $scope.settings.selectedTry.searchUrl, try_number: $scope.settings.selectedTry.tryNo, @@ -108,5 +125,11 @@ angular.module('QuepidApp') $scope.settings.reset(); $scope.validateSearchEngineUrl(); }; + + $scope.changeSearchEngine2 = function() { + console.log("In changeSearchEngine2 and we don't do anything here!"); + //$scope.settings.reset(); + //$scope.validateSearchEngineUrl(); + }; } ]); diff --git a/app/assets/javascripts/controllers/settings.js b/app/assets/javascripts/controllers/settings.js index 4f7b3b2a6..56678c485 100644 --- a/app/assets/javascripts/controllers/settings.js +++ b/app/assets/javascripts/controllers/settings.js @@ -3,33 +3,45 @@ angular.module('QuepidApp') .controller('SettingsCtrl', [ - '$scope', - '$location', + '$scope','$location', 'flash', 'settingsSvc', - function ($scope, $location, flash, settingsSvc) { + function ( + $scope, $location, + flash, + settingsSvc + ) { $scope.settingsModel = {}; $scope.pendingSettings = { searchEngine: '', searchUrl: '', - titleField: '' + titleField: '', + searchEndpointId: '' }; - + + $scope.whoami = function() { + console.log("I am settings.js"); + } + $scope.settingsModel.settingsId = function() { return settingsSvc.settingsId(); }; var reset = function() { var currSettings = settingsSvc.editableSettings(); - if ( this.searchEngine !== currSettings.searchEngine) { - currSettings = settingsSvc.pickSettingsToUse($scope.pendingSettings.searchEngine, null); - currSettings.fieldSpec = currSettings.fieldSpec + ', ' + currSettings.additionalFields.join(', '); - $scope.pendingSettings.urlFormat = currSettings.urlFormat; + if ( this.searchEndpointId !== currSettings.searchEndpointId) { + console.log("We don't do this anymore"); + //currSettings = settingsSvc.pickSettingsToUse($scope.pendingSettings.searchEngine, null); + //currSettings.fieldSpec = currSettings.fieldSpec + ', ' + currSettings.additionalFields.join(', '); + //$scope.pendingSettings.urlFormat = currSettings.urlFormat; } + this.searchEndpointId = currSettings.searchEndpointId; + this.endpointName = currSettings.endpointName; this.searchEngine = currSettings.searchEngine; - this.apiMethod = currSettings.apiMethod; + //this.apiMethod = currSettings.apiMethod; + if (false){ if (this.searchEngine === 'solr') { var quepidStartsWithHttps = $location.protocol() === 'https'; if (quepidStartsWithHttps === true){ @@ -42,6 +54,7 @@ angular.module('QuepidApp') else { this.searchUrl = currSettings.searchUrl; } + } this.fieldSpec = currSettings.fieldSpec; diff --git a/app/assets/javascripts/factories/TryFactory.js b/app/assets/javascripts/factories/TryFactory.js index 3e1e40472..8fc844644 100644 --- a/app/assets/javascripts/factories/TryFactory.js +++ b/app/assets/javascripts/factories/TryFactory.js @@ -49,9 +49,12 @@ self.numberOfRows = data.number_of_rows; self.queryParams = data.query_params; self.searchEngine = data.search_engine; + self.searchEndpointId = data.search_endpoint_id; + self.endpointName = data.endpoint_name; self.searchUrl = data.search_url; self.tryNo = data.try_number; self.endpointName = data.endpoint_name; + // transform curator vars to be more angular friendly diff --git a/app/assets/javascripts/services/settingsSvc.js b/app/assets/javascripts/services/settingsSvc.js index e70247800..e2580e5b1 100644 --- a/app/assets/javascripts/services/settingsSvc.js +++ b/app/assets/javascripts/services/settingsSvc.js @@ -359,6 +359,7 @@ angular.module('QuepidApp') settings.numberOfRows = tryToUse.numberOfRows; settings.queryParams = tryToUse.queryParams; settings.searchEngine = tryToUse.searchEngine; + settings.searchEndpointId = tryToUse.searchEndpointId; settings.searchUrl = tryToUse.searchUrl; // TODO: Store type in db?... @@ -428,6 +429,7 @@ angular.module('QuepidApp') payloadTry.field_spec = settingsToSave.fieldSpec; payloadTry.number_of_rows = settingsToSave.numberOfRows; payloadTry.query_params = settingsToSave.selectedTry.queryParams; + payloadSearchEndpoint.search_endpoint_id = settingsToSave.searchEndpointId; payloadSearchEndpoint.search_engine = settingsToSave.searchEngine; payloadSearchEndpoint.endpoint_url = settingsToSave.searchUrl; payloadSearchEndpoint.api_method = settingsToSave.apiMethod; diff --git a/app/assets/templates/views/devQueryParams.html b/app/assets/templates/views/devQueryParams.html index c3a6c2d55..a8873679a 100644 --- a/app/assets/templates/views/devQueryParams.html +++ b/app/assets/templates/views/devQueryParams.html @@ -10,7 +10,10 @@
-
+

+ With a static search endpoint there are no query settings to play with ;-(. +

+

Query Sandbox:

@@ -19,11 +22,7 @@

Query Sandbox:

-
- -

- With a static (snapshot) search endpoint there are no query settings to play with ;-(. -

+

{{ queryParamsWarning }}

@@ -59,31 +58,32 @@

Query Sandbox:

-

- What's this tab do? Knobs allow you to fine tune your search! - Define variables in your query template with ##, such as this boost: title^##titleBoost##. - Play with the values in this tab. Submit to rerun with the new values! -

- -

- With a static (snapshot) search endpoint there are no tuning knobs to play with ;-(. -

- -

Tuning Knobs

- -

- Add and remove knobs from here by editing your query. +

+ With a static search endpoint there are tuning knobs to play with ;-(.

-
-
- - -

- This knob/dial is not currently used by the query! -

+
+

+ What's this tab do? Knobs allow you to fine tune your search! + Define variables in your query template with ##, such as this boost: title^##titleBoost##. + Play with the values in this tab. Submit to rerun with the new values! +

+ +

Tuning Knobs

+ +

+ Add and remove knobs from here by editing your query. +

+
+
+ + +

+ This knob/dial is not currently used by the query! +

+
-
-
+
+
@@ -95,40 +95,24 @@

Tuning Knobs

diff --git a/app/models/user.rb b/app/models/user.rb index 61a740b3e..6105b26cf 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -23,7 +23,7 @@ # name :string(255) # num_logins :integer # password :string(120) -# profile_pic :string(255) +# profile_pic :string(4000) # reset_password_sent_at :datetime # reset_password_token :string(255) # stored_raw_invitation_token :string(255) diff --git a/db/migrate/20230816183004_create_search_endpoints_from_tries.rb b/db/migrate/20230816183004_create_search_endpoints_from_tries.rb index f399dc02a..5d667f8ed 100644 --- a/db/migrate/20230816183004_create_search_endpoints_from_tries.rb +++ b/db/migrate/20230816183004_create_search_endpoints_from_tries.rb @@ -2,7 +2,7 @@ class CreateSearchEndpointsFromTries < ActiveRecord::Migration[7.0] def change puts "Found #{Try.all.where(case_id: nil).count} tries with no Case. Any is bad!" - Try.all.each do |try| + Try.all.where(search_endpoint: nil).limit(10000).each do |try| # Go through and find each unique set of values from all the tries, # and create a single end point that is used by multiple tries where it diff --git a/db/migrate/20230913181833_resize_user_profile_pic_to4000_chars.rb b/db/migrate/20230913181833_resize_user_profile_pic_to4000_chars.rb new file mode 100644 index 000000000..0398f10d5 --- /dev/null +++ b/db/migrate/20230913181833_resize_user_profile_pic_to4000_chars.rb @@ -0,0 +1,5 @@ +class ResizeUserProfilePicTo4000Chars < ActiveRecord::Migration[7.0] + def change + change_column :users, :profile_pic, :string, :limit => 4000 + end +end diff --git a/db/schema.rb b/db/schema.rb index 62ca58128..4e2ddd184 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_09_07_102331) do +ActiveRecord::Schema[7.0].define(version: 2023_09_13_181833) do create_table "annotations", id: :integer, charset: "utf8mb3", force: :cascade do |t| t.text "message" t.string "source" @@ -281,7 +281,7 @@ t.integer "invitations_count", default: 0 t.boolean "completed_case_wizard", default: false, null: false t.string "stored_raw_invitation_token" - t.string "profile_pic" + t.string "profile_pic", limit: 4000 t.index ["default_scorer_id"], name: "index_users_on_default_scorer_id" t.index ["email"], name: "ix_user_username", unique: true t.index ["invitation_token"], name: "index_users_on_invitation_token", unique: true, length: 191 diff --git a/public/images/es-icon.png b/public/images/es-icon.png new file mode 100644 index 000000000..edf8b785b Binary files /dev/null and b/public/images/es-icon.png differ diff --git a/public/images/os-icon.png b/public/images/os-icon.png new file mode 100644 index 000000000..cf42b8867 Binary files /dev/null and b/public/images/os-icon.png differ diff --git a/public/images/snapshot-icon.png b/public/images/snapshot-icon.png new file mode 100644 index 000000000..4c1adae63 Binary files /dev/null and b/public/images/snapshot-icon.png differ diff --git a/public/images/solr-icon.png b/public/images/solr-icon.png new file mode 100644 index 000000000..50704f053 Binary files /dev/null and b/public/images/solr-icon.png differ diff --git a/public/images/vectara-icon.png b/public/images/vectara-icon.png new file mode 100644 index 000000000..a4608f1b7 Binary files /dev/null and b/public/images/vectara-icon.png differ diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index 2cf7a2e05..38e6f6b5a 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -21,7 +21,7 @@ # name :string(255) # num_logins :integer # password :string(120) -# profile_pic :string(255) +# profile_pic :string(4000) # reset_password_sent_at :datetime # reset_password_token :string(255) # stored_raw_invitation_token :string(255) diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 77ddad575..8fd29d659 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -23,7 +23,7 @@ # name :string(255) # num_logins :integer # password :string(120) -# profile_pic :string(255) +# profile_pic :string(4000) # reset_password_sent_at :datetime # reset_password_token :string(255) # stored_raw_invitation_token :string(255)