mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 09:52:04 +00:00
final changes from PR comments
This commit is contained in:
parent
68eb5e6286
commit
26069dac79
@ -85,13 +85,11 @@ export default {
|
||||
item.key = this.openmct.objects.makeKeyString(domainObject.identifier);
|
||||
|
||||
this.items.push(item);
|
||||
// this.checkForUnits();
|
||||
},
|
||||
removeItem(identifier) {
|
||||
let index = this.items.findIndex(item => this.openmct.objects.makeKeyString(identifier) === item.key);
|
||||
|
||||
this.items.splice(index, 1);
|
||||
// this.checkForUnits();
|
||||
},
|
||||
reorder(reorderPlan) {
|
||||
let oldItems = this.items.slice();
|
||||
|
@ -65,8 +65,25 @@ export default {
|
||||
return {
|
||||
primaryTelemetryObjects: [],
|
||||
secondaryTelemetryObjects: {},
|
||||
compositions: [],
|
||||
hasUnits: false
|
||||
compositions: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hasUnits() {
|
||||
for(let telemetryObject in this.secondaryTelemetryObjects) {
|
||||
if(this.secondaryTelemetryObjects[telemetryObject]) {
|
||||
let objects = this.secondaryTelemetryObjects[telemetryObject];
|
||||
for(let current of objects) {
|
||||
let metadata = this.openmct.telemetry.getMetadata(current.domainObject);
|
||||
for(let metadatum of metadata.valueMetadatas) {
|
||||
if(metadatum.unit) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -111,7 +128,6 @@ export default {
|
||||
this.$set(this.secondaryTelemetryObjects, primary.key, undefined);
|
||||
this.primaryTelemetryObjects.splice(index,1);
|
||||
primary = undefined;
|
||||
this.checkForUnits();
|
||||
},
|
||||
reorderPrimary(reorderPlan) {
|
||||
let oldComposition = this.primaryTelemetryObjects.slice();
|
||||
@ -129,9 +145,6 @@ export default {
|
||||
array.push(secondary);
|
||||
|
||||
this.$set(this.secondaryTelemetryObjects, primary.key, array);
|
||||
if(!this.hasUnits) {
|
||||
this.checkForUnits(domainObject);
|
||||
}
|
||||
}
|
||||
},
|
||||
removeSecondary(primary) {
|
||||
@ -142,9 +155,6 @@ export default {
|
||||
array.splice(index, 1);
|
||||
|
||||
this.$set(this.secondaryTelemetryObjects, primary.key, array);
|
||||
if(this.hasUnits) {
|
||||
this.checkForUnits();
|
||||
}
|
||||
}
|
||||
},
|
||||
checkForUnits() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user