diff options
Diffstat (limited to 'app/assets/javascripts/issues_list/constants.js')
-rw-r--r-- | app/assets/javascripts/issues_list/constants.js | 188 |
1 files changed, 188 insertions, 0 deletions
diff --git a/app/assets/javascripts/issues_list/constants.js b/app/assets/javascripts/issues_list/constants.js index f008ba1bf4a..f6f23af80ba 100644 --- a/app/assets/javascripts/issues_list/constants.js +++ b/app/assets/javascripts/issues_list/constants.js @@ -54,3 +54,191 @@ export const availableSortOptionsJira = [ ]; 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, + }, + }, +]; |