From 9be646f1e71ba8d4c9532e313d2511fd61ba75a0 Mon Sep 17 00:00:00 2001 From: slhale Date: Mon, 3 Aug 2015 09:38:30 -0700 Subject: [PATCH] [Search] Moved search folder location Moved search from platform/features/search to platform/search. Added more style corrections. --- bundles.json | 2 +- platform/{features => }/search/bundle.json | 2 +- platform/{features => }/search/res/templates/search-item.html | 0 platform/{features => }/search/res/templates/search-view.html | 0 platform/{features => }/search/res/templates/search.html | 0 platform/{features => }/search/src/SearchAggregator.js | 0 .../{features => }/search/src/controllers/SearchController.js | 0 .../search/src/controllers/SearchItemController.js | 0 .../search/src/controllers/SearchViewController.js | 0 .../search/src/providers/ElasticsearchSearchProvider.js | 4 ++-- .../search/src/providers/GenericSearchProvider.js | 0 .../{features => }/search/src/workers/GenericSearchWorker.js | 2 +- platform/{features => }/search/test/SearchAggregatorSpec.js | 0 .../search/test/controllers/SearchControllerSpec.js | 0 .../search/test/controllers/SearchItemControllerSpec.js | 0 .../search/test/providers/ElasticsearchSearchProviderSpec.js | 0 .../search/test/providers/GenericSearchProviderSpec.js | 0 platform/{features => }/search/test/suite.json | 0 .../search/test/workers/GenericSearchWorkerSpec.js | 2 +- 19 files changed, 6 insertions(+), 6 deletions(-) rename platform/{features => }/search/bundle.json (98%) rename platform/{features => }/search/res/templates/search-item.html (100%) rename platform/{features => }/search/res/templates/search-view.html (100%) rename platform/{features => }/search/res/templates/search.html (100%) rename platform/{features => }/search/src/SearchAggregator.js (100%) rename platform/{features => }/search/src/controllers/SearchController.js (100%) rename platform/{features => }/search/src/controllers/SearchItemController.js (100%) rename platform/{features => }/search/src/controllers/SearchViewController.js (100%) rename platform/{features => }/search/src/providers/ElasticsearchSearchProvider.js (98%) rename platform/{features => }/search/src/providers/GenericSearchProvider.js (100%) rename platform/{features => }/search/src/workers/GenericSearchWorker.js (99%) rename platform/{features => }/search/test/SearchAggregatorSpec.js (100%) rename platform/{features => }/search/test/controllers/SearchControllerSpec.js (100%) rename platform/{features => }/search/test/controllers/SearchItemControllerSpec.js (100%) rename platform/{features => }/search/test/providers/ElasticsearchSearchProviderSpec.js (100%) rename platform/{features => }/search/test/providers/GenericSearchProviderSpec.js (100%) rename platform/{features => }/search/test/suite.json (100%) rename platform/{features => }/search/test/workers/GenericSearchWorkerSpec.js (97%) diff --git a/bundles.json b/bundles.json index 1924dafae8..826ff11656 100644 --- a/bundles.json +++ b/bundles.json @@ -16,13 +16,13 @@ "platform/features/pages", "platform/features/plot", "platform/features/scrolling", - "platform/features/search", "platform/features/events", "platform/forms", "platform/persistence/elastic", "platform/persistence/queue", "platform/policy", "platform/entanglement", + "platform/search", "example/imagery", "example/eventGenerator", diff --git a/platform/features/search/bundle.json b/platform/search/bundle.json similarity index 98% rename from platform/features/search/bundle.json rename to platform/search/bundle.json index 46e06faad9..56c2b24f5b 100644 --- a/platform/features/search/bundle.json +++ b/platform/search/bundle.json @@ -1,5 +1,5 @@ { - "name": "Search View", + "name": "Search", "description": "Allows the user to search through the file tree.", "extensions": { "controllers": [ diff --git a/platform/features/search/res/templates/search-item.html b/platform/search/res/templates/search-item.html similarity index 100% rename from platform/features/search/res/templates/search-item.html rename to platform/search/res/templates/search-item.html diff --git a/platform/features/search/res/templates/search-view.html b/platform/search/res/templates/search-view.html similarity index 100% rename from platform/features/search/res/templates/search-view.html rename to platform/search/res/templates/search-view.html diff --git a/platform/features/search/res/templates/search.html b/platform/search/res/templates/search.html similarity index 100% rename from platform/features/search/res/templates/search.html rename to platform/search/res/templates/search.html diff --git a/platform/features/search/src/SearchAggregator.js b/platform/search/src/SearchAggregator.js similarity index 100% rename from platform/features/search/src/SearchAggregator.js rename to platform/search/src/SearchAggregator.js diff --git a/platform/features/search/src/controllers/SearchController.js b/platform/search/src/controllers/SearchController.js similarity index 100% rename from platform/features/search/src/controllers/SearchController.js rename to platform/search/src/controllers/SearchController.js diff --git a/platform/features/search/src/controllers/SearchItemController.js b/platform/search/src/controllers/SearchItemController.js similarity index 100% rename from platform/features/search/src/controllers/SearchItemController.js rename to platform/search/src/controllers/SearchItemController.js diff --git a/platform/features/search/src/controllers/SearchViewController.js b/platform/search/src/controllers/SearchViewController.js similarity index 100% rename from platform/features/search/src/controllers/SearchViewController.js rename to platform/search/src/controllers/SearchViewController.js diff --git a/platform/features/search/src/providers/ElasticsearchSearchProvider.js b/platform/search/src/providers/ElasticsearchSearchProvider.js similarity index 98% rename from platform/features/search/src/providers/ElasticsearchSearchProvider.js rename to platform/search/src/providers/ElasticsearchSearchProvider.js index 37c8ab526c..24522a7eac 100644 --- a/platform/features/search/src/providers/ElasticsearchSearchProvider.js +++ b/platform/search/src/providers/ElasticsearchSearchProvider.js @@ -55,7 +55,7 @@ define( } return searchTerm.split(' ').map(function (s) { - if (s.includes('"')) { + if (s.indexOf('"') !== -1) { return s; } else { return s + '~' + editDistance; @@ -166,7 +166,7 @@ define( }).then(function (rawResults) { // ...then process the data return processResults(rawResults, timestamp); - }).catch(function (err) { + })['catch'](function (err) { // In case of error, return nothing. (To prevent // infinite loading time.) return {hits: [], total: 0}; diff --git a/platform/features/search/src/providers/GenericSearchProvider.js b/platform/search/src/providers/GenericSearchProvider.js similarity index 100% rename from platform/features/search/src/providers/GenericSearchProvider.js rename to platform/search/src/providers/GenericSearchProvider.js diff --git a/platform/features/search/src/workers/GenericSearchWorker.js b/platform/search/src/workers/GenericSearchWorker.js similarity index 99% rename from platform/features/search/src/workers/GenericSearchWorker.js rename to platform/search/src/workers/GenericSearchWorker.js index 6101760305..36f24161c8 100644 --- a/platform/features/search/src/workers/GenericSearchWorker.js +++ b/platform/search/src/workers/GenericSearchWorker.js @@ -97,7 +97,7 @@ for (i = 0; i < terms.length; i += 1) { // Increase the score if the term is in the item name - if (name.includes(terms[i])) { + if (name.indexOf(terms[i]) !== -1) { score += 1; // Add extra to the score if the search term exists diff --git a/platform/features/search/test/SearchAggregatorSpec.js b/platform/search/test/SearchAggregatorSpec.js similarity index 100% rename from platform/features/search/test/SearchAggregatorSpec.js rename to platform/search/test/SearchAggregatorSpec.js diff --git a/platform/features/search/test/controllers/SearchControllerSpec.js b/platform/search/test/controllers/SearchControllerSpec.js similarity index 100% rename from platform/features/search/test/controllers/SearchControllerSpec.js rename to platform/search/test/controllers/SearchControllerSpec.js diff --git a/platform/features/search/test/controllers/SearchItemControllerSpec.js b/platform/search/test/controllers/SearchItemControllerSpec.js similarity index 100% rename from platform/features/search/test/controllers/SearchItemControllerSpec.js rename to platform/search/test/controllers/SearchItemControllerSpec.js diff --git a/platform/features/search/test/providers/ElasticsearchSearchProviderSpec.js b/platform/search/test/providers/ElasticsearchSearchProviderSpec.js similarity index 100% rename from platform/features/search/test/providers/ElasticsearchSearchProviderSpec.js rename to platform/search/test/providers/ElasticsearchSearchProviderSpec.js diff --git a/platform/features/search/test/providers/GenericSearchProviderSpec.js b/platform/search/test/providers/GenericSearchProviderSpec.js similarity index 100% rename from platform/features/search/test/providers/GenericSearchProviderSpec.js rename to platform/search/test/providers/GenericSearchProviderSpec.js diff --git a/platform/features/search/test/suite.json b/platform/search/test/suite.json similarity index 100% rename from platform/features/search/test/suite.json rename to platform/search/test/suite.json diff --git a/platform/features/search/test/workers/GenericSearchWorkerSpec.js b/platform/search/test/workers/GenericSearchWorkerSpec.js similarity index 97% rename from platform/features/search/test/workers/GenericSearchWorkerSpec.js rename to platform/search/test/workers/GenericSearchWorkerSpec.js index 3f9cb73e11..67e482b218 100644 --- a/platform/features/search/test/workers/GenericSearchWorkerSpec.js +++ b/platform/search/test/workers/GenericSearchWorkerSpec.js @@ -31,7 +31,7 @@ define( describe("The generic search worker ", function () { // If this test fails, make sure this path is correct - var worker = new Worker('platform/features/search/src/workers/GenericSearchWorker.js'), + var worker = new Worker('platform/search/src/workers/GenericSearchWorker.js'), numObjects = 5; beforeEach(function () {