-
Notifications
You must be signed in to change notification settings - Fork 715
fix: update table chart no data validation logic #8422
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
Greptile Summary
This PR fixes the no data validation logic for table charts in the dashboard PanelSchemaRenderer component. The change differentiates between table charts and other chart types (area, bar, line, scatter, gauge) by implementing more appropriate validation logic for each.
For table charts, the validation now uses some() instead of every() to check if there's any non-null data in either X or Y axis fields. This means tables will display data when at least one column has valid values, rather than requiring all columns to be non-null. The logic checks three conditions: if there's more than one row of data, or if there's a single row with at least one non-null X axis value, or at least one non-null Y axis value.
For other chart types (gauge is shown as an example), the validation continues to use every() which requires all specified axis fields to be non-null, as complete data points are necessary for meaningful chart visualizations.
This change addresses the fundamental difference in data requirements between tabular displays and graphical charts. Tables are designed to show structured data where empty cells are common and acceptable, while charts typically need complete coordinate pairs to render properly. The fix ensures that tables with partial data are displayed to users instead of showing an incorrect "No Data" message.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it improves user experience without breaking existing functionality
- Score reflects a logical and well-targeted fix that addresses a specific UI issue with clear reasoning and appropriate validation logic
- Pay close attention to the validation logic in PanelSchemaRenderer.vue to ensure the conditions cover all expected data scenarios
1 file reviewed, 1 comment
| 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) |
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.
syntax: Missing closing parenthesis - the yAlias.some() call is outside the main return condition
| yAlias.some((y: any) => data.value[0][0][y] != null) | |
| yAlias.some((y: any) => data.value[0][0][y] != null) | |
| ); |
75ae11f to
9b070ad
Compare
9b070ad to
ce7c5fb
Compare
Bug fix
___
- Fix table chart no-data validation
- Separate table logic from other charts
- Ensure presence check on x/y aliases
- Prevent false negatives with single row
___
```mermaid
flowchart LR
Renderer["PanelSchemaRenderer.vue"]
Charts["Non-table charts validation"]
Table["Table-specific validation"]
Metric["Metric validation (unchanged)"]
Renderer -- "refine validation" --> Charts
Renderer -- "add distinct logic" --> Table
Renderer -- "keep existing flow" --> Metric
```
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>PanelSchemaRenderer.vue</strong><dd><code>Refine table
chart data validation logic</code>
</dd></summary>
<hr>
web/src/components/dashboards/PanelSchemaRenderer.vue
<ul><li>Remove table from generic chart validation branch.<br> <li> Add
table-specific data presence checks.<br> <li> Allow single-row tables
with any x/y value.<br> <li> Keep gauge and others using stricter alias
checks.</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8422/files#diff-e5376e7e77bf3aaf6590c2522d8c2dbffcc95a8006ae0d6dc0040a37825367d6">+10/-2</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___
Bug fix
___
- Fix table chart no-data validation
- Separate table logic from other charts
- Ensure presence check on x/y aliases
- Prevent false negatives with single row
___
```mermaid
flowchart LR
Renderer["PanelSchemaRenderer.vue"]
Charts["Non-table charts validation"]
Table["Table-specific validation"]
Metric["Metric validation (unchanged)"]
Renderer -- "refine validation" --> Charts
Renderer -- "add distinct logic" --> Table
Renderer -- "keep existing flow" --> Metric
```
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>PanelSchemaRenderer.vue</strong><dd><code>Refine table
chart data validation logic</code>
</dd></summary>
<hr>
web/src/components/dashboards/PanelSchemaRenderer.vue
<ul><li>Remove table from generic chart validation branch.<br> <li> Add
table-specific data presence checks.<br> <li> Allow single-row tables
with any x/y value.<br> <li> Keep gauge and others using stricter alias
checks.</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8422/files#diff-e5376e7e77bf3aaf6590c2522d8c2dbffcc95a8006ae0d6dc0040a37825367d6">+10/-2</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___
PR Type
Bug fix
Description
Fix table chart no-data validation
Separate table logic from other charts
Ensure presence check on x/y aliases
Prevent false negatives with single row
Diagram Walkthrough
File Walkthrough
PanelSchemaRenderer.vue
Refine table chart data validation logicweb/src/components/dashboards/PanelSchemaRenderer.vue