-
Notifications
You must be signed in to change notification settings - Fork 141
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
Fix picture fetching as an attribute #294
Conversation
cc: @himdel |
…ent collections. This will allow for formatting of picture responses to not return the picture content and will return the picture image_href by default
"MS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3Jp"\ | ||
"ZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpS"\ | ||
"REY+CjwveDp4bXBtZXRhPgpMwidZAAAADUlEQVQIHWNgYGCwBQAAQgA+3N0+"\ | ||
"xQAAAABJRU5ErkJggg==" |
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.
Now you know I HAVE to see what this picture is cc @bdunne
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.
@Fryguy let me know, I added this in a while ago and forgot 😆 maybe a heart?
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.
awww..just a blank square :/
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 *think* IIRC this is a single pixel - maybe the smallest possible image?
46e8fdc
to
026a716
Compare
Checked commit jntullo@026a716 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
Thanks, confirming this fixes my Heads up: SUI's Service Catalog section isn't accessible without this fix (assuming any pictures I guess), so possibly this should be a blocker. |
@miq-bot add_label blocker |
LGTM!! Thanks @jntullo for fixing this ... |
ping @Fryguy @imtayadeway please review/ ✅ when you get a chance. Thanks!! |
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'm good with this. The only concern I have is the duplicated knowledge of which things can have a picture - if that changes on the backend will someone remember to update this too? I'm wondering if the mixin should be included in the base controller?
format_picture_response(resource.picture) | ||
end | ||
|
||
def format_picture_response(picture) |
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 need to get that serializers PR finished ;)
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.
@imtayadeway yes please! 😛
@imtayadeway Yeah, that was a concern I had as well. Even if we include the module in the base controller, it is still looking for methods with the resource name, ie |
Looks like this is good to go. Thanks @jntullo for fixing this 👍 |
Fix picture fetching as an attribute (cherry picked from commit 99a3b63)
Gaprindashvili backport details:
|
Fetching a picture as an attribute is causing the same error that we saw #292, where it returns:
due to the changes in picture content.
This change creates a picture mixin to both format the way a picture object will now be returned, as well as provide a fetch method for collections with picture attributes.
Note, that I only added the module to collections that we were testing picture attribute selection on. We may need to add it to more in the future, or consider other options such as a picture serializer.
@miq-bot add_label bug, gaprindashvili/yes
@miq-bot assign @abellotti