<commit_before>import React from 'react'
import PropTypes from 'prop-types'

import { Icon } from 'semantic-ui-react'
import Modal from 'shared/components/modal/Modal'

const ShowPhenotipsModalButton = ({ individual, isViewOnly, modalId }) => (
  <Modal
    modalName={`Phenotips-${individual.individualGuid}-${isViewOnly ? 'view' : 'edit'}-${modalId || ''}`}
    title={`PhenoTips: ${individual.displayName}`}
    size="large"
    trigger={
      <div style={{ display: 'inline-block' }}>
        <a role="button" tabIndex="0" style={{ cursor: 'pointer' }} >
          {
            isViewOnly ?
              <Icon name="file pdf outline" title="PhenoTips PDF" />
              : <Icon name="write" size="small" title="Edit in PhenoTips" />
          }
        </a>
      </div>
    }
  >
    <iframe
      frameBorder={0}
      width="100%"
      height="750px"
      src={`/api/project/${individual.projectGuid}/individual/${individual.individualGuid}/phenotips_${isViewOnly ? 'pdf' : 'edit'}`}
    />
  </Modal>
)

ShowPhenotipsModalButton.propTypes = {
  individual: PropTypes.object.isRequired,
  isViewOnly: PropTypes.bool.isRequired,
  modalId: PropTypes.string,
}

export default ShowPhenotipsModalButton
<commit_msg>show phenotips updates after edit<commit_after>import React from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import { Icon } from 'semantic-ui-react'

import Modal from 'shared/components/modal/Modal'
import { updateIndividual } from 'redux/rootReducer'

const ShowPhenotipsModalButton = ({ individual, isViewOnly, modalId, handleEditClose }) => (
  <Modal
    modalName={`Phenotips-${individual.individualGuid}-${isViewOnly ? 'view' : 'edit'}-${modalId || ''}`}
    title={`PhenoTips: ${individual.displayName}`}
    size="large"
    handleClose={isViewOnly ? null : handleEditClose}
    trigger={
      <div style={{ display: 'inline-block' }}>
        <a role="button" tabIndex="0" style={{ cursor: 'pointer' }} >
          {
            isViewOnly ?
              <Icon name="file pdf outline" title="PhenoTips PDF" />
              : <Icon name="write" size="small" title="Edit in PhenoTips" />
          }
        </a>
      </div>
    }
  >
    <iframe
      frameBorder={0}
      width="100%"
      height="750px"
      src={`/api/project/${individual.projectGuid}/individual/${individual.individualGuid}/phenotips_${isViewOnly ? 'pdf' : 'edit'}`}
    />
  </Modal>
)

ShowPhenotipsModalButton.propTypes = {
  individual: PropTypes.object.isRequired,
  isViewOnly: PropTypes.bool.isRequired,
  modalId: PropTypes.string,
  handleEditClose: PropTypes.func,

}


const mapDispatchToProps = (dispatch, ownProps) => {
  return {
    handleEditClose: () => {
      dispatch(updateIndividual(ownProps.individual))
    },
  }
}

export default connect(null, mapDispatchToProps)(ShowPhenotipsModalButton)

{'fraction_non_alphanumeric': 0.15092366678285116, 'fraction_numerical': 0.0055768560474032764, 'mean_word_length': 3.401840490797546, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, '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': '5104721', 'n_tokens_mistral': 949, 'n_tokens_neox': 917, 'n_words': 170}