Skip to content

Commit

Permalink
fix: Hide fields button
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan committed Oct 8, 2019
1 parent 5b1520a commit 9659a36
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion messages/ReportView/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"ReportView.HideFieldsButton.hideFieldsLabel": {
"description": "Button label for hide fields menu",
"message": "{count, plural, =0 {Hide Fields} one {# Hidden Field} other {# Hidden Fields}}"
"message": "{count} Hidden Fields"
},
"ReportView.HideFieldsButton.showAll": {
"description": "Show all fields in report view",
Expand Down
2 changes: 1 addition & 1 deletion messages/ReportView/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"ReportView.HideFieldsButton.hideFieldsLabel": {
"description": "Button label for hide fields menu",
"message": "{count, plural, =0 {Esconder campos} one {# Campo escondido} other {# Campos escondidos}}"
"message": "{count} Campos Escondidos"
},
"ReportView.HideFieldsButton.showAll": {
"description": "Show all fields in report view",
Expand Down
7 changes: 2 additions & 5 deletions src/ReportView/HideFieldsButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ import ToolbarButton from '../internal/ToolbarButton'
import type { FieldState } from '../types'
const msgs = defineMessages({
// Button label for hide fields menu
hideFieldsLabel: `{count, plural,
=0 {Hide Fields}
one {# Hidden Field}
other {# Hidden Fields}
}`,
hideFieldsLabel: `{count} Hidden Fields`,
// Show all fields in report view
showAll: 'Show All',
// Hide all fields in report view
Expand Down Expand Up @@ -83,6 +79,7 @@ const HideFieldsButton = ({ fieldState, onFieldStateUpdate }: Props) => {
const open = Boolean(anchorEl)

const hiddenCount = fieldState.filter(f => f.hidden).length
console.log('hiddenCount', hiddenCount)
return (
<React.Fragment>
<ToolbarButton onClick={handleClick}>
Expand Down

0 comments on commit 9659a36

Please sign in to comment.