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

Table: Fixes issues with phantom extra 0 for zero values #29165

Merged
merged 1 commit into from
Nov 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/grafana-ui/src/components/Table/DefaultCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const DefaultCell: FC<TableCellProps> = props => {
{value}
</a>
)}
{showFilters && cell.value && <FilterActions {...props} />}
{showFilters && cell.value !== undefined && <FilterActions {...props} />}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I read somewhere about React best practices that we should try to use ternaries instead.

Suggested change
{showFilters && cell.value !== undefined && <FilterActions {...props} />}
{showFilters && cell.value ? <FilterActions {...props} /> : null}

Choose a reason for hiding this comment

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

It will display 'false' as text if the condition is false, should be:

{showFilters && cell.value !== undefined ? <FilterActions {...props} /> : null}

</div>
);
};
Expand Down