mirror of
https://github.com/nasa/openmct.git
synced 2025-01-18 18:57:01 +00:00
[Search] Generic search roots constant
Made a constant for the generic search roots, rather than depending on roots[].
This commit is contained in:
parent
15e39e00c2
commit
eab140df48
@ -2,6 +2,13 @@
|
||||
"name": "Search",
|
||||
"description": "Allows the user to search through the file tree.",
|
||||
"extensions": {
|
||||
"constants": [
|
||||
{
|
||||
"key": "GENERIC_SEARCH_ROOTS",
|
||||
"value": [ "ROOT" ],
|
||||
"priority": "fallback"
|
||||
}
|
||||
],
|
||||
"controllers": [
|
||||
{
|
||||
"key": "SearchController",
|
||||
@ -32,7 +39,7 @@
|
||||
"provides": "searchService",
|
||||
"type": "provider",
|
||||
"implementation": "services/GenericSearchProvider.js",
|
||||
"depends": [ "$q", "objectService", "workerService", "roots[]" ]
|
||||
"depends": [ "$q", "objectService", "workerService", "GENERIC_SEARCH_ROOTS" ]
|
||||
},
|
||||
{
|
||||
"provides": "searchService",
|
||||
|
@ -43,9 +43,10 @@ define(
|
||||
* domain objects can be gotten.
|
||||
* @param {WorkerService} workerService The service which allows
|
||||
* more easy creation of web workers.
|
||||
* @param {roots[]} roots An array of all the root domain objects.
|
||||
* @param {GENERIC_SEARCH_ROOTS} ROOTS An array of the root
|
||||
* domain objects' IDs.
|
||||
*/
|
||||
function GenericSearchProvider($q, objectService, workerService, roots) {
|
||||
function GenericSearchProvider($q, objectService, workerService, ROOTS) {
|
||||
var worker = workerService.run('genericSearchWorker'),
|
||||
pendingQueries = {};
|
||||
// pendingQueries is a dictionary with the key value pairs st
|
||||
@ -142,14 +143,8 @@ define(
|
||||
|
||||
// Converts the filetree into a list
|
||||
function getItems(timeout) {
|
||||
var rootIds = [],
|
||||
i;
|
||||
for (i = 0; i < roots.length; i += 1) {
|
||||
rootIds.push(roots[i].id);
|
||||
}
|
||||
|
||||
// Aquire root objects
|
||||
objectService.getObjects(rootIds).then(function (objectsById) {
|
||||
objectService.getObjects(ROOTS).then(function (objectsById) {
|
||||
var objects = [],
|
||||
id;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user