mirror of
https://github.com/nasa/openmct.git
synced 2025-06-17 06:38:17 +00:00
[Search] Moved search folder location
Moved search from platform/features/search to platform/search. Added more style corrections.
This commit is contained in:
@ -16,13 +16,13 @@
|
|||||||
"platform/features/pages",
|
"platform/features/pages",
|
||||||
"platform/features/plot",
|
"platform/features/plot",
|
||||||
"platform/features/scrolling",
|
"platform/features/scrolling",
|
||||||
"platform/features/search",
|
|
||||||
"platform/features/events",
|
"platform/features/events",
|
||||||
"platform/forms",
|
"platform/forms",
|
||||||
"platform/persistence/elastic",
|
"platform/persistence/elastic",
|
||||||
"platform/persistence/queue",
|
"platform/persistence/queue",
|
||||||
"platform/policy",
|
"platform/policy",
|
||||||
"platform/entanglement",
|
"platform/entanglement",
|
||||||
|
"platform/search",
|
||||||
|
|
||||||
"example/imagery",
|
"example/imagery",
|
||||||
"example/eventGenerator",
|
"example/eventGenerator",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "Search View",
|
"name": "Search",
|
||||||
"description": "Allows the user to search through the file tree.",
|
"description": "Allows the user to search through the file tree.",
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"controllers": [
|
"controllers": [
|
@ -55,7 +55,7 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return searchTerm.split(' ').map(function (s) {
|
return searchTerm.split(' ').map(function (s) {
|
||||||
if (s.includes('"')) {
|
if (s.indexOf('"') !== -1) {
|
||||||
return s;
|
return s;
|
||||||
} else {
|
} else {
|
||||||
return s + '~' + editDistance;
|
return s + '~' + editDistance;
|
||||||
@ -166,7 +166,7 @@ define(
|
|||||||
}).then(function (rawResults) {
|
}).then(function (rawResults) {
|
||||||
// ...then process the data
|
// ...then process the data
|
||||||
return processResults(rawResults, timestamp);
|
return processResults(rawResults, timestamp);
|
||||||
}).catch(function (err) {
|
})['catch'](function (err) {
|
||||||
// In case of error, return nothing. (To prevent
|
// In case of error, return nothing. (To prevent
|
||||||
// infinite loading time.)
|
// infinite loading time.)
|
||||||
return {hits: [], total: 0};
|
return {hits: [], total: 0};
|
@ -97,7 +97,7 @@
|
|||||||
|
|
||||||
for (i = 0; i < terms.length; i += 1) {
|
for (i = 0; i < terms.length; i += 1) {
|
||||||
// Increase the score if the term is in the item name
|
// Increase the score if the term is in the item name
|
||||||
if (name.includes(terms[i])) {
|
if (name.indexOf(terms[i]) !== -1) {
|
||||||
score += 1;
|
score += 1;
|
||||||
|
|
||||||
// Add extra to the score if the search term exists
|
// Add extra to the score if the search term exists
|
@ -31,7 +31,7 @@ define(
|
|||||||
|
|
||||||
describe("The generic search worker ", function () {
|
describe("The generic search worker ", function () {
|
||||||
// If this test fails, make sure this path is correct
|
// 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;
|
numObjects = 5;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
Reference in New Issue
Block a user