From 6ab4bc680067618897fc67cfdf1a11a2e495e1f5 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 10 Aug 2015 08:40:37 -0700 Subject: [PATCH] About Tower version number fix for parsing versions such as "2.3.0" and "2.3.0-0.git201507231538" --- awx/ui/client/src/helpers/AboutAnsible.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/awx/ui/client/src/helpers/AboutAnsible.js b/awx/ui/client/src/helpers/AboutAnsible.js index bd05d4d3d3..68fda8fc92 100644 --- a/awx/ui/client/src/helpers/AboutAnsible.js +++ b/awx/ui/client/src/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 + " "; }