Compare commits
	
		
			3 Commits
		
	
	
		
			fix-bargra
			...
			tables-rem
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 49eba13f0d | ||
|   | 89e97cfadc | ||
|   | dec95a5a18 | 
| @@ -62,6 +62,7 @@ define([ | ||||
|             //Don't trigger self | ||||
|             this.eventEmitter.off('mutation', handleMutation); | ||||
|             this.eventEmitter.emit(newStyleObject.identifier.key + ":*", newStyleObject); | ||||
|             this.eventEmitter.emit('mutation', newStyleObject); | ||||
|             this.eventEmitter.on('mutation', handleMutation); | ||||
|         }.bind(this); | ||||
|  | ||||
|   | ||||
| @@ -46,6 +46,7 @@ define([ | ||||
|     function DefaultCompositionProvider(publicAPI, compositionAPI) { | ||||
|         this.publicAPI = publicAPI; | ||||
|         this.listeningTo = {}; | ||||
|         this.onMutation = this.onMutation.bind(this); | ||||
|  | ||||
|         this.cannotContainDuplicates = this.cannotContainDuplicates.bind(this); | ||||
|         this.cannotContainItself = this.cannotContainItself.bind(this); | ||||
| @@ -208,9 +209,10 @@ define([ | ||||
|         if (this.topicListener) { | ||||
|             return; | ||||
|         } | ||||
|         var topic = this.publicAPI.$injector.get('topic'); | ||||
|         var mutation = topic('mutation'); | ||||
|         this.topicListener = mutation.listen(this.onMutation.bind(this)); | ||||
|         this.publicAPI.objects.eventEmitter.on('mutation', this.onMutation); | ||||
|         this.topicListener = () => { | ||||
|             this.publicAPI.objects.eventEmitter.off('mutation', this.onMutation) | ||||
|         }; | ||||
|     }; | ||||
|  | ||||
|     /** | ||||
| @@ -220,7 +222,7 @@ define([ | ||||
|      * @private | ||||
|      */ | ||||
|     DefaultCompositionProvider.prototype.onMutation = function (oldDomainObject) { | ||||
|         var id = oldDomainObject.getId(); | ||||
|         var id = objectUtils.makeKeyString(oldDomainObject.identifier); | ||||
|         var listeners = this.listeningTo[id]; | ||||
|  | ||||
|         if (!listeners) { | ||||
| @@ -228,7 +230,7 @@ define([ | ||||
|         } | ||||
|  | ||||
|         var oldComposition = listeners.composition.map(objectUtils.makeKeyString); | ||||
|         var newComposition = oldDomainObject.getModel().composition.map(objectUtils.makeKeyString); | ||||
|         var newComposition = oldDomainObject.composition.map(objectUtils.makeKeyString); | ||||
|  | ||||
|         var added = _.difference(newComposition, oldComposition).map(objectUtils.parseKeyString); | ||||
|         var removed = _.difference(oldComposition, newComposition).map(objectUtils.parseKeyString); | ||||
|   | ||||
| @@ -83,18 +83,17 @@ define([ | ||||
|             this.object = newObject; | ||||
|         }.bind(this); | ||||
|  | ||||
|         //Emit wildcard event | ||||
|         this.eventEmitter.emit(qualifiedEventName(this.object, '*'), this.object); | ||||
|         //Emit a general "any object" event | ||||
|         this.eventEmitter.emit(ANY_OBJECT_EVENT, this.object); | ||||
|  | ||||
|         this.eventEmitter.on(qualifiedEventName(this.object, '*'), handleRecursiveMutation); | ||||
|  | ||||
|         //Emit event specific to property | ||||
|         this.eventEmitter.emit(qualifiedEventName(this.object, path), value); | ||||
|  | ||||
|         this.eventEmitter.off(qualifiedEventName(this.object, '*'), handleRecursiveMutation); | ||||
|  | ||||
|         //Emit wildcare event | ||||
|         this.eventEmitter.emit(qualifiedEventName(this.object, '*'), this.object); | ||||
|  | ||||
|         //Emit a general "any object" event | ||||
|         this.eventEmitter.emit(ANY_OBJECT_EVENT, this.object); | ||||
|     }; | ||||
|  | ||||
|     return MutableObject; | ||||
|   | ||||
| @@ -79,8 +79,8 @@ define([ | ||||
|  | ||||
|         loadComposition() { | ||||
|             this.tableComposition = this.openmct.composition.get(this.domainObject); | ||||
|             if (this.tableComposition !== undefined){ | ||||
|                 this.tableComposition.load().then((composition)=>{ | ||||
|             if (this.tableComposition !== undefined) { | ||||
|                 this.tableComposition.load().then((composition) => { | ||||
|                     composition = composition.filter(this.isTelemetryObject); | ||||
|  | ||||
|                     this.configuration.addColumnsForAllObjects(composition); | ||||
| @@ -122,7 +122,6 @@ define([ | ||||
|  | ||||
|                     let telemetryRows = telemetryData.map(datum => new TelemetryTableRow(datum, columnMap, keyString, limitEvaluator)); | ||||
|                     this.boundedRows.add(telemetryRows); | ||||
|                     console.log('Loaded %i rows', telemetryRows.length); | ||||
|                     this.decrementOutstandingRequests(); | ||||
|                 }); | ||||
|         } | ||||
| @@ -131,7 +130,7 @@ define([ | ||||
|          * @private | ||||
|          */ | ||||
|         incrementOutstandingRequests() { | ||||
|             if (this.outstandingRequests === 0){ | ||||
|             if (this.outstandingRequests === 0) { | ||||
|                 this.emit('outstanding-requests', true); | ||||
|             } | ||||
|             this.outstandingRequests++; | ||||
| @@ -143,7 +142,7 @@ define([ | ||||
|         decrementOutstandingRequests() { | ||||
|             this.outstandingRequests--; | ||||
|  | ||||
|             if (this.outstandingRequests === 0){ | ||||
|             if (this.outstandingRequests === 0) { | ||||
|                 this.emit('outstanding-requests', false); | ||||
|             } | ||||
|         } | ||||
|   | ||||
| @@ -64,6 +64,7 @@ define([ | ||||
|         objectMutated(object) { | ||||
|             //Synchronize domain object reference. Duplicate object otherwise change detection becomes impossible. | ||||
|             this.domainObject = object; | ||||
|             //Was it the configuration that changed? | ||||
|             if (!_.eq(object.configuration, this.oldConfiguration)) { | ||||
|                 //Make copy of configuration, otherwise change detection is impossible if shared instance is being modified. | ||||
|                 this.oldConfiguration = JSON.parse(JSON.stringify(this.getConfiguration())); | ||||
| @@ -91,16 +92,19 @@ define([ | ||||
|             let columnsToRemove = this.columns[objectKeyString]; | ||||
|  | ||||
|             delete this.columns[objectKeyString]; | ||||
|  | ||||
|             let configuration = this.domainObject.configuration; | ||||
|             let configurationChanged = false; | ||||
|             columnsToRemove.forEach((column) => { | ||||
|                 //There may be more than one column with the same key (eg. time system columns) | ||||
|                 if (!this.hasColumnWithKey(column.getKey())) { | ||||
|                     let configuration = this.domainObject.configuration; | ||||
|                     delete configuration.hiddenColumns[column.getKey()]; | ||||
|                     // If there are no more columns with this key, delete any configuration, and trigger | ||||
|                     // a column refresh. | ||||
|                     this.openmct.objects.mutate(this.domainObject, 'configuration', configuration); | ||||
|                     configurationChanged = true; | ||||
|                 } | ||||
|             }); | ||||
|             if (configurationChanged) { | ||||
|                 this.updateConfiguration(configuration); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         hasColumnWithKey(columnKey) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user