Fix type conversion (#1466)

This commit is contained in:
Christophe Maudoux 2018-06-28 22:29:51 +02:00
parent 73f66df1e2
commit bc825de39c
3 changed files with 13 additions and 5 deletions

View File

@ -667,8 +667,14 @@ llapp.controller 'TreeCtrl', [
else
node.data = data.value
# Cast int as int (remember that booleans are int for Perl)
if node.type and node.type.match /^(int|bool|trool)$/
node.data = parseInt(node.data)
if node.type and node.type.match /^(bool|trool|boolOrExpr)$/
node.data = node.data.toString()
else if node.type and node.type.match /^int$/
node.data = parseInt(node.data, 10)
#if node.type and node.type.match /^(int|bool|trool)$/
# node.data = parseInt(node.data)
# Split SAML types
else if node.type and node.type.match(/^(saml(Service|Assertion)|blackWhiteList)$/) and not (typeof node.data == 'object')
node.data = node.data.split ';'

View File

@ -807,8 +807,10 @@ This file contains:
} else {
node.data = data.value;
}
if (node.type && node.type.match(/^(int|bool|trool)$/)) {
node.data = parseInt(node.data);
if (node.type && node.type.match(/^(bool|trool|boolOrExpr)$/)) {
node.data = node.data.toString();
} else if (node.type && node.type.match(/^int$/)) {
node.data = parseInt(node.data, 10);
} else if (node.type && node.type.match(/^(saml(Service|Assertion)|blackWhiteList)$/) && !(typeof node.data === 'object')) {
node.data = node.data.split(';');
}

File diff suppressed because one or more lines are too long