-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[metricVis] Add support for html field formatters #11008
Conversation
nice! can you add a test for this ? |
I'm not familiar with this field formatter. We were just trying to find it in the visualizations sync and couldn't, for what field types is it available? |
@ppisljar @thomasneirynck tests written and passing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f9416cc
to
7d857f1
Compare
jenkins, test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a nice concise win!
Needs small change to import statement, to match recent changes.
LGTM otherwise.
@@ -1,6 +1,6 @@ | |||
<div ng-controller="KbnMetricVisController" class="metric-vis"> | |||
<div class="metric-container" ng-repeat="metric in metrics"> | |||
<div class="metric-value" ng-style="{'font-size': vis.params.fontSize+'pt'}">{{metric.value}}</div> | |||
<div class="metric-value" ng-bind-html="metric.value" ng-style="{'font-size': vis.params.fontSize+'pt'}"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so subtle
import ngMock from 'ng_mock'; | ||
import expect from 'expect.js'; | ||
|
||
import VisProvider from 'ui/vis'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likely named import here
import {VisProvider}
is reason of failing test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
* [metricVis] Fix html support * [metric_vis] add test to verify 42d11b021 * [ui/vis] fix import (cherry picked from commit 34c33f3)
* [metricVis] Fix html support * [metric_vis] add test to verify 42d11b021 * [ui/vis] fix import (cherry picked from commit 34c33f3)
* [fieldFormat] make formatted output non-bindable (#11911) * [fieldFormat] make formatted output non-bindable * [aggTable] totals are consumed as text, produce text * [tests] fix existing tests * [fieldFormat/contentType] add tests for non-bindable wrapper (cherry picked from commit 1d2341f) * fix import statement * [metricVis] Fix html support (#11008) * [metricVis] Fix html support * [metric_vis] add test to verify 42d11b021 * [ui/vis] fix import (cherry picked from commit 34c33f3) * fix import statement
* [fieldFormat] make formatted output non-bindable (#11911) * [fieldFormat] make formatted output non-bindable * [aggTable] totals are consumed as text, produce text * [tests] fix existing tests * [fieldFormat/contentType] add tests for non-bindable wrapper (cherry picked from commit 1d2341f) (cherry picked from commit f85570d) * fix import statement * [metricVis] Fix html support (#11008) * [metricVis] Fix html support * [metric_vis] add test to verify 42d11b021 * [ui/vis] fix import (cherry picked from commit 34c33f3) (cherry picked from commit eea7622) * fix import statement (cherry picked from commit 07d9a3b)
* [metricVis] Fix html support * [metric_vis] add test to verify 42d11b021 * [ui/vis] fix import
The metric vis uses the
html
output of the field formatter, but doesn't render the value as html. This allows: