Closed KurtStam closed 7 years ago
Embedding the base64 version image in the JSON just bloats the response IMO and affects stuff like caching, which we should be looking to utilise for static assets as much as possible. I'd prefer to serve images from a separate endpoint and the JSON instead contain the link to the image.
Thoughts @gashcrumb, @kahboom?
I am happy for this in two phases though, embedded in JSON for now and introduce a proper image service later, if doing the image service will take too long for now.
I think it'd be just as easy to host the image files in the console and just use CSS classes from the json response. Definitely inlining images is error-prone, plus there's a size limit that you have to worry about, think it's 4k but it might be different cross-browser.
We just discussed on IRC with @kahboom, I'm happy to do whatever. Whatever is easier..
So, there are several things we can do:
icon
property as it does now, except this would be an absolute path to the public endpoint that loads the image directly. This requires more work in the API and overworks it for larger files (again, we'd need a dedicated service), but works just as well for now.cc @chirino
For now lets do the fastest thing possible.. so I'd got with @gashcrumb's suggestion and take this on as technical debt.
Simples.
UPDATE: We decided to go with option 3, with the exception of the class names. Was just discussing with @gashcrumb, we can just use the name or whatever property from the connector, it should map 1:1 for all common services. For now, while we still don't have users inputting the name of the images, etc.
My point is, we won't need to use the label
property at all.. we can reference the connection's connector or integration's connection connector (if it's accessible). Whatever property defines the name of the service (e.g. twitter
). It might need sanitization in the UI but would be even faster than labels.
In the HTML we'd do something like /icons/{{ connection.connector.name }}.connection.png
and similar for integrations. The .connection.png
would be to distinguish the image types, since there is apparently a different one for the Integration List and one for the Connection List, etc.
In other words, @KurtStam you don't have to do anything, for now, I think.. as we'll ignore the label
property for now until we begin to accept user input where the name may vary.
Please keep this issue open for now until works out okay. Hoping to get this in today; need to re-scale the images to size so that the API and UI don't have to do this on the fly. Considering providing black&white versions for disabled states (need to consult UXD first) as well.
cc @dongniwang @sjcox-rh - Please read above and consult about black&white icons for disabled states, or if we should do this on demand in the UI (preferably not). Also, I'll first be testing with 40x40 for the integration list, smaller for connection list. Let me know what you think.
Embed the icons are base64 in the returned JSON.
https://issues.jboss.org/browse/IPAAS-295