resolve merge conflicts

This commit is contained in:
Joel McKinnon 2020-01-31 13:21:31 -08:00
commit 7ac7a40b1b
4 changed files with 43 additions and 33 deletions

View File

@ -55,7 +55,7 @@ export default {
}, },
methods: { methods: {
handleConditionResult(args) { handleConditionResult(args) {
this.$emit('condition-result-updated', { this.$emit('conditionResultUpdated', {
id: this.conditionIdentifier, id: this.conditionIdentifier,
result: args.data.result result: args.data.result
}) })

View File

@ -75,10 +75,18 @@
<div v-else> <div v-else>
<Condition :condition-identifier="conditionIdentifier" <Condition :condition-identifier="conditionIdentifier"
:current-condition-identifier="currentConditionIdentifier" :current-condition-identifier="currentConditionIdentifier"
/> @update-current-condition="updateCurrentCondition"
</div> @remove-condition="removeCondition"
</li> @condition-result-updated="handleConditionResult"
</ul> />
</div>
<div v-else>
<Condition :condition-identifier="conditionIdentifier"
:current-condition-identifier="currentConditionIdentifier"
@condition-result-updated="handleConditionResult"
/>
</div>
</div>
</div> </div>
</div> </div>
</section> </section>
@ -189,16 +197,16 @@ export default {
break; break;
} }
} }
this.$emit('current-condition-updated', currentConditionIdentifier); this.$emit('currentConditionUpdated', currentConditionIdentifier);
}, },
addTelemetry(telemetryDomainObject) { addTelemetry(telemetryDomainObject) {
this.telemetryObjs.push(telemetryDomainObject); this.telemetryObjs.push(telemetryDomainObject);
}, },
addCondition(event, isDefault) { addCondition(event, isDefault) {
let conditionDO = this.getConditionDomainObject(!!isDefault); let conditionDomainObject = this.getConditionDomainObject(!!isDefault);
//persist the condition DO so that we can do an openmct.objects.get on it and only persist the identifier in the conditionCollection of conditionSet //persist the condition domain object so that we can do an openmct.objects.get on it and only persist the identifier in the conditionCollection of conditionSet
this.openmct.objects.mutate(conditionDO, 'created', new Date()); this.openmct.objects.mutate(conditionDomainObject, 'created', new Date());
this.conditionCollection.unshift(conditionDO.identifier); this.conditionCollection.unshift(conditionDomainObject.identifier);
this.persist(); this.persist();
}, },
updateCurrentCondition(identifier) { updateCurrentCondition(identifier) {
@ -224,10 +232,10 @@ export default {
}, },
summary: 'summary description' summary: 'summary description'
}; };
let conditionDOKeyString = this.openmct.objects.makeKeyString(conditionObj.identifier); let conditionDomainObjectKeyString = this.openmct.objects.makeKeyString(conditionObj.identifier);
let newDO = this.instantiate(conditionObj, conditionDOKeyString); let newDomainObject = this.instantiate(conditionObj, conditionDomainObjectKeyString);
return newDO.useCapability('adapter'); return newDomainObject.useCapability('adapter');
}, },
updateCondition(updatedCondition) { updateCondition(updatedCondition) {
//TODO: this should only happen for reordering //TODO: this should only happen for reordering

View File

@ -118,7 +118,7 @@
</select> </select>
</span> </span>
<span class="controls"> <span class="controls">
<select v-model="selectedOperationKey[currentCriteria.key]" <select v-model="selectOperationName"
@change="setInputValueVisibility" @change="setInputValueVisibility"
> >
<option value="">- Select Comparison -</option> <option value="">- Select Comparison -</option>
@ -190,10 +190,9 @@ export default {
telemetryObject: this.telemetryObject, telemetryObject: this.telemetryObject,
telemetryMetadata: this.telemetryMetadata, telemetryMetadata: this.telemetryMetadata,
operations: OPERATIONS, operations: OPERATIONS,
trigger: 'all', selectedMetaDataKey: '',
selectedMetaDataKey: {}, selectedTelemetryKey: '',
selectedTelemetryKey: {}, selectOperationName: '',
selectedOperationKey: {},
selectedOutputKey: '', selectedOutputKey: '',
stringOutputField: false, stringOutputField: false,
comparisonValueField: false, comparisonValueField: false,
@ -282,13 +281,13 @@ export default {
} }
}, },
handleConditionResult(args) { handleConditionResult(args) {
this.$emit('condition-result-updated', { this.$emit('conditionResultUpdated', {
id: this.conditionIdentifier, id: this.conditionIdentifier,
result: args.data.result result: args.data.result
}) })
}, },
removeCondition(ev) { removeCondition(ev) {
this.$emit('remove-condition', this.conditionIdentifier); this.$emit('removeCondition', this.conditionIdentifier);
}, },
cloneCondition(ev) { cloneCondition(ev) {
this.$emit('clone-condition', { this.$emit('clone-condition', {
@ -297,10 +296,11 @@ export default {
}); });
}, },
setOutput() { setOutput() {
if (this.condition.definition.output !== 'false' && this.condition.definition.output !== 'true') { let conditionOutput = this.condition.definition.output;
if (conditionOutput !== 'false' && conditionOutput !== 'true') {
this.selectedOutputKey = this.outputOptions[2].key; this.selectedOutputKey = this.outputOptions[2].key;
} else { } else {
if (this.condition.definition.output === 'true') { if (conditionOutput === 'true') {
this.selectedOutputKey = this.outputOptions[1].key; this.selectedOutputKey = this.outputOptions[1].key;
} else { } else {
this.selectedOutputKey = this.outputOptions[0].key; this.selectedOutputKey = this.outputOptions[0].key;
@ -363,11 +363,12 @@ export default {
return this.currentCriteria && this.currentCriteria.key; return this.currentCriteria && this.currentCriteria.key;
}, },
updateConditionCriteria() { updateConditionCriteria() {
if (this.currentCriteria) { if (this.condition.definition.criteria.length) {
this.currentCriteria.selectedTelemetryKey = this.selectedTelemetryKey[this.currentCriteria[0].key]; let criterion = this.condition.definition.criteria[0];
this.currentCriteria.metaDataKey = this.selectedMetaDataKey[this.currentCriteria[0].key]; criterion.key = this.selectedTelemetryKey;
this.currentCriteria.operation = this.selectedOperationKey[this.currentCriteria[0].key]; criterion.metaDataKey = this.selectedMetaDataKey;
this.currentCriteria.input = this.operationValue[this.currentCriteria[0].key]; criterion.operation = this.selectOperationName;
criterion.input = [this.operationValue];
} }
}, },
persist() { persist() {
@ -382,10 +383,11 @@ export default {
} }
}, },
setInputValueVisibility(ev) { setInputValueVisibility(ev) {
if (this.selectedOperationKey[this.currentCriteria.key] !== 'isUndefined' && this.selectedOperationKey[this.currentCriteria.key] !== 'isDefined') { for (let i=0, ii=this.operations.length; i < ii; i++) {
this.comparisonValueField = true; if (this.selectOperationName === this.operations[i].name) {
} else { this.comparisonValueField = this.operations[i].inputCount > 0;
this.comparisonValueField = false; break;
}
} }
//find the criterion being updated and set the operation property //find the criterion being updated and set the operation property
}, },
@ -395,7 +397,7 @@ export default {
this.updateTelemetry(); this.updateTelemetry();
}, },
updateCurrentCondition() { updateCurrentCondition() {
this.$emit('update-current-condition', this.conditionIdentifier); this.$emit('updateCurrentCondition', this.conditionIdentifier);
} }
} }
} }

View File

@ -5,7 +5,7 @@
<CurrentOutput :condition="currentCondition" /> <CurrentOutput :condition="currentCondition" />
<TestData :is-editing="isEditing" /> <TestData :is-editing="isEditing" />
<ConditionCollection :is-editing="isEditing" <ConditionCollection :is-editing="isEditing"
@current-condition-updated="updateCurrentCondition" @currentConditionUpdated="updateCurrentCondition"
/> />
</div> </div>
</div> </div>