From c52ec1197b43afe201de681db74f1bc1c2044554 Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Fri, 10 Jul 2015 11:22:40 -0400 Subject: [PATCH] [system_tracking] Remove truncation of fact values This is a temporary fix until we can get a permanent fix to the performance issues we have with rendering this much data to the DOM. For more info see my comment on https://trello.com/c/QrbeaZfK. --- .../js/shared/truncated-text.directive.js | 9 ++++++--- .../js/shared/utilities/truncated-text.less | 5 +++++ .../fact-data-table/fact-data-table.block.less | 3 +-- .../fact-data-table.partial.html | 18 +++++++++--------- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/awx/ui/static/js/shared/truncated-text.directive.js b/awx/ui/static/js/shared/truncated-text.directive.js index bf3d1fd8cc..745ae352ca 100644 --- a/awx/ui/static/js/shared/truncated-text.directive.js +++ b/awx/ui/static/js/shared/truncated-text.directive.js @@ -1,4 +1,5 @@ /* jshint unused: vars */ +import {addResizeListener, removeResizeListener} from 'tower/shared/element-resize'; function link($compile, scope, element, attrs) { @@ -65,12 +66,14 @@ function link($compile, scope, element, attrs) { // wanted to leave this as a regular event binding, but // was running into issues with the resized element getting // removed from the DOM after truncating! No idea why yet. - element.resize(function() { + function resizeListener() { addTitleIfWrapping(getText()); - }); + } + + addResizeListener(element[0], resizeListener); scope.$watch('$destroy', function() { - element.off('resize'); + removeResizeListener(element[0], resizeListener); }); } diff --git a/awx/ui/static/js/shared/utilities/truncated-text.less b/awx/ui/static/js/shared/utilities/truncated-text.less index 938ed45bcc..42be763ab9 100644 --- a/awx/ui/static/js/shared/utilities/truncated-text.less +++ b/awx/ui/static/js/shared/utilities/truncated-text.less @@ -2,3 +2,8 @@ overflow: hidden; text-overflow: ellipsis; } + +.u-wrappedText { + white-space: normal; + word-wrap: break-word; +} diff --git a/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.block.less b/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.block.less index 16194ebf07..350aa6dd08 100644 --- a/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.block.less +++ b/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.block.less @@ -9,7 +9,7 @@ margin-bottom: 0.5em; align-items: center; transition: background-color 100ms, border-color 100ms; - max-height: 36px; + // max-height: 36px; border: solid 1px #fff; &:hover { background-color: #ebebeb; @@ -31,7 +31,6 @@ &-column { padding: 8px; flex: 1 0 33%; - white-space: nowrap; align-self: flex-start; &--offsetLeft { margin-left: 33%; diff --git a/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.partial.html b/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.partial.html index 44df785f58..29047d293b 100644 --- a/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.partial.html +++ b/awx/ui/static/js/system-tracking/fact-data-table/fact-data-table.partial.html @@ -28,20 +28,20 @@
{{group.facts.keyName}} - + {{value}} - + {{value}}
{{group.facts.keyName}} - {{group.facts.value1}} - {{group.facts.value2}} + {{group.facts.value1}} + {{group.facts.value2}}
@@ -60,13 +60,13 @@ {{fact.keyName}} - + {{fact.keyPath[0]}}.{{fact.keyName}} - + {{fact.value1}} - + {{fact.value2}} @@ -78,10 +78,10 @@ {{fact.keyPath[0]}}.{{fact.keyName}} - + {{fact.value1}} - + {{fact.value2}}