fix: Number comparisons in alerts and device groups (#7695)

Remove quotes so if the field we are comparing against is a string type, we still do a number comparison.
This commit is contained in:
Tony Murray
2017-11-09 20:37:45 +00:00
committed by Neil Lathwood
parent de6266cb88
commit 8b3bd57303
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -357,7 +357,7 @@ $('#and').click('', function(e) {
strategy: 'array',
tagFieldName: 'rules[]'
});
if(value.indexOf("%") < 0) {
if(value.indexOf("%") < 0 && isNaN(value)) {
value = '"'+value+'"';
}
if(entity.indexOf("%") < 0) {
+6 -4
View File
@@ -181,11 +181,13 @@ $('#and, #or').click('', function(e) {
strategy: 'array',
tagFieldName: 'patterns[]'
});
if(entity.indexOf("%") >= 0) {
$('#response').data('tagmanager').populate([ entity+' '+condition+' '+value+' '+glue ]);
} else {
$('#response').data('tagmanager').populate([ '%'+entity+' '+condition+' "'+value+'" '+glue ]);
if(value.indexOf("%") < 0 && isNaN(value)) {
value = '"'+value+'"';
}
if(entity.indexOf("%") < 0) {
entity = '%'+entity;
}
$('#response').data('tagmanager').populate([ entity+' '+condition+' '+value+' '+glue ]);
}
});