<commit_before>import { Component, PropTypes } from "react";
import { connect } from "react-apollo";
import gql from "graphql-tag";

import { nav, give as giveActions } from "../../../../store";
import Loading from "../../../../components/loading";

import Layout from "./Layout";

// XXX remove cache: false once we feel good about caching
const mapQueriesToProps = () => ({
  data: {
    forceFetch: true,
    query: gql`
      query PaymentDetails {
        accounts: savedPayments(cache: false) {
          id: entityId
          name
          payment {
            id
            accountNumber
            paymentType
          }
        }
      }
    `,
  },
});
const defaultAccounts = [];
@connect({ mapQueriesToProps })
export default class GiveNow extends Component {

  state = { accounts: [] }

  componentWillMount() {
    this.props.dispatch(nav.setLevel("BASIC_CONTENT"));
  }

  componentWillUnmount() {
    this.props.dispatch(nav.setLevel("TOP"));
  }

  componentWillReceiveProps(nextProps) {
    if (this.props.data.loading && !nextProps.data.loading) {
      this.setState({ accounts: nextProps.data.accounts });
    }
  }


  remove = (e) => {
    e.preventDefault();
    const { id } = e.target;

    const accounts = this.state.accounts.filter(x => x.id != id);

    this.setState({ accounts });
    Meteor.call("PaymentAccounts.remove", id, (err, response) => {
      // XXX mutation
      this.props.data.refetch(); // clear out data store for newly missing account
    });
  }

  render() {
    const { accounts } = this.state;
    return <Layout loading={this.props.data.loading} details={accounts} remove={this.remove} />;
  }
}
<commit_msg>linte settings pyaments index<commit_after>import { Component, PropTypes } from "react";
import { connect } from "react-apollo";
import gql from "graphql-tag";

import { nav } from "../../../../store";

import Layout from "./Layout";

// XXX remove cache: false once we feel good about caching
const mapQueriesToProps = () => ({
  data: {
    forceFetch: true,
    query: gql`
      query PaymentDetails {
        accounts: savedPayments(cache: false) {
          id: entityId
          name
          payment {
            id
            accountNumber
            paymentType
          }
        }
      }
    `,
  },
});
@connect({ mapQueriesToProps })
export default class GiveNow extends Component {

  static propTypes = {
    dispatch: PropTypes.function.isRequired,
    data: {
      loading: PropTypes.boolean.isRequired,
      refetch: PropTypes.function.isRequired,
    },
  }

  state = { accounts: [] }

  componentWillMount() {
    this.props.dispatch(nav.setLevel("BASIC_CONTENT"));
  }

  componentWillReceiveProps(nextProps) {
    if (this.props.data.loading && !nextProps.data.loading) {
      this.setState({ accounts: nextProps.data.accounts });
    }
  }

  componentWillUnmount() {
    this.props.dispatch(nav.setLevel("TOP"));
  }

  remove = (e) => {
    e.preventDefault();
    const { id } = e.target;

    const accounts = this.state.accounts.filter(x => x.id !== id);

    this.setState({ accounts });
    Meteor.call("PaymentAccounts.remove", id, () => {
      // XXX mutation
      this.props.data.refetch(); // clear out data store for newly missing account
    });
  }

  render() {
    const { accounts } = this.state;
    return <Layout loading={this.props.data.loading} details={accounts} remove={this.remove} />;
  }
}

{'fraction_non_alphanumeric': 0.14423357664233577, 'fraction_numerical': 0.0, 'mean_word_length': 2.5724713242961417, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '522103', 'n_tokens_mistral': 1027, 'n_tokens_neox': 1011, 'n_words': 235}