-
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
[EPM] Share package icon location hook #62072
[EPM] Share package icon location hook #62072
Conversation
Export the hook used by PackageIcon component. Removed HTTP API call. `icons` comes from the API, so we don't want to call the API again.
Pinging @elastic/ingest-management (Feature:EPM) |
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.
Question: I see that the API call was removed - will this component still display the correct/expected icon in cases where this it is used with only props packageName
and version
? (this is (was?) the case in the Agent Config > Datasources list)
x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_package_icon_type.ts
Show resolved
Hide resolved
@paul-tavares thanks for the context about the API call. I thought it was from the time when registry only gave icon paths for /search but not /package (or vice versa?). I'll look at config > datasources list and adjust |
np @jfsiii - it was one of my last contributions to Ingest, so its still fresh in my mind 😃 . |
…-icon-location-hook
@paul-tavares Do you mean these views? If so, things look good to me. IIUC those views use |
Sorry for the delay.
The view for adding datasource (second screen capture) does have the
`icons` info. (uses epm APIs) if I remember correctly.
The view shown under the Agent Config > `datasources` uses the datasources
api which, unless changed recently, does not have the `icons` object under
the `package` information.
I can give it a closer look tomorrow tomorrow.
…--
___
*Paul Tavares *| Sr. Software Engineer | Elastic / www.elastic.co | Durham,
NC, USA
|
@paul-tavares I was trying to show that activemq, cockroachdb, and other integrations without EUI logos work. However, it seems to only occur if you've gone through the setup. Hard refresh or starting on that view uses default icon. I'll update the code one way or another and ping you after. |
@jfsiii ahhh. sorry about that - did not realize that was the intent 😄 |
Trusts given values by default but can opt-in to side-effects like calling API. Prevents trying API when we know none are present (api explicitly returns none). This also fixes the issue in master where the API was called several times for each item in the datasources list.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
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.
LGTM 👍
Friendly reminder: Looks like this PR hasn’t been backported yet. |
* EPM detail page now uses same icon as list page. * Moved hook from ./components to ./hooks * Add optional `tryApi` param to `<PackageIcon>` Trusts given values by default but can opt-in to side-effects like calling API. Prevents trying API when we know none are present (api explicitly returns none). This also fixes the issue in master where the API was called several times for each item in the datasources list.
Summary
Moved the hook which determines the icon to show for a package to top-level
hooks
so it can be shared by other components.Removed code to call HTTP API if an icon couldn't be found.
See commit messages for more information.
Current
PR