From d2a45e46f19c97a5a318e891ffed0459f681c62f Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Fri, 28 Feb 2020 08:37:20 -0800 Subject: [PATCH] modified getOperationFormat --- .../condition/components/Criterion.vue | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/plugins/condition/components/Criterion.vue b/src/plugins/condition/components/Criterion.vue index f33adcb931..5ca8edbe79 100644 --- a/src/plugins/condition/components/Criterion.vue +++ b/src/plugins/condition/components/Criterion.vue @@ -44,7 +44,7 @@ {{ option.text }} - { - let valueMetadata = this.telemetryMetadataOptions[index]; - if (valueMetadata.formatString) { - this.operationFormat = 'number'; - } else if (valueMetadata.format) { - if (valueMetadata.format === 'utc') { - this.operationFormat = 'number'; - } else if (valueMetadata.format === 'enum') { + if (value.key === this.criterion.metadata) { + let valueMetadata = this.telemetryMetadataOptions[index]; + if (valueMetadata.enumerations !== undefined) { this.operationFormat = 'enum'; + } else if (valueMetadata.hints.hasOwnProperty('range')) { + this.operationFormat = 'number'; + } else if (valueMetadata.hints.hasOwnProperty('domain')) { + this.operationFormat = 'number'; + } else if (valueMetadata.key === 'name') { + this.operationFormat = 'string'; + } else { + this.operationFormat = 'string'; } - } else { - this.operationFormat = 'string'; } }); },