Skip to content
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

Merged
merged 4 commits into from
May 12, 2017

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Apr 3, 2017

The metric vis uses the html output of the field formatter, but doesn't render the value as html. This allows:

image

@spalger spalger added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) review v5.4.0 v6.0.0 labels Apr 3, 2017
@ppisljar
Copy link
Member

ppisljar commented Apr 5, 2017

nice! can you add a test for this ?

@epixa
Copy link
Contributor

epixa commented Apr 5, 2017

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?

@lukasolson
Copy link
Member

@epixa I think this has to do with the URL field formatter. If I have a URL formatter and create a metric vis, it currently looks like this:

image

I believe that's what this issue fixes, is that correct @spalger?

@spalger
Copy link
Contributor Author

spalger commented Apr 14, 2017

@ppisljar @thomasneirynck tests written and passing

Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@spalger spalger force-pushed the fix/html-in-metric-vis branch from f9416cc to 7d857f1 Compare April 26, 2017 03:11
@thomasneirynck
Copy link
Contributor

jenkins, test this

Copy link
Contributor

@thomasneirynck thomasneirynck left a 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>
Copy link
Contributor

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';
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@spalger spalger merged commit 34c33f3 into elastic:master May 12, 2017
@spalger spalger changed the title [metricVis] Fix html support [metricVis] Add support for html field formatters May 12, 2017
@spalger spalger deleted the fix/html-in-metric-vis branch May 12, 2017 08:48
spalger added a commit that referenced this pull request May 12, 2017
* [metricVis] Fix html support

* [metric_vis] add test to verify 42d11b021

* [ui/vis] fix import

(cherry picked from commit 34c33f3)
spalger added a commit to spalger/kibana that referenced this pull request May 19, 2017
* [metricVis] Fix html support

* [metric_vis] add test to verify 42d11b021

* [ui/vis] fix import

(cherry picked from commit 34c33f3)
spalger added a commit to spalger/kibana that referenced this pull request May 19, 2017
* [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)
spalger added a commit that referenced this pull request May 19, 2017
* [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
spalger added a commit that referenced this pull request May 19, 2017
* [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)
snide pushed a commit to snide/kibana that referenced this pull request May 30, 2017
* [metricVis] Fix html support

* [metric_vis] add test to verify 42d11b021

* [ui/vis] fix import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:fix review v5.5.0 v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants