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

Adding width and height as parameters to image url #46917

Merged
merged 5 commits into from
Oct 7, 2019

Conversation

majagrubic
Copy link
Contributor

@majagrubic majagrubic commented Sep 30, 2019

Summary

Closes #10109.
This PR adds two new fields when setting an url of type image: width and height. These are then used to set the appropriate image size, in a way that the image is never scaled up, only down.
image_resize

Checklist

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

For maintainers

@majagrubic majagrubic added Feature:FieldFormatters Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Sep 30, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@majagrubic majagrubic requested review from timroes and removed request for timroes September 30, 2019 14:03
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nreese
Copy link
Contributor

nreese commented Sep 30, 2019

Thanks for adding support for width and height. Would it be possible to add a quick sentence in the docs https://www.elastic.co/guide/en/kibana/current/field-formatters-string.html about how width and height are in pixels and how they work.

@timroes timroes self-requested a review October 1, 2019 12:02
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested and works, LGTM 👍 Added one small nitpick, but nothing to block merging

Comment on lines 144 to 145
isInvalid={!!error}
error={error}
Copy link
Contributor

Choose a reason for hiding this comment

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

I might miss something, but how do I get into the error state? Might be a left-over of a former refactoring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Widht/height changes won't throw errors for now. I was thinking we should add some limitations on max/min values and then display errors accordingly. Not sure if it is necessary though and happy to remove these for now.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Nov 12, 2019
* Adding width and height as parameters to image url

* Addressing PR comments

* Removing unnecessary error message
majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Nov 12, 2019
* Adding width and height as parameters to image url

* Addressing PR comments

* Removing unnecessary error message
majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Nov 12, 2019
* Adding width and height as parameters to image url

* Addressing PR comments

* Removing unnecessary error message
majagrubic pushed a commit that referenced this pull request Nov 13, 2019
* Adding width and height as parameters to image url

* Addressing PR comments

* Removing unnecessary error message
majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Dec 7, 2019
* Adding width and height as parameters to image url

* Addressing PR comments

* Removing unnecessary error message
majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Dec 7, 2019
* Adding width and height as parameters to image url

* Addressing PR comments

* Removing unnecessary error message
majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Dec 7, 2019
* Adding width and height as parameters to image url

* Addressing PR comments

* Removing unnecessary error message
@nreese
Copy link
Contributor

nreese commented Dec 7, 2019

7.x #50406
7.5.1 #52457

majagrubic pushed a commit that referenced this pull request Dec 7, 2019
* Adding width and height as parameters to image url

* Addressing PR comments

* Removing unnecessary error message
@majagrubic majagrubic deleted the maja/fix-10109 branch December 9, 2019 16:28
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.

Add "size" parameter for "img" fields in index patterns
5 participants