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

Kibana 7.0.0 URL field formatter doesn't render relative hyperlinks properly #53265

Merged
merged 4 commits into from
Dec 20, 2019

Conversation

alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Dec 17, 2019

Closes: #35235

Summary

  • HtmlContextTypeConvert, TextContextTypeConvert types were refactored and unified. Now both converters accept 2 arguments: value and options
  • 2 new types were created:
    Options for HtmlContextTypeConvert:
/** @internal **/
export interface HtmlContextTypeOptions {
  field?: any;
  hit?: Record<string, any>;
}

Options for TextContextTypeConvert:

/** @internal **/
export type TextContextTypeOptions = Record<string, any>;
  • parsedUrl was moved into meta params. Duplicate code was removed across all Kibana

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@alexwizp alexwizp force-pushed the field_formats branch 3 times, most recently from abda56f to 3b67821 Compare December 17, 2019 11:38
@alexwizp alexwizp changed the title Kibana 7.0.0 URL field formatter doesn't render relative hyperlinks p… Kibana 7.0.0 URL field formatter doesn't render relative hyperlinks properly Dec 17, 2019
@elastic elastic deleted a comment from elasticmachine Dec 17, 2019
@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

@elastic elastic deleted a comment from elasticmachine Dec 17, 2019
@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

@elastic elastic deleted a comment from elasticmachine Dec 17, 2019
@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

@alexwizp alexwizp force-pushed the field_formats branch 2 times, most recently from 94fc7df to 8504b28 Compare December 18, 2019 08:56
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@alexwizp alexwizp self-assigned this Dec 18, 2019
@alexwizp alexwizp marked this pull request as ready for review December 18, 2019 12:21
@alexwizp alexwizp requested a review from a team as a code owner December 18, 2019 12:21
Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

This LGTM! I think I prefer this approach above the others we have discussed so far.

The only thing I think we should add are some functional tests.

Copy link
Contributor

@gospodarsky gospodarsky left a comment

Choose a reason for hiding this comment

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

Looks real efficiently!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

This all LGTM, thanks for all of the iterations on this! I think we are in a good place.

I'll approve on my end now as I am going to be unavailable next week, but let's wait to merge until we add a functional test to this PR and an approval from @dmlemeshko

We should also open a PR with the "smaller" fix we discussed (the one-line change in pipeline_helpers/utilities where we use getConverterFor instead of convert), which can merge directly into 7.5 branch, so this can ship in 7.5.2. Ideally the functional test would be included in that PR as well as this one.

As for the functional test, the main use case I think we should capture is something like this:

  1. Update an IP field in the index patterns so be of type URL
  2. Navigate to Discover, assert that the correct HTML is rendered for the IP field
  3. Navigate to Visualize, create table vis
  4. Split rows with terms agg on IP field
  5. Assert that correct HTML is rendered for the IP field

I don't think testing a dashboard is necessary as it should be using the same code which is used in visualize for rendering, but open to your suggestions on this.

@alexwizp alexwizp merged commit 80b11a7 into elastic:master Dec 20, 2019
alexwizp added a commit to alexwizp/kibana that referenced this pull request Dec 20, 2019
…roperly (elastic#53265)

* Kibana 7.0.0 URL field formatter doesn't render relative hyperlinks properly

* fix CI

* fix PR comment / add tests
alexwizp added a commit that referenced this pull request Dec 20, 2019
…roperly (#53265) (#53678)

* Kibana 7.0.0 URL field formatter doesn't render relative hyperlinks properly

* fix CI

* fix PR comment / add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kibana 7.0.0 URL field formatter doesn't render relative hyperlinks properly
4 participants