[Root Objects] Order by specified priority (#4658)
* Updated objectAPI to support root priority * Updated to new ES6 module for root registry and updated docs for new priority API and root object priority * Set "My Items" to default priority of low, for root object order Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
@@ -41,7 +41,7 @@ function ObjectAPI(typeRegistry, openmct) {
|
||||
this.typeRegistry = typeRegistry;
|
||||
this.eventEmitter = new EventEmitter();
|
||||
this.providers = {};
|
||||
this.rootRegistry = new RootRegistry();
|
||||
this.rootRegistry = new RootRegistry(openmct);
|
||||
this.inMemorySearchProvider = new InMemorySearchProvider(openmct);
|
||||
|
||||
this.rootProvider = new RootObjectProvider(this.rootRegistry);
|
||||
@@ -367,14 +367,17 @@ ObjectAPI.prototype.endTransaction = function () {
|
||||
|
||||
/**
|
||||
* Add a root-level object.
|
||||
* @param {module:openmct.ObjectAPI~Identifier|function} an array of
|
||||
* identifiers for root level objects, or a function that returns a
|
||||
* @param {module:openmct.ObjectAPI~Identifier|array|function} identifier an identifier or
|
||||
* an array of identifiers for root level objects, or a function that returns a
|
||||
* promise for an identifier or an array of root level objects.
|
||||
* @param {module:openmct.PriorityAPI~priority|Number} priority a number representing
|
||||
* this item(s) position in the root object's composition (example: order in object tree).
|
||||
* For arrays, they are treated as blocks.
|
||||
* @method addRoot
|
||||
* @memberof module:openmct.ObjectAPI#
|
||||
*/
|
||||
ObjectAPI.prototype.addRoot = function (key) {
|
||||
this.rootRegistry.addRoot(key);
|
||||
ObjectAPI.prototype.addRoot = function (identifier, priority) {
|
||||
this.rootRegistry.addRoot(identifier, priority);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user