-
Notifications
You must be signed in to change notification settings - Fork 45
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
UI: Expose hooks that retrieve the highest alerts for each entity #3275
UI: Expose hooks that retrieve the highest alerts for each entity #3275
Conversation
Hello chengyanjin,My role is to assist you with the merge of this Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list:
|
98932fd
to
8847337
Compare
abefd0d
to
223c978
Compare
b32f9c6
to
1940c5f
Compare
Check if the k8s call carry the id_token, othewise listen to the navbarElement AUTHENTICATED event Refs: #3275
1940c5f
to
c35493f
Compare
Check if the k8s call carry the `id_token`, otherwise listen to the navbarElement AUTHENTICATED_EVENT Refs: #3275
c35493f
to
92ec079
Compare
0625ea3
to
741b8fb
Compare
Check if the k8s call carry the `id_token`, otherwise listen to the navbarElement AUTHENTICATED_EVENT Refs: #3275
92ec079
to
bcfa1a0
Compare
Check if the k8s call carry the `id_token`, otherwise listen to the navbarElement AUTHENTICATED_EVENT Refs: #3275
bcfa1a0
to
1878730
Compare
shell-ui/src/platform/service/k8s.js
Outdated
.then((res) => { | ||
return res.items.length; | ||
}), | ||
options: { refetchInterval: 10000 }, |
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 it is missing enabled options :
options: { refetchInterval: 10000 }, | |
options: { refetchInterval: 10000, enabled: token }, |
this will only triggers the query if the token is provided.
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.
Right, I've checked the doc, the enabled
is a boolean, so maybe the following one is more correct
options: { refetchInterval: 10000, enabled: token ? true : false },
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.
JS is automatically casting this to a boolean so token ? true : false
is strictly equivalent to token
. Actually in token ? true : false
you are also casting token as a boolean for the ternary condition
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.
For some reason, the tests won't execute by enabled: token
. So I have to switch back to enabled: token ? true : false
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.
Axios is not available in shell-ui. I think we can simply use fetch as it is available in the browser we target |
d90bd0e
to
d6a94e3
Compare
I think you can merge this manually in my branch |
shell-ui/src/platform/service/k8s.js
Outdated
.then((res) => { | ||
return res.items.length; | ||
}), | ||
options: { refetchInterval: 10000, enabled: token }, |
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.
not sure about this options to be checked
d6a94e3
to
586e812
Compare
To disable the query if token is not provided Refs: #3257
Check if the k8s call carry the `id_token`, otherwise listen to the navbarElement AUTHENTICATED_EVENT Refs: #3275
Check if the k8s call carry the `id_token`, otherwise listen to the navbarElement AUTHENTICATED_EVENT Refs: #3275
Check if the k8s call carry the `id_token`, otherwise listen to the navbarElement AUTHENTICATED_EVENT Refs: #3275
Component: ui, alerts
Context:
Provide hooks to fetch the highest severity alerts for each entity to display the health.
Summary:
As discussed with @JBWatenbergScality, we will eventually remove the AlertProvider from Metalk8s UI.
Acceptance criteria:
Closes: #3257