From 9b7eb52772e0bcb6e00c814c12c7d954ca7e70b2 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Tue, 19 Sep 2017 10:26:58 -0400 Subject: [PATCH] Replace translate filter and retrieve tooltip text from strings file --- awx/ui/client/lib/components/layout/_index.less | 3 ++- .../lib/components/layout/side-nav-item.directive.js | 8 ++++---- awx/ui/client/lib/components/popover/_index.less | 1 - awx/ui/client/lib/components/popover/popover.partial.html | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/awx/ui/client/lib/components/layout/_index.less b/awx/ui/client/lib/components/layout/_index.less index f495b46876..1a351d6bfd 100644 --- a/awx/ui/client/lib/components/layout/_index.less +++ b/awx/ui/client/lib/components/layout/_index.less @@ -96,6 +96,8 @@ .at-Layout-sideNavItem { display: flex; cursor: pointer; + text-transform: uppercase; + > i.fa { padding-left: 20px; @@ -132,7 +134,6 @@ justify-content: flex-start; align-items: center; padding-right: @at-padding-between-side-nav-icon-text; - text-transform: uppercase; } + .at-Layout-main { diff --git a/awx/ui/client/lib/components/layout/side-nav-item.directive.js b/awx/ui/client/lib/components/layout/side-nav-item.directive.js index 45029b87d2..6a0f6c1624 100644 --- a/awx/ui/client/lib/components/layout/side-nav-item.directive.js +++ b/awx/ui/client/lib/components/layout/side-nav-item.directive.js @@ -5,9 +5,9 @@ function atSideNavItemLink (scope, element, attrs, ctrl) { scope.layoutVm = ctrl[1]; } -function AtSideNavItemController ($state, $scope) { +function AtSideNavItemController ($state, $scope, strings) { let vm = this || {}; - vm.popoverText = $scope.name.replace(/_/g,' '); + $scope.$watch('layoutVm.currentState', function(current) { if ($scope.name === 'portal mode') { vm.isRoute = (current && current.indexOf('portalMode') === 0); @@ -30,7 +30,7 @@ function AtSideNavItemController ($state, $scope) { vm.tooltip = { popover: { - text: vm.popoverText, + text: strings.get(`layout.${$scope.name}`), on: 'mouseenter', icon: $scope.iconClass, position: 'right', @@ -39,7 +39,7 @@ function AtSideNavItemController ($state, $scope) { } } -AtSideNavItemController.$inject = ['$state', '$scope']; +AtSideNavItemController.$inject = ['$state', '$scope', 'ComponentsStrings']; function atSideNavItem () { return { diff --git a/awx/ui/client/lib/components/popover/_index.less b/awx/ui/client/lib/components/popover/_index.less index 9018729eda..e6356217ca 100644 --- a/awx/ui/client/lib/components/popover/_index.less +++ b/awx/ui/client/lib/components/popover/_index.less @@ -10,7 +10,6 @@ .at-mixin-ButtonIcon(); color: @at-color-icon-popover; font-size: @at-font-size-icon; - padding: 1px; margin: 0; } diff --git a/awx/ui/client/lib/components/popover/popover.partial.html b/awx/ui/client/lib/components/popover/popover.partial.html index dabf0df2a7..974575f68f 100644 --- a/awx/ui/client/lib/components/popover/popover.partial.html +++ b/awx/ui/client/lib/components/popover/popover.partial.html @@ -9,8 +9,8 @@
-

{{ popover.title }}

-

{{ popover.text }}

+

{{ popover.title | translate }}

+

{{ popover.text | translate }}