2019-07-07 11:18:12 +05:30
|
|
|
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',
|
2021-04-17 20:07:23 +05:30
|
|
|
CREATED: 'created',
|
2019-07-07 11:18:12 +05:30
|
|
|
STARTED: 'started',
|
|
|
|
NONE: 'none',
|
|
|
|
SCHEDULING: 'scheduling',
|
2021-04-29 21:17:54 +05:30
|
|
|
CANCELLED: 'cancelled',
|
|
|
|
};
|
|
|
|
|
|
|
|
const SCHEDULED_STATUS = {
|
|
|
|
icon: 'status-scheduled',
|
|
|
|
text: __('Pending'),
|
|
|
|
iconClass: 'gl-text-orange-400',
|
2019-07-07 11:18:12 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
const STATUS_MAP = {
|
2021-04-29 21:17:54 +05:30
|
|
|
[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',
|
|
|
|
},
|
2019-07-07 11:18:12 +05:30
|
|
|
[STATUSES.FINISHED]: {
|
2021-04-29 21:17:54 +05:30
|
|
|
icon: 'status-success',
|
|
|
|
text: __('Complete'),
|
|
|
|
iconClass: 'gl-text-green-400',
|
2019-07-07 11:18:12 +05:30
|
|
|
},
|
|
|
|
[STATUSES.FAILED]: {
|
2021-04-29 21:17:54 +05:30
|
|
|
icon: 'status-failed',
|
2019-07-07 11:18:12 +05:30
|
|
|
text: __('Failed'),
|
2021-04-29 21:17:54 +05:30
|
|
|
iconClass: 'gl-text-red-600',
|
2019-07-07 11:18:12 +05:30
|
|
|
},
|
2021-04-29 21:17:54 +05:30
|
|
|
[STATUSES.CANCELLED]: {
|
|
|
|
icon: 'status-stopped',
|
|
|
|
text: __('Cancelled'),
|
|
|
|
iconClass: 'gl-text-red-600',
|
2019-07-07 11:18:12 +05:30
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export default STATUS_MAP;
|