Merge pull request #2501 from overleaf/as-unvendor-algoliasearch

Unvendor Algolia search client

GitOrigin-RevId: ad0ea56c66a516bd8a26a76d454cbc8d0594a03f
This commit is contained in:
Timothée Alby
2020-01-11 04:15:10 +00:00
committed by Copybot
parent 4c72278257
commit 1af8f0358b
10 changed files with 134 additions and 68 deletions
-1
View File
@@ -6,7 +6,6 @@ define([
'libs/angular-autocomplete/angular-autocomplete',
'libs/ui-bootstrap',
'libs/ng-context-menu-0.1.4',
'libs/algolia-2.5.2',
'libs/jquery.storage',
'libs/angular-cookie',
'libs/passfield',
+3 -3
View File
@@ -95,6 +95,9 @@ define(['base', 'directives/mathjax', 'services/algolia-search'], function(
return algoliaSearch.searchWiki(
query,
{
hitsPerPage: $scope.config_hits_per_page
},
function(err, response) {
$scope.processingSearch = false
if (response.hits.length === 0) {
@@ -103,9 +106,6 @@ define(['base', 'directives/mathjax', 'services/algolia-search'], function(
const hits = _.map(response.hits, buildHitViewModel)
return updateHits(hits, response.nbHits)
}
},
{
hitsPerPage: $scope.config_hits_per_page
}
)
}
@@ -12,9 +12,9 @@
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
define(['base', 'libs/algolia-2.5.2'], function(App, algolia) {
define(['base', 'algoliasearch'], function(App, AlgoliaSearch) {
App.factory('Institutions', () =>
new AlgoliaSearch(
AlgoliaSearch(
window.algolia.institutions.app_id,
window.algolia.institutions.api_key
).initIndex('institutions')
@@ -11,7 +11,7 @@
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
define(['base'], App =>
define(['base', 'algoliasearch'], (App, AlgoliaSearch) =>
App.factory('algoliaSearch', function() {
let kbIdx, wikiIdx
if (
@@ -24,7 +24,7 @@ define(['base'], App =>
x => x.wiki
) != null
) {
const client = new AlgoliaSearch(
const client = AlgoliaSearch(
window.sharelatex.algolia != null
? window.sharelatex.algolia.app_id
: undefined,
File diff suppressed because one or more lines are too long