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

constants.js « issues_list « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f6f23af80ba40ceb80baa7b5ccf0a49037b7b6ec (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
import { __ } from '~/locale';

// Maps sort order as it appears in the URL query to API `order_by` and `sort` params.
const PRIORITY = 'priority';
const ASC = 'asc';
const DESC = 'desc';
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
const DUE_DATE = 'due_date';
const MILESTONE_DUE = 'milestone_due';
const POPULARITY = 'popularity';
const WEIGHT = 'weight';
const LABEL_PRIORITY = 'label_priority';
export const RELATIVE_POSITION = 'relative_position';
export const LOADING_LIST_ITEMS_LENGTH = 8;
export const PAGE_SIZE = 20;
export const PAGE_SIZE_MANUAL = 100;

export const sortOrderMap = {
  priority: { order_by: PRIORITY, sort: ASC }, // asc and desc are flipped for some reason
  created_date: { order_by: CREATED_AT, sort: DESC },
  created_asc: { order_by: CREATED_AT, sort: ASC },
  updated_desc: { order_by: UPDATED_AT, sort: DESC },
  updated_asc: { order_by: UPDATED_AT, sort: ASC },
  milestone_due_desc: { order_by: MILESTONE_DUE, sort: DESC },
  milestone: { order_by: MILESTONE_DUE, sort: ASC },
  due_date_desc: { order_by: DUE_DATE, sort: DESC },
  due_date: { order_by: DUE_DATE, sort: ASC },
  popularity: { order_by: POPULARITY, sort: DESC },
  popularity_asc: { order_by: POPULARITY, sort: ASC },
  label_priority: { order_by: LABEL_PRIORITY, sort: ASC }, // asc and desc are flipped
  relative_position: { order_by: RELATIVE_POSITION, sort: ASC },
  weight_desc: { order_by: WEIGHT, sort: DESC },
  weight: { order_by: WEIGHT, sort: ASC },
};

export const availableSortOptionsJira = [
  {
    id: 1,
    title: __('Created date'),
    sortDirection: {
      descending: 'created_desc',
      ascending: 'created_asc',
    },
  },
  {
    id: 2,
    title: __('Last updated'),
    sortDirection: {
      descending: 'updated_desc',
      ascending: 'updated_asc',
    },
  },
];

export const JIRA_IMPORT_SUCCESS_ALERT_HIDE_MAP_KEY = 'jira-import-success-alert-hide-map';

export const BLOCKING_ISSUES_ASC = 'BLOCKING_ISSUES_ASC';
export const BLOCKING_ISSUES_DESC = 'BLOCKING_ISSUES_DESC';
export const CREATED_ASC = 'CREATED_ASC';
export const CREATED_DESC = 'CREATED_DESC';
export const DUE_DATE_ASC = 'DUE_DATE_ASC';
export const DUE_DATE_DESC = 'DUE_DATE_DESC';
export const LABEL_PRIORITY_ASC = 'LABEL_PRIORITY_ASC';
export const LABEL_PRIORITY_DESC = 'LABEL_PRIORITY_DESC';
export const MILESTONE_DUE_ASC = 'MILESTONE_DUE_ASC';
export const MILESTONE_DUE_DESC = 'MILESTONE_DUE_DESC';
export const POPULARITY_ASC = 'POPULARITY_ASC';
export const POPULARITY_DESC = 'POPULARITY_DESC';
export const PRIORITY_ASC = 'PRIORITY_ASC';
export const PRIORITY_DESC = 'PRIORITY_DESC';
export const RELATIVE_POSITION_ASC = 'RELATIVE_POSITION_ASC';
export const UPDATED_ASC = 'UPDATED_ASC';
export const UPDATED_DESC = 'UPDATED_DESC';
export const WEIGHT_ASC = 'WEIGHT_ASC';
export const WEIGHT_DESC = 'WEIGHT_DESC';

const SORT_ASC = 'asc';
const SORT_DESC = 'desc';

const BLOCKING_ISSUES = 'blocking_issues';

export const sortParams = {
  [PRIORITY_ASC]: {
    order_by: PRIORITY,
    sort: SORT_ASC,
  },
  [PRIORITY_DESC]: {
    order_by: PRIORITY,
    sort: SORT_DESC,
  },
  [CREATED_ASC]: {
    order_by: CREATED_AT,
    sort: SORT_ASC,
  },
  [CREATED_DESC]: {
    order_by: CREATED_AT,
    sort: SORT_DESC,
  },
  [UPDATED_ASC]: {
    order_by: UPDATED_AT,
    sort: SORT_ASC,
  },
  [UPDATED_DESC]: {
    order_by: UPDATED_AT,
    sort: SORT_DESC,
  },
  [MILESTONE_DUE_ASC]: {
    order_by: MILESTONE_DUE,
    sort: SORT_ASC,
  },
  [MILESTONE_DUE_DESC]: {
    order_by: MILESTONE_DUE,
    sort: SORT_DESC,
  },
  [DUE_DATE_ASC]: {
    order_by: DUE_DATE,
    sort: SORT_ASC,
  },
  [DUE_DATE_DESC]: {
    order_by: DUE_DATE,
    sort: SORT_DESC,
  },
  [POPULARITY_ASC]: {
    order_by: POPULARITY,
    sort: SORT_ASC,
  },
  [POPULARITY_DESC]: {
    order_by: POPULARITY,
    sort: SORT_DESC,
  },
  [LABEL_PRIORITY_ASC]: {
    order_by: LABEL_PRIORITY,
    sort: SORT_ASC,
  },
  [LABEL_PRIORITY_DESC]: {
    order_by: LABEL_PRIORITY,
    sort: SORT_DESC,
  },
  [RELATIVE_POSITION_ASC]: {
    order_by: RELATIVE_POSITION,
    per_page: 100,
    sort: SORT_ASC,
  },
  [WEIGHT_ASC]: {
    order_by: WEIGHT,
    sort: SORT_ASC,
  },
  [WEIGHT_DESC]: {
    order_by: WEIGHT,
    sort: SORT_DESC,
  },
  [BLOCKING_ISSUES_ASC]: {
    order_by: BLOCKING_ISSUES,
    sort: SORT_ASC,
  },
  [BLOCKING_ISSUES_DESC]: {
    order_by: BLOCKING_ISSUES,
    sort: SORT_DESC,
  },
};

export const sortOptions = [
  {
    id: 1,
    title: __('Priority'),
    sortDirection: {
      ascending: PRIORITY_ASC,
      descending: PRIORITY_DESC,
    },
  },
  {
    id: 2,
    title: __('Created date'),
    sortDirection: {
      ascending: CREATED_ASC,
      descending: CREATED_DESC,
    },
  },
  {
    id: 3,
    title: __('Last updated'),
    sortDirection: {
      ascending: UPDATED_ASC,
      descending: UPDATED_DESC,
    },
  },
  {
    id: 4,
    title: __('Milestone due date'),
    sortDirection: {
      ascending: MILESTONE_DUE_ASC,
      descending: MILESTONE_DUE_DESC,
    },
  },
  {
    id: 5,
    title: __('Due date'),
    sortDirection: {
      ascending: DUE_DATE_ASC,
      descending: DUE_DATE_DESC,
    },
  },
  {
    id: 6,
    title: __('Popularity'),
    sortDirection: {
      ascending: POPULARITY_ASC,
      descending: POPULARITY_DESC,
    },
  },
  {
    id: 7,
    title: __('Label priority'),
    sortDirection: {
      ascending: LABEL_PRIORITY_ASC,
      descending: LABEL_PRIORITY_DESC,
    },
  },
  {
    id: 8,
    title: __('Manual'),
    sortDirection: {
      ascending: RELATIVE_POSITION_ASC,
      descending: RELATIVE_POSITION_ASC,
    },
  },
  {
    id: 9,
    title: __('Weight'),
    sortDirection: {
      ascending: WEIGHT_ASC,
      descending: WEIGHT_DESC,
    },
  },
  {
    id: 10,
    title: __('Blocking'),
    sortDirection: {
      ascending: BLOCKING_ISSUES_ASC,
      descending: BLOCKING_ISSUES_DESC,
    },
  },
];