Skip to content
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

chore(ui): update no events messaging #527

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

TristanHoladay
Copy link
Contributor

@TristanHoladay TristanHoladay commented Nov 5, 2024

Description

Adds a field to the Resource Store for customizing the messaging when there are no resources found. The default is still 'no resources found'. With that enabled, we are updating the messaging for Events tables when no events are found.

Related Issue

Resolves #521

Screenshot from 2024-11-07 08-33-35

Screenshot from 2024-11-06 19-13-48

@TristanHoladay TristanHoladay marked this pull request as ready for review November 7, 2024 02:27
@TristanHoladay TristanHoladay requested a review from a team as a code owner November 7, 2024 02:27
Copy link

@Madeline-UX Madeline-UX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add padding to between the text and the header of the table in the events table page view

@TristanHoladay
Copy link
Contributor Author

Please add padding to between the text and the header of the table in the events table page view

I was playing with that and wasn't sure since the figma showed more for the events widget and i thought it looked a little odd on the table. Will do though!

@@ -51,6 +51,8 @@ export interface ResourceStoreInterface<T extends KubernetesObject, U extends Co
numResources: Writable<number>
// The url for the EventSource
url: string
// The message to display when there are no resources
noResourcesMsg: { msg: string; style: string }[]
Copy link
Contributor

@decleaver decleaver Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on making this type a little more defined? something like { title: string; titleStyle: string; msg?: string; msgStyle?: string}? Where msg and msgStyle are optional. Or is there a case where you would have more than 2 msg, styles as is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure if there's a potential for more than 2 child message styles, but my guess is no. so yeah i like this idea of making it 1 object instead of a string[].

@@ -191,7 +193,7 @@ export class ResourceStore<T extends KubernetesObject, U extends CommonRow> impl
this.#eventSource.onmessage = ({ data }) => {
try {
this.#table = this.#tableCallback(JSON.parse(data))
this.#resources.set(this.#table)
this.#resources.set([])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.#resources.set([])
this.#resources.set(this.#table)

assume you did this for debugging and just forgot to put back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve K8s Events Empty State Messaging for Better System Status Clarity
3 participants