-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Drilldows] Url Drilldown basic template helpers #80500
[Drilldows] Url Drilldown basic template helpers #80500
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
This is a great set to handle most simple string manipulations. I think we may want to still consider a way for a developer to register a custom helper if it's useful for them, but that is a separate goal. |
@elastic-jb 👍 this is tracked here: #78404 |
I think we need the change for event.row (79157) to make use of the numeric formatting. I can't create a drilldown on a table that only has an aggregation, and if I add a terms aggregation to act on, I can't access the 2nd column value. That does bring up a point though. Even if I have a single column table with an aggregation, I would expect the context menu to display and allow me to send that single value. There is no way to do it right now. |
Correct, Regarding the current pr and helpers: this future table-vis work doesn't block helpers. |
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.
x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/url_template.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/url_template.ts
Outdated
Show resolved
Hide resolved
I removed Instead of |
Anton, the example I was thinking of was something like if I have a field that has "47.766201,-122.257057" stored as a single string field, it would be useful if I could have something that's kind of a cross between split and event.row so I could express that I want to use the value before the comma as a parameter, and the value after the comma as a separate parameter to send them to an API that requires them separately. |
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.
Dropping match and adding replace makes sense. I think we have a good core here.
@elasticmachine merge upstream |
@elastic-jb, I added |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]page load bundle size
History
To update your PR or re-run it, just comment with: |
Summary
close #77758
New helpers
Provides a basic list of string manipulation helpers for URL Drilldown templating:
formatNumber
{{formatNumber value "0.0"}}
lowercase
uppercase
trim
trimLeft
trimRight
left
{{left "12345" 3}} -> "123"
right
{{right "12345" 3}} -> "345"
mid
{{mid "12345" 1 3}} -> "234"
concat
{{concat value1 ";" value2 }}
replace
{{replace "Label:Feature:Something" "Label:" ""}} -> "Feature:Something"
split
{{split "Label:Feature:Something" ":"}} -> ["Label", "Feature", "Something"]
Checklist
Delete any items that are not applicable to this PR.
For maintainers