From f7b0da7be527554a536cf3d05b51710317adfc49 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 10 Aug 2015 10:02:45 -0700 Subject: [PATCH] About Tower version number fix for parsing versions such as "2.3.0" and "2.3.0-0.git201507231538" --- awx/ui/static/js/helpers/AboutAnsible.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/awx/ui/static/js/helpers/AboutAnsible.js b/awx/ui/static/js/helpers/AboutAnsible.js index 1be96d17d5..cca08fac18 100644 --- a/awx/ui/static/js/helpers/AboutAnsible.js +++ b/awx/ui/static/js/helpers/AboutAnsible.js @@ -52,17 +52,16 @@ export default scope.removeBuildAboutDialog = scope.$on('BuildAboutDialog', function(e, data) { var spaces, i, j, paddedStr = "", + versionParts, str = data.version, subscription = data.license_info.subscription_name || ""; - if(str.search('-')){ - str = str.substr(0,str.search('-')); - } - spaces = Math.floor((16-str.length)/2); + versionParts = str.split('-'); + spaces = Math.floor((16-versionParts[0].length)/2); for( i=0; i<=spaces; i++){ paddedStr = paddedStr +" "; } - paddedStr = paddedStr+str; + paddedStr = paddedStr + versionParts[0]; for( j = paddedStr.length; j<16; j++){ paddedStr = paddedStr + " "; }