<commit_before>import React, { Component } from 'react'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { Table, Button } from 'reactstrap'
import { fetchUsers } from '../../modules/user'
import moment from 'moment'
import LoadingSection from '../Components/LoadingSection'

class UserList extends Component {
  state = { needRefresh: false }

  componentDidMount() {
    this.props.fetchUsers()
  }

  componentDidUpdate() {
    if (this.state.needRefresh) {
      this.props.fetchUsers()
      this.setState({ needRefresh: false })
    }
  }

  renderUsers() {
    const isDetailed = this.props.detailed === 'true' ? {} : { display: 'none' }

    return (
      <div className="users">
        <Table className="table bp-table">
          <thead>
            <tr>
              <th>Username</th>
              <th>Name</th>
              <th>Created at</th>
              <th>Last Logon</th>
              <th>Actions</th>
            </tr>
          </thead>
          <tbody>
            {this.props.users &&
              this.props.users.map(user => {
                if (this.props.ignoreUsers && this.props.ignoreUsers.indexOf(user.id) !== -1) {
                  return null
                }

                return (
                  <tr key={user.id}>
                    <td>{user.username}</td>
                    <td className="table-cell--ellipsis">
                      {user.firstname}&nbsp;{user.lastname}
                    </td>
                    <td style={isDetailed}>{moment(user.created_at).format('lll')}</td>
                    <td style={isDetailed}>{user.last_logon ? moment(user.last_logon).fromNow() : 'never'}</td>
                    <td>
                      {this.props.actions.map((action, idx) => {
                        return (
                          <Button
                            color={action.type ? action.type : 'link'}
                            size="sm"
                            key={idx}
                            onClick={() => {
                              action.onClick(user)
<commit_msg>fix user table in add user modal<commit_after>import React, { Component } from 'react'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { Table, Button } from 'reactstrap'
import { fetchUsers } from '../../modules/user'
import moment from 'moment'
import LoadingSection from '../Components/LoadingSection'

class UserList extends Component {
  state = { needRefresh: false }

  componentDidMount() {
    this.props.fetchUsers()
  }

  componentDidUpdate() {
    if (this.state.needRefresh) {
      this.props.fetchUsers()
      this.setState({ needRefresh: false })
    }
  }

  renderUsers() {
    const isDetailed = this.props.detailed === 'true' ? {} : { display: 'none' }

    return (
      <div className="users">
        <Table className="table bp-table">
          <thead>
            <tr>
              <th>Username</th>
              <th>Name</th>
              <th style={isDetailed}>Created at</th>
              <th style={isDetailed}>Last Logon</th>
              <th>Actions</th>
            </tr>
          </thead>
          <tbody>
            {this.props.users &&
              this.props.users.map(user => {
                if (this.props.ignoreUsers && this.props.ignoreUsers.indexOf(user.id) !== -1) {
                  return null
                }

                return (
                  <tr key={user.id}>
                    <td>{user.username}</td>
                    <td className="table-cell--ellipsis">
                      {user.firstname}&nbsp;{user.lastname}
                    </td>
                    <td style={isDetailed}>{moment(user.created_at).format('lll')}</td>
                    <td style={isDetailed}>{user.last_logon ? moment(user.last_logon).fromNow() : 'never'}</td>
                    <td>
                      {this.props.actions.map((action, idx) => {
                        return (
                          <Button
                            color={action.type ? action.type : 'link'}
                            size="sm"
                            key={idx}
                            onClick={() => {
                              action.onClick(user)

{'fraction_non_alphanumeric': 0.13539470602014522, 'fraction_numerical': 0.00046849379245724994, 'mean_word_length': 1.4441900400686891, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 63, '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': '5824124', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1140, 'n_words': 218}