All files / ee/app/assets/javascripts/group_member_contributions/components app.vue

100% Statements 9/9
100% Branches 2/2
100% Functions 5/5
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61  1x 1x   1x 1x                                 6x     1x     1x             1x           21x                                      
<script>
import { GlLoadingIcon } from '@gitlab/ui';
import COLUMNS from '../constants';
 
import TableBody from './table_body.vue';
import TableHeader from './table_header.vue';
 
export default {
  columns: COLUMNS,
  components: {
    TableHeader,
    TableBody,
    GlLoadingIcon,
  },
  props: {
    store: {
      type: Object,
      required: true,
    },
  },
  computed: {
    isLoading() {
      return this.store.isLoading;
    },
    members() {
      return this.store.members;
    },
    sortOrders() {
      return this.store.sortOrders;
    },
  },
  methods: {
    handleColumnClick(columnName) {
      // This is probably a false positive.
      // eslint-disable-next-line vue/no-mutating-props
      this.store.sortMembers(columnName);
    },
  },
};
</script>
 
<template>
  <div class="group-member-contributions-container">
    <h3>{{ __('Contributions per group member') }}</h3>
    <gl-loading-icon
      v-if="isLoading"
      :label="__('Loading contribution stats for group members')"
      size="md"
      class="loading-animation prepend-top-20 append-bottom-20"
    />
    <table v-else class="table gl-sortable">
      <table-header
        :columns="$options.columns"
        :sort-orders="sortOrders"
        @onColumnClick="handleColumnClick"
      />
      <table-body :rows="members" />
    </table>
  </div>
</template>