All files / ee/app/assets/javascripts/dependencies/store/modules/list constants.js

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

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      14x 14x 14x 14x   14x             14x           14x             14x 14x   14x             14x               14x         14x       14x       14x       14x 14x   14x       14x      
import { pick } from 'lodash';
import { __, s__ } from '~/locale';
 
export const SORT_FIELD_NAME = 'name';
export const SORT_FIELD_PACKAGER = 'packager';
export const SORT_FIELD_SEVERITY = 'severity';
export const SORT_FIELD_LICENSE = 'license';
 
const SORT_FIELDS = {
  [SORT_FIELD_NAME]: s__('Dependencies|Component name'),
  [SORT_FIELD_PACKAGER]: s__('Dependencies|Packager'),
  [SORT_FIELD_SEVERITY]: s__('Vulnerability|Severity'),
  [SORT_FIELD_LICENSE]: s__('Dependencies|License'),
};
 
export const SORT_FIELDS_PROJECT = pick(SORT_FIELDS, [
  SORT_FIELD_NAME,
  SORT_FIELD_PACKAGER,
  SORT_FIELD_SEVERITY,
]);
 
export const SORT_FIELDS_GROUP = pick(SORT_FIELDS, [
  SORT_FIELD_NAME,
  SORT_FIELD_PACKAGER,
  SORT_FIELD_LICENSE,
  SORT_FIELD_SEVERITY,
]);
 
export const SORT_ASCENDING = 'asc';
export const SORT_DESCENDING = 'desc';
 
export const SORT_ORDERS = {
  [SORT_FIELD_NAME]: SORT_ASCENDING,
  [SORT_FIELD_PACKAGER]: SORT_ASCENDING,
  [SORT_FIELD_SEVERITY]: SORT_DESCENDING,
  [SORT_FIELD_LICENSE]: SORT_DESCENDING,
};
 
export const REPORT_STATUS = {
  ok: 'ok',
  jobNotSetUp: 'job_not_set_up',
  jobFailed: 'job_failed',
  noDependencies: 'no_dependencies',
  incomplete: 'no_dependency_files',
};
 
export const FILTER = {
  all: 'all',
  vulnerable: 'vulnerable',
};
 
export const FETCH_ERROR_MESSAGE = __(
  'Error fetching the dependency list. Please check your network connection and try again.',
);
 
export const FETCH_ERROR_MESSAGE_WITH_DETAILS = __(
  'Error fetching the dependency list: %{errorDetails}',
);
 
export const FETCH_EXPORT_ERROR_MESSAGE = s__(
  'Dependencies|Error exporting the dependency list. Please reload the page.',
);
 
export const DEPENDENCIES_FILENAME = 'dependencies.json';
export const DEPENDENCIES_CSV_FILENAME = 'dependencies.csv';
 
export const LICENSES_FETCH_ERROR_MESSAGE = s__(
  'Dependencies|There was a problem fetching the licenses for this group.',
);
 
export const VULNERABILITIES_FETCH_ERROR_MESSAGE = s__(
  'Dependencies|There was a problem fetching vulnerabilities.',
);