syndesisio / syndesis-react

[FORK] A flexible, customizable, open source platform that provides core integration capabilities as a service.
Apache License 2.0
3 stars 19 forks source link

provided icons for extensions/api client connector aren't correctly fetched from a CI staged instance #283

Open gashcrumb opened 5 years ago

gashcrumb commented 5 years ago

This is a...


[ ] Feature request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Documentation issue or request

Description

Noticed this after importing an extension that includes it's own icon file. On staging there's an 'openshift' extension now installed that includes a new connector. However the icon file doesn't show up properly:

image

Since it's a connector extension, it also shows up in the create connection wizard:

image

And then as a connection:

image

I think we should consolidate getConnectionIcon, getStepIcon into perhaps a WithIconHelpers component. The trouble is some icons are served out from the UI because they're from built-in steps, and some icons are served out by the backend, using different mechanisms, either by embedding a file, a data URL with an embedded SVG, a db: or extension: URI scheme that requires constructing a URL to the backend in a particular way.

I think basically if we could throw everything at getConnectionIcon anytime we have an object and we need the icon file from it we'd be in good shape. Or maybe to solve this we need to get better at mapping between backend objects and some canonical UI object.

gashcrumb commented 5 years ago

I feel also like we could move all this icon-related stuff out of the api package and into utils or even the syndesis package.

riccardo-forina commented 5 years ago

They do work when the app is served from the root, so I guess somewhere we are not making use of the PUBLIC_URL thing. We should really clean up the whole thing tho, I agree.

gashcrumb commented 5 years ago

Updated the title so it doesn't sound so bad :-)