From 8e8ec52d1514ca04ecc1ffbdc01c735049d3388c Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Fri, 31 Jul 2015 11:59:55 -0400 Subject: [PATCH] Fix issues with forms using trueValue and falseValue --- awx/ui/client/src/shared/generator-helpers.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/shared/generator-helpers.js b/awx/ui/client/src/shared/generator-helpers.js index f8c3129c82..8296587ec6 100644 --- a/awx/ui/client/src/shared/generator-helpers.js +++ b/awx/ui/client/src/shared/generator-helpers.js @@ -38,11 +38,17 @@ angular.module('GeneratorHelpers', [systemStatus.name]) result = s + "=\"" + value + "\" "; } else { switch (key) { + // In the cases where we specify trueValue and falseValue, + // the boolean value from the API is getting converted to + // a string. After upgrading to angular 1.4, we need to quote + // the ng-true-value and ng-false-value values so we compare + // them appropriately. + // case 'trueValue': - result = "ng-true-value=\"" + value + "\" "; + result = "ng-true-value=\"'" + value + "'\" "; break; case 'falseValue': - result = "ng-false-value=\"" + value + "\" "; + result = "ng-false-value=\"'" + value + "'\" "; break; case 'awPopOver': // construct the entire help link