From 553a3c5af34925ca58cfa22bb3d29cd45f41e26a Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 28 Aug 2015 10:36:26 -0400 Subject: [PATCH] fixed title capitalization of activity stream breadcrumb --- awx/ui/client/src/widgets/Stream.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/widgets/Stream.js b/awx/ui/client/src/widgets/Stream.js index 78c44b0326..a8acfbe779 100644 --- a/awx/ui/client/src/widgets/Stream.js +++ b/awx/ui/client/src/widgets/Stream.js @@ -104,7 +104,13 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti // Load the breadcrumbs array. We have to do things a bit different than Utilities.LoadBreadcrumbs. // Rather than botch that all up, we'll do our own thing here. $rootScope.breadcrumbs = []; - var path, title, i, j, paths = $location.path().split('/'); + var path, title, i, j, paths = $location.path().split('/'), + capitalizeTitle = function(title) { + return title.split("_") + .map(function(title) { + return title.charAt(0).toUpperCase() + title.slice(1); + }).join(" "); + }; paths.splice(0, 1); for (i = 0; i < paths.length; i++) { if (/^\d+/.test(paths[i])) { @@ -121,7 +127,7 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti } if (!title) { title = paths[i - 1].substr(0, paths[i - 1].length - 1); - title = title.charAt(0).toUpperCase() + title.slice(1); + title = capitalizeTitle(title); title = (title === 'Inventorie') ? 'Inventory' : title; } } else { @@ -135,7 +141,7 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti path = '/' + paths[i]; } title = paths[i]; - title = title.charAt(0).toUpperCase() + title.slice(1); + title = capitalizeTitle(title); } $rootScope.breadcrumbs.push({ path: path,