debian-mirror-gitlab/app/assets/javascripts/releases/constants.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-01-29 00:20:46 +05:30
import { __ } from '~/locale';
2020-01-01 13:55:28 +05:30
export const MAX_MILESTONES_TO_DISPLAY = 5;
2020-04-08 14:13:33 +05:30
export const BACK_URL_PARAM = 'back_url';
2020-06-23 00:09:42 +05:30
export const ASSET_LINK_TYPE = Object.freeze({
OTHER: 'other',
IMAGE: 'image',
PACKAGE: 'package',
RUNBOOK: 'runbook',
});
export const DEFAULT_ASSET_LINK_TYPE = ASSET_LINK_TYPE.OTHER;
2021-01-03 14:25:43 +05:30
2021-03-08 18:12:59 +05:30
export const PAGE_SIZE = 10;
2021-01-29 00:20:46 +05:30
2021-09-04 01:27:46 +05:30
export const ASCENDING_ORDER = 'asc';
2021-01-29 00:20:46 +05:30
export const DESCENDING_ORDER = 'desc';
export const RELEASED_AT = 'released_at';
export const CREATED_AT = 'created_at';
export const SORT_OPTIONS = [
{
orderBy: RELEASED_AT,
label: __('Released date'),
},
{
orderBy: CREATED_AT,
label: __('Created date'),
},
];
2021-09-04 01:27:46 +05:30
export const RELEASED_AT_ASC = 'RELEASED_AT_ASC';
export const RELEASED_AT_DESC = 'RELEASED_AT_DESC';
export const CREATED_ASC = 'CREATED_ASC';
export const CREATED_DESC = 'CREATED_DESC';
export const ALL_SORTS = [RELEASED_AT_ASC, RELEASED_AT_DESC, CREATED_ASC, CREATED_DESC];
export const SORT_MAP = {
[RELEASED_AT]: {
[ASCENDING_ORDER]: RELEASED_AT_ASC,
[DESCENDING_ORDER]: RELEASED_AT_DESC,
},
[CREATED_AT]: {
[ASCENDING_ORDER]: CREATED_ASC,
[DESCENDING_ORDER]: CREATED_DESC,
},
};
export const DEFAULT_SORT = RELEASED_AT_DESC;