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

Conversation

dprokop
Copy link
Member

@dprokop dprokop commented Nov 17, 2020

Fixes #29108

@dprokop dprokop added area/panel/table backport A backport PR old backport v7.3.x Mark PR to be automatically backported to v7.3.x labels Nov 17, 2020
@dprokop dprokop added this to the 7.3.4 milestone Nov 17, 2020
@dprokop dprokop requested review from torkelo, hugohaggmark and a team November 17, 2020 16:40
@dprokop dprokop self-assigned this Nov 17, 2020
Copy link
Contributor

@hugohaggmark hugohaggmark left a comment

Choose a reason for hiding this comment

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

Looks great!

@@ -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}

@dprokop dprokop merged commit f28ba27 into master Nov 18, 2020
@dprokop dprokop deleted the fix29108 branch November 18, 2020 07:46
grafanabot pushed a commit that referenced this pull request Nov 18, 2020
dprokop added a commit that referenced this pull request Nov 18, 2020
…29181)

(cherry picked from commit f28ba27)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
@torkelo torkelo changed the title Table: Fix incorrect condtition for rendering table filter Table: Fix incorrect condition for rendering table filter Nov 24, 2020
@torkelo
Copy link
Member

torkelo commented Nov 27, 2020

This was a really poor title for changelog, explains not the user impact of the bugfix (phantom zeros for zero values). Need to remember PR titles matter :)

@torkelo torkelo changed the title Table: Fix incorrect condition for rendering table filter Table: Fixes issues with phantom extra 0 for zero values Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog area/panel/table backport A backport PR old backport v7.3.x Mark PR to be automatically backported to v7.3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elasticsearch phantom zero
4 participants