-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[12.0] [MIG] web_widget_image_url #1145
[12.0] [MIG] web_widget_image_url #1145
Conversation
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.
Thanks!
placeholder: "/web/static/src/img/placeholder.png", | ||
supportedFieldTypes: ['char'], | ||
|
||
url(){ |
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.
This is not the correct syntax, please check the jslint error.
var AbstractField = require('web.AbstractField'); | ||
var core = require('web.core'); | ||
var registry = require('web.field_registry'); | ||
var QWeb = core.qweb; |
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.
This is never used
// License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html). | ||
|
||
odoo.define('web_widget_image_url.FieldImageURL', function (require) { | ||
"use strict"; |
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.
Please indent
<t t-name="FieldImageURL"> | ||
<span class="oe_form_field oe_form_field_image" t-att-style="widget.attrs.style"> | ||
<img t-att-src="widget.url()" | ||
t-att-border="widget.readonly ? 0 : 1" |
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.
The border attribute is deprecated in html5.
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 don't get it. Could you please describe it more?
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.
The attribute border is deprecated, please remove it. You can use the style attribute (t-att-style) to add a border to the image instead. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#Deprecated_attributes
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.
Thanks for the explanation.
@@ -0,0 +1,56 @@ | |||
.. image:: https://www.gnu.org/graphics/lgplv3-147x51.png |
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.
Can you use the new split readme?
50f6f2c
to
ac5cc00
Compare
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.
Just tested it with thousands of images in a list view.
Works well.
And for code review LGTM
@tarteo can you update your review please? |
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.
nitpicking LGPLv3
--> LGPL-3
Code review LGTM 👍
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.
The syntax is still incorrect (see my comments):
https://travis-ci.org/OCA/web/jobs/477666187#L608
ac5cc00
to
a974387
Compare
a974387
to
03c8d6a
Compare
$img.on('error', function () { | ||
$img.attr('src', self.placeholder); | ||
self.do_warn( | ||
_t("Image"), _t("Could not display the selected image.")); |
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.
this can be really annoying if by chance you use the widget on multiple images and you have more than one image missing (tree view for instance).
Out of the scope of this PR but I'd add a TODO in the roadmap.
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.
Thanks!
This PR has the |
Issue Reference