2022-07-16 23:28:13 +05:30
|
|
|
import { __, sprintf } from '~/locale';
|
|
|
|
import { IssuableType, WorkspaceType } from '~/issues/constants';
|
2020-04-08 14:13:33 +05:30
|
|
|
|
|
|
|
const INTERVALS = {
|
|
|
|
minute: 'minute',
|
|
|
|
hour: 'hour',
|
|
|
|
day: 'day',
|
|
|
|
};
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
export const FILE_SYMLINK_MODE = '120000';
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
export const SHORT_DATE_FORMAT = 'd mmm, yyyy';
|
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
export const ISO_SHORT_FORMAT = 'yyyy-mm-dd';
|
|
|
|
|
|
|
|
export const DATE_FORMATS = [SHORT_DATE_FORMAT, ISO_SHORT_FORMAT];
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
export const timeRanges = [
|
|
|
|
{
|
|
|
|
label: __('30 minutes'),
|
|
|
|
duration: { seconds: 60 * 30 },
|
|
|
|
name: 'thirtyMinutes',
|
|
|
|
interval: INTERVALS.minute,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: __('3 hours'),
|
|
|
|
duration: { seconds: 60 * 60 * 3 },
|
|
|
|
name: 'threeHours',
|
|
|
|
interval: INTERVALS.hour,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: __('8 hours'),
|
|
|
|
duration: { seconds: 60 * 60 * 8 },
|
|
|
|
name: 'eightHours',
|
|
|
|
default: true,
|
|
|
|
interval: INTERVALS.hour,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: __('1 day'),
|
|
|
|
duration: { seconds: 60 * 60 * 24 * 1 },
|
|
|
|
name: 'oneDay',
|
|
|
|
interval: INTERVALS.hour,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: __('3 days'),
|
|
|
|
duration: { seconds: 60 * 60 * 24 * 3 },
|
|
|
|
name: 'threeDays',
|
|
|
|
interval: INTERVALS.hour,
|
|
|
|
},
|
|
|
|
{
|
2020-10-24 23:57:45 +05:30
|
|
|
label: __('7 days'),
|
2020-04-08 14:13:33 +05:30
|
|
|
duration: { seconds: 60 * 60 * 24 * 7 * 1 },
|
|
|
|
name: 'oneWeek',
|
|
|
|
interval: INTERVALS.day,
|
|
|
|
},
|
|
|
|
{
|
2020-10-24 23:57:45 +05:30
|
|
|
label: __('30 days'),
|
2020-04-08 14:13:33 +05:30
|
|
|
duration: { seconds: 60 * 60 * 24 * 30 },
|
|
|
|
name: 'oneMonth',
|
|
|
|
interval: INTERVALS.day,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
export const defaultTimeRange = timeRanges.find((tr) => tr.default);
|
|
|
|
export const getTimeWindow = (timeWindowName) =>
|
|
|
|
timeRanges.find((tr) => tr.name === timeWindowName);
|
2021-12-11 22:18:48 +05:30
|
|
|
|
|
|
|
export const AVATAR_SHAPE_OPTION_CIRCLE = 'circle';
|
|
|
|
export const AVATAR_SHAPE_OPTION_RECT = 'rect';
|
2022-07-16 23:28:13 +05:30
|
|
|
|
|
|
|
export const confidentialityInfoText = (workspaceType, issuableType) =>
|
|
|
|
sprintf(
|
|
|
|
__(
|
|
|
|
'Only %{workspaceType} members with at least Reporter role can view or be notified about this %{issuableType}.',
|
|
|
|
),
|
|
|
|
{
|
|
|
|
workspaceType: workspaceType === WorkspaceType.project ? __('project') : __('group'),
|
|
|
|
issuableType: issuableType === IssuableType.Issue ? __('issue') : __('epic'),
|
|
|
|
},
|
|
|
|
);
|