All files / app/assets/javascripts/jobs/components/table constants.js

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

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 88 89 90 91 92 93        7x 7x 7x         7x     7x     7x 7x 7x 7x 7x   7x 7x 7x     7x       7x         7x   7x                                                                                                       56x  
import { s__, __ } from '~/locale';
import { DEFAULT_TH_CLASSES } from '~/lib/utils/constants';
 
/* Error constants */
export const POST_FAILURE = 'post_failure';
export const DEFAULT = 'default';
export const RAW_TEXT_WARNING = s__(
  'Jobs|Raw text search is not currently supported for the jobs filtered search feature. Please use the available search tokens.',
);
 
/* Job Status Constants */
export const JOB_SCHEDULED = 'SCHEDULED';
 
/* Artifact file types */
export const FILE_TYPE_ARCHIVE = 'ARCHIVE';
 
/* i18n */
export const ACTIONS_DOWNLOAD_ARTIFACTS = __('Download artifacts');
export const ACTIONS_START_NOW = s__('DelayedJobs|Start now');
export const ACTIONS_UNSCHEDULE = s__('DelayedJobs|Unschedule');
export const ACTIONS_PLAY = __('Play');
export const ACTIONS_RETRY = __('Retry');
 
export const CANCEL = __('Cancel');
export const GENERIC_ERROR = __('An error occurred while making the request.');
export const PLAY_JOB_CONFIRMATION_MESSAGE = s__(
  `DelayedJobs|Are you sure you want to run %{job_name} immediately? This job will run automatically after its timer finishes.`,
);
export const RUN_JOB_NOW_HEADER_TITLE = s__('DelayedJobs|Run the delayed job now?');
 
/* Table constants */
 
const defaultTableClasses = {
  tdClass: 'gl-p-5!',
  thClass: DEFAULT_TH_CLASSES,
};
// eslint-disable-next-line @gitlab/require-i18n-strings
const coverageTdClasses = `${defaultTableClasses.tdClass} gl-display-none! gl-lg-display-table-cell!`;
 
export const DEFAULT_FIELDS = [
  {
    key: 'status',
    label: __('Status'),
    ...defaultTableClasses,
    columnClass: 'gl-w-10p',
  },
  {
    key: 'job',
    label: __('Job'),
    ...defaultTableClasses,
    columnClass: 'gl-w-20p',
  },
  {
    key: 'pipeline',
    label: __('Pipeline'),
    ...defaultTableClasses,
    columnClass: 'gl-w-10p',
  },
  {
    key: 'stage',
    label: __('Stage'),
    ...defaultTableClasses,
    columnClass: 'gl-w-10p',
  },
  {
    key: 'name',
    label: __('Name'),
    ...defaultTableClasses,
    columnClass: 'gl-w-15p',
  },
  {
    key: 'duration',
    label: __('Duration'),
    ...defaultTableClasses,
    columnClass: 'gl-w-15p',
  },
  {
    key: 'coverage',
    label: __('Coverage'),
    tdClass: coverageTdClasses,
    thClass: defaultTableClasses.thClass,
    columnClass: 'gl-w-10p',
  },
  {
    key: 'actions',
    label: '',
    ...defaultTableClasses,
    columnClass: 'gl-w-10p',
  },
];
 
export const JOBS_TAB_FIELDS = DEFAULT_FIELDS.filter((field) => field.key !== 'pipeline');