-
Notifications
You must be signed in to change notification settings - Fork 268
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
Add Event schema null checks #13478
Add Event schema null checks #13478
Conversation
@@ -75,23 +75,25 @@ export default { | |||
const inStore = this.$store.getters['currentStore'](EVENT); | |||
const eventSchema = this.$store.getters[`${ inStore }/schemaFor`](EVENT); // @TODO be smarter about which resources actually ever have events | |||
|
|||
const paginationHeaders = eventSchema ? [ |
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.
paginationHeaders
can be an empty array since the UI shows events only if event schema is not null:
showEvents() {
return this.isView && this.needEvents && this.eventSchema;
},
a1af300
to
0ccfec7
Compare
@@ -35,7 +35,7 @@ export default { | |||
|
|||
const schema = this.$store.getters['cluster/schemaFor'](EVENT); | |||
|
|||
const paginationHeaders = [ | |||
const paginationHeaders = schema ? [ |
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.
Are changes to this file needed? the events table isn't shown if the type can't been seen
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.
In theory no, this is just a null check for the component itself. It doesn't hurt, I would keep it, so that if the EventTable is shown by any mistake, the UI doesn't crash.
Signed-off-by: Francesco Torchia <[email protected]>
Co-authored-by: Richard Cox <[email protected]>
Signed-off-by: Francesco Torchia <[email protected]>
ed764b1
to
68e9820
Compare
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.
Note - this can also be reproduced outside of fleet with a user who is user-base and has view workload project role. looking at a workload should result in the event tab not showing
Summary
Fixes #13477
Occurred changes and/or fixed issues
Technical notes summary
Areas or cases that should be tested
Areas which could experience regressions
Screenshot/Video
Checklist