<commit_before>import React, { Component } from 'react';
import FlybaseDataGrid from 'react-flybase-datagrid';

function getHeaders(){

  var columns = [
   {id:'do_name', name:'Disease Name'},
   {id:'associationType', name:'Association'},
   {id:'evidence', name:'Evidence Code'},
   {id:'dataProvider', name:'Association Source'},
   {id:'ref', name:'References'}
  ];
  return columns;
}

class DiseaseTable extends Component {
  constructor(props) {
    super(props);

    // var diseases = [
    //   {
    //     'associationType': 'contributes_to_condition',
    //     'dataProvider': 'ZFIN',
    //     'do_name': [
    //       'cardiomyopathy'
    //     ],
    //     'evidence': [
    //       {
    //         'evidenceCode': 'TAS',
    //         'pubs': [
    //           {
    //             'pubMedId': '27642634',
    //             'publicationModId': 'ZFIN:ZDB-PUB-160920-5'
    //           },
    //           {
    //             'pubMedId': '1233',
    //             'publicationModId': 'ZFIN:ZDB-PUB-170406-10'
    //           }
    //         ]
    //       }
    //     ],
    //   },
    //   {
    //     'associationType': 'contributes_to_condition',
    //     'dataProvider': 'flybase',
    //     'do_name': [
    //       'cancer'
    //     ],
    //     'evidence': [
    //       {
    //         'evidenceCode': 'TAS',
    //         'pubs': [
    //           {
    //             'pubMedId': '987654',
    //             'publicationModId': 'ZFIN:ZDB-PUB-160920-5'
    //           },
    //           {
    //             'pubMedId': '',
    //             'publicationModId': 'ZFIN:ZDB-PUB-170406-10'
    //           }
    //         ]
    //       }
    //     ],
    //   }
    // ];

  }

  render() {
    const diseases = this.props.data;

    var data = diseases.map((disease) => {
      const {
        associationType: associationType,
        dataProvider: dataProvider,
        do_id: do_id,
        do_name: do_name,
        evidence: [
          {
            evidenceCode: evidenceCode,
            pubs: [ ...pubs ]
          }
        ],
      } = disease;

      return {
        do_id : do_id,
        do_name : do_name,
        associationType: associationType,
        evidence: evidenceCode,
        dataProvider: dataProvider,
        ref: pubs.map((pub) => { return pub['pubMedId']; }).filter((pub) => { return (pub!=''); }).join()
      };
    });

    return (

       <FlybaseDataGrid
         columns={getHeaders()}
         data={data}
         showColumnFilter
         showDownloadButton
         width={1110}
       />

    );
  }
}

DiseaseTable.propTypes = {
  data: React.PropTypes.array.isRequired,
};

export default DiseaseTable;<commit_msg>fixes agr-391<commit_after>import React, { Component } from 'react';
import FlybaseDataGrid from 'react-flybase-datagrid';

function getHeaders(){

  var columns = [
   {id:'do_name', name:'Disease Name'},
   {id:'associationType', name:'Association'},
   {id:'evidence', name:'Evidence Code'},
   {id:'dataProvider', name:'Association Source'},
   {id:'ref', name:'References'}
  ];
  return columns;
}

class DiseaseTable extends Component {
  constructor(props) {
    super(props);

    // var diseases = [
    //   {
    //     'associationType': 'contributes_to_condition',
    //     'dataProvider': 'ZFIN',
    //     'do_name': [
    //       'cardiomyopathy'
    //     ],
    //     'evidence': [
    //       {
    //         'evidenceCode': 'TAS',
    //         'pubs': [
    //           {
    //             'pubMedId': '27642634',
    //             'publicationModId': 'ZFIN:ZDB-PUB-160920-5'
    //           },
    //           {
    //             'pubMedId': '1233',
    //             'publicationModId': 'ZFIN:ZDB-PUB-170406-10'
    //           }
    //         ]
    //       }
    //     ],
    //   },
    //   {
    //     'associationType': 'contributes_to_condition',
    //     'dataProvider': 'flybase',
    //     'do_name': [
    //       'cancer'
    //     ],
    //     'evidence': [
    //       {
    //         'evidenceCode': 'TAS',
    //         'pubs': [
    //           {
    //             'pubMedId': '987654',
    //             'publicationModId': 'ZFIN:ZDB-PUB-160920-5'
    //           },
    //           {
    //             'pubMedId': '',
    //             'publicationModId': 'ZFIN:ZDB-PUB-170406-10'
    //           }
    //         ]
    //       }
    //     ],
    //   }
    // ];

  }

  render() {
    const diseases = this.props.data;

    var data = diseases.map((disease) => {
      const {
        associationType: associationType,
        dataProvider: dataProvider,
        do_id: do_id,
        do_name: do_name,
        evidence: [
          {
            evidenceCode: evidenceCode,
            pubs: [ ...pubs ]
          }
        ],
      } = disease;

      return {
        do_id : do_id,
        do_name : do_name,
        associationType: associationType,
        evidence: evidenceCode,
        dataProvider: dataProvider,
        ref: pubs.map((pub) => { return pub['pubMedId']; }).filter((pub) => { return (pub!=undefined); }).join()
      };
    });

    return (

       <FlybaseDataGrid
         columns={getHeaders()}
         data={data}
         showColumnFilter
         downloadButton={['tsv']}
         width={1110}
       />

    );
  }
}

DiseaseTable.propTypes = {
  data: React.PropTypes.array.isRequired,
};

export default DiseaseTable;
{'fraction_non_alphanumeric': 0.1659036806445706, 'fraction_numerical': 0.01959348104742721, 'mean_word_length': 1.3655262018189693, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6631789', 'n_tokens_mistral': 1829, 'n_tokens_neox': 1721, 'n_words': 250}