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

constants.js « environments « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dc9481a5429d5275e273af8cd96acf1aa5596801 (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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import { __, s__ } from '~/locale';
import { getDateInPast } from '~/lib/utils/datetime_utility';

// These statuses are based on how the backend defines pod phases here
// lib/gitlab/kubernetes/pod.rb

export const STATUS_MAP = {
  succeeded: {
    class: 'succeeded',
    text: __('Succeeded'),
    stable: true,
  },
  running: {
    class: 'running',
    text: __('Running'),
    stable: true,
  },
  failed: {
    class: 'failed',
    text: __('Failed'),
    stable: true,
  },
  pending: {
    class: 'pending',
    text: __('Pending'),
    stable: true,
  },
  unknown: {
    class: 'unknown',
    text: __('Unknown'),
    stable: true,
  },
};

export const CANARY_STATUS = {
  class: 'canary-icon',
  text: __('Canary'),
  stable: false,
};

export const CANARY_UPDATE_MODAL = 'confirm-canary-change';

export const ENVIRONMENTS_SCOPE = {
  AVAILABLE: 'available',
  STOPPED: 'stopped',
};

export const ENVIRONMENT_COUNT_BY_SCOPE = {
  [ENVIRONMENTS_SCOPE.AVAILABLE]: 'availableCount',
  [ENVIRONMENTS_SCOPE.STOPPED]: 'stoppedCount',
};

export const REVIEW_APP_MODAL_I18N = {
  title: s__('Environments|Enable Review Apps'),
  intro: s__(
    'EnableReviewApp|Review apps are dynamic environments that you can use to provide a live preview of changes made in a feature branch.',
  ),
  instructions: {
    title: s__('EnableReviewApp|To configure a dynamic review app, you must:'),
    step1: s__(
      'EnableReviewApp|Have access to infrastructure that can host and deploy the review apps.',
    ),
    step2: s__('EnableReviewApp|Install and configure a runner to do the deployment.'),
    step3: s__('EnableReviewApp|Add a job in your CI/CD configuration that:'),
    step3a: s__('EnableReviewApp|Only runs for feature branches or merge requests.'),
    step3b: s__(
      'EnableReviewApp|Uses a predefined CI/CD variable like %{codeStart}$(CI_COMMIT_REF_SLUG)%{codeEnd} to dynamically create the review app environments. For example, for a configuration using merge request pipelines:',
    ),
    step4: s__('EnableReviewApp|Recommended: Set up a job that manually stops the Review Apps.'),
  },
  staticSitePopover: {
    title: s__('EnableReviewApp|Using a static site?'),
    body: s__(
      'EnableReviewApp|Make sure your project has an environment configured with the target URL set to your website URL. If not, create a new one before continuing.',
    ),
  },
  learnMore: __('Learn more'),
  viewMoreExampleProjects: s__('EnableReviewApp|View more example projects'),
  copyToClipboardText: s__('EnableReviewApp|Copy snippet'),
};

export const MIN_STALE_ENVIRONMENT_DATE = getDateInPast(new Date(), 3650); // 10 years ago
export const MAX_STALE_ENVIRONMENT_DATE = getDateInPast(new Date(), 7); // one week ago

export const ENVIRONMENT_NEW_HELP_TEXT = __(
  'Environments allow you to track deployments of your application.%{linkStart} More information.%{linkEnd}',
);

export const ENVIRONMENT_EDIT_HELP_TEXT = ENVIRONMENT_NEW_HELP_TEXT;

export const SERVICES_LIMIT_PER_PAGE = 10;

export const CLUSTER_STATUS_HEALTHY_TEXT = s__('Environment|Healthy');
export const CLUSTER_STATUS_UNHEALTHY_TEXT = s__('Environment|Unhealthy');

export const HEALTH_BADGES = {
  success: {
    variant: 'success',
    text: CLUSTER_STATUS_HEALTHY_TEXT,
  },
  error: {
    variant: 'danger',
    text: CLUSTER_STATUS_UNHEALTHY_TEXT,
  },
};

export const PHASE_RUNNING = 'Running';
export const PHASE_PENDING = 'Pending';
export const PHASE_SUCCEEDED = 'Succeeded';
export const PHASE_FAILED = 'Failed';

const ERROR_UNAUTHORIZED = 'unauthorized';
const ERROR_FORBIDDEN = 'forbidden';
const ERROR_NOT_FOUND = 'not found';
const ERROR_OTHER = 'other';

export const CLUSTER_AGENT_ERROR_MESSAGES = {
  [ERROR_UNAUTHORIZED]: s__(
    'Environment|Unauthorized to access the cluster agent from this environment. Check your authentication and try again.',
  ),
  [ERROR_FORBIDDEN]: s__(
    'Environment|Forbidden to access the cluster agent from this environment.',
  ),
  [ERROR_NOT_FOUND]: s__('Environment|Cluster agent not found.'),
  [ERROR_OTHER]: s__('Environment|There was an error connecting to the cluster agent.'),
};