Skip to content

Conversation

@ktx-vaidehi
Copy link
Collaborator

No description provided.

@github-actions github-actions bot added ☢️ Bug Something isn't working 🧹 Updates labels Sep 15, 2025
@ktx-vaidehi ktx-vaidehi changed the title fix: update table data validation logic in PanelSchemaRenderer fix: update table chart no data validation logic Sep 15, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR modifies the data validation logic for table panels in the PanelSchemaRenderer component. Previously, tables used the same validation logic as charts, which required both X and Y field aliases to have non-null values simultaneously using every() for strict validation. The change introduces table-specific logic that is more permissive:

  • Tables now return true if there's more than one data row
  • OR if there's exactly one row with at least one non-null value in either X or Y field aliases
  • Uses some() instead of every() for field validation
  • Separates X and Y field checks with OR logic instead of AND

This change addresses the core difference between chart and table data requirements. Charts typically need both X and Y values to render meaningful visualizations, but tables can display partial data usefully - they can show meaningful content even when some fields are null or when only X or Y fields have data. The modification prevents tables from incorrectly showing 'No Data' when they contain displayable information, making the validation logic more appropriate for tabular data presentation.

Confidence score: 4/5

  • This PR is safe to merge with low risk as it addresses a specific UI issue without affecting core functionality
  • Score reflects a targeted fix that improves user experience by making table data validation more appropriate for the use case
  • Pay close attention to the PanelSchemaRenderer.vue file to ensure the new validation logic works correctly across different table scenarios

1 file reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

Comment on lines 801 to 809
case "table": {
// For tables, simply check if there's any data in the array
return (
data.value[0]?.length > 1 ||
(data.value[0]?.length == 1 &&
xAlias.some((x: any) => data.value[0][0][x] != null)) ||
yAlias.some((y: any) => data.value[0][0][y] != null)
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: The validation logic change from every() to some() and AND to OR makes tables more permissive. Consider if this could cause tables to display when they shouldn't have meaningful data to show.

Comment on lines 806 to 807
xAlias.some((x: any) => data.value[0][0][x] != null)) ||
yAlias.some((y: any) => data.value[0][0][y] != null)
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The parentheses grouping suggests the OR condition for yAlias applies regardless of data array length. This might show data even when the first condition fails and xAlias check fails.

@ktx-vaidehi ktx-vaidehi force-pushed the fix/dashboard/table-no-data-rc9 branch from 93ce9de to 04558c4 Compare September 15, 2025 08:45
@ktx-vaidehi ktx-vaidehi changed the title fix: update table chart no data validation logic fix: update table chart no data logic Sep 15, 2025
@ktx-vaidehi ktx-vaidehi changed the title fix: update table chart no data logic fix: update table chart no data validation logic (#8422) Sep 15, 2025
@ktx-vaidehi ktx-vaidehi merged commit 65fa13b into branch-v0.14.6-rc9 Sep 15, 2025
82 of 86 checks passed
@ktx-vaidehi ktx-vaidehi deleted the fix/dashboard/table-no-data-rc9 branch September 15, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☢️ Bug Something isn't working 🧹 Updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants