<commit_before><template>
    <table id="userSummary" class="summary">
        <thead>
        <tr>
            <th>Issues by User</th>
            <th>Type</th>
            <th>#</th>
            <th>SP</th>
            <th>Done</th>
        </tr>
        </thead>
        <tbody>
        <tr v-for="userEntry in userSummary" :key="userEntry.userId" :class="'user' + userEntry.userId">
            <td :title="userEntry.lastLogin">{{ userEntry.userName }}</td>

            <td>
                <div v-for="issuesByTracker in userEntry.issuesByTracker" :key="issuesByTracker.trackerName">
                    {{ issuesByTracker.trackerName }}
                </div>
            </td>

            <td>
                <div v-for="issuesByTracker in userEntry.issuesByTracker" :key="issuesByTracker.trackerName">
                    {{ issuesByTracker.issues.length }}
                </div>
            </td>

            <td>
                <div v-for="issuesByTracker in userEntry.issuesByTracker" :key="issuesByTracker.trackerName"
                     v-html="estimationFrom(issuesByTracker.issues)"></div>
            </td>

            <td>
                <div v-for="issuesByTracker in userEntry.issuesByTracker" :key="issuesByTracker.trackerName"
                     v-html="doneRatioFrom(issuesByTracker.issues)"></div>
            </td>
        </tr>
        </tbody>
        <tfoot>
        <tr>
            <th>Total</th>
            <th></th>
            <th>{{ issuesLength }}</th>
            <th v-html="estimationFrom(issues)"></th>
            <th v-html="doneRatioFrom(issues)"></th>
        </tr>
        </tfoot>
    </table>
</template>

<style scoped>

</style>

<script>
  import { leftOfEstimationFrom, doneRatioFrom, estimationFrom} from '../helpers';

  export default {
    name: 'UserSummary',
    props: ['issues', 'users'],
    computed: {
      userSummary () {
        if (!Object.keys(this.users).length) {
          console.log('Waiting for users')
          return {}
        }

        let data = {}

        for (let index in this.issues) {
          if (this.issues.hasOwnProperty(index)) {
            let issue = this.issues[index]
            let dataKey = issue.assigned_to ? issue.assigned_to.id : -1

            if (!data.hasOwnProperty(dataKey)) {
              data[dataKey] = {
                userId: issue.assigned_to ? issue.assigned_to.id : -1,
                userName: dataKey > -1 ? this.users[issue.assigned_to.id].login : '- unassigned -',
                issuesByTracker: {}
              }
            }

            if (!data[dataKey].issuesByTracker.hasOwnProperty(issue.tracker.id)) {
              data[dataKey].issuesByTracker[issue.tracker.id] = {
                trackerId: issue.tracker.id,
                trackerName: issue.tracker.name,<commit_msg>Respect new displayName user property in UserSummary component.<commit_after><template>
    <table id="userSummary" class="summary">
        <thead>
        <tr>
            <th>Issues by User</th>
            <th>Type</th>
            <th>#</th>
            <th>SP</th>
            <th>Done</th>
        </tr>
        </thead>
        <tbody>
        <tr v-for="userEntry in userSummary" :key="userEntry.userId" :class="'user' + userEntry.userId">
            <td :title="userEntry.lastLogin">
                {{ userEntry.displayName }}
            </td>

            <td>
                <div v-for="issuesByTracker in userEntry.issuesByTracker" :key="issuesByTracker.trackerName">
                    {{ issuesByTracker.trackerName }}
                </div>
            </td>

            <td>
                <div v-for="issuesByTracker in userEntry.issuesByTracker" :key="issuesByTracker.trackerName">
                    {{ issuesByTracker.issues.length }}
                </div>
            </td>

            <td>
                <div v-for="issuesByTracker in userEntry.issuesByTracker" :key="issuesByTracker.trackerName"
                     v-html="estimationFrom(issuesByTracker.issues)"></div>
            </td>

            <td>
                <div v-for="issuesByTracker in userEntry.issuesByTracker" :key="issuesByTracker.trackerName"
                     v-html="doneRatioFrom(issuesByTracker.issues)"></div>
            </td>
        </tr>
        </tbody>
        <tfoot>
        <tr>
            <th>Total</th>
            <th></th>
            <th>{{ issuesLength }}</th>
            <th v-html="estimationFrom(issues)"></th>
            <th v-html="doneRatioFrom(issues)"></th>
        </tr>
        </tfoot>
    </table>
</template>

<style scoped>

</style>

<script>
  import { leftOfEstimationFrom, doneRatioFrom, estimationFrom} from '../helpers';

  export default {
    name: 'UserSummary',
    props: ['issues', 'users'],
    computed: {
      userSummary () {
        if (!Object.keys(this.users).length) {
          console.log('Waiting for users')
          return {}
        }

        let data = {}

        for (let index in this.issues) {
          if (this.issues.hasOwnProperty(index)) {
            let issue = this.issues[index]
            let dataKey = issue.assigned_to ? issue.assigned_to.id : -1

            if (!data.hasOwnProperty(dataKey)) {
              data[dataKey] = {
                userId: issue.assigned_to ? issue.assigned_to.id : -1,
                displayName: dataKey > -1 ? this.users[issue.assigned_to.id].displayName : '- unassigned -',
                issuesByTracker: {}
              }
            }

            if (!data[dataKey].issuesByTracker.hasOwnProperty(issue.tracker.id)) {
              data[dataKey].issuesByTracker[issue.tracker.id] = {
                trackerId: issue.tracker.id,
                trackerName: issue.tracker.name,
{'fraction_non_alphanumeric': 0.13959567793656327, 'fraction_numerical': 0.0010456605088881143, 'mean_word_length': 1.6680613668061366, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 119, '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': '1185411', 'n_tokens_mistral': 1705, 'n_tokens_neox': 1663, 'n_words': 286}