All files / ee/app/assets/javascripts/analytics/productivity_analytics constants.js

100% Statements 12/12
100% Branches 0/0
100% Functions 0/0
100% Lines 12/12

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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87    13x             13x         13x                                                                           13x                         13x         13x 13x           13x       13x   13x 13x 13x  
import { __, s__ } from '~/locale';
 
export const chartKeys = {
  main: 'main',
  timeBasedHistogram: 'timeBasedHistogram',
  commitBasedHistogram: 'commitBasedHistogram',
  scatterplot: 'scatterplot',
};
 
export const chartTypes = {
  histogram: 'histogram',
  scatterplot: 'scatterplot',
};
 
export const metricTypes = [
  {
    key: 'days_to_merge',
    label: __('Days to merge'),
    charts: [chartKeys.scatterplot],
  },
  {
    key: 'time_to_first_comment',
    label: __('Time from first commit until first comment'),
    charts: [chartKeys.timeBasedHistogram, chartKeys.scatterplot],
  },
  {
    key: 'time_to_last_commit',
    label: __('Time from first comment to last commit'),
    charts: [chartKeys.timeBasedHistogram, chartKeys.scatterplot],
  },
  {
    key: 'time_to_merge',
    label: __('Time from last commit to merge'),
    charts: [chartKeys.timeBasedHistogram, chartKeys.scatterplot],
  },
  {
    key: 'commits_count',
    label: __('Number of commits per MR'),
    charts: [chartKeys.commitBasedHistogram, chartKeys.scatterplot],
  },
  {
    key: 'loc_per_commit',
    label: __('Number of LOCs per commit'),
    charts: [chartKeys.commitBasedHistogram, chartKeys.scatterplot],
  },
  {
    key: 'files_touched',
    label: __('Number of files touched'),
    charts: [chartKeys.commitBasedHistogram, chartKeys.scatterplot],
  },
];
 
export const tableSortOrder = {
  asc: {
    title: s__('ProductivityAnalytics|Ascending'),
    value: 'asc',
    icon: 'sort-lowest',
  },
  desc: {
    title: s__('ProductivityAnalytics|Descending'),
    value: 'desc',
    icon: 'sort-highest',
  },
};
 
export const daysToMergeMetric = {
  key: 'days_to_merge',
  label: s__('ProductivityAnalytics|Days to merge'),
};
 
export const defaultMaxColumnChartItemsPerPage = 20;
export const maxColumnChartItemsPerPage = {
  [chartKeys.main]: 40,
};
/**
 * #418cd8 --> $blue-400 (see variables.scss)
 */
export const columnHighlightStyle = { color: '#418cd8', opacity: 0.8 };
 
// The number of days which will be to the state's daysInPast
// This is required to query historical data from the API to draw a 30 days rolling median line
export const scatterPlotAddonQueryDays = 30;
 
export const accessLevelReporter = 20;
export const projectsPerPage = 50;
export const defaultDaysInPast = 30;