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

[FieldFormatters] Use default values for URL formatter #113141

Merged
merged 2 commits into from Sep 28, 2021
Merged

[FieldFormatters] Use default values for URL formatter #113141

merged 2 commits into from Sep 28, 2021

Conversation

Tacklebox
Copy link
Contributor

@Tacklebox Tacklebox commented Sep 27, 2021

Summary

close #112238 (comment)

The default behavior when creating a URL formatter is to have the type set to link, But the link specific field wasn't being shown until the the type select box had a transition to the link select from a different type. This was caused because the default for the type field is link, but the formatter props still have type as undefined. I addressed the issue by calling format.getParamDefaults() and coalescing it with the provided type prop.

Before this PR:
open_in_new_tab_before

After this PR:
open_in_new_tab_fixed

Checklist

The unit tests passed without modification. However, they also passed before, despite the snapshot including the html for the "Open in new tab" toggle. So I may be running them incorrectly.

For maintainers

Release Notes

Fix url formatter editor "Open in new tab" is hidden by default

When no formatter parameters are passed, the default formatter
parameters should be used.
@spalger spalger removed their request for review September 27, 2021 18:44
@spalger
Copy link
Contributor

spalger commented Sep 27, 2021

Hey @Tacklebox, I have removed myself from review because I haven't touched this code in many years (since it was all in Angular) except for broad changes regarding ESLint and the like. I suspect that someone from @elastic/kibana-app-services will be able to give you a much more usable review.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
indexPatternFieldEditor 149.3KB 149.3KB +51.0B

History

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

cc @Tacklebox

@Dosant Dosant added auto-backport Deprecated: Automatically backport this PR after it's merged Team:AppServicesUx v7.16.0 v8.0.0 Feature:FieldFormatters labels Sep 28, 2021
Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

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

tested, works well 👍

@Tacklebox Tacklebox merged commit 18930d6 into elastic:master Sep 28, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 28, 2021
* [FieldFormatters] Use default values for URL formatter
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Sep 28, 2021
…3290)

* [FieldFormatters] Use default values for URL formatter

Co-authored-by: Maxwell Borden <Tacklebox@users.noreply.github.com>
lykkin pushed a commit to lykkin/kibana that referenced this pull request Sep 28, 2021
* [FieldFormatters] Use default values for URL formatter
@tonymeehan
Copy link

WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated: Automatically backport this PR after it's merged Feature:FieldFormatters release_note:fix v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

URL formatter: "Open in new tab" UI is hidden by default
5 participants