mirror of
https://github.com/nasa/openmct.git
synced 2025-03-24 04:55:21 +00:00
changed default input to array and clear downstream selection lists on change
This commit is contained in:
parent
f328a1078e
commit
ee6e0f310e
@ -37,7 +37,7 @@ import {computeCondition} from "@/plugins/condition/utils/evaluator";
|
||||
* {
|
||||
* telemetry: '',
|
||||
* operation: '',
|
||||
* input: '',
|
||||
* input: [],
|
||||
* metadata: ''
|
||||
* }
|
||||
* ]
|
||||
|
@ -82,7 +82,7 @@
|
||||
:key="option"
|
||||
:value="option"
|
||||
>
|
||||
{{ option.charAt(0).toUpperCase() + option.slice(1) }}
|
||||
{{ initCap(option) }}
|
||||
</option>
|
||||
</select>
|
||||
<input v-if="selectedOutputKey === outputOptions[2]"
|
||||
@ -203,11 +203,6 @@ export default {
|
||||
outputOptions: ['false', 'true', 'string']
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
initCap: function (string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1)
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
this.destroy();
|
||||
},
|
||||
@ -289,6 +284,9 @@ export default {
|
||||
hasTelemetry(identifier) {
|
||||
// TODO: check parent domainObject.composition.hasTelemetry
|
||||
return this.currentCriteria && identifier;
|
||||
},
|
||||
initCap: function (string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ export default {
|
||||
criteria: isDefault ? [] : [{
|
||||
telemetry: '',
|
||||
operation: '',
|
||||
input: '',
|
||||
input: [],
|
||||
metadata: '',
|
||||
key: ''
|
||||
}]
|
||||
|
@ -98,22 +98,34 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.updateMetadataOptions();
|
||||
this.updateOperationInputVisibility();
|
||||
},
|
||||
methods: {
|
||||
updateMetadataOptions() {
|
||||
updateMetadataOptions(ev) {
|
||||
if (ev) {
|
||||
this.criterion.metadata = '';
|
||||
this.criterion.operation = '';
|
||||
this.criterion.input = [];
|
||||
}
|
||||
if (this.criterion.telemetry) {
|
||||
this.openmct.objects.get(this.criterion.telemetry).then((telemetryObject) => {
|
||||
this.telemetryMetadata = this.openmct.telemetry.getMetadata(telemetryObject);
|
||||
this.telemetryMetadataOptions = this.telemetryMetadata.values();
|
||||
this.updateOperations();
|
||||
this.updateOperationInputVisibility();
|
||||
});
|
||||
} else {
|
||||
this.criterion.metadata = '';
|
||||
}
|
||||
this.persist();
|
||||
},
|
||||
updateOperations(ev) {
|
||||
if (ev) {
|
||||
this.criterion.operation = '';
|
||||
this.criterion.input = [];
|
||||
}
|
||||
let operationFormat = 'string';
|
||||
this.telemetryMetadata.valueMetadatas.forEach((value, index) => {
|
||||
if (value.key === ev.target.value) {
|
||||
if (value.key === this.criterion.metadata) {
|
||||
let valueMetadata = this.telemetryMetadataOptions[index];
|
||||
if (valueMetadata.formatString) {
|
||||
operationFormat = 'number';
|
||||
@ -128,7 +140,10 @@ export default {
|
||||
});
|
||||
this.filteredOps = [...this.operations.filter(op => op.appliesTo.indexOf(operationFormat) !== -1)];
|
||||
},
|
||||
updateOperationInputVisibility() {
|
||||
updateOperationInputVisibility(ev) {
|
||||
if (ev) {
|
||||
this.criterion.input = [];
|
||||
}
|
||||
if (this.criterion.operation === '') {
|
||||
this.isInputOperation = false;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user