summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/import_projects/constants.js
blob: ad33ca158d2deb9bdbb380cc6c52301e09b46777 (plain)
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
import { __ } from '../locale';

// The `scheduling` status is only present on the client-side,
// it is used as the status when we are requesting to start an import.

export const STATUSES = {
  FINISHED: 'finished',
  FAILED: 'failed',
  SCHEDULED: 'scheduled',
  STARTED: 'started',
  NONE: 'none',
  SCHEDULING: 'scheduling',
};

const STATUS_MAP = {
  [STATUSES.FINISHED]: {
    icon: 'success',
    text: __('Done'),
    textClass: 'text-success',
  },
  [STATUSES.FAILED]: {
    icon: 'failed',
    text: __('Failed'),
    textClass: 'text-danger',
  },
  [STATUSES.SCHEDULED]: {
    icon: 'pending',
    text: __('Scheduled'),
    textClass: 'text-warning',
  },
  [STATUSES.STARTED]: {
    icon: 'running',
    text: __('Running…'),
    textClass: 'text-info',
  },
  [STATUSES.NONE]: {
    icon: 'created',
    text: __('Not started'),
    textClass: 'text-muted',
  },
  [STATUSES.SCHEDULING]: {
    loadingIcon: true,
    text: __('Scheduling'),
    textClass: 'text-warning',
  },
};

export default STATUS_MAP;