Welcome to mirror list, hosted at ThFree Co, Russian Federation.

constants.js « import_entities « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 156e92e2d00e69c008b7619c28d6f5f2eaed9c3a (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
49
50
51
52
53
54
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',
  CREATED: 'created',
  STARTED: 'started',
  NONE: 'none',
  SCHEDULING: 'scheduling',
  CANCELLED: 'cancelled',
};

const SCHEDULED_STATUS = {
  icon: 'status-scheduled',
  text: __('Pending'),
  iconClass: 'gl-text-orange-400',
};

const STATUS_MAP = {
  [STATUSES.NONE]: {
    icon: 'status-waiting',
    text: __('Not started'),
    iconClass: 'gl-text-gray-400',
  },
  [STATUSES.SCHEDULING]: SCHEDULED_STATUS,
  [STATUSES.SCHEDULED]: SCHEDULED_STATUS,
  [STATUSES.CREATED]: SCHEDULED_STATUS,
  [STATUSES.STARTED]: {
    icon: 'status-running',
    text: __('Importing...'),
    iconClass: 'gl-text-blue-400',
  },
  [STATUSES.FINISHED]: {
    icon: 'status-success',
    text: __('Complete'),
    iconClass: 'gl-text-green-400',
  },
  [STATUSES.FAILED]: {
    icon: 'status-failed',
    text: __('Failed'),
    iconClass: 'gl-text-red-600',
  },
  [STATUSES.CANCELLED]: {
    icon: 'status-stopped',
    text: __('Cancelled'),
    iconClass: 'gl-text-red-600',
  },
};

export default STATUS_MAP;