-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Conversation
Pinging @elastic/kibana-app |
💚 Build Succeeded |
37a3bd5
to
6daa37d
Compare
src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/url.js
Outdated
Show resolved
Hide resolved
src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/url.test.js
Outdated
Show resolved
Hide resolved
src/legacy/core_plugins/kibana/common/field_formats/types/url.js
Outdated
Show resolved
Hide resolved
src/legacy/core_plugins/kibana/common/field_formats/types/url.js
Outdated
Show resolved
Hide resolved
src/legacy/core_plugins/kibana/common/field_formats/types/url.js
Outdated
Show resolved
Hide resolved
src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/url.js
Outdated
Show resolved
Hide resolved
src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/url.js
Show resolved
Hide resolved
💚 Build Succeeded |
💚 Build Succeeded |
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. |
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.
Tested and works, LGTM 👍 Added one small nitpick, but nothing to block merging
isInvalid={!!error} | ||
error={error} |
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.
I might miss something, but how do I get into the error state? Might be a left-over of a former refactoring
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.
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.
src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/url.js
Show resolved
Hide resolved
💚 Build Succeeded |
💚 Build Succeeded |
* Adding width and height as parameters to image url * Addressing PR comments * Removing unnecessary error message
* Adding width and height as parameters to image url * Addressing PR comments * Removing unnecessary error message
* Adding width and height as parameters to image url * Addressing PR comments * Removing unnecessary error message
* Adding width and height as parameters to image url * Addressing PR comments * Removing unnecessary error message
* Adding width and height as parameters to image url * Addressing PR comments * Removing unnecessary error message
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.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] Documentation was added for features that require explanation or tutorialsFor maintainers