<commit_before>// @flow

import React, {Component} from 'react'
import { Row, Col, FormControl, Table, Button, Glyphicon, Tooltip, OverlayTrigger } from 'react-bootstrap'

import OptionButton from '../../common/components/OptionButton'
import GtfsPlusField from './GtfsPlusField'
import GtfsPlusFieldHeader from './GtfsPlusFieldHeader'

import type {Props as GtfsPlusEditorProps} from './GtfsPlusEditor'
import type {Entity, GtfsPlusTable as GtfsPlusTableType} from '../../types'

export type Props = GtfsPlusEditorProps & {
  getGtfsEntity: (string, string) => Entity,
  newRowsDisplayed: Array<any> => void,
  rows: Array<any>,
  showHelpClicked: (string, ?string) => void,
  table: GtfsPlusTableType,
  tableValidation: Array<any>
}

export const VISIBILITY = Object.freeze({
  ALL: 'all',
  VALIDATION: 'validation'
})

export default class GtfsPlusTable extends Component<Props> {
  componentDidMount () {
    this.props.newRowsDisplayed(this.props.rows)
  }

  componentDidUpdate () {
    this.props.newRowsDisplayed(this.props.rows)<commit_msg>refactor(gtfs-plus): add visibility filter comment<commit_after>// @flow

import React, {Component} from 'react'
import { Row, Col, FormControl, Table, Button, Glyphicon, Tooltip, OverlayTrigger } from 'react-bootstrap'

import OptionButton from '../../common/components/OptionButton'
import GtfsPlusField from './GtfsPlusField'
import GtfsPlusFieldHeader from './GtfsPlusFieldHeader'

import type {Props as GtfsPlusEditorProps} from './GtfsPlusEditor'
import type {Entity, GtfsPlusTable as GtfsPlusTableType} from '../../types'

export type Props = GtfsPlusEditorProps & {
  getGtfsEntity: (string, string) => Entity,
  newRowsDisplayed: Array<any> => void,
  rows: Array<any>,
  showHelpClicked: (string, ?string) => void,
  table: GtfsPlusTableType,
  tableValidation: Array<any>
}

// The values here are used to filter the visibility of 
// table rows to either all rows or just those with 
// validation issues.
export const VISIBILITY = Object.freeze({
  ALL: 'all',
  VALIDATION: 'validation'
})

export default class GtfsPlusTable extends Component<Props> {
  componentDidMount () {
    this.props.newRowsDisplayed(this.props.rows)
  }

  componentDidUpdate () {
    this.props.newRowsDisplayed(this.props.rows)
{'fraction_non_alphanumeric': 0.11668868339938353, 'fraction_numerical': 0.0, 'mean_word_length': 5.01058201058201, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4878981', 'n_tokens_mistral': 715, 'n_tokens_neox': 711, 'n_words': 193}