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: update empty state of infra monitoring tables #7003

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

Conversation

amlannandy
Copy link
Member

@amlannandy amlannandy commented Feb 1, 2025

Summary

Update the empty states of both hosts and k8s tables to provide more accurate information.

Related Issues / PR's

Fixes #6889
Fixes #6890
Fixes #6980

Screenshots

Screenshot 2025-02-01 at 8 28 41 PM Screenshot 2025-02-01 at 8 28 51 PM Screenshot 2025-02-01 at 9 17 58 PM

Affected Areas and Manually Tested Areas


Important

Update empty states for infra monitoring tables with new K8s entity status handling and improved UI messages.

  • Behavior:
    • Update empty states for hosts and K8s tables to provide more accurate information in HostsEmptyOrIncorrectMetrics.tsx and EntityStatusEmptyStateWrapper.tsx.
    • Introduce getK8sEntityStatus in getK8sEntityStatus.ts to fetch K8s entity status.
    • Add useGetK8sEntityStatus hook in useGetK8sEntityStatus.ts to utilize the new API.
  • API and Hooks:
    • Add K8sEntityStatusResponse interface in getK8sEntityStatus.ts.
    • Add GET_K8S_ENTITY_STATUS to reactQueryKeys.ts.
  • UI Components:
    • Update HostsListTable.tsx and InfraMonitoringK8s.tsx to use new empty state logic.
    • Modify K8s list components (e.g., K8sClustersList.tsx, K8sDaemonSetsList.tsx) to integrate EntityStatusEmptyStateWrapper.
  • Misc:
    • Update styles in InfraMonitoringK8s.styles.scss for new empty state messages.

This description was created by Ellipsis for 69ef3fd. It will automatically update as commits are pushed.

@amlannandy amlannandy requested a review from YounixM as a code owner February 1, 2025 15:54
@CLAassistant
Copy link

CLAassistant commented Feb 1, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ amlannandy
❌ Amlan Kumar Nandy


Amlan Kumar Nandy seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot added the chore label Feb 1, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to d6e0c5d in 59 seconds

More details
  • Looked at 1925 lines of code in 18 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. frontend/src/hooks/infraMonitoring/useGetK8sEntityStatus.ts:25
  • Draft comment:
    The queryKey logic can be simplified by directly returning the default key if no custom key is provided. Consider using a ternary operator for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 20%
    The code in useGetK8sEntityStatus.ts is well-structured, but there's a minor improvement that can be made for clarity. The queryKey logic can be simplified by directly returning the default key if no custom key is provided.
2. frontend/src/api/infraMonitoring/getK8sEntityStatus.ts:41
  • Draft comment:
    Consider using the message from the response if available, instead of hardcoding 'Success'.
  • Reason this comment was not posted:
    Confidence changes required: 30%
    The PR introduces a new file getK8sEntityStatus.ts which fetches Kubernetes entity status. The error handling is done using ErrorResponseHandler, which is consistent with the existing codebase. However, the message field in the success response is hardcoded to 'Success', which might not always be accurate. It would be better to use the message from the response if available.
3. frontend/src/container/InfraMonitoringK8s/EntityStatusEmptyStateWrapper.tsx:114
  • Draft comment:
    Remove the console.log statement as it is unnecessary in production code.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The EntityStatusEmptyStateWrapper component is responsible for rendering different empty states based on the category and data. However, the console.log statement on line 114 is unnecessary and should be removed in production code.
4. frontend/src/container/InfraMonitoringHosts/HostsListTable.tsx:103
  • Draft comment:
    Remove the commented-out Skeleton.Input section as it is not used in the current implementation.
  • Reason this comment was not posted:
    Confidence changes required: 20%
    The HostsListTable.tsx file has a commented-out section for loading state using Skeleton.Input. This is not used in the current implementation and should be removed to keep the code clean.
5. frontend/src/container/InfraMonitoringK8s/Jobs/K8sJobsList.tsx:460
  • Draft comment:
    Avoid using inline styles in React components. Instead, use external stylesheets, CSS classes, or styled components. This issue is also present in other files like K8sNamespacesList.tsx, K8sNodesList.tsx, K8sPodLists.tsx, K8sStatefulSetsList.tsx, and K8sVolumesList.tsx.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_VcEklHBBjeANfFcb


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

<Typography.Text className="no-filtered-hosts-message">
This query had no results. Edit your query and try again!
</Typography.Text>
<EntityStatusEmptyStateWrapper
Copy link
Member Author

Choose a reason for hiding this comment

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

Haven't really made any huge changes here or in any of the listing pages. Only added the EntityStatusEmptyStateWrapper around the table component everywhere, due to which the padding shifted. The changes are not as big as the lines of code suggest.

@amlannandy amlannandy force-pushed the chore/k8s-list-empty-state branch from d6e0c5d to 5114c14 Compare February 1, 2025 15:55
Partial metrics detected. The following metrics from the kubelet metrics are
not received. They help monitor the resource utilisation to their
requests/limits. Learn more{' '}
<Typography.Link href="placeholder">here</Typography.Link> about how to send
Copy link
Member Author

Choose a reason for hiding this comment

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

Waiting to get the links for a couple of places here. Will update these before merging.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 69ef3fd in 25 seconds

More details
  • Looked at 67 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/src/container/InfraMonitoringK8s/EntityStatusEmptyStateWrapper.tsx:59
  • Draft comment:
    The href attribute is set to "placeholder". Ensure to replace it with the actual documentation link before merging.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. frontend/src/container/InfraMonitoringK8s/EntityStatusEmptyStateWrapper.tsx:55
  • Draft comment:
    Avoid using inline styles for the image and text components. Use external stylesheets, CSS classes, or styled components instead. This applies to the image on line 177 and the text on line 183.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_YgRAl1gdsKu50UVE


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@srikanthccv srikanthccv self-assigned this Feb 3, 2025
@srikanthccv
Copy link
Member

@amlannandy, I assigned this to myself and will update the placeholder links when the docs PR is merged.

@amlannandy
Copy link
Member Author

@amlannandy, I assigned this to myself and will update the placeholder links when the docs PR is merged.

Got it 👍🏻

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