<commit_before>// @flow

import React, { Component } from 'react'
import { Col, ListGroup, Panel, Row, ListGroupItem, Badge } from 'react-bootstrap'

import type {FeedVersion} from '../../types'

type Props = {
  version: FeedVersion,
}

export default class TransformationsViewer extends Component<Props> {
  render () {
    const {
      version
    } = this.props

    if (version.feedTransformResult && version.feedTransformResult.tableTransformResults) {
      const {tableTransformResults} = version.feedTransformResult
      tableTransformResults[1] = {...tableTransformResults[0]}
      tableTransformResults[1].tableName = 'test'
      const transformContent = tableTransformResults.map(res => {
        const badge = res.transformType === 'TABLE_MODIFIED'
          ? <Badge>Table Modified</Badge>
          : res.transformType === 'TABLE_ADDED'
            ? <Badge>Table Added</Badge>
            : res.transformType === 'TABLE_REPLACED'
              ? <Badge>Table Replaced</Badge>
              : res.transformType === 'TABLE_DELETED'
                ? <Badge>Table Deleted</Badge>
                : null
        return (
          <ListGroupItem key={res.tableName}>
            <div>
              <h4 style={{marginTop: '5px'}}>{res.tableName} {badge}</h4><commit_msg>refactor(TransformationsViewer): remove some testing code<commit_after>// @flow

import React, { Component } from 'react'
import { Col, ListGroup, Panel, Row, ListGroupItem, Badge } from 'react-bootstrap'

import type {FeedVersion} from '../../types'

type Props = {
  version: FeedVersion,
}

export default class TransformationsViewer extends Component<Props> {
  render () {
    const {
      version
    } = this.props

    if (version.feedTransformResult && version.feedTransformResult.tableTransformResults) {
      const {tableTransformResults} = version.feedTransformResult
      const transformContent = tableTransformResults.map(res => {
        const badge = res.transformType === 'TABLE_MODIFIED'
          ? <Badge>Table Modified</Badge>
          : res.transformType === 'TABLE_ADDED'
            ? <Badge>Table Added</Badge>
            : res.transformType === 'TABLE_REPLACED'
              ? <Badge>Table Replaced</Badge>
              : res.transformType === 'TABLE_DELETED'
                ? <Badge>Table Deleted</Badge>
                : null
        return (
          <ListGroupItem key={res.tableName}>
            <div>
              <h4 style={{marginTop: '5px'}}>{res.tableName} {badge}</h4>
{'fraction_non_alphanumeric': 0.12265281662005593, 'fraction_numerical': 0.003595685177786656, 'mean_word_length': 2.70962962962963, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, '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': '1554113', 'n_tokens_mistral': 720, 'n_tokens_neox': 705, 'n_words': 149}