openshift / troubleshooting-panel-console-plugin

Console Plugin to add a troubleshooting side panel to display Korrel8r data
Apache License 2.0
0 stars 7 forks source link

Prevent extra Korrel8r API calls #21

Closed PeterYurkovich closed 3 months ago

PeterYurkovich commented 3 months ago

Resolves #17.

Adds loading status to usePluginAvailable, which is then used to prevent the primary korrel8r query until they have finished running.

Refactored the primary useEffect since it was getting very large with a lot of dependencies. I also tried to use a reducer instead but I found the resulting code to be confusing and that it clashes too much with redux. All of the state could be moved into redux to make everything flow through the same reducer, but we are trying to move off of redux going forward and adding extra project logic to redux seemed like a poor idea with that in mind.

I messed up the rebasing the changes from #20 onto #19, so I'm reopening this with a clean/correct git history.

openshift-ci[bot] commented 3 months ago

@PeterYurkovich: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
jgbernalp commented 3 months ago

/lgtm

openshift-ci[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgbernalp, PeterYurkovich

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/troubleshooting-panel-console-plugin/blob/main/OWNERS)~~ [PeterYurkovich,jgbernalp] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment