<commit_before>import React from 'react';
import reactMixin from 'react-mixin';
import autoBind from 'react-autobind';
import Reflux from 'reflux';
import {actions} from 'js/actions';
import assetStore from 'js/assetStore';
import bem from 'js/bem';

export default class FormJson extends React.Component {
  constructor(props) {
    super(props);
    this.state = {assetContent: false};
    autoBind(this);
  }

  componentDidMount() {
    this.listenTo(assetStore, this.assetStoreTriggered);
    const uid = this.props.params.assetid || this.props.params.uid;
    actions.resources.loadAsset({id: uid});
  }

  assetStoreTriggered(data, uid) {
    this.setState({assetContent: data[uid].content});
  }

  render() {
    let content = null;
    if (this.state.assetContent) {
      content = JSON.stringify(this.state.assetContent, null, 4);
    }

    return (
      <bem.uiPanel>
        <bem.uiPanel__body>
          <bem.FormView>
            <pre>
              <code>
                {content}
              </code><commit_msg>fixes formJson view<commit_after>import React from 'react';
import reactMixin from 'react-mixin';
import autoBind from 'react-autobind';
import Reflux from 'reflux';
import {actions} from 'js/actions';
import assetStore from 'js/assetStore';
import bem from 'js/bem';

export default class FormJson extends React.Component {
  constructor(props) {
    super(props);
    this.state = {assetContent: false};
    autoBind(this);
  }

  componentDidMount() {
    this.listenTo(assetStore, this.assetStoreTriggered);
    const uid = this.props.params.assetid || this.props.params.uid;
    actions.resources.loadAsset({id: uid});
  }

  assetStoreTriggered(response) {
    const { content } = Object.values(response)[0];
    this.setState({assetContent: content});
  }

  render() {
    let content = null;
    if (this.state.assetContent) {
      content = JSON.stringify(this.state.assetContent, null, 4);
    }

    return (
      <bem.uiPanel>
        <bem.uiPanel__body>
          <bem.FormView>
            <pre>
              <code>
                {content}
              </code>
{'fraction_non_alphanumeric': 0.12624113475177304, 'fraction_numerical': 0.0014184397163120568, 'mean_word_length': 2.933085501858736, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '5915274', 'n_tokens_mistral': 663, 'n_tokens_neox': 652, 'n_words': 145}