mirror of
https://github.com/nasa/openmct.git
synced 2025-05-30 22:24:18 +00:00
Merge pull request #2711 from nasa/condition-output-persistance2
Added persistance for changes to output selector
This commit is contained in:
commit
768df84f10
@ -76,8 +76,8 @@
|
|||||||
<li>
|
<li>
|
||||||
<label>Output</label>
|
<label>Output</label>
|
||||||
<span class="controls">
|
<span class="controls">
|
||||||
<select v-model="selectedOutputKey"
|
<select v-model="selectedOutputSelection"
|
||||||
@change="checkInputValue"
|
@change="setOutputValue"
|
||||||
>
|
>
|
||||||
<option value="">- Select Output -</option>
|
<option value="">- Select Output -</option>
|
||||||
<option v-for="option in outputOptions"
|
<option v-for="option in outputOptions"
|
||||||
@ -87,7 +87,7 @@
|
|||||||
{{ initCap(option) }}
|
{{ initCap(option) }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<input v-if="selectedOutputKey === outputOptions[2]"
|
<input v-if="selectedOutputSelection === outputOptions[2]"
|
||||||
v-model="domainObject.configuration.output"
|
v-model="domainObject.configuration.output"
|
||||||
class="t-condition-name-input"
|
class="t-condition-name-input"
|
||||||
type="text"
|
type="text"
|
||||||
@ -213,8 +213,8 @@ export default {
|
|||||||
domainObject: this.domainObject,
|
domainObject: this.domainObject,
|
||||||
currentCriteria: this.currentCriteria,
|
currentCriteria: this.currentCriteria,
|
||||||
expanded: true,
|
expanded: true,
|
||||||
selectedOutputKey: '',
|
trigger: 'all',
|
||||||
stringOutputField: false,
|
selectedOutputSelection: '',
|
||||||
outputOptions: ['false', 'true', 'string'],
|
outputOptions: ['false', 'true', 'string'],
|
||||||
criterionIndex: 0
|
criterionIndex: 0
|
||||||
};
|
};
|
||||||
@ -230,7 +230,25 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initialize() {
|
initialize() {
|
||||||
this.setOutput();
|
this.setOutputSelection();
|
||||||
|
},
|
||||||
|
setOutputSelection() {
|
||||||
|
let conditionOutput = this.domainObject.configuration.output;
|
||||||
|
if (conditionOutput) {
|
||||||
|
if (conditionOutput !== 'false' && conditionOutput !== 'true') {
|
||||||
|
this.selectedOutputSelection = 'string';
|
||||||
|
} else {
|
||||||
|
this.selectedOutputSelection = conditionOutput;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setOutputValue() {
|
||||||
|
if (this.selectedOutputSelection === 'string') {
|
||||||
|
this.domainObject.configuration.output = '';
|
||||||
|
} else {
|
||||||
|
this.domainObject.configuration.output = this.selectedOutputSelection;
|
||||||
|
}
|
||||||
|
this.persist();
|
||||||
},
|
},
|
||||||
addCriteria() {
|
addCriteria() {
|
||||||
const criteriaObject = {
|
const criteriaObject = {
|
||||||
@ -270,32 +288,13 @@ export default {
|
|||||||
this.domainObject.configuration.criteria.splice(index + 1, 0, clonedCriterion);
|
this.domainObject.configuration.criteria.splice(index + 1, 0, clonedCriterion);
|
||||||
this.persist()
|
this.persist()
|
||||||
},
|
},
|
||||||
|
|
||||||
setOutput() {
|
|
||||||
let conditionOutput = this.domainObject.configuration.output;
|
|
||||||
if (conditionOutput) {
|
|
||||||
if (conditionOutput !== 'false' && conditionOutput !== 'true') {
|
|
||||||
this.selectedOutputKey = 'string';
|
|
||||||
} else {
|
|
||||||
this.selectedOutputKey = conditionOutput;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
persist() {
|
|
||||||
this.openmct.objects.mutate(this.domainObject, 'configuration', this.domainObject.configuration);
|
|
||||||
},
|
|
||||||
checkInputValue() {
|
|
||||||
if (this.selectedOutputKey === 'string') {
|
|
||||||
this.domainObject.configuration.output = '';
|
|
||||||
} else {
|
|
||||||
this.domainObject.configuration.output = this.selectedOutputKey;
|
|
||||||
}
|
|
||||||
this.persist();
|
|
||||||
},
|
|
||||||
hasTelemetry(identifier) {
|
hasTelemetry(identifier) {
|
||||||
// TODO: check parent domainObject.composition.hasTelemetry
|
// TODO: check parent domainObject.composition.hasTelemetry
|
||||||
return this.currentCriteria && identifier;
|
return this.currentCriteria && identifier;
|
||||||
},
|
},
|
||||||
|
persist() {
|
||||||
|
this.openmct.objects.mutate(this.domainObject, 'configuration', this.domainObject.configuration);
|
||||||
|
},
|
||||||
initCap: function (string) {
|
initCap: function (string) {
|
||||||
return string.charAt(0).toUpperCase() + string.slice(1)
|
return string.charAt(0).toUpperCase() + string.slice(1)
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="c-cs__ui_content">
|
<div class="c-cs__ui_content">
|
||||||
<span v-if="currentConditionOutput"
|
<span v-if="currentConditionOutput"
|
||||||
class="current-output">{{ currentConditionOutput }}
|
class="current-output"
|
||||||
|
>
|
||||||
|
{{ currentConditionOutput }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else>No output selected</span>
|
<span v-else>No output selected</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="c-inspector">
|
<div class="c-inspector">
|
||||||
<div class="c-inspector__tabs"
|
<div class="c-inspector__tabs">
|
||||||
>
|
|
||||||
<div v-if="showStyles"
|
<div v-if="showStyles"
|
||||||
class="c-inspector__tabs__holder">
|
class="c-inspector__tabs__holder"
|
||||||
|
>
|
||||||
<div v-for="tabbedView in tabbedViews"
|
<div v-for="tabbedView in tabbedViews"
|
||||||
:key="tabbedView.key"
|
:key="tabbedView.key"
|
||||||
class="c-inspector__tabs__header"
|
class="c-inspector__tabs__header"
|
||||||
@ -22,7 +22,7 @@
|
|||||||
<pane class="c-inspector__properties">
|
<pane class="c-inspector__properties">
|
||||||
<properties />
|
<properties />
|
||||||
<location />
|
<location />
|
||||||
<inspector-views/>
|
<inspector-views />
|
||||||
</pane>
|
</pane>
|
||||||
<pane
|
<pane
|
||||||
v-if="isEditing && hasComposition"
|
v-if="isEditing && hasComposition"
|
||||||
@ -36,7 +36,7 @@
|
|||||||
<pane v-else
|
<pane v-else
|
||||||
class="c-inspector__styles"
|
class="c-inspector__styles"
|
||||||
>
|
>
|
||||||
<styles-inspector-view/>
|
<styles-inspector-view />
|
||||||
</pane>
|
</pane>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user